From d02a02d018277d154f7056a2d4e13220cd5d428f Mon Sep 17 00:00:00 2001 From: Pen <18875240351@163.com> Date: Tue, 10 Sep 2019 19:24:04 +0800 Subject: [PATCH] change folder name --- docs/{Guide => aaa}/README.md | 0 docs/{Guide => aaa}/g_contribute.md | 0 docs/{Guide => aaa}/g_joinCCC.md | 0 docs/{Guide => aaa}/g_linux_tutorial.md | 2 +- docs/{Guide => aaa}/g_multi_sign_account.md | 0 docs/{Guide => aaa}/g_transaction.md | 0 docs/guide/README.md | 25 - docs/guide/g_contribute.md | 45 - docs/guide/g_joinCCC.md | 69 - docs/guide/g_linux_tutorial.md | 1711 ------------------- docs/guide/g_multi_sign_account.md | 223 --- docs/guide/g_transaction.md | 16 - 12 files changed, 1 insertion(+), 2090 deletions(-) rename docs/{Guide => aaa}/README.md (100%) rename docs/{Guide => aaa}/g_contribute.md (100%) rename docs/{Guide => aaa}/g_joinCCC.md (100%) rename docs/{Guide => aaa}/g_linux_tutorial.md (99%) rename docs/{Guide => aaa}/g_multi_sign_account.md (100%) rename docs/{Guide => aaa}/g_transaction.md (100%) delete mode 100644 docs/guide/README.md delete mode 100644 docs/guide/g_contribute.md delete mode 100644 docs/guide/g_joinCCC.md delete mode 100644 docs/guide/g_linux_tutorial.md delete mode 100644 docs/guide/g_multi_sign_account.md delete mode 100644 docs/guide/g_transaction.md diff --git a/docs/Guide/README.md b/docs/aaa/README.md similarity index 100% rename from docs/Guide/README.md rename to docs/aaa/README.md diff --git a/docs/Guide/g_contribute.md b/docs/aaa/g_contribute.md similarity index 100% rename from docs/Guide/g_contribute.md rename to docs/aaa/g_contribute.md diff --git a/docs/Guide/g_joinCCC.md b/docs/aaa/g_joinCCC.md similarity index 100% rename from docs/Guide/g_joinCCC.md rename to docs/aaa/g_joinCCC.md diff --git a/docs/Guide/g_linux_tutorial.md b/docs/aaa/g_linux_tutorial.md similarity index 99% rename from docs/Guide/g_linux_tutorial.md rename to docs/aaa/g_linux_tutorial.md index 6f833da7..d23fb9bb 100644 --- a/docs/Guide/g_linux_tutorial.md +++ b/docs/aaa/g_linux_tutorial.md @@ -10,7 +10,7 @@ This section is a guide for the use of the full node wallet for the Linux versio | :------: | :--------: | :------: | | V0.9.0 | 2018-03-18 | alpha | | V0.9.1 | 2019-07-08 | Beta | -| V1.0.0 | 2019-09-08 | Mainnet| +| V1.0.0 | 2019-09-08 | Mainnet | ## Preparation diff --git a/docs/Guide/g_multi_sign_account.md b/docs/aaa/g_multi_sign_account.md similarity index 100% rename from docs/Guide/g_multi_sign_account.md rename to docs/aaa/g_multi_sign_account.md diff --git a/docs/Guide/g_transaction.md b/docs/aaa/g_transaction.md similarity index 100% rename from docs/Guide/g_transaction.md rename to docs/aaa/g_transaction.md diff --git a/docs/guide/README.md b/docs/guide/README.md deleted file mode 100644 index 09b53fd8..00000000 --- a/docs/guide/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# 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/wp-content/uploads/2019/06/NULS_Whitepaper_2.0.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/wp-content/uploads/2019/06/NulsYellowpaper1.1.pdf) \ No newline at end of file diff --git a/docs/guide/g_contribute.md b/docs/guide/g_contribute.md deleted file mode 100644 index b0dbf9ea..00000000 --- a/docs/guide/g_contribute.md +++ /dev/null @@ -1,45 +0,0 @@ -# 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/guide/g_joinCCC.md b/docs/guide/g_joinCCC.md deleted file mode 100644 index 3ce3175e..00000000 --- a/docs/guide/g_joinCCC.md +++ /dev/null @@ -1,69 +0,0 @@ -# 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/guide/g_linux_tutorial.md b/docs/guide/g_linux_tutorial.md deleted file mode 100644 index 6f833da7..00000000 --- a/docs/guide/g_linux_tutorial.md +++ /dev/null @@ -1,1711 +0,0 @@ -# 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 | -| :------: | :--------: | :------: | -| V0.9.0 | 2018-03-18 | alpha | -| V0.9.1 | 2019-07-08 | Beta | -| V1.0.0 | 2019-09-08 | Mainnet| - -## 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 <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 - -```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" : "