From 03ade4b3834adbbf7099fc05dea96639035aa30b Mon Sep 17 00:00:00 2001 From: gcharang Date: Wed, 9 Nov 2022 18:52:45 +0530 Subject: [PATCH 1/6] add a hint about -ac_cc param for activatinmg antara modules on a smart chain --- .../smart-chain-tutorials/create-a-default-smart-chain.md | 8 ++++++-- .../creating-a-smart-chain-on-a-single-node.md | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md index b8d70788e..e18f3b860 100644 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md +++ b/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md @@ -31,7 +31,7 @@ For example, if the developers are operating on a local router, where the two ma A home or office-type setup can suffice, if you're just looking to test an Smart Chain quickly and don't want to spend money on a VPS. However, don't be surprised if you need to ask for help. Please reach out to us, and we'll help the best we can. -To test the creation of a Smart Chain using only a single node, [see these linked instructions.](../../../basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.html#introduction) +To test the creation of a Smart Chain using only a single node, [see these linked instructions.](../../../basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.html#introduction) To prepare for the next step, execute the following command in the terminal on both machines: @@ -82,6 +82,10 @@ On your first node, change into the directory where Komodo's `komodod` and `komo ./komodod.exe -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & ``` +::: tip +If you want the Smart Chain to have Antara Modules enabled, please include the [-ac_cc](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-cc) parameter with the required value in your launch parameters on both the nodes. +::: + ### Verify the Response After issuing this command in the terminal on both machines, you will find the p2p port in the terminal window. @@ -231,7 +235,7 @@ Several teams have already signed up for our services and are developing on our ### A Note About Low-Activity Blockchains -Blockchain technology relies on a network of users using the blockchain and sharing data to function. +Blockchain technology relies on a network of users using the blockchain and sharing data to function. Smart Chains that are built for low-activity networks require extra steps from the developer to ensure proper syncing between nodes. diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md index e51ca3856..6122dc406 100644 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md +++ b/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md @@ -27,6 +27,10 @@ For this example, we use simple configurations. ./komodod -ac_name=HELLOWORLD -ac_supply=777777 ``` +::: tip +If you want the Smart Chain to have Antara Modules enabled, please include the [-ac_cc](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-cc) parameter with the required value in your launch parameters on both the daemons. +::: + ##### Response (truncated) Search for the part of the response that begins with this string: `>>>>>>>>>` @@ -80,8 +84,7 @@ rpcport=12345 (Change all values shown above on the right side of the `=` side. In all values above, the chosen values must be different from the values in the first daemon's .conf file.) - -Add a new line `port=` to the file. This value indicates the [p2pport](../smart-chain-setup/common-runtime-parameters.html#port) used by the second daemon. +Add a new line `port=` to the file. This value indicates the [p2pport](../smart-chain-setup/common-runtime-parameters.html#port) used by the second daemon. ``` ... (file continued) ... From 3f0f9f73d0d8d25dcdcd7aaf52ffb65dad9ead60 Mon Sep 17 00:00:00 2001 From: gcharang Date: Mon, 12 Dec 2022 14:19:16 +0530 Subject: [PATCH 2/6] update - gh actions workflow --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be8c78b9c..5103db2d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,16 +5,16 @@ on: - master jobs: build-and-deploy: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: "0" persist-credentials: false - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ${{ github.repository_owner }}/AtomicDEX-docs path: AtomicDEX-docs @@ -42,7 +42,7 @@ jobs: run: ./prepare-atomicDEX-docs.sh - name: Deploy updated files to AtomicDEX-docs repo - uses: KomodoPlatform/github-pages-deploy-action@3.7.1 + uses: KomodoPlatform/github-pages-deploy-action@4ef50ca with: ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} REPOSITORY_NAME: ${{ github.repository_owner }}/AtomicDEX-docs From 2844426d30a872d29772966da1988293dd003623 Mon Sep 17 00:00:00 2001 From: gcharang Date: Mon, 12 Dec 2022 14:21:01 +0530 Subject: [PATCH 3/6] update - gh actions workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5103db2d0..9c14531a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: run: ./prepare-atomicDEX-docs.sh - name: Deploy updated files to AtomicDEX-docs repo - uses: KomodoPlatform/github-pages-deploy-action@4ef50ca + uses: KomodoPlatform/github-pages-deploy-action@4ef50ca87fb0d1007fab1bfce9019fb5749daf26 with: ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} REPOSITORY_NAME: ${{ github.repository_owner }}/AtomicDEX-docs From 6156baaf3f06e8ec2daf3105b2425effdb362f9c Mon Sep 17 00:00:00 2001 From: gcharang Date: Mon, 12 Dec 2022 14:38:25 +0530 Subject: [PATCH 4/6] update - gh actions workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c14531a3..a4d88389d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: run: ./prepare-atomicDEX-docs.sh - name: Deploy updated files to AtomicDEX-docs repo - uses: KomodoPlatform/github-pages-deploy-action@4ef50ca87fb0d1007fab1bfce9019fb5749daf26 + uses: KomodoPlatform/github-pages-deploy-action@v4.4.1 with: ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} REPOSITORY_NAME: ${{ github.repository_owner }}/AtomicDEX-docs From 94015873cc1efc297b997ba642566dd0e1ef357d Mon Sep 17 00:00:00 2001 From: gcharang Date: Mon, 12 Dec 2022 09:14:17 +0000 Subject: [PATCH 5/6] =?UTF-8?q?Deploying=20to=20master=20from=20@=20Komodo?= =?UTF-8?q?Platform/developer-docs@043899129103a8aaf0152d7a4b82402dd042b71?= =?UTF-8?q?b=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 - README.md | 2 +- additional-assets/misc/2019-11-23-pegs.md | 21 - .../2019-06-26-alphabetize/pre-composite.txt | 2 - deploy_docker.sh | 4 +- docker-compose.yml | 2 +- docs/.vuepress/components/collapse-text.vue | 2 +- docs/.vuepress/config.js | 51 +- docs/.vuepress/navbar.js | 39 +- docs/.vuepress/sidebar.js | 358 +- docs/.vuepress/styles/palette.styl | 9 - docs/.vuepress/theme/layouts/Layout.vue | 7 +- docs/README.md | 56 +- docs/basic-docs/antara/README.md | 0 docs/basic-docs/antara/antara-api/README.md | 0 docs/basic-docs/antara/antara-api/assets.md | 1335 - docs/basic-docs/antara/antara-api/channels.md | 722 - docs/basic-docs/antara/antara-api/custom.md | 148 - docs/basic-docs/antara/antara-api/dice.md | 1401 - .../basic-docs/antara/antara-api/dilithium.md | 580 - docs/basic-docs/antara/antara-api/faucet.md | 594 - docs/basic-docs/antara/antara-api/gaming.md | 1807 - docs/basic-docs/antara/antara-api/gateways.md | 816 - docs/basic-docs/antara/antara-api/heir.md | 1030 - docs/basic-docs/antara/antara-api/musig.md | 498 - docs/basic-docs/antara/antara-api/oracles.md | 1892 - docs/basic-docs/antara/antara-api/payments.md | 1013 - docs/basic-docs/antara/antara-api/pegs.md | 778 - docs/basic-docs/antara/antara-api/prices.md | 869 - docs/basic-docs/antara/antara-api/rewards.md | 1309 - docs/basic-docs/antara/antara-api/rogue.md | 767 - docs/basic-docs/antara/antara-api/sudoku.md | 595 - docs/basic-docs/antara/antara-api/tokens.md | 927 - docs/basic-docs/antara/antara-setup/README.md | 0 .../antara-setup/antara-customizations.md | 1169 - .../antara/antara-tutorials/README.md | 0 .../antara-tutorials/advanced-series-0.md | 89 - .../antara-tutorials/advanced-series-1.md | 288 - .../antara-tutorials/advanced-series-2.md | 232 - .../antara-tutorials/advanced-series-3.md | 339 - .../antara-tutorials/advanced-series-4.md | 219 - .../antara-tutorials/advanced-series-5.md | 970 - .../antara-tutorials/advanced-series-6.md | 320 - .../beginner-series-part-0.md | 230 - .../beginner-series-part-1.md | 248 - .../beginner-series-part-2.md | 138 - .../beginner-series-part-3.md | 224 - .../beginner-series-part-4.md | 175 - .../dilithium-module-tutorial.md | 1798 - .../antara-tutorials/gaming-sdk-tutorial-0.md | 222 - .../antara-tutorials/gaming-sdk-tutorial-1.md | 219 - .../antara-tutorials/gaming-sdk-tutorial-2.md | 4 - .../antara-tutorials/gaming-sdk-tutorial-3.md | 2208 - .../antara-tutorials/gaming-sdk-tutorial-4.md | 5477 --- .../gateways-module-tutorial.md | 1111 - .../introduction-to-antara-tutorials.md | 14 - .../antara-tutorials/musig-module-tutorial.md | 664 - .../overview-of-antara-modules-part-i.md | 256 - .../overview-of-antara-modules-part-ii.md | 115 - .../pegs-module-creator-tutorial.md | 495 - .../pegs-module-user-tutorial.md | 674 - .../antara-tutorials/rogue-module-tutorial.md | 892 - .../understanding-antara-addresses.md | 93 - .../antara/introduction-to-antara.md | 40 - docs/basic-docs/smart-chains/README.md | 0 docs/basic-docs/smart-chains/changelog.md | 18 - ...troduction-to-smart-chain-documentation.md | 46 - .../smart-chains/smart-chain-api/README.md | 0 .../smart-chains/smart-chain-api/address.md | 637 - .../smart-chain-api/blockchain.md | 2232 - .../smart-chains/smart-chain-api/cclib.md | 318 - .../smart-chains/smart-chain-api/control.md | 302 - .../smart-chain-api/crosschain.md | 1420 - .../smart-chain-api/disclosure.md | 114 - .../smart-chains/smart-chain-api/generate.md | 294 - .../smart-chains/smart-chain-api/jumblr.md | 211 - .../smart-chains/smart-chain-api/mining.md | 631 - .../smart-chains/smart-chain-api/network.md | 908 - .../smart-chain-api/rawtransactions.md | 806 - .../smart-chains/smart-chain-api/util.md | 504 - .../smart-chains/smart-chain-api/wallet.md | 4832 -- .../smart-chains/smart-chain-setup/README.md | 0 .../common-runtime-parameters.md | 630 - .../ecosystem-launch-parameters.md | 3 - .../installing-from-source.md | 525 - .../interacting-with-smart-chains.md | 84 - .../smart-chains/smart-chain-setup/nspv.md | 1455 - .../smart-chain-maintenance.md | 27 - .../smart-chain-setup/updating-from-source.md | 147 - .../smart-chain-tutorials/README.md | 0 .../basic-environment-setup-for-linux-vps.md | 83 - .../create-a-default-smart-chain.md | 242 - ...creating-a-smart-chain-on-a-single-node.md | 156 - .../introduction-to-smart-chain-tutorials.md | 11 - ...re-transaction-creation-and-walkthrough.md | 281 - .../running-komodo-software-in-debug-mode.md | 54 - .../smart-chain-api-basics.md | 1100 - docs/basic-docs/start-here/README.md | 0 .../about-komodo-platform/README.md | 0 .../about-komodo-platform.md | 133 - .../about-komodo-platform/orientation.md | 88 - .../product-introductions.md | 202 - .../simple-installations.md | 55 - .../core-technology-discussions/antara.md | 116 - .../core-technology-discussions/atomicdex.md | 249 - .../delayed-proof-of-work.md | 692 - .../initial-dex-offering.md | 265 - .../introduction.md | 40 - .../miscellaneous.md | 290 - .../core-technology-discussions/references.md | 14 - .../start-here/learning-launchpad/README.md | 0 .../common-terminology-and-concepts.md | 515 - .../learning-path-outline.md | 478 - package.json | 5 +- prepare-atomicDEX-docs.sh | 13 - test.txt | 39095 ++++++++++++++++ utils/parse_api_docs.py | 185 - yarn.lock | 4234 +- 118 files changed, 40958 insertions(+), 60341 deletions(-) delete mode 100644 additional-assets/misc/2019-11-23-pegs.md delete mode 100644 docs/basic-docs/antara/README.md delete mode 100644 docs/basic-docs/antara/antara-api/README.md delete mode 100644 docs/basic-docs/antara/antara-api/assets.md delete mode 100644 docs/basic-docs/antara/antara-api/channels.md delete mode 100644 docs/basic-docs/antara/antara-api/custom.md delete mode 100644 docs/basic-docs/antara/antara-api/dice.md delete mode 100644 docs/basic-docs/antara/antara-api/dilithium.md delete mode 100644 docs/basic-docs/antara/antara-api/faucet.md delete mode 100644 docs/basic-docs/antara/antara-api/gaming.md delete mode 100644 docs/basic-docs/antara/antara-api/gateways.md delete mode 100644 docs/basic-docs/antara/antara-api/heir.md delete mode 100644 docs/basic-docs/antara/antara-api/musig.md delete mode 100644 docs/basic-docs/antara/antara-api/oracles.md delete mode 100644 docs/basic-docs/antara/antara-api/payments.md delete mode 100644 docs/basic-docs/antara/antara-api/pegs.md delete mode 100644 docs/basic-docs/antara/antara-api/prices.md delete mode 100644 docs/basic-docs/antara/antara-api/rewards.md delete mode 100644 docs/basic-docs/antara/antara-api/rogue.md delete mode 100644 docs/basic-docs/antara/antara-api/sudoku.md delete mode 100644 docs/basic-docs/antara/antara-api/tokens.md delete mode 100644 docs/basic-docs/antara/antara-setup/README.md delete mode 100644 docs/basic-docs/antara/antara-setup/antara-customizations.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/README.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-0.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-1.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-2.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-3.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-4.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-5.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/advanced-series-6.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/beginner-series-part-0.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/beginner-series-part-1.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/beginner-series-part-2.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/beginner-series-part-3.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/beginner-series-part-4.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/dilithium-module-tutorial.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-0.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-1.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-2.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-3.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-4.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/gateways-module-tutorial.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/introduction-to-antara-tutorials.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/musig-module-tutorial.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/pegs-module-creator-tutorial.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/pegs-module-user-tutorial.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/rogue-module-tutorial.md delete mode 100644 docs/basic-docs/antara/antara-tutorials/understanding-antara-addresses.md delete mode 100644 docs/basic-docs/antara/introduction-to-antara.md delete mode 100644 docs/basic-docs/smart-chains/README.md delete mode 100644 docs/basic-docs/smart-chains/changelog.md delete mode 100644 docs/basic-docs/smart-chains/introduction-to-smart-chain-documentation.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/README.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/address.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/blockchain.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/cclib.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/control.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/crosschain.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/disclosure.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/generate.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/jumblr.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/mining.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/network.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/rawtransactions.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/util.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-api/wallet.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/README.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/ecosystem-launch-parameters.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/installing-from-source.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/nspv.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-setup/updating-from-source.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/README.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/basic-environment-setup-for-linux-vps.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/introduction-to-smart-chain-tutorials.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/multisignature-transaction-creation-and-walkthrough.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/running-komodo-software-in-debug-mode.md delete mode 100644 docs/basic-docs/smart-chains/smart-chain-tutorials/smart-chain-api-basics.md delete mode 100644 docs/basic-docs/start-here/README.md delete mode 100644 docs/basic-docs/start-here/about-komodo-platform/README.md delete mode 100644 docs/basic-docs/start-here/about-komodo-platform/about-komodo-platform.md delete mode 100644 docs/basic-docs/start-here/about-komodo-platform/orientation.md delete mode 100644 docs/basic-docs/start-here/about-komodo-platform/product-introductions.md delete mode 100644 docs/basic-docs/start-here/about-komodo-platform/simple-installations.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/antara.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/atomicdex.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/initial-dex-offering.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/introduction.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/miscellaneous.md delete mode 100644 docs/basic-docs/start-here/core-technology-discussions/references.md delete mode 100644 docs/basic-docs/start-here/learning-launchpad/README.md delete mode 100644 docs/basic-docs/start-here/learning-launchpad/common-terminology-and-concepts.md delete mode 100644 docs/basic-docs/start-here/learning-launchpad/learning-path-outline.md delete mode 100755 prepare-atomicDEX-docs.sh create mode 100644 test.txt delete mode 100755 utils/parse_api_docs.py diff --git a/.gitignore b/.gitignore index 4993b923b..e1810d949 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -parsed_* .DS_Store /node_modules /dist @@ -24,4 +23,3 @@ yarn-error.log* # Local build files /docs/.vuepress/dist/ -/.project diff --git a/README.md b/README.md index 61fa183ce..ed42cf053 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Readme -Komodo documentation uses [Vuepress](https://vuepress.vuejs.org/). +Komodo documentation uses [Vuepress](https://vuepress.vuejs.org/). ## Setup: diff --git a/additional-assets/misc/2019-11-23-pegs.md b/additional-assets/misc/2019-11-23-pegs.md deleted file mode 100644 index 443bf01ee..000000000 --- a/additional-assets/misc/2019-11-23-pegs.md +++ /dev/null @@ -1,21 +0,0 @@ -# A Komodo-based Stablecoin - -- Introduction: - - The Komodo team presents a stablecoin, allowing ecosystem users to create products that are bought, sold, and traded using familiar and stable market prices. -- The problems of the cryptocurrency market - - One of the largest challenges when building a cryptocurrency-backed product is that users can be turned off by economic volatility -- A common solution is to offer a stablecoin - - CEX's offer these to help users have some place to store money where there is a less volatile expectation of future value -- Komodo now offers stablecoin technology - - This allows Komodo ecosystem users to buy, sell, and trade in a more stable environment -- How it works - - Users lock a familiar cryptocurrency as a collateral loan to the Pegs Smart Chain - - Can include Bitcoin/Komodo, anything from the Bitcoin protocol - - The Pegs Smart Chain issues them coins that mimic the value of a foreign asset - - Users can buy/sell/trade these coins - - As prices change, there are methods available to the users of the ecosystem to either manager their own collateral loan accounts and keep them current - - Or, other users can purchase the excess debt of other users - - When the debt of a user's account becomes high, other users can purchase the user's debt at a profit - - At any time, a user can trade the stablecoins in for the collateralize assets - - These asset can then be sent back to other exchanges, such as CEXs -- This allows Komodo users to create and self-manage stable economic environments diff --git a/additional-assets/play/2019-06-26-alphabetize/pre-composite.txt b/additional-assets/play/2019-06-26-alphabetize/pre-composite.txt index 354d272ac..2bd585cfd 100644 --- a/additional-assets/play/2019-06-26-alphabetize/pre-composite.txt +++ b/additional-assets/play/2019-06-26-alphabetize/pre-composite.txt @@ -4,8 +4,6 @@ The `keypair` method generates a Dilithium `pubkey` and `privkey`. This method requires a 256 bit seed in hex format (64 characters). - - If no `hexseed` is provided, the module uses the user's pubkey seed for entropy and generates a new seed. From this new seed the module produces a Dilithium `pubkey` and `privkey`. #### Arguments diff --git a/deploy_docker.sh b/deploy_docker.sh index f6e6aa2cc..ae68efbbc 100755 --- a/deploy_docker.sh +++ b/deploy_docker.sh @@ -5,8 +5,8 @@ set -e # build -docker build -t komodo_docs_image . -docker run --rm -v $(pwd):/app/ -w /app/ -u $(id -u):$(id -g) komodo_docs_image +docker build -t atomicdex_docs_image . +docker run --rm -v $(pwd):/app/ -w /app/ -u $(id -u):$(id -g) atomicdex_docs_image diff --git a/docker-compose.yml b/docker-compose.yml index a99df8137..9406d49fa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ app: - 8080:8080 volumes: - .:/app/ - container_name: komodo_docs + container_name: atomicdex_docs user: "1000:1000" command: - ./algolia-key.sh diff --git a/docs/.vuepress/components/collapse-text.vue b/docs/.vuepress/components/collapse-text.vue index 8ea93e66e..d3bf200a1 100755 --- a/docs/.vuepress/components/collapse-text.vue +++ b/docs/.vuepress/components/collapse-text.vue @@ -23,7 +23,7 @@ button - - -## Create a System - -Between the `using namespace` statement and the definition of the class `my_world`, create a system class that is defined as a `pre_update_system`. - -```cpp -class pre_concrete_system final : public ecs::pre_update_system -{ -public: - //! Here the constructor can take other additional arguments but the first two are mandatory - pre_concrete_system(entt::registry ®istry) noexcept : system(registry) - { - - } - - void update() noexcept final - { - //! Empty for the moment - } - - ~pre_concrete_system() noexcept final = default; -}; -``` - -Place the cursor at the body of the constructor of the class `my_world`. - -In order to load the system, use the function [create_system](../../../basic-docs/antara/antara-api/gaming.html#create-system) of the `system_manager` class. - -```cpp -my_world() noexcept -{ - //! Here there is no need to add any parameters for the constructor - //! because the mandatory parameters are forwarded by default - this->system_manager_.create_system(); -} -``` - -## Add a Quit Game Event - -Currently, the source code creates in an infinite loop, as the system is running inside the game loop. - -Use the [dispatcher](https://github.com/skypjack/entt/wiki/Crash-Course:-events,-signals-and-everything-in-between#event-dispatcher) to stop the system. - -Add source code that emits a `quit_game event` that the game world will catch and stop the gaming loop. - -Create a `counter` as a private field of the system and increment the counter each time the update function is called. At `10` iterations, emit an event to leave the game. - -```cpp -class pre_concrete_system final : public antara::gaming::ecs::pre_update_system -{ -public: - //! Here the constructor can take other additional arguments, but the first two are mandatory - pre_concrete_system(entt::registry ®istry) noexcept : system(registry) - { - - } - - void update() noexcept final - { - std::cout << "nb_iteration: " << (++nb_iteration) << "\n"; - if (nb_iteration == 10u) { - this->dispatcher_.trigger(0); - } - } - - ~pre_concrete_system() noexcept final = default; -private: - std::size_t nb_iteration{0u}; -}; - -REFL_AUTO(type(pre_concrete_system)) //! This line is very important, it's give a static reflection name function to your system, otherwise you will not compile. -``` - -::: tip - -Don't forget to add `#include ` at the top of the file. - -::: - -## Test the Gaming System - -The game should now compile, and when executed, iterate `10` times and close. - -#### Full Code Sample - -```cpp -#include -#include - -using namespace antara::gaming; - -class pre_concrete_system final : public ecs::pre_update_system -{ -public: - //! Here the constructor can take other additional arguments but the first two are mandatory - pre_concrete_system(entt::registry ®istry) noexcept : system(registry) - { - - } - - void update() noexcept final - { - std::cout << "nb_iteration: " << (++nb_iteration) << "\n"; - if (nb_iteration == 10u) { - this->dispatcher_.trigger(0); - } - } - - ~pre_concrete_system() noexcept final = default; -private: - std::size_t nb_iteration{0u}; -}; - -REFL_AUTO(type(pre_concrete_system)) - -class my_world : public world::app -{ -public: - my_world() noexcept - { - //! Here there is no need to add any parameters for the constructor - //! because the mandatory parameters are forwarded by default - this->system_manager_.create_system(); - } -}; - -int main() -{ - my_world world; - return world.run(); -} -``` diff --git a/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-2.md b/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-2.md deleted file mode 100644 index 7b4cd563a..000000000 --- a/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-2.md +++ /dev/null @@ -1,4 +0,0 @@ -# Tutorial: Gaming Events - -(Under construction) - diff --git a/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-3.md b/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-3.md deleted file mode 100644 index 61c9083d4..000000000 --- a/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-3.md +++ /dev/null @@ -1,2208 +0,0 @@ -# Tutorial: How to do a Tic-Tac-Toe in less than 15 minutes with the gaming SDK ? - -Please become familiar with the [Getting Started](../../../basic-docs/antara/antara-tutorials/tic-tac-toe-tutorial-0.html) tutorial before beginning this tutorial. - -## Introduction - -This tutorial guides the reader in creating a simple game of Tic-Tac-Toe in relation to Komodo technology. - -## Set Up the Executable and Window - -#### Create a Project Directory - -Create a folder called `tic-tac-toe` for the project. - -#### Create CMakeLists.txt - -Create a text file `CMakeLists.txt` to create and compile the executable. - -The `CMakeLists.txt` file contains the following items: - -- Name of the project -- Creation of the executable -- Link with the SDK -- C++ standard that will be used -- Any desired extra modules - - For this tutorial, the extra modules is the `antara::sfml` module provided by the Antara Gaming SDK - -Below is an example `CMakeLists.txt` file. - -```cpp -if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the source code and call cmake from there") -endif () - -##! Minimum version of the CMake. -cmake_minimum_required(VERSION 3.14) - -##! C++ Standard needed by the SDK is 17 -set(CMAKE_CXX_STANDARD 17) - -##! Our Project title, here tic-tac-toe. -project(tic-tac-toe DESCRIPTION "An awesome tic-tac-toe" LANGUAGES CXX) - -##! The SDK need's clang as main compiler. -if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") - message(FATAL_ERROR "Only Clang is supported (minimum LLVM 8.0)") - endif() -endif () - -##! Test whether the setup is on Linux -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(LINUX TRUE) -endif () - -##! Include the module from CMake for fetching dependencies -include(FetchContent) - -##! Declare information about the dependance to fetch -FetchContent_Declare( - antara-gaming-sdk - URL https://github.com/KomodoPlatform/antara-gaming-sdk/archive/master.zip -) - -##! Set extras modules from the SDK -set(USE_SFML_ANTARA_WRAPPER ON) - -##! Fetch the dependence -FetchContent_MakeAvailable(antara-gaming-sdk) - -##! If using OSX, calling this macro provided by the sdk will initalize the environment (std::filesystem) -init_apple_env() - -##! Create the executable with the project name -add_executable(${PROJECT_NAME} tic-tac-toe.cpp) - -##! Set output directory -set_target_properties(${PROJECT_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/" - ) - -##! Link the SDK modules used in the executable -target_link_libraries(${PROJECT_NAME} PUBLIC antara::world antara::sfml) - -##! Move DLL -if (WIN32) - ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${SFML_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/bin/" - COMMENT "copying dlls …" - $ - ) - - ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${SFML_SOURCE_DIR}/extlibs/bin/x64/openal32.dll" "${CMAKE_BINARY_DIR}/bin/openal32.dll" - COMMENT "copying dlls …" - $ - ) -endif () -``` - -#### Create tic-tac-toe.cpp Input File - -Create the input file for the application and call it `tic-tac-toe.cpp`. - -Add an empty main function: - -```cpp -int main() -{ - return 0; -} -``` - -The project directory tree should now be as follows. - -```cpp -./tic-tac-toe -├── CMakeLists.txt -└── tic-tac-toe.cpp -``` - -#### Test Compilation - -Before continuing, ensure that the required dependencies are installed and that the program compiles in its current state. To test compilation, use the build commands available in the [Getting Started](./tic-tac-toe-tutorial-0.html) tutorial. - -For assistance, please visit the Komodo [Discord.](https://discord.gg/VRtwmR2) - -#### Create World - -To create a world representing the world of the project game, use the following header file. - -```cpp -#include -``` - -Add a basic structure, `tic_tac_toe_world`. This structure inherits from the `antara::gaming::world::app` class. - -Optionally, use the namespace `antara::gaming` to make naming easier. - -Declare the new world object in the body of the main function. - -Replace the return value, `return 0`, with the return value of the project game. This is the value that is returned by the `run` function of the `class world::app` object. - -The resulting logic should be similar to the following. - -```cpp -#include - -using namespace antara::gaming; - -struct tic_tac_toe_world : world::app -{ - //! The game entry point - tic_tac_toe_world() noexcept = default; -}; - -int main() -{ - tic_tac_toe_world game; - return game.run(); -} -``` - -At this point, compiling and running the executable creates an infinite loop, and nothing happens. - -#### Initiate the Graphics - -To initiate the in-game graphics, use the following two modules. - -```cpp -antara::gaming::sfml::graphic_system -antara::gaming::sfml::input::system -``` - -These modules have the following headers, respectively. - -```cpp -#include -#include -``` - -Load the graphic system in the body of the constructor of the `tic_tac_toe_world` class, and initialize the input system with the window from the loaded graphic system. - -```cpp -#include -#include -#include - -//! For convenience -using namespace antara::gaming; - -//! The game world -struct tic_tac_toe_world : world::app -{ - //! The game entry point - tic_tac_toe_world() noexcept - { - //! Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - } -}; - -int main() -{ - //! Declare the world - tic_tac_toe_world game; - - //! Run the game - return game.run(); -} -``` - -Compile and run the program. A black window should open. - -Close the window by pressing the close button on the window bar. - -
- - - -
- -## The Game Scene, The Grid, and Game Constants - -This portion of the tutorial creates the logic to draw the grid of Tic-Tac-Toe. - -The grid appears as follows. - -
- - - -
- -#### Creating the Game Scene - -This requires the creation of a game scene using the scene manager. - -Include the header file `#include ` and load the scene's manager system into the system manager. - -```cpp -struct tic_tac_toe_world : world::app -{ - //! The game entry point - tic_tac_toe_world() noexcept - { - //! Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - //! Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - } -}; -``` - -Create the `game_scene` class that inherits from the `base_scene` class. The `game_scene` class will be the entry point of the project's game scene. - -The concrete class must override several functions, such as `update`, `scene_name`, and the destructor. - -There is no need to use the `update` function, because the game of Tic-Tac-Toe itself does not require an update for each frame. Leave the `update` function empty. - -For the `scene_name` function, return the name of the scene. - -```cpp -class game_scene final : public scenes::base_scene -{ -public: - game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) - {} - - //! This function will not be used, because Tic-Tac-Toe doesn't need an update every frame. - void update() noexcept final - {} - - //! the scene name - std::string scene_name() noexcept final - { - return "game_scene"; - } - - ~game_scene() noexcept final - {} -private: -}; -``` - - -Load the game scene into the `scene_manager` using the `change_scene` member function. - -```cpp -struct tic_tac_toe_world : world::app -{ - //! The game entry point - tic_tac_toe_world() noexcept - { - //! Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - //! Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - //! Change scene to game_scene - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; -``` - -Compiling now still results in the black window, as before, but this time the black window is the game scene. - - -
- - - -
- -::: tip Tip - -The scene system is a useful method for organizing multiple screens of the game: **introduction scene**, **game scene**, **end-of-game scene**, etc. - -::: - -#### Adding Constants - -Several constants are essential for the game of Tic-Tac-Toe: `width` and `height` of a cell, the `number` of cells per `line` and the `thickness` of the grid. - -For the size of the cells, use the current size of the canvas divided by the number of cells per line. This obtains the size of a cell. - -Create a structure, `tic_tac_toe_constants`, that contains these different pieces of information. Save the structure in the entity registry, so that the data is accessible from anywhere in the program. - -```cpp -struct tic_tac_toe_constants -{ - tic_tac_toe_constants(std::size_t nb_cells_per_axis_, std::size_t width_, std::size_t height_) noexcept : - nb_cells_per_axis(nb_cells_per_axis_), - cell_width(width_ / nb_cells_per_axis), - cell_height(height_ / nb_cells_per_axis) - { - } - - const std::size_t nb_cells_per_axis; - const std::size_t cell_width; - const std::size_t cell_height; - const float grid_thickness{20.0f}; -}; -``` - -In the constructor of the gaming scene create the following logic. - -```cpp -game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) -{ - //! Retrieve canvas information - auto[canvas_width, canvas_height] = entity_registry_.ctx().canvas.size.to(); - - //! Set the constants that will be used in the program - entity_registry_.set(3ull, canvas_width, canvas_height); -} -``` - -To create the entity representing the grid, add in a private member of the `game_scene` class, the `grid_entity_` field, which is of type `entt::entity` and which has the initial value `entt::null`. - -```cpp -class game_scene final : public scenes::base_scene -{ -public: - game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) - { - //! Retrieve canvas information - auto[canvas_width, canvas_height] = entity_registry_.ctx().canvas.size.to(); - - //! Set the constants that will be used in the program - entity_registry_.set(3ull, canvas_width, canvas_height); - } - - //! This function won't be used, because Tic-Tac-Toe doesn't need to update every frame. - void update() noexcept final - {} - - //! Return the scene name - std::string scene_name() noexcept final - { - return "game_scene"; - } - - ~game_scene() noexcept final - {} -private: - //! The entity which represents the Tic-Tac-Toe grid - entt::entity grid_entity_{entt::null}; -}; -``` - -To initialize this entity, create an anonymous namespace with a function, `create_grid`, which returns an `entt::entity` and takes the parameter `entity registry`. - -```cpp -//! Contains all functions which will be used for logic and factory -namespace -{ - //! Factory for creating a Tic-Tac-Toe grid - entt::entity create_grid(entt::registry ®istry) noexcept - { - return entt::null; - } -} -``` - -Call the function from the game scene constructor and assign the return value to the field `grid_entity_`. - -```cpp -game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) -{ - //! Retrieve canvas information - auto[canvas_width, canvas_height] = entity_registry_.ctx().canvas.size.to(); - - //! Set the constants that will be used in the program - entity_registry_.set(3ull, canvas_width, canvas_height); - - //! Create the grid of the Tic-Tac-Toe - grid_entity_ = create_grid(entity_registry_); -} -``` - -#### Begin the create_grid Function and the Destruction of Entities - -The following steps create the logic of the `create_grid` function and manage the destruction of the entities of the game scene when leaving the program. - -Retrieve the canvas size in order to define the size of the grid. - -```cpp -//! Retrieve canvas information -auto[canvas_width, canvas_height] = registry.ctx().canvas.size; -``` - -Create a new entity named `grid`. - -```cpp -//! Entity creation -auto grid_entity = registry.create(); -``` - -To create a visual line in the scene, represent two dots on the screen ("vertices") and join them together. - -Each vertex has an `X` position and a `Y` position. - -The connection of two vertices makes a line. - -However, the line thickness by default is only `1 px`. This is not visible when the scene's rendered image is small, due to scaling. Therefore, this scene requires a line that is `20 px` thick. - -
- - - -
- -A thick line is essentially a rectangle. Four vertices are required for a rectangle's four corners. - -A Tic-Tac-Toe grid requires four vertical lines: two in the middle and two at the screen borders. The grid also requires four horizontal lines, for the same effect. - -Therefore, the grid needs `8` lines, and each line is `4` vertices. Thus, `8 \* 4 = 32` vertices are required. - -```cpp -//! The vertices -std::vector lines{8 * 4}; -``` - -Additional information required for the grid includes the following. - -- `nb_cells` : the number of cells in one axis — `3` in this case - -- `cell_width` and `cell_height` : width and height of a cell - -- `grid_thickness` : thickness of the line - -Retrieve these from the defined constants. - -```cpp -//! Retrieve constants information -auto[nb_cells, cell_width, cell_height, grid_thickness] = registry.ctx(); -``` - -In calculations, use half of the thickness for the internal lines and the full thickness for the outer border of the grid - -For clarity and reuse, prepare another constant. - -```cpp -const auto half_thickness = grid_thickness * 0.5f; -``` - -At each loop of the function that draws the grid, define one vertical and one horizontal line. - -There are `4` lines in each axis, and therefore the function needs to loop `4` times. In other words, the function needs to loop `nb_cells + 1` times. - -Start the count from `0` as this is used for the starting coordinate. - -There is also a variable `counter` which counts the vertex indexes. This varaible increases by `4 vertices \* 2 lines = 8 vertices` at each iteration. - -```cpp -//! The loop to create the grid -for (std::size_t counter = 0, i = 0; i <= nb_cells; ++i, counter += 4 * 2) { -``` - -The order of the vertices of a rectangle is logically arranged as follows: `Top Left`, `Top Right`, `Bottom Right`, `Bottom Left`. - -Therefore, the next neighbour is always the clockwise neighbour. - -
- - - -
- -#### Draw the Vertical Line - -Draw the vertical line first and start with the `Top Left` vertex. - -A vertical line is from top to bottom and the `X` position is the same for the top and bottom. The `Y` changes, however. - -Calculate the `X` value first. `idx` is currently `0`. Multiply this value with `cell_width`. - -The `X` axis grows from left to right, while the `Y` axis grows from top to bottom. - -For example, say `cell_width` is `300`. In `4` iterations the `X` values are: `0, 300, 600, 900`. - -The left and right vertices of a thick vertical line need to be separate. Therefore, use `- half_thickness` to offset the `X` value a small amount to the left. - -The `Y` value for these vertices is `0` because they are located at the top of the screen. - -```cpp -lines[counter + 0].pos = {idx * cell_width - half_thickness, 0.f}; -``` - -The `Top Right` vertex is essentially the same, with the exception of its using `+ half_thickness`; this offsets the `X` value in the opposite direction. `Y` is still `0` because it is still located at the top of the screen. - -```cpp -lines[counter + 1].pos = {idx * cell_width + half_thickness, 0.f}; -``` - -For the `Bottom Right` vertex, `X` is the same as the `Top Right` vertex, but the `Y` value is now `canvas_height`, which is the bottom of the screen. - -```cpp -lines[counter + 2].pos = {idx * cell_width + half_thickness, canvas_height}; -``` - -For the last vertex, `Bottom Left`, the `Y` value is the same as `Bottom Right`, and the `X` value is using the `- half_thickness` adjustment, to align this `X` value with the left. - -```cpp -lines[counter + 3].pos = {idx * cell_width - half_thickness, canvas_height}; -``` - -This completes the vertical line. - -#### Draw a Horizontal Line - -Starting at the `Top Left` again, since the line runs from left to right, the `X` value of the left vertex is `0`. The `Y` value changes in a fashion similar to the way the `X` value changed in the vertical line. The four horizontal lines have the `Y` values as: `0, 300, 600, 900`. - -Use the `- half_thickness` logic again to calculate `Y`. This shifts the `Y` value of each vertex a small amount to create thickness. - -```cpp -lines[counter + 4].pos = {0, idx * cell_height - half_thickness}; -``` - -The `Top Right` vertex, at the far right side, is `canvas_width` pixels away. The `Y` value here is the same as `Top Left`. - -```cpp -lines[counter + 5].pos = {canvas_width, idx * cell_height - half_thickness}; -``` - -For the `Bottom Right` vertex, the `X` value stays the same. Add thickness to shift the value towards the bottom. - -```cpp -lines[counter + 6].pos = {canvas_width, idx * cell_height + half_thickness}; -``` - -The `X` value of the last vertex, `Bottom Left`, is at the far left, `0`. Shift the `Y` value towards the bottom by adding thickness again. - -```cpp -lines[counter + 7].pos = {0, idx * cell_height + half_thickness}; -``` - -Both vertical and horizontal lines are now ready and the loop ends here. - -#### Improving the Game Scene Rendering - -After the loop, turn the vertices to a quad variable of type `geometry::vertex_array`, which are rectangles. Assign this variable to the `grid_entity`. - -```cpp -//! Assign the vertex array to the grid entity -registry.assign(grid_entity, lines, geometry::vertex_geometry_type::quads); -``` - -Tag the grid as `game_scene`. - -```cpp -//! Assign the game_scene tag to the grid_entity (_hs means hashed_string) -registry.assign>(grid_entity); -``` - -Set the grid to appear at `layer 0` of the scene and return the prepared grid. - -```cpp -//! Draw the grid on the most deep layer, 0 -registry.assign>(grid_entity); - -//! Return the fresh entity -return grid_entity; -``` - -Note that there is a small issue with adding and substracting `half_thickness` for the values at the edges of the screen. Because the top border and left border of the screen are at coordinate `0`, subtracting `half_thickness` makes half of the associated rectangle appear out of the screen. The same effect occurs with the bottom border and the right border. This is not as clean of a solution as the game project requires. - -
- - - -
- -To solve this, push the top border down, the left border to the right, the bottom border upwards, and the right border to the left. This keeps the rectangles within the screen. - -This shift can be called `offset` as a variable. In the function loop, define `offset` at the beginning. - -For any given rectangle, there is no offset by default. Set the offset variables to `0`. - -```cpp -auto offset_x = 0.0f; -auto offset_y = 0.0f; -``` - -If the current rectangle is one of the the first iteration, add the `half_thickness` value to push the rectangles inside. If the current rectangle is one of the last, subtract the `half_thickness` value to pull the rectangles inside. - -```cpp -if (i == 0) { - offset_x += half_thickness; - offset_y += half_thickness; -} -else if (i == nb_cells) { - offset_x -= half_thickness; - offset_y -= half_thickness; -} -``` - -For the vertical line, use the `offset X` value to push the lines left and right. - -```cpp -//! Vertical -lines[counter + 0].pos = {offset_x + idx * cell_width - half_thickness, 0.f}; -lines[counter + 1].pos = {offset_x + idx * cell_width + half_thickness, 0.f}; -lines[counter + 2].pos = {offset_x + idx * cell_width + half_thickness, canvas_height}; -lines[counter + 3].pos = {offset_x + idx * cell_width - half_thickness, canvas_height}; -``` - -For the horizontal line, use the `offset Y` value to push the lines up and down. - -```cpp -//! Horizontal -lines[counter + 4].pos = {offset_x + 0, offset_y + idx * cell_height - half_thickness}; -lines[counter + 5].pos = {offset_x + canvas_width, offset_y + idx * cell_height - half_thickness}; -lines[counter + 6].pos = {offset_x + canvas_width, offset_y + idx * cell_height + half_thickness}; -lines[counter + 7].pos = {offset_x + 0, offset_y + idx * cell_height + half_thickness}; -``` - -Below is the complete function. - -```cpp -//! Contains all the function that will be used for logic and factory -namespace -{ - //! Factory for creating a Tic-Tac-Toe grid - entt::entity create_grid(entt::registry ®istry) noexcept - { - //! Retrieve canvas information - auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - - //! Entity creation - auto grid_entity = registry.create(); - - //! The vertices - std::vector lines{8 * 4}; - - //! Retrieve constants information - auto[nb_cells, cell_width, cell_height, grid_thickness] = registry.ctx(); - const auto half_thickness = grid_thickness * 0.5f; - - //! The loop to create the grid - for (std::size_t counter = 0, i = 0; i <= nb_cells; ++i, counter += 4 * 2) { - - //! To avoid narrowing conversion - auto idx = static_cast(i); - - //! First and last ones should be a bit inside, otherwise half of it is out of the screen - auto offset_x = 0.0f; - auto offset_y = 0.0f; - - if (i == 0) { - offset_x += half_thickness; - offset_y += half_thickness; - } else if (i == nb_cells) { - offset_x -= half_thickness; - offset_y -= half_thickness; - } - - //! Prepare lines - - //! Vertical - lines[counter + 0].pos = {offset_x + idx * cell_width - half_thickness, 0.f}; - lines[counter + 1].pos = {offset_x + idx * cell_width + half_thickness, 0.f}; - lines[counter + 2].pos = {offset_x + idx * cell_width + half_thickness, canvas_height}; - lines[counter + 3].pos = {offset_x + idx * cell_width - half_thickness, canvas_height}; - - //! Horizontal - lines[counter + 4].pos = {offset_x + 0, offset_y + idx * cell_height - half_thickness}; - lines[counter + 5].pos = {offset_x + canvas_width, offset_y + idx * cell_height - half_thickness}; - lines[counter + 6].pos = {offset_x + canvas_width, offset_y + idx * cell_height + half_thickness}; - lines[counter + 7].pos = {offset_x + 0, offset_y + idx * cell_height + half_thickness}; - } - - //! Assign the vertex array to the grid entity - registry.assign(grid_entity, lines, geometry::vertex_geometry_type::quads); - - //! Assign the game_scene tag to the grid_entity (_hs means hashed_string) - registry.assign>(grid_entity); - - //! Draw the grid on the most deep layer, here 0 - registry.assign>(grid_entity); - - //! Return the fresh entity - return grid_entity; - } -} -``` - -#### Create the Destructor Logic - -The following content organizes the destruction of the entities in the destructor. This is needed at the time of game reset. - -In the destructor, the logic iterates over and destroys all the entities that have the tag of the game scene. - -```cpp -~game_scene() noexcept final -{ - //! Retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - //! Iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - //! Unset the Tic-Tac-Toe constants - entity_registry_.unset(); -} -``` - -#### Survey of Current Progress - -Compiling and running the program at this point achieves the following result. - -
- - - -
- -Here is the created code. - -```cpp -#include -#include -#include -#include -#include -#include -#include - -//! For convenience -using namespace antara::gaming; - -struct tic_tac_toe_constants -{ - tic_tac_toe_constants(std::size_t nb_cells_per_axis_, std::size_t width_, std::size_t height_) noexcept : - nb_cells_per_axis(nb_cells_per_axis_), - cell_width(width_ / nb_cells_per_axis), - cell_height(height_ / nb_cells_per_axis) - { - } - - const std::size_t nb_cells_per_axis; - const std::size_t cell_width; - const std::size_t cell_height; - const float grid_thickness{20.0f}; -}; - -//! Contains all the functions used for logic and factory -namespace -{ - //! Factory for creating a tic-tac-toe grid - entt::entity create_grid(entt::registry ®istry) noexcept - { - //! retrieve canvas information - auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - - //! entity creation - auto grid_entity = registry.create(); - - //! the vertices - std::vector lines{8 * 4}; - - //! retrieve constants information - auto[nb_cells, cell_width, cell_height, grid_thickness] = registry.ctx(); - const auto half_thickness = grid_thickness * 0.5f; - - //! the loop to create the grid - for (std::size_t counter = 0, i = 0; i <= nb_cells; ++i, counter += 4 * 2) { - - //! to avoid narrowing conversion - auto idx = static_cast(i); - - //! first and last ones should be a bit inside, otherwise half of it is out of the screen - auto offset_x = 0.0f; - auto offset_y = 0.0f; - - if (i == 0) { - offset_x += half_thickness; - offset_y += half_thickness; - } else if (i == nb_cells) { - offset_x -= half_thickness; - offset_y -= half_thickness; - } - - //! prepare lines - - //! vertical - lines[counter + 0].pos = {offset_x + idx * cell_width - half_thickness, 0.f}; - lines[counter + 1].pos = {offset_x + idx * cell_width + half_thickness, 0.f}; - lines[counter + 2].pos = {offset_x + idx * cell_width + half_thickness, canvas_height}; - lines[counter + 3].pos = {offset_x + idx * cell_width - half_thickness, canvas_height}; - - //! horizontal - lines[counter + 4].pos = {offset_x + 0, offset_y + idx * cell_height - half_thickness}; - lines[counter + 5].pos = {offset_x + canvas_width, offset_y + idx * cell_height - half_thickness}; - lines[counter + 6].pos = {offset_x + canvas_width, offset_y + idx * cell_height + half_thickness}; - lines[counter + 7].pos = {offset_x + 0, offset_y + idx * cell_height + half_thickness}; - } - - //! assign the vertex array to the grid entity - registry.assign(grid_entity, lines, geometry::vertex_geometry_type::quads); - - //! assign the game_scene tag to the grid_entity (_hs means hashed_string) - registry.assign>(grid_entity); - - //! draw the grid on the most deep layer, here 0. - registry.assign>(grid_entity); - - //! return the fresh entity - return grid_entity; - } -} - -class game_scene final : public scenes::base_scene -{ -public: - game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) - { - //! retrieve canvas information - auto[canvas_width, canvas_height] = entity_registry_.ctx().canvas.size.to(); - - //! set the constants used in the program - entity_registry_.set(3ull, canvas_width, canvas_height); - - //! create the grid of tic tac toe - grid_entity_ = create_grid(entity_registry_); - } - - //! This function will not be used, because tic tac toe doesn't need an update for every frame - void update() noexcept final - {} - - //! the scene name - std::string scene_name() noexcept final - { - return "game_scene"; - } - - ~game_scene() noexcept final - { - //! retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - //! iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - //! unset the tic tac toe constants - entity_registry_.unset(); - } - -private: - //! the entity representing the tic-tac-toe grid - entt::entity grid_entity_{entt::null}; -}; - -//! the game world -struct tic_tac_toe_world : world::app -{ - //! the game entry point - tic_tac_toe_world() noexcept - { - //! load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - //! load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - //! change the current_scene to "game_scene" by pushing it - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; - -int main() -{ - //! declare the world - tic_tac_toe_world game; - - //! run the game - return game.run(); -} -``` - -## Create the Board, the X and O Graphics, and the Game Logic - -The game requires a `cell_state` variable to indicate whether the cell is empty, or marked `x` or `y`. - -Use `enum` for this effect. - -```cpp -enum cell_state -{ - empty, - player_x = 1, - player_y = 2 -}; -``` - -#### Create the Board - -Create a `3x3` board. Accept the value `3` in a parameter variable named `nb_cells_per_axis`. - -The board is a `vector` of `9` `cell_state` instances and all are marked `empty`. - -```cpp -std::vector create_board(std::size_t nb_cells_per_axis) -{ - std::vector board(nb_cells_per_axis * nb_cells_per_axis, cell_state::empty); - return board; -} -``` - -#### Display X - -The function to display cell states has `row` and `column` parameters. - -```cpp -void create_x(entt::registry &entity_registry, std::size_t row, std::size_t column) noexcept -``` - -Develop the constants that are stored for reuse, such as `nb_cells`, `cell_width`, `cell_height` and `grid_thickness`. Then create other helpful constants as `half_box_side`, `center_x`, `center_y` which is the center position of that specific cell. - -```cpp -auto[nb_cells, cell_width, cell_height, grid_thickness] = entity_registry.ctx(); -const auto half_box_side = static_cast(std::fmin(cell_width, cell_height) * 0.25f); -const auto center_x = static_cast(cell_width * 0.5 + column * cell_width); -const auto center_y = static_cast(cell_height * 0.5 + row * cell_height); -``` - -Make an `X` using two lines. As before, every line is a `quad` which has `4` vertices. - -```cpp -auto x_entity = entity_registry.create(); -std::vector lines{2 * 4}; -``` - -Every vertex of the `X` has a magenta color. - -```cpp -for (auto &¤t_vertex: lines) current_vertex.pixel_color = graphics::magenta; -``` - -As before, set the position of every single vertex. The order is `Top Left`, `Top Right`, `Bottom Left`, `Bottom Right`. - -```cpp -// Top-left to Bottom-right -lines[0].pos = {center_x - half_box_side - half_thickness, center_y - half_box_side}; -lines[1].pos = {center_x - half_box_side + half_thickness, center_y - half_box_side}; -lines[2].pos = {center_x + half_box_side + half_thickness, center_y + half_box_side}; -lines[3].pos = {center_x + half_box_side - half_thickness, center_y + half_box_side}; - - -// Top-right to Bottom-left -lines[4].pos = {center_x + half_box_side - half_thickness, center_y - half_box_side}; -lines[5].pos = {center_x + half_box_side + half_thickness, center_y - half_box_side}; -lines[6].pos = {center_x - half_box_side + half_thickness, center_y + half_box_side}; -lines[7].pos = {center_x - half_box_side - half_thickness, center_y + half_box_side}; -``` - -Create a `geometry::vertex_array`. - -```cpp -entity_registry.assign(x_entity, lines, geometry::vertex_geometry_type::quads); -``` - -Assign the `X` entity to `player_x` and `game_scene`. - -Set the layer as `1`. `X` and `O` need to render above the background layer `0`. - -```cpp -entity_registry.assign>(x_entity); -entity_registry.assign>(x_entity); -entity_registry.assign>(x_entity); -``` - -#### Render O - -The process of rendering `O` starts in the same manner as that of `X`. - -```cpp -void create_o(entt::registry &entity_registry, std::size_t row, std::size_t column) noexcept -{ - auto constants = entity_registry.ctx(); - const auto half_box_side = static_cast(std::fmin(constants.cell_width, constants.cell_height) * 0.25f); - const auto center_x = static_cast(constants.cell_width * 0.5 + column * constants.cell_width); - const auto center_y = static_cast(constants.cell_height * 0.5 + row * constants.cell_height); -``` - -To create the `O`, create an entity, assign it as a `geometry::circle`. - -Set the `fill_color` and `outline_color`, and set the entity position to the center of the cell. - -```cpp -auto o_entity = geometry::blueprint_circle(entity_registry, half_box_side, graphics::transparent, - transform::position_2d(center_x, center_y), - graphics::outline_color(constants.grid_thickness, graphics::cyan)); -``` - -The process of rendering the `O` from this point is the same as that of `X`: assign the object to `game_scene` and set the object to layer `1`. - -```cpp -entity_registry.assign>(o_entity); -entity_registry.assign>(o_entity); -``` - -#### Create a Logic System - -Create an `ecs::logic_update_system` called `tic_tac_toe_logic`. - -```cpp -class tic_tac_toe_logic final : public ecs::logic_update_system -{ -public: - ~tic_tac_toe_logic() noexcept final = default; - - void update() noexcept final - {} -``` - -::: tip Note - -The update function does not perform any actions because Tic-Tac-Toe is a passive game. - -Actual updates occur only when the mouse is clicked. - -::: - -Define the `play_turn` function. - -```cpp -//! Game logic -void play_turn(std::size_t row, std::size_t column) noexcept -``` - -Set `index` according to the `row` and `column`. - -```cpp -//! Retrieve constants -auto constants = entity_registry_.ctx(); - -//! Which cell is clicked ? -std::size_t index = row * constants.nb_cells_per_axis + column; -``` - -Ensure that `index` is inside the board and the clicked cell is empty. - -If so, set the board as the current `player_turn_`. If this value is `X`, call `create_x` for that cell. Otherwise, call `create_o`. - -Then change the turn to the other player. - -```cpp - //! Cell is available ? - if (index < board_.size() && board_[index] == cell_state::empty) { - - //! Change state of the cell to the current player - board_[index] = static_cast(player_turn_); - - //! Create x or o based on the current player - player_turn_ == x ? create_x(entity_registry_, row, column) : create_o(entity_registry_, row, column); - - //! Switch player - player_turn_ = (player_turn_ == player::x) ? player::o : player::x; - } -} -``` - -Call `play_turn` with the position of the mouse click. - -```cpp -void on_mouse_button_pressed(const event::mouse_button_pressed &evt) noexcept - { - if (current_game_state_ == running) { - //! Retrieve game constants. - auto constants = entity_registry_.ctx(); - - //! Play one turn of the Tic-Tac-Toe - play_turn(evt.y / constants.cell_height, evt.x / constants.cell_width); - } else { - //! Reset the game - } - } -``` - -Assign the `on_mouse_button_pressed` event to the mouse click in the constructor. - -```cpp -tic_tac_toe_logic(entt::registry ®istry, entt::entity grid_entity, std::vector board) noexcept - : system(registry), grid_entity_(grid_entity), board_(std::move(board)) -{ - //! stateless system - this->disable(); - - //! subscribe to mouse_button event - this->dispatcher_.sink().connect<&tic_tac_toe_logic::on_mouse_button_pressed>( - *this); -} -``` - -Also in this class are the enums `game_state` and `player`. - -```cpp -//! Private enums -enum game_state -{ - running, - player_x_won = 1, - player_y_won = 2, - tie, - quit -}; - -enum player -{ - x = 1, - o = 2 -}; -``` - -Also develop the other member variables, such as `grid`, `state board`, `game state` and `player turn`. - -```cpp -//! Private members variable -entt::entity grid_entity_{entt::null}; -std::vector board_; -game_state current_game_state_{game_state::running}; -player player_turn_{player::x}; -``` - -After the class definition and out of the class scope give a name to the system. - -```cpp -//! Give a name to the system -REFL_AUTO(type(tic_tac_toe_logic)); -``` - -In the constructor of the `game_scene` create the board and the logic system. - -```cpp -//! Create the board of the tic tac toe -auto board = create_board(tictactoe_constants.nb_cells_per_axis); - -//! Create the logic game system and give the fresh grid entity and the fresh board. -this->system_manager_.create_system(grid_entity, board); -``` - -
- - - -
- -The code up to this point in the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include - -//! For convenience -using namespace antara::gaming; - -struct tic_tac_toe_constants -{ - tic_tac_toe_constants(std::size_t nb_cells_per_axis_, std::size_t width_, std::size_t height_) noexcept : - nb_cells_per_axis(nb_cells_per_axis_), - cell_width(width_ / nb_cells_per_axis), - cell_height(height_ / nb_cells_per_axis) - { - } - - const std::size_t nb_cells_per_axis; - const std::size_t cell_width; - const std::size_t cell_height; - const float grid_thickness{20.0f}; -}; - -enum cell_state -{ - empty, - player_x = 1, - player_y = 2 -}; - -//! Contains all the functions used for logic and factory -namespace -{ - //! Factory for creating a tic-tac-toe grid - entt::entity create_grid(entt::registry ®istry) noexcept - { - //! retrieve canvas information - auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - - //! entity creation - auto grid_entity = registry.create(); - - //! the vertices - std::vector lines{8 * 4}; - - //! retrieve constants information - auto[nb_cells, cell_width, cell_height, grid_thickness] = registry.ctx(); - const auto half_thickness = grid_thickness * 0.5f; - - //! the loop to create the grid - for (std::size_t counter = 0, i = 0; i <= nb_cells; ++i, counter += 4 * 2) { - - //! to avoid narrowing conversion - auto idx = static_cast(i); - - //! first and last ones should be a bit inside, otherwise half of it is out of the screen - auto offset_x = 0.0f; - auto offset_y = 0.0f; - - if (i == 0) { - offset_x += half_thickness; - offset_y += half_thickness; - } else if (i == nb_cells) { - offset_x -= half_thickness; - offset_y -= half_thickness; - } - - //! prepare lines - - //! vertical - lines[counter + 0].pos = {offset_x + idx * cell_width - half_thickness, 0.f}; - lines[counter + 1].pos = {offset_x + idx * cell_width + half_thickness, 0.f}; - lines[counter + 2].pos = {offset_x + idx * cell_width + half_thickness, canvas_height}; - lines[counter + 3].pos = {offset_x + idx * cell_width - half_thickness, canvas_height}; - - //! horizontal - lines[counter + 4].pos = {offset_x + 0, offset_y + idx * cell_height - half_thickness}; - lines[counter + 5].pos = {offset_x + canvas_width, offset_y + idx * cell_height - half_thickness}; - lines[counter + 6].pos = {offset_x + canvas_width, offset_y + idx * cell_height + half_thickness}; - lines[counter + 7].pos = {offset_x + 0, offset_y + idx * cell_height + half_thickness}; - } - - //! assign the vertex array to the grid entity - registry.assign(grid_entity, lines, geometry::vertex_geometry_type::quads); - - //! assign the game_scene tag to the grid_entity (_hs means hashed_string) - registry.assign>(grid_entity); - - //! Draw the grid on the deepest layer, here 0. - registry.assign>(grid_entity); - - //! return the fresh entity - return grid_entity; - } - - std::vector create_board(std::size_t nb_cells_per_axis) - { - std::vector board(nb_cells_per_axis * nb_cells_per_axis, cell_state::empty); - return board; - } - - void create_x(entt::registry &entity_registry, std::size_t row, std::size_t column) noexcept - { - auto[nb_cells, cell_width, cell_height, grid_thickness] = entity_registry.ctx(); - const auto half_box_side = static_cast(std::fmin(cell_width, cell_height) * 0.25f); - const auto center_x = static_cast(cell_width * 0.5 + column * cell_width); - const auto center_y = static_cast(cell_height * 0.5 + row * cell_height); - - auto x_entity = entity_registry.create(); - std::vector lines{2 * 4}; - - for (auto &¤t_vertex: lines) current_vertex.pixel_color = graphics::magenta; - - const auto half_thickness = grid_thickness * 0.5f; - - // Top-left to Bottom-right - lines[0].pos = {center_x - half_box_side - half_thickness, center_y - half_box_side}; - lines[1].pos = {center_x - half_box_side + half_thickness, center_y - half_box_side}; - lines[2].pos = {center_x + half_box_side + half_thickness, center_y + half_box_side}; - lines[3].pos = {center_x + half_box_side - half_thickness, center_y + half_box_side}; - - - // Top-right to Bottom-left - lines[4].pos = {center_x + half_box_side - half_thickness, center_y - half_box_side}; - lines[5].pos = {center_x + half_box_side + half_thickness, center_y - half_box_side}; - lines[6].pos = {center_x - half_box_side + half_thickness, center_y + half_box_side}; - lines[7].pos = {center_x - half_box_side - half_thickness, center_y + half_box_side}; - - entity_registry.assign(x_entity, lines, geometry::vertex_geometry_type::quads); - entity_registry.assign>(x_entity); - entity_registry.assign>(x_entity); - entity_registry.assign>(x_entity); - } - - void create_o(entt::registry &entity_registry, std::size_t row, std::size_t column) noexcept - { - auto constants = entity_registry.ctx(); - const auto half_box_side = static_cast(std::fmin(constants.cell_width, constants.cell_height) * 0.25f); - const auto center_x = static_cast(constants.cell_width * 0.5 + column * constants.cell_width); - const auto center_y = static_cast(constants.cell_height * 0.5 + row * constants.cell_height); - - auto o_entity = geometry::blueprint_circle(entity_registry, half_box_side, graphics::transparent, - transform::position_2d(center_x, center_y), - graphics::outline_color(constants.grid_thickness, graphics::cyan)); - - entity_registry.assign>(o_entity); - entity_registry.assign>(o_entity); - } -} - -class tic_tac_toe_logic final : public ecs::logic_update_system -{ -public: - ~tic_tac_toe_logic() noexcept final = default; - - void update() noexcept final - {} - - void on_mouse_button_pressed(const event::mouse_button_pressed &evt) noexcept - { - if (current_game_state_ == running) { - //! Retrieve game constants. - auto constants = entity_registry_.ctx(); - - //! Play one turn of the Tic-Tac-Toe - play_turn(evt.y / constants.cell_height, evt.x / constants.cell_width); - } else { - //! Reset the game - } - } - - tic_tac_toe_logic(entt::registry ®istry, entt::entity grid_entity, std::vector board) noexcept - : system(registry), grid_entity_(grid_entity), board_(std::move(board)) - { - //! stateless system - this->disable(); - - //! subscribe to mouse_button event - this->dispatcher_.sink().connect<&tic_tac_toe_logic::on_mouse_button_pressed>( - *this); - } - -private: - //! Game logic - void play_turn(std::size_t row, std::size_t column) noexcept - { - //! Retrieve constants - auto constants = entity_registry_.ctx(); - - //! Which cell is clicked ? - std::size_t index = row * constants.nb_cells_per_axis + column; - - //! Cell is available ? - if (index < board_.size() && board_[index] == cell_state::empty) { - - //! change state of the cell to the current player - board_[index] = static_cast(player_turn_); - - //! create x or o based on the current player - player_turn_ == x ? create_x(entity_registry_, row, column) : create_o(entity_registry_, row, column); - - //! switch player - player_turn_ = (player_turn_ == player::x) ? player::o : player::x; - } - } - -private: - //! Private enums - enum game_state - { - running, - player_x_won = 1, - player_y_won = 2, - tie, - quit - }; - - enum player - { - x = 1, - o = 2 - }; - -private: - //! Private members variable - entt::entity grid_entity_{entt::null}; - std::vector board_; - game_state current_game_state_{game_state::running}; - player player_turn_{player::x}; -}; - -//! Provide the system with a name -REFL_AUTO(type(tic_tac_toe_logic)); - -class game_scene final : public scenes::base_scene -{ -public: - game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) - { - //! Retrieve canvas information - auto[canvas_width, canvas_height] = entity_registry_.ctx().canvas.size.to(); - - //! Set the constants that will be used in the program - auto &tictactoe_constants = entity_registry_.set(3ull, canvas_width, canvas_height); - - //! Create the grid of the tic tac toe - auto grid_entity = create_grid(entity_registry_); - - //! Create the board of the tic tac toe - auto board = create_board(tictactoe_constants.nb_cells_per_axis); - - //! Create the logic game system and give the fresh grid entity and the fresh board. - this->system_manager_.create_system(grid_entity, board); - } - - //! This function will not be used, because tic tac toe doesn't need an update every frame. - void update() noexcept final - {} - - - //! the scene name - std::string scene_name() noexcept final - { - return "game_scene"; - } - - ~game_scene() noexcept final - { - //! Retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - //! Iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - //! Unset the tic tac toe constants - entity_registry_.unset(); - } - -private: - ecs::system_manager system_manager_{entity_registry_}; -}; - -//! The game world -struct tic_tac_toe_world : world::app -{ - //! The game entry point - tic_tac_toe_world() noexcept - { - //! Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - //! Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - //! Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; - -int main() -{ - //! Declare the world - tic_tac_toe_world game; - - //! Run the game - return game.run(); -} -``` - -## Win, Tie Conditions, and Resetting the Game - -The game requires final conditions, such as `win`, `tie`, and the ability to the reset the game. - -#### Create Reset Capabilities - -Create a blank `reset_event` struct. - -```cpp -struct reset_event -{ - -}; -``` - -Define the reset event callback. This calls the destructor and then calls the constructor again. - -```cpp -//! Callback -void on_reset_event(const reset_event &) noexcept -{ - entt::registry ®istry = this->entity_registry_; - this->~game_scene(); - new(this) game_scene(registry); -} -``` - -Subscribe to this reset event in the `game_scene` constructor. - -```cpp -class game_scene final : public scenes::base_scene -{ -public: - game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) - { - //! Subscribe to reset event - this->dispatcher_.sink().connect<&game_scene::on_reset_event>(*this); -``` - -Remove this event in the class destructor. - -```cpp -~tic_tac_toe_logic() noexcept final -{ - this->dispatcher_.sink().disconnect(*this); -} -``` - -Trigger this when the mouse button is pressed and the game state is not `running`. - -```cpp -this->dispatcher_.trigger(); - ---------- - -void on_mouse_button_pressed(const event::mouse_button_pressed &evt) noexcept -{ - if (current_game_state_ == running) { - //! Retrieve game constants. - auto constants = entity_registry_.ctx(); - - //! Play one turn of the Tic-Tac-Toe - play_turn(evt.y / constants.cell_height, evt.x / constants.cell_width); - } else { - //! Reset the game - this->dispatcher_.trigger(); - } -} -``` - -#### Create Final Conditions - -Define the checks for `win` and `tie` conditions. - -Start with the winning condition. - -Check the current player’s `win` situation. - -In this function, check every cell and count how many are marked as `current player`. Perform this action separately in two variables: `row_count` and `column_count`. If any of these two reach the `nb_cells` value, which is `3`, the player wins and the function returns `true`. - -Count the diagonal lines and check `nb_cells` as before. - -If nothing has reached `3`, return `false`. - -```cpp -[[nodiscard]] bool did_current_player_win_the_game() const noexcept -{ - std::size_t row_count{0u}, column_count{0u}, diag1_count{0u}, diag2_count{0u}; - auto[nb_cells, cell_width, cell_height, _] = entity_registry_.ctx(); - for (std::size_t i = 0; i < nb_cells; ++i) { - for (std::size_t j = 0; j < nb_cells; ++j) { - //! Check rows - if (board_[i * nb_cells + j] == static_cast(player_turn_)) - row_count++; - - //! Check columns - if (board_[j * nb_cells + i] == static_cast(player_turn_)) - column_count++; - } - - //! Check condition - if (row_count >= nb_cells || column_count >= nb_cells) { - return true; - } - - //! Reset rows and columns - row_count = 0u, column_count = 0u; - - //! Diag1 count - if (board_[i * nb_cells + i] == static_cast(player_turn_)) - diag1_count++; - - //! Second diag count - if (board_[i * nb_cells + nb_cells - i - 1] == static_cast(player_turn_)) - diag2_count++; - } - - //! Condition - return diag1_count >= nb_cells || diag2_count >= nb_cells; -} -``` - -If all the cells are filled and there is no `win` condition, the game is a tie. - -```cpp -[[nodiscard]] bool is_tie() const noexcept -{ - return std::count(begin(board_), end(board_), cell_state::empty) == 0; -} -``` - -#### Set Colors for the Conditions - -Use these two conditions to check functions in a larger function that is called later. - -```cpp -void check_winning_condition() noexcept -``` - -Inside this function define a functor `make_screen` that sets the color of the grid. - -```cpp -auto make_screen = [this](graphics::color clr_winner, - entt::entity entity) { - auto &array_cmp = this->entity_registry_.get(entity); - for (auto &v : array_cmp.vertices) v.pixel_color = clr_winner; - entity_registry_.replace(entity, array_cmp.vertices, array_cmp.geometry_type); -}; -``` - -Using this functor, make another functor, `make_player_win_screen`, that gives the winner’s color as an argument. - -```cpp -auto make_player_win_screen = [this, make_screen](entt::entity entity) { - auto winning_color = player_turn_ == player::x ? graphics::magenta : graphics::cyan; - make_screen(winning_color, entity); -}; -``` - -Likewise, create another which feeds a different color when the game is a tie. - -```cpp -auto make_tie_screen = [make_screen](entt::entity entity) { - make_screen(graphics::yellow, entity); -}; -``` - -Check if the current player won the game. If not, check if the game is not a tie. - -Set the game state accordingly and call the proper functor. - -```cpp -if (did_current_player_win_the_game()) { - current_game_state_ = static_cast(player_turn_); - make_player_win_screen(grid_entity_); -} else if (is_tie()) { - current_game_state_ = game_state::tie; - make_tie_screen(grid_entity_); -} -``` - -The function `check_winning_condition` now appears as follows. - -```cpp -void check_winning_condition() noexcept -{ - auto make_screen = [this](graphics::color clr_winner, - entt::entity entity) { - auto &array_cmp = this->entity_registry_.get(entity); - for (auto &v : array_cmp.vertices) v.pixel_color = clr_winner; - entity_registry_.replace(entity, array_cmp.vertices, array_cmp.geometry_type); - }; - - auto make_player_win_screen = [this, make_screen](entt::entity entity) { - auto winning_color = player_turn_ == player::x ? graphics::magenta : graphics::cyan; - make_screen(winning_color, entity); - }; - - auto make_tie_screen = [make_screen](entt::entity entity) { - make_screen(graphics::yellow, entity); - }; - - if (did_current_player_win_the_game()) { - current_game_state_ = static_cast(player_turn_); - make_player_win_screen(grid_entity_); - } else if (is_tie()) { - current_game_state_ = game_state::tie; - make_tie_screen(grid_entity_); - } -} -``` - -Call this function in the end of `play_turn`. - -```cpp -void play_turn(std::size_t row, std::size_t column) noexcept -{ - //! Retrieve constants - auto constants = entity_registry_.ctx(); - - //! Which cell is clicked ? - std::size_t index = row * constants.nb_cells_per_axis + column; - - //! Cell is available ? - if (index < board_.size() && board_[index] == cell_state::empty) { - - //! Change state of the cell to the current player - board_[index] = static_cast(player_turn_); - - //! Create x or o based on the current player - player_turn_ == x ? create_x(entity_registry_, row, column) : create_o(entity_registry_, row, column); - - //! Check winning condition - check_winning_condition(); - - //! Switch player - player_turn_ = (player_turn_ == player::x) ? player::o : player::x; - } -} -``` - -The game is now complete. - -#### During the Match - -
- - - -
- -#### When Player X Wins - -
- - - -
- -#### When Player O Wins - -
- - - -
- -#### A Tie: - -
- - - -
- -#### The Complete Game Code - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include - -//! For convenience -using namespace antara::gaming; - -struct tic_tac_toe_constants -{ - tic_tac_toe_constants(std::size_t nb_cells_per_axis_, std::size_t width_, std::size_t height_) noexcept : - nb_cells_per_axis(nb_cells_per_axis_), - cell_width(width_ / nb_cells_per_axis), - cell_height(height_ / nb_cells_per_axis) - { - } - - const std::size_t nb_cells_per_axis; - const std::size_t cell_width; - const std::size_t cell_height; - const float grid_thickness{20.0f}; -}; - -enum cell_state -{ - empty, - player_x = 1, - player_y = 2 -}; - -struct reset_event -{ - -}; - -//! Contains all the functions used for logic and factory -namespace -{ - //! Factory for creating a tic-tac-toe grid - entt::entity create_grid(entt::registry ®istry) noexcept - { - //! Retrieve canvas information - auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - - //! Entity creation - auto grid_entity = registry.create(); - - //! the vertices - std::vector lines{8 * 4}; - - //! Retrieve constants information - auto[nb_cells, cell_width, cell_height, grid_thickness] = registry.ctx(); - const auto half_thickness = grid_thickness * 0.5f; - - //! the loop to create the grid - for (std::size_t counter = 0, i = 0; i <= nb_cells; ++i, counter += 4 * 2) { - - //! To avoid narrowing conversion - auto idx = static_cast(i); - - //! First and last ones should be a bit inside, otherwise half of it is out of the screen - auto offset_x = 0.0f; - auto offset_y = 0.0f; - - if (i == 0) { - offset_x += half_thickness; - offset_y += half_thickness; - } else if (i == nb_cells) { - offset_x -= half_thickness; - offset_y -= half_thickness; - } - - //! Prepare lines - - //! Vertical - lines[counter + 0].pos = {offset_x + idx * cell_width - half_thickness, 0.f}; - lines[counter + 1].pos = {offset_x + idx * cell_width + half_thickness, 0.f}; - lines[counter + 2].pos = {offset_x + idx * cell_width + half_thickness, canvas_height}; - lines[counter + 3].pos = {offset_x + idx * cell_width - half_thickness, canvas_height}; - - //! Horizontal - lines[counter + 4].pos = {offset_x + 0, offset_y + idx * cell_height - half_thickness}; - lines[counter + 5].pos = {offset_x + canvas_width, offset_y + idx * cell_height - half_thickness}; - lines[counter + 6].pos = {offset_x + canvas_width, offset_y + idx * cell_height + half_thickness}; - lines[counter + 7].pos = {offset_x + 0, offset_y + idx * cell_height + half_thickness}; - } - - //! Assign the vertex array to the grid entity - registry.assign(grid_entity, lines, geometry::vertex_geometry_type::quads); - - //! Assign the game_scene tag to the grid_entity (_hs means hashed_string) - registry.assign>(grid_entity); - - //! Draw the grid on the deepest layer, here 0. - registry.assign>(grid_entity); - - //! give back the fresh entity - return grid_entity; - } - - std::vector create_board(std::size_t nb_cells_per_axis) - { - std::vector board(nb_cells_per_axis * nb_cells_per_axis, cell_state::empty); - return board; - } - - void create_x(entt::registry &entity_registry, std::size_t row, std::size_t column) noexcept - { - auto[_, cell_width, cell_height, grid_thickness] = entity_registry.ctx(); - const auto half_box_side = static_cast(std::fmin(cell_width, cell_height) * 0.25f); - const auto center_x = static_cast(cell_width * 0.5 + column * cell_width); - const auto center_y = static_cast(cell_height * 0.5 + row * cell_height); - - auto x_entity = entity_registry.create(); - std::vector lines{2 * 4}; - - for (auto &¤t_vertex: lines) current_vertex.pixel_color = graphics::magenta; - - const auto half_thickness = grid_thickness * 0.5f; - - // Top-left to Bottom-right - lines[0].pos = {center_x - half_box_side - half_thickness, center_y - half_box_side}; - lines[1].pos = {center_x - half_box_side + half_thickness, center_y - half_box_side}; - lines[2].pos = {center_x + half_box_side + half_thickness, center_y + half_box_side}; - lines[3].pos = {center_x + half_box_side - half_thickness, center_y + half_box_side}; - - - // Top-right to Bottom-left - lines[4].pos = {center_x + half_box_side - half_thickness, center_y - half_box_side}; - lines[5].pos = {center_x + half_box_side + half_thickness, center_y - half_box_side}; - lines[6].pos = {center_x - half_box_side + half_thickness, center_y + half_box_side}; - lines[7].pos = {center_x - half_box_side - half_thickness, center_y + half_box_side}; - - entity_registry.assign(x_entity, lines, geometry::vertex_geometry_type::quads); - entity_registry.assign>(x_entity); - entity_registry.assign>(x_entity); - entity_registry.assign>(x_entity); - } - - void create_o(entt::registry &entity_registry, std::size_t row, std::size_t column) noexcept - { - auto constants = entity_registry.ctx(); - const auto half_box_side = static_cast(std::fmin(constants.cell_width, constants.cell_height) * 0.25f); - const auto center_x = static_cast(constants.cell_width * 0.5 + column * constants.cell_width); - const auto center_y = static_cast(constants.cell_height * 0.5 + row * constants.cell_height); - - auto o_entity = geometry::blueprint_circle(entity_registry, half_box_side, graphics::transparent, - transform::position_2d(center_x, center_y), - graphics::outline_color(constants.grid_thickness, graphics::cyan)); - - entity_registry.assign>(o_entity); - entity_registry.assign>(o_entity); - } -} - -class tic_tac_toe_logic final : public ecs::logic_update_system -{ -public: - - void update() noexcept final - {} - - void on_mouse_button_pressed(const event::mouse_button_pressed &evt) noexcept - { - if (current_game_state_ == running) { - //! Retrieve game constants. - auto constants = entity_registry_.ctx(); - - //! Play one turn of the Tic-Tac-Toe - play_turn(evt.y / constants.cell_height, evt.x / constants.cell_width); - } else { - //! Reset the game - this->dispatcher_.trigger(); - } - } - - tic_tac_toe_logic(entt::registry ®istry, entt::entity grid_entity, std::vector board) noexcept - : system(registry), grid_entity_(grid_entity), board_(std::move(board)) - { - //! Stateless system - this->disable(); - - //! Subscribe to mouse_button event - this->dispatcher_.sink().connect<&tic_tac_toe_logic::on_mouse_button_pressed>( - *this); - } - - ~tic_tac_toe_logic() noexcept final - { - this->dispatcher_.sink().disconnect(*this); - } - -private: - //! Game logic - [[nodiscard]] bool did_current_player_win_the_game() const noexcept - { - std::size_t row_count{0u}, column_count{0u}, diag1_count{0u}, diag2_count{0u}; - auto[nb_cells, cell_width, cell_height, _] = entity_registry_.ctx(); - for (std::size_t i = 0; i < nb_cells; ++i) { - for (std::size_t j = 0; j < nb_cells; ++j) { - //! Check rows - if (board_[i * nb_cells + j] == static_cast(player_turn_)) - row_count++; - - //! Check columns - if (board_[j * nb_cells + i] == static_cast(player_turn_)) - column_count++; - } - - //! Check condition - if (row_count >= nb_cells || column_count >= nb_cells) { - return true; - } - - //! Reset rows and columns - row_count = 0u, column_count = 0u; - - //! Diag1 count - if (board_[i * nb_cells + i] == static_cast(player_turn_)) - diag1_count++; - - //! Second diag count - if (board_[i * nb_cells + nb_cells - i - 1] == static_cast(player_turn_)) - diag2_count++; - } - - //! Condition - return diag1_count >= nb_cells || diag2_count >= nb_cells; - } - - [[nodiscard]] bool is_tie() const noexcept - { - return std::count(begin(board_), end(board_), cell_state::empty) == 0; - } - - void check_winning_condition() noexcept - { - auto make_screen = [this](graphics::color clr_winner, - entt::entity entity) { - auto &array_cmp = this->entity_registry_.get(entity); - for (auto &v : array_cmp.vertices) v.pixel_color = clr_winner; - entity_registry_.replace(entity, array_cmp.vertices, array_cmp.geometry_type); - }; - - auto make_player_win_screen = [this, make_screen](entt::entity entity) { - auto winning_color = player_turn_ == player::x ? graphics::magenta : graphics::cyan; - make_screen(winning_color, entity); - }; - - auto make_tie_screen = [make_screen](entt::entity entity) { - make_screen(graphics::yellow, entity); - }; - - if (did_current_player_win_the_game()) { - current_game_state_ = static_cast(player_turn_); - make_player_win_screen(grid_entity_); - } else if (is_tie()) { - current_game_state_ = game_state::tie; - make_tie_screen(grid_entity_); - } - } - - void play_turn(std::size_t row, std::size_t column) noexcept - { - //! Retrieve constants - auto constants = entity_registry_.ctx(); - - //! Which cell is clicked ? - std::size_t index = row * constants.nb_cells_per_axis + column; - - //! Cell is available ? - if (index < board_.size() && board_[index] == cell_state::empty) { - - //! Change state of the cell to the current player - board_[index] = static_cast(player_turn_); - - //! Create x or o based on the current player - player_turn_ == x ? create_x(entity_registry_, row, column) : create_o(entity_registry_, row, column); - - //! Check winning condition - check_winning_condition(); - - //! Switch player - player_turn_ = (player_turn_ == player::x) ? player::o : player::x; - } - } - -private: - //! Private enums - enum game_state - { - running, - player_x_won = 1, - player_y_won = 2, - tie, - quit - }; - - enum player - { - x = 1, - o = 2 - }; - -private: - //! Private members variable - entt::entity grid_entity_{entt::null}; - std::vector board_; - game_state current_game_state_{game_state::running}; - player player_turn_{player::x}; -}; - -//! Provide the system with a name -REFL_AUTO(type(tic_tac_toe_logic)); - -class game_scene final : public scenes::base_scene -{ -public: - game_scene(entt::registry &entity_registry) noexcept : base_scene(entity_registry) - { - //! Subscribe to reset event - this->dispatcher_.sink().connect<&game_scene::on_reset_event>(*this); - //! Retrieve canvas information - auto[canvas_width, canvas_height] = entity_registry_.ctx().canvas.size.to(); - - //! Set the constants that will be used in the program - auto &tictactoe_constants = entity_registry_.set(3ull, canvas_width, canvas_height); - - //! Create the grid of the tic tac toe - auto grid_entity = create_grid(entity_registry_); - - //! Create the board of the tic tac toe - auto board = create_board(tictactoe_constants.nb_cells_per_axis); - - //! Create the logic game system and give the fresh grid entity and the fresh board. - this->system_manager_.create_system(grid_entity, board); - } - - //! This function will not be used, because tic tac toe doesn't need an update every frame. - void update() noexcept final - {} - - - //! The scene name - std::string scene_name() noexcept final - { - return "game_scene"; - } - - ~game_scene() noexcept final - { - //! Retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - //! Iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - //! Unset the tic tac toe constants - entity_registry_.unset(); - } - - //! Callback - void on_reset_event(const reset_event &) noexcept - { - entt::registry ®istry = this->entity_registry_; - this->~game_scene(); - new(this) game_scene(registry); - } - -private: - ecs::system_manager system_manager_{entity_registry_}; -}; - -//! The game world -struct tic_tac_toe_world : world::app -{ - //! The game entry point - tic_tac_toe_world() noexcept - { - //! Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - //! Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - //! Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; - -int main() -{ - //! Declare the world - tic_tac_toe_world game; - - //! Run the game - return game.run(); -} -``` diff --git a/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-4.md b/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-4.md deleted file mode 100644 index 8c1106ba4..000000000 --- a/docs/basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-4.md +++ /dev/null @@ -1,5477 +0,0 @@ -# Tutorial: Flappy Bird - -Please become familiar with the [Getting Started](../../../basic-docs/antara/antara-tutorials/gaming-sdk-tutorial-0.html) tutorial before beginning this tutorial. - -## Introduction - -This tutorial guides the reader in creating a simple game of Flappy Bird in relation to Komodo technology. - -## Set Up the Executable, Window, and Game Scene - -Create a folder called `flappy-bird` for the project, and create a subfolder called `assets` inside. - -Within the `assets` folder create a `textures` subfolder for storing the `player.png` image. - -Also in the `assets` folder, create another subfolder called `data`, and within this, create two subfolders: `linux` and `osx` to store utility files required to install the game on targeted systems. - -#### The Linux Folder - -In the `Linux` folder three files are required. - -- komodo_icon.png - - (these are the icons of the game) -- org.antara.gaming.sfml.flappybird.appdata.xml - - (xml definition for the game) -- org.antara.gaming.sfml.flappybird.desktop - - (desktop file for Linux) - -Here is the icon of the game for the tutorials: - -
- - - -
- -Here is the xml file: - -```xml - - org.antara.gaming.sfml.flappybird.desktop - MIT - MIT - flappy-bird - flappy-bird tutorial antara gaming sdk - -

Written in c++17

-
- org.antara.gaming.sfml.flappybird.desktop - https://github.com/KomodoPlatform/antara-gaming-sdk - - - https://www.freedesktop.org/software/appstream/docs/images/scr-examples/geany-good.png - - - - org.antara.gaming.sfml.flappybird.desktop - -
-``` - -Here is the desktop file: - -``` -[Desktop Entry] -Type=Application -Name=flappy-bird -Exec=flappy-bird -Icon=komodo_icon -Categories=Game; -``` - -#### The OSX Folder - -The `OSX` folder requires four files. - -- kmd_logo.icns - - (icon osx format of the game) -- Packaging_CMakeDMGBackground.tif - - (dmg image background) -- Packaging_CMakeDMGSetup.scpt - - (OSX Apple script for the packaging) -- sfml_flappybird_install.cmake - - (CMake script for the bundling) - -[Click here](/flappy-bird-tutorial/kmd_logo.icns) to download kmd_logo.icns. - -[Click here](/flappy-bird-tutorial/Packaging_CMakeDMGBackground.tif) to download Packaging_CMakeDMGBackground.tif. - -The AppleScript: - -```cmake -on run argv - set image_name to item 1 of argv - - tell application "Finder" - tell disk image_name - - -- wait for the image to finish mounting - set open_attempts to 0 - repeat while open_attempts < 4 - try - open - delay 1 - set open_attempts to 5 - close - on error errStr number errorNumber - set open_attempts to open_attempts + 1 - delay 10 - end try - end repeat - delay 5 - - -- open the image the first time and save a DS_Store with just - -- background and icon setup - open - set current view of container window to icon view - set theViewOptions to the icon view options of container window - set background picture of theViewOptions to file ".background:background.tif" - set arrangement of theViewOptions to not arranged - set icon size of theViewOptions to 128 - delay 5 - close - - -- next setup the position of the app and Applications symlink - -- plus hide all the window decorationPackaging_CMakeDMGBackground.tif - open - update without registering applications - tell container window - set sidebar width to 0 - set statusbar visible to false - set toolbar visible to false - set the bounds to { 400, 100, 900, 465 } - set position of item "flappy-bird.app" to { 133, 200 } - set position of item "Applications" to { 378, 200 } - end tell - update without registering applications - delay 5 - close - - -- one last open and close to verify that everything looks correct - open - delay 5 - close - - end tell - delay 1 -end tell -end run -``` - -The CMake script: - -```cmake -if (APPLE) - set_target_properties(${PROJECT_NAME} PROPERTIES - MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}" - RESOURCE data/osx/${PROJECT_NAME}.icns - MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME} - MACOSX_BUNDLE_SHORT_VERSION_STRING 0.0.1 - MACOSX_BUNDLE_LONG_VERSION_STRING 0.0.1 - MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in") - add_custom_command(TARGET ${PROJECT_NAME} - POST_BUILD COMMAND - ${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/" - $) -endif () - -if (APPLE) - install(TARGETS ${PROJECT_NAME} - BUNDLE DESTINATION . COMPONENT Runtime - RUNTIME DESTINATION bin COMPONENT Runtime - ) - - # Note Mac specific extension .app - set(APPS "\${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app") - - # Directories to look for dependencies - set(DIRS ${CMAKE_BINARY_DIR}) - - install(CODE "include(BundleUtilities) - fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\")") - - set(CPACK_GENERATOR "DRAGNDROP") - set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/data/osx/Packaging_CMakeDMGSetup.scpt") - set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/data/osx/Packaging_CMakeDMGBackground.tif") - set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") - include(CPack) -endif () -``` - -#### Other Build Files - -In the `flappy-bird` directory, create a text file and save it as `CMakeLists.txt`. - -This file has the following items: the name of the project, the creation of the executable, a link to the SDK, moving of the assets, the C++ standard that will be used, and any extra modules required. - -Below is the `CMakeLists.txt` file. - -```cmake -if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the source code and call cmake from there") -endif () - -##! Minimum version of the CMake. -cmake_minimum_required(VERSION 3.14) - -##! C++ Standard needed by the SDK is 17 -set(CMAKE_CXX_STANDARD 17) - -##! The Project title -- flappy-bird. -project(flappy-bird DESCRIPTION "An awesome flappy-bird" LANGUAGES CXX VERSION 1.0.0) - -##! The SDK need's clang as main compiler. -if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") - message(FATAL_ERROR "Only Clang is supported (minimum LLVM 8.0)") - endif() -endif () - -##! Inform the SDK if the machine is on Linux -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(LINUX TRUE) -endif () - -##! Include the module from CMake for fetching dependencies -include(FetchContent) - -##! Declare information about the dependance to fetch. -FetchContent_Declare( - antara-gaming-sdk - URL https://github.com/KomodoPlatform/antara-gaming-sdk/archive/master.zip -) - -##! Set extra modules from the SDK to use -- the SFML module here -set(USE_SFML_ANTARA_WRAPPER ON) - -##! Fetch the dependence -FetchContent_MakeAvailable(antara-gaming-sdk) - -##! Calling this macros provided by the sdk will, if the local machine runs Apple, init the environment for this OS (std::filesystem). -init_antara_env() - -##! Get basis assets (default fonts, etc) -get_resources_basics_assets(${CMAKE_CURRENT_SOURCE_DIR}) - -##! Osx bundle icon -set(ICON) -configure_icon_osx(data/osx/kmd_logo.icns ICON kmd_logo.icns) - -##! Create the executable with the project name -add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${ICON} flappy-bird.cpp) - -##! Linux assets -magic_game_app_image_generation("${CMAKE_CURRENT_SOURCE_DIR}/data/linux" - "org.antara.gaming.sfml.flappybird.desktop" - "org.antara.gaming.sfml.flappybirds.appdata.xml" - "komodo_icon.png" - flappy-bird - AntaraFlappyBirdAppDir - ${CMAKE_CURRENT_SOURCE_DIR}/assets - ) - -##! Setting output directory -set_target_properties(${PROJECT_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/" - ) - -##! Link the SDK modules to use to the executable -target_link_libraries(${PROJECT_NAME} PUBLIC antara::world antara::sfml antara::collisions) - -##! Move the assets -if (WIN32) - file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}/bin/) - ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory "${SFML_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/bin/" - COMMENT "copying dlls …" - $ - ) - - ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${SFML_SOURCE_DIR}/extlibs/bin/x64/openal32.dll" "${CMAKE_BINARY_DIR}/bin/openal32.dll" - COMMENT "copying dlls …" - $ - ) -endif () - -if (APPLE) - file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}.app/Contents/Resources) -endif() -``` - -Create the input file for the application containing an empty main function (as below) and save the file as `flappy-bird.cpp`. - -```cpp -int main() { - return 0; -} -``` - -The project tree should now be as follows. - -``` -./flappy-bird -├── assets -│ ├── config -│ │ └── game.config.maker.json -│ └── textures -│ └── player.png -│ └── fonts -│ └── sansation.ttf -├── CMakeLists.txt -├── data -│ ├── linux -│ │ ├── komodo_icon.png -│ │ ├── org.antara.gaming.sfml.flappybird.appdata.xml -│ │ └── org.antara.gaming.sfml.flappybird.desktop -│ └── osx -│ ├── kmd_logo.icns -│ ├── Packaging_CMakeDMGBackground.tif -│ ├── Packaging_CMakeDMGSetup.scpt -│ └── sfml_flappybird_install.cmake -└── flappy-bird.cpp -``` - -## Create a Game World - -To create a world representing the world of the game, start by including the following header file. - -```cpp -#include -``` - -Add a basic structure named `flappy_bird_world`. - -This inherits from the `antara::gaming::world::app` class. - -Use the namespace `antara::gaming` and `std::string_literals` for convenience. - -Declare the new object in the body of the main function. Replace its return value with the return value of the game, as returned by the `run` function of the `class world::app`. - -The following is the result. - -```cpp -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept = default; -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -#### Initiating the Graphics - -To compile and execute the program at this point would result only in an infinite loop. - -Adding the graphics side of the application requires two modules: `antara::gaming::sfml::graphic_system` and `antara::gaming::sfml::input::system`. These have the following headers, respectively: `#include ` and `#include `. - -In the body of the constructor of the class `flappy_bird_world` load the graphic system and initialize the input system with the window from the graphic system. - -```cpp -// Game entry point -flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); -} -``` - -Compiling and running now creates a black window, which can be closed by pressing the close button on the window bar. - -
- - - -
- -#### Create a Game Scene - -To create a game scene using the scene manager include the header file `#include ` and load the scene's manager system into the system manager. - -```cpp -// Game entry point -struct flappy_bird_world : world::app { - //! the game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - } -}; -``` - -Create the `game_scene` class that inherits from the `base_scene` class. This class is the entry point of the game scene. - -The concrete class must override several functions such as `update`, and `scene_name`. - -Leave the `update` function empty for the time being. - -The `scene_name` function returns the name of the scene. - -```cpp -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - } -}; -``` - -Load the game scene into the `scene_manager` using the `change_scene` member function. - -```cpp -struct flappy_bird_world : world::app -{ - //! The game entry point - flappy_bird_world() noexcept - { - //! Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - //! Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - //! Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; -``` - -The sprite for the bird requires the `sfml::resources_system`. Include the header file `#include ` and load this in the world constructor. - -```cpp -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; -``` - -Compiling the game at this time still produces a black window, but this is now the game scene. - -
- - - -
- -::: tip Note - -The scene system is a useful method to organize multiple screens of the game: **introduction scene**, **game scene**, **end-of-game scene**, etc. - -::: - -Here is the code at this stage of the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - } -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## Create the Pipes - -The following steps add the pipes that kill the Flappy Bird whenenver they touch each other. In the image below, note the two pipes that have a gap between them. This is a `column`. - -
- - - -
- -#### Create the Structs - -Begin by developing the constant values. Keep these in a struct. - -Observe the following example. - -```cpp -// Constants -struct flappy_bird_constants { - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; -``` - -Add this to the `registry` in the `game_scene` constructor. - -```cpp -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - // Set the constants that will be used in the program - registry.set(); - } -``` - -Create a struct to represent a single `pipe`. Instead of using a sprite, create graphics with basic shapes. - -For example, a pipe has two parts: the `body` and the `cap`. The body is the long part of the pipe with a cap sitting at the tip. Both are green-rectangle entities, but with different sizes. - -Also, prepare a `destroy` function to destroy `body` and `cap` entities. - -```cpp -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; -``` - -Two of these pipes together are called a `column`. - -Make another struct which uses the `struct pipe`. - -In this struct, one instance of the `pipe` is the `top_pipe`, the other is the `bottom_pipe`. - -Call the `destroy` function again, but this time the `destroy` function also has an entity parameter which will be the `column` entity itself. - -```cpp -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; -``` - -#### Create the Pipe Functions - -The first function returns a random number. This randomly positions the gap between the pipes. Use `std::random_device`, `std::mt19937`, and `std::uniform_real_distribution` to this effect. - -```cpp -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} -``` - -Tag each entity with the `game_scene` name. - -Dynamic entities require a `dynamic` tag. This makes queries to dynamic entities easier when destroying entities at game reset. - -Since the tagging is repeated frequently, create a function to manage the tagging process. Adding this helper function to a namespace is convenient. - -```cpp -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } -} -``` - -The creation of the pipes requires another function to obtain a random starting position for the gap. This informs the logic of the place to start and end the top pipe, to include the gap, and then start and end the bottom pipe. - -This function uses a few constants, such as `column_min` and `column_max`. - -`column_min` is for the top limit, `0.2` of the canvas height. - -`column_max` is for the bottom limit, `0.8` of the canvas height. Subtract `gap_height` from the `bottom_limit`, as this is the starting position (top position) of the gap. - -Once the limits are established, the function returns a random float value between the limits, using the random function defined previously. - -Add this function to the same namespace. - -```cpp -// Returns a random gap start position Y -float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); -} -``` - -#### Construct the Pipes - -The `create_pipe` function has `bool is_top, float pos_x, float gap_start_pos_y` parameters. - -`is_top` indicates if this is the top pipe or the bottom. - -`pos_x` is the horizontal position of the pipe. - -`gap_start_pos_y` is the vertical start position of the gap, for example, the bottom edge of the top pipe. - -Retrieve `canvas_height` and the constants. - -```cpp -// Retrieve constants -const auto canvas_height = registry.ctx().canvas.size.y(); -const auto constants = registry.ctx(); -``` - -Recall that the pipe is comprised of two parts: the body and the cap. - -Construct the body first. This is a rectangle, and therefore needs a center position and size. - -To avoid complicated math, set the center of the rectangle at the screen edge. - -Half of the pipe will be out of the view, but this visual optimization may be ignored for the purposes of this example tutorial. - -The `X` value is `pos_x`, and the `Y` value is at the top of the screen, `0`, for the top pipe. - -For the bottom pipe, the `Y` value is at the bottom edge of the screen, which is `canvas_height`. - -```cpp -// PIPE BODY -// Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas -transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; -``` - -Body size however, is trickier. Size `X` is the column thickness, but size `Y` is different depending on whether the pipe in question is at the top or bottom of the screen. - -For the top pipe, the start of the gap `gap_start_pos_y` should be the bottom of the rectangle. Half size is `gap_start_pos_y`, as the center of the rectangle is at 0. Full size is `gap_start_pos_y \* 2.0f`. - -For the bottom pipe, the top of the rectangle is the end of the gap, `gap_start_pos_y + gap_height`. Half size is `canvas_height - (gap_start_pos_y + gap_height)`. Double this value for the full size: `(canvas_height - (gap_start_pos_y + constants.gap_height)) \* 2.0f`. - -```cpp -// Size X is the column thickness, -// Size Y is the important part. -// If this is a top pipe, gap_start_pos_y is the bottom of the rectangle -// Half size is gap_start_pos_y, since the center of the rectangle is 0. -// If this is the bottom pipe, the top of the rectangle is located at gap_start_pos_y + gap_height -// Half size is canvas_height - (gap_start_pos_y + gap_height) -// Since these are half-sizes, and the position is at the screen border, multiply these sizes by two -math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; -``` - -To construct the rectangle entity, use the blueprint function `geometry::blueprint_rectangle` and feed `pipe_color` and `pipe_outline_color` (which includes line thickness information). - -```cpp -auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, constants.pipe_outline_color); -``` - -#### Construct the Cap of the Pipe - -The size of the cap is `column_thickness` plus `pipe_cap_extra_width`, as the cap is visually similar to the popular pipe design from Super Mario Brothers. - -The height is pre-defined as `pipe_cap_height`. - -```cpp -// PIPE CAP -// Prepare the pipe cap -// The size of the cap is defined in constants -math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; -``` - -The cap position is trickier. The `X` position is the same as the body, `body_pos.x()`, since the cap is centered. However, the `Y` position changes depending on whether the cap is for the top or bottom. - -If the cap is at the top, the bottom line of the cap is alligned with bottom of the body, or start of the gap, as this is the same line. - -Use the start of the gap minus half of the cap height, because the position is the center of the rectangle. This is defined as `gap_start_pos_y - constants.pipe_cap_height \* 0.5f`. - -For the the bottom cap, the bottom of the gap is the same line as the top of the cap. The bottom of the gap is the gap start position plus the gap height: `gap_start_pos_y + constants.gap_height`. Add half of the pipe height again to the shift the pipe down, since the position is the center of the cap and the top of the cap must be alligned with the top of the body. - -```cpp -// Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, -// or start of the gap, use the start of the gap minus half of the cap height -transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f -}; -``` - -To construct the rectangle entity, use the blueprint function `geometry::blueprint_rectangle` and feed `pipe_color` and `pipe_outline_color` once again, with the color set to the same color as the body. - -```cpp -auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, constants.pipe_outline_color); -``` - -Define the draw order to make the cap appear in front of the body. Use `graphics::layer`. The higher value is the front, the lower is the back. Set `cap` as `layer<4>` and `body` as `layer<3>`. - -```cpp -// Set layers, cap should be in front of body -registry.assign>(cap); -registry.assign>(body); -``` - -Tag both entities as `game_scene` and `dynamic` with the `tag_game_scene` function defined earlier. Return both inside `{ }` to automatically construct a `struct pipe`. - -```cpp -tag_game_scene(registry, cap, true); -tag_game_scene(registry, body, true); - -// Construct a pipe with the body and cap, and return it -return {body, cap}; -``` - -The completed function appears as follows. - -```cpp -// Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y -pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; -} -``` - -#### Create a Pipe - -Use this functionality to build a full column (two pipes and a gap). - -Make the function `void create_column(entt::registry ®istry, float pos_x)` with a single parameter `pos_x` for the `X` position of the column. - -Start by creating an empty entity. - -```cpp -// Create a fresh entity for a new column -auto entity_column = registry.create(); -``` - -Obtain a random vertical position for the start of the gap with the function created earlier, `get_random_gap_start_pos`. - -```cpp -// Get a random gap start position Y, between pipes -float gap_start_pos_y = get_random_gap_start_pos(registry); -``` - -Create `top_pipe` and `bottom_pipe` with the `create_pipe` function. The only parameter that varies is the `is_top` boolean — true for the `top_pipe` and false for `bottom_pipe`. - -```cpp -// Create pipes, is_top variable is false for bottom one -auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); -auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); -``` - -Construct a `struct column` with these two, tag it with `column` name, then use the `tag_game_scene` function to tag it with `game_scene` and `dynamic`. - -```cpp -// Make a column from these two pipes and mark it as "column" -registry.assign(entity_column, top_pipe, bottom_pipe); -registry.assign>(entity_column); -tag_game_scene(registry, entity_column, true); -``` - -The completed function appears as follows. - -```cpp -// Factory to create single column -void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); -} -``` - -Create a `create_columns` function to reuse this functionality. - -Begin by retrieving the constants. - -```cpp -// Retrieve constants -const auto constants = registry.ctx(); -``` - -Columns move towards the starting position of Flappy Bird from a distance. This animation requires a `column_start_distance` variable to add the offset. The animation also requires an additional `constants.column_thickness \* 2.0f` value to make sure the columns are out of the screen if `column_start_distance` is set as `canvas_width`. - -```cpp -// Spawn columns far away -const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; -``` - -Use the `create_column` function in a `for loop` to create more columns. For count, use the `column_count` constant. To add distance between every column use the counter `i` which increments by one, and multiply `i` with `column_distance` to put each column further than the previous column. Add the `column_pos_offset` offset, also. - -The loop appears as follows. - -```cpp -// Create the columns -for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); -} -``` - -The completed function appears as follows. - -```cpp -// Factory for creating a Flappy Bird columns -void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } -} -``` - -Call this `create_columns` function at initialization. - -#### Dynamic Objects - -Make an initialization function for dynamic objects. - -```cpp -// Initialize dynamic objects, this function is called at start and resets -void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); -} -``` - -Call this in the `game_scene` constructor. - -```cpp -game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - init_dynamic_objects(registry); -} -``` - -The result is as follows. - -
- - - -
- -Here is the code up to this point in the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird columns - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } -} - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - } -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## The Creation of the Background - -Beautify the background by adding sky, ground, and grass. - -The following is the objective. - -
- - - -
- -#### Create the Sky - -Add the constants to the `struct flappy_bird_constants` thickness and colors. - -```cpp -// Background -const float ground_thickness{100.0f}; -const float grass_thickness{20.0f}; -const graphics::color background_color{82, 189, 199}; -const graphics::color ground_color{220, 209, 143}; -const graphics::color grass_color{132, 227, 90}; -const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -``` - -Make a function called `create_background`. - -Retrieve the constants and canvas size: - -```cpp -// Retrieve constants -const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; -const auto constants = registry.ctx(); -``` - -Create the sky as a simple blue rectangle. - -The position is the center of the canvas. - -```cpp -// The sky is the whole canvas, so the position is in the middle of the canvas -transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; -``` - -Set the size of the rectangle to the whole canvas (other visual elements will appear in the foreground). - -```cpp -// The size is the full canvas -math::vec2f size{canvas_width, canvas_height}; -``` - -Use the `geometry::blueprint_rectangle` blueprint again and use `background_color` from defined constants. - -```cpp -auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); -``` - -Set the sky rectangle to appear at `layer<1>` and tag the rectangle with `game_scene`. - -```cpp -registry.assign>(sky); -tag_game_scene(registry, sky); -``` - -The following is the entire sky creation snippet. - -```cpp -// Create Sky -{ - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); -} -``` - -#### Create the Grass - -Now we do the same thing, but for grass. X position is middle of the canvas, Y position is canvas height minus ground thickness because grass grows above the ground! - -```cpp -// The ground expands to the whole canvas width, so the position is in the center X value of the canvas, -// Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness -transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; -``` - -Size `Y` is constant `grass_thickness` and Size `X` is full `canvas_width` plus the outline thickness, to hide the left and right edges of the ground. - -```cpp -// Size X is full canvas but the height is defined in constants -// Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides -math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; -``` - -Use `geometry::blueprint_rectangle` again and assign `layer<3>` to the rectangle, then tag it. - -```cpp -auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, constants.grass_outline_color); -registry.assign>(grass); -tag_game_scene(registry, grass); -``` - -Here is the completed grass creation snippet. - -```cpp -// Create Grass -{ - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); -} -``` - -#### Create the Ground - -The `X` position is the middle of the canvas and the height is the canvas height minus half of the ground thickness (because the position is the center of the rectangle). - -Size `X` is the canvas width, size `Y` is the ground thickness. - -```cpp -// Create Ground -{ - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); -} -``` - - - -Notice that there are no tags for any of these `dynamic` objects. They are static and permanent. - -The background creation function appears as follows. - -```cpp -// Factory for creating a Flappy Bird background -void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } -} -``` - -Call this function inside the `game_scene` constructor. - -```cpp -game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); -} -``` - -The result is as follows. - -
- - - -
- -Here is the full code up to this point of the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; - - // Background - const float ground_thickness{100.0f}; - const float grass_thickness{20.0f}; - const graphics::color background_color{82, 189, 199}; - const graphics::color ground_color{220, 209, 143}; - const graphics::color grass_color{132, 227, 90}; - const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird column - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } - - // Factory for creating a Flappy Bird background - void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } - } -} - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry) noexcept : base_scene(registry) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - } -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## Move, Destroy, and Respawn Pipes - -To create the illusion of movement, Flappy Bird stays still with respect to the horizontal axis and pipes move to the left. (This eliminates the need for a camera that follows the bird.) - -#### Moving the Columns - -Define a constant to `flappy_bird_constants` named `scroll_speed`. This is the speed of movement of pipes. - -```cpp -const float scroll_speed{200.f}; -``` - -Smooth movement requires a position update at every tick. This requires a `ecs::logic_update_system` value. Call this `column_logic`. - -```cpp -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry) noexcept : system(registry) { - disable(); - } -``` - -Make a `move_pipe` function that accepts as a parameter a reference to a `struct pipe` object. Retrieve constants to access the scroll speed. - -```cpp -// Move the pipe and return the x position -float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); -``` - -To move the pipe the logic needs to to know the pipe's current position. Retrieve the body position of the pipe (cap is also the same, so the body data is enough). - -Pipes move only along the X axis, horizontally. - -```cpp -// Get current position of the pipe -auto pos = registry.get(pipe.body); -``` - -Calculate the new position `X` by adding `scroll_speed`. Use the `-` operator, because a lower position value moves to the left side. - -Conceptually, this is the same as subtracting from the `X` position to make the pipe move towards the left side. - -Multiply `scroll_speed` with delta time `timer::time_step::get_fixed_delta_time()`, so that the movement occurs over time and the frame changes are smoother. `scroll_speed` is actually the amount of pixels the object moves in `1 second`. - -```cpp -// Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second -// Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels -auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); -``` - -Update both body and cap positions by replacing entity’s `transform::position_2d`. - -```cpp -// Set the new position value -registry.replace(pipe.body, new_pos_x, pos.y()); - -// Set cap position too -auto cap_pos = registry.get(pipe.cap); -registry.replace(pipe.cap, new_pos_x, cap_pos.y()); -``` - -Return the new position. - -```cpp -// Return the information about whether this pipe is out of the screen -return new_pos_x; -``` - -The completed function is now as follows. - -```cpp -// Move the pipe and return the x position -float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the pipe - auto pos = registry.get(pipe.body); - - // Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second - // Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels - auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); - - // Set the new position value - registry.replace(pipe.body, new_pos_x, pos.y()); - - // Set cap position too - auto cap_pos = registry.get(pipe.cap); - registry.replace(pipe.cap, new_pos_x, cap_pos.y()); - - // Return the information about whether this pipe is out of the screen - return new_pos_x; -} -``` - -In the update function move all the columns each tick. Those exiting the screen on the left are destroyed. - -A new column is spawned from the right side of the screen and is now the column furthest away from Flappy Bird. - -Create a function that returns the `X` position of the furthest pipe. This function loops over all columns and checks whether the column’s `X` position is higher than the previous maximum. - -```cpp -// Find the furthest pipe's position X -float furthest_pipe_position(entt::registry ®istry) { - float furthest = 0.f; - - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - float x = entity_registry_.get(col.top_pipe.body).x(); - if (x > furthest) furthest = x; - } - - return furthest; -} -``` - -The update function that is called ever tick retrieves constants and all columns, and loops all the columns. - -```cpp -// Update, this is called every tick -void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { -``` - -Inside the loop retrieve the `struct column` from the column `entt::entity`. - -```cpp -auto &col = registry.get(entity); -``` - -Call the `move_pipe` function twice: one for the top pipe and one for the bottom. They are at the same X position, and this value is returned into the `column_pos_x` value. - -```cpp -// Move pipes, and retrieve column position x -float column_pos_x = move_pipe(registry, col.top_pipe); -move_pipe(registry, col.bottom_pipe); -``` - -#### Destroying a Column Once Out of Screen - -The position of the left side of the screen is `0`. - -To make sure the column is out of the screen, use the `column_distance` value in the negative. - -For example, assume the value is `-400`. Compare the column’s `X` position against this value whether the column is outside the screen. - -```cpp -// Test whether column is out of the screen -if (column_pos_x < -constants.column_distance) { -``` - -If the column is out of the screen, destroy it and create a new column on the right using the `create_column` function. - -For the new column position use the `furthest_pipe_position` value and add `column_distance` as this spawns further than the last column. - -```cpp -// Test whether column is out of the screen -if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); -} -``` - -The completed `update` function is as follows. - -```cpp -// Update, this will be called every tick -void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - - // Move pipes, and retrieve column position x - float column_pos_x = move_pipe(registry, col.top_pipe); - move_pipe(registry, col.bottom_pipe); - - // Test whether column is out of the screen - if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); - } - } -} -``` - -Name this logic system after the class. - -```cpp -// Name this system -REFL_AUTO (type(column_logic)); -``` - -The `column_logic` class is fully ready. - -#### Create the Logic System - -To create a logic system, access `ecs::system_manager` inside the `game_scene` and add a member variable to store the reference inside the `game_scene`. - -```cpp -// System manager reference -ecs::system_manager &system_manager_; -``` - -Add a parameter to the constructor that sets this reference. - -```cpp -game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), system_manager_(system_manager) { -``` - -Make a function to create logic systems and inside use the `system_manager_`. - -```cpp -// Create logic systems -void create_logic_systems() { - system_manager_.create_system_rt(); -} -``` - -Call this function in the `init_dynamic_objects` function. - -```cpp -// Initialize dynamic objects, this function is called at start and resets -void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create logic systems - create_logic_systems(); -} -``` - -Below is the complete code of the tutorial up to this point. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; - const float scroll_speed{200.f}; - - // Background - const float ground_thickness{100.0f}; - const float grass_thickness{20.0f}; - const graphics::color background_color{82, 189, 199}; - const graphics::color ground_color{220, 209, 143}; - const graphics::color grass_color{132, 227, 90}; - const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird columns - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } - - // Factory for creating a Flappy Bird background - void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } - } -} - -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry) noexcept : system(registry) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - - // Move pipes, and retrieve column position x - float column_pos_x = move_pipe(registry, col.top_pipe); - move_pipe(registry, col.bottom_pipe); - - // Test whether column is out of the screen - if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); - } - } - } - -private: - // Find the furthest pipe's position X - float furthest_pipe_position(entt::registry ®istry) { - float furthest = 0.f; - - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - float x = entity_registry_.get(col.top_pipe.body).x(); - if (x > furthest) furthest = x; - } - - return furthest; - } - - // Move the pipe and return the x position - float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the pipe - auto pos = registry.get(pipe.body); - - // Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second - // Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels - auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); - - // Set the new position value - registry.replace(pipe.body, new_pos_x, pos.y()); - - // Set cap position too - auto cap_pos = registry.get(pipe.cap); - registry.replace(pipe.cap, new_pos_x, cap_pos.y()); - - // Return the information about whether this pipe is out of the screen - return new_pos_x; - } -}; - -// Name this system -REFL_AUTO (type(column_logic)); - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), system_manager_(system_manager) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create logic systems - create_logic_systems(); - } - - // Create logic systems - void create_logic_systems() { - system_manager_.create_system_rt(); - } - - // System manager reference - ecs::system_manager &system_manager_; -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_, system_manager_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## The Creation of Flappy Bird - -Create the Flappy Bird. Instead of using a rectangle as a character, use an image file. This is called a `character sprite`. - -From this point forward in the tutorial, the Flappy Bird is referred to as “player.” - -Two constants are required: one for the player position and another one for the image file name. - -```cpp -struct flappy_bird_constants { - // Player - const std::string player_image_name{"player.png"}; - const float player_pos_x{400.0f}; -``` - -Create a `create_player` function that constructs the player entity and returns it. - -Retrieve the constants, as before. - -```cpp -// Factory for creating the player -entt::entity create_player(entt::registry ®istry) { - // Retrieve constants - const auto[_, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); -``` - -Use the `graphics::blueprint_sprite`. This requires two parameters: `graphics::sprite` and `transform::position_2d`. - -The `graphics::sprite` parameter receives the image path and `transform::position_2d` receives the `player_pos_x` constant as an `X` position and half of the canvas height as the `Y` position. - -```cpp -auto entity = graphics::blueprint_sprite(registry, - graphics::sprite{constants.player_image_name.c_str()}, - transform::position_2d{constants.player_pos_x, canvas_height * 0.5f}); -``` - -Assign `layer<5>` for the draw order, and provide the tags `player`, `game_scene`, and `dynamic`. - -Return the entity. - -```cpp -registry.assign>(entity); -registry.assign>(entity); -tag_game_scene(registry, entity, true); - -return entity; -``` - -The completed `create_player` function is as follows. - -```cpp -// Factory for creating the player -entt::entity create_player(entt::registry ®istry) { - // Retrieve constants - const auto[_, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - auto entity = graphics::blueprint_sprite(registry, - graphics::sprite{constants.player_image_name.c_str()}, - transform::position_2d{constants.player_pos_x, canvas_height * 0.5f}); - registry.assign>(entity); - registry.assign>(entity); - tag_game_scene(registry, entity, true); - - return entity; -} -``` - -Call this function inside `init_dynamic_objects`. - -```cpp -// Initialize dynamic objects, this function is called at start and resets -void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create player - create_player(registry); - - // Create logic systems - create_logic_systems(); -} -``` - -Compiling and executing the program now shows the character and moving pipes. - -
- - - -
- -Here is the full code up to this point of the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Player - const std::string player_image_name{"player.png"}; - const float player_pos_x{400.0f}; - - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; - const float scroll_speed{200.f}; - - // Background - const float ground_thickness{100.0f}; - const float grass_thickness{20.0f}; - const graphics::color background_color{82, 189, 199}; - const graphics::color ground_color{220, 209, 143}; - const graphics::color grass_color{132, 227, 90}; - const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird columns - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } - - // Factory for creating a Flappy Bird background - void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } - } - - // Factory for creating the player - entt::entity create_player(entt::registry ®istry) { - // Retrieve constants - const auto[_, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - auto entity = graphics::blueprint_sprite(registry, - graphics::sprite{constants.player_image_name.c_str()}, - transform::position_2d{constants.player_pos_x, canvas_height * 0.5f}); - registry.assign>(entity); - registry.assign>(entity); - tag_game_scene(registry, entity, true); - - return entity; - } -} - -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry) noexcept : system(registry) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - - // Move pipes, and retrieve column position x - float column_pos_x = move_pipe(registry, col.top_pipe); - move_pipe(registry, col.bottom_pipe); - - // Test whether column is out of the screen - if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); - } - } - } - -private: - // Find the furthest pipe's position X - float furthest_pipe_position(entt::registry ®istry) { - float furthest = 0.f; - - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - float x = entity_registry_.get(col.top_pipe.body).x(); - if (x > furthest) furthest = x; - } - - return furthest; - } - - // Move the pipe and return the x position - float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the pipe - auto pos = registry.get(pipe.body); - - // Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second - // Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels - auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); - - // Set the new position value - registry.replace(pipe.body, new_pos_x, pos.y()); - - // Set cap position too - auto cap_pos = registry.get(pipe.cap); - registry.replace(pipe.cap, new_pos_x, cap_pos.y()); - - // Return the information about whether this pipe is out of the screen - return new_pos_x; - } -}; - -// Name this system -REFL_AUTO (type(column_logic)); - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), system_manager_(system_manager) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create player - create_player(registry); - - // Create logic systems - create_logic_systems(); - } - - // Create logic systems - void create_logic_systems() { - system_manager_.create_system_rt(); - } - - // System manager reference - ecs::system_manager &system_manager_; -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_, system_manager_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## Player Input and Character Physics - -To receive input and create character physics begin by including two headers for input, `` and ``. - -The logic for this section also requires constants for physics. - -`gravity` is the force which pulls the player down. - -`jump_force` is the force which is applied instantly when the user presses the jump button. - -`rotate_speed` is for the rotating animation. - -`max_angle` is the rotation limit. - -```cpp -const float gravity{2000.f}; -const float jump_force{650.f}; -const float rotate_speed{100.f}; -const float max_angle{60.f}; -``` - -Initialize the virtual input system and add a `jump` action. - -Keyboard keys are: `space`, `w`, `up`. - -Mouse buttons are `left` and `right`. - -```cpp -// Create virtual input system -system_manager_.create_system(); - -// Define the buttons for the jump action -input::virtual_input::create("jump", - {input::key::space, input::key::w, input::key::up}, - {input::mouse_button::left, input::mouse_button::right}); -``` - -Make another `ecs::logic_update_system` object, similar to `column_logic`, but this time for the player. - -```cpp -// Player Logic System -class player_logic final : public ecs::logic_update_system { -public: - player_logic(entt::registry ®istry, entt::entity player_) noexcept : system(registry), player_(player_) { - disable(); - } -``` - -Keep the player entity as a member. - -There is a 2D vector for movement speed, `math::vec2f`. - -```cpp -private: - entt::entity player_; - math::vec2f movement_speed_{0.f, 0.f}; -``` - -Make the update function to be called for every tick. - -```cpp -// Update, this will be called every tick -void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the player - auto pos = registry.get(player_); -``` - -Gravity is acceleration. Instead of adding gravity to the position, add it to the movement speed. Multiply gravity with delta time to spread the change in value over time. - -Update `Y` of `movement_speed_` with `Y` plus gravity. - -```cpp -// Add gravity to movement speed, multiply with delta time to apply it over time -movement_speed_.set_y(movement_speed_.y() + constants.gravity * timer::time_step::get_fixed_delta_time()); -``` - -For the jump, check if the jump button is tapped. - -```cpp -// Check if jump key is tapped -bool jump_key_tapped = input::virtual_input::is_tapped("jump"); -``` - -If the jump button is tapped, set the `Y` value of `movement_speed_` as negative `jump_force`. Using this as a negative value here is effective as it acts as a reversal of the gravitational force. - -For this change, directly set the value instead of adding the value to the existing value. The reason for this is that this method prevents the player from spamming the jump button and infinitely speeding up. - -This also solves another problem. If the player is dropping more quickly than the jump button could counter, the method prevents a scenario where pressing the button only slows down the player's rate of descent, but does not reverse it. - -```cpp -// If jump is tapped, jump by adding jump force to the movement speed Y -if (jump_key_tapped) movement_speed_.set_y(-constants.jump_force); -``` - -#### Moving the Player Position - -Move the position with the movement speed. Multiplying the position with delta time, as always, to spread the change over time. - -```cpp -// Add movement speed to position to make the character move, but apply over time with delta time -pos += movement_speed_ * timer::time_step::get_fixed_delta_time(); -``` - -Currently, the player can jump out of the screen. There must be a limit to the character position. - -If position `Y` is equal to or lower than zero, reset both positions and speed `Y` to `0`. This keeps the player inside, no matter how many times jump is pressed. - -```cpp -// Do not let player to go out of the screen to top -if (pos.y() <= 0.f) { - pos.set_y(0.f); - movement_speed_.set_y(0.f); -} -``` - -Set the modified position to the player entity. - -```cpp -// Set the new position value -registry.replace(player_, pos); -``` - -#### Apply Rotation - -Retrieve the properties of the player, add `rotate_speed` to the `props.rotation`, also apply delta time. - -```cpp -// ROTATION -// Retrieve props of the player -auto &props = registry.get(player_); - -// Increase the rotation a little by applying delta time -float new_rotation = props.rotation + constants.rotate_speed * timer::time_step::get_fixed_delta_time(); -``` - -When the player jumps, reset the rotation so that the character is straight again before rotating downwards once more. - -Also, apply a `max_angle` limit to prevent excessive rotation. - -```cpp -// If jump button is tapped, reset rotation, -// If rotation is higher than the max angle, set it to max angle -if (jump_key_tapped) - new_rotation = 0.f; -else if (props.rotation > constants.max_angle) - new_rotation = constants.max_angle; -``` - -Set the `transform::properties` to apply the rotation change. - -```cpp -// Set the properties -registry.replace(player_, transform::properties{.rotation = new_rotation}); -``` - -The following is the completed update function. - -```cpp -// Update, this will be called every tick -void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the player - auto pos = registry.get(player_); - - // Add gravity to movement speed, multiply with delta time to apply it over time - movement_speed_.set_y(movement_speed_.y() + constants.gravity * timer::time_step::get_fixed_delta_time()); - - // Check if jump key is tapped - bool jump_key_tapped = input::virtual_input::is_tapped("jump"); - - // If jump is tapped, jump by adding jump force to the movement speed Y - if (jump_key_tapped) movement_speed_.set_y(-constants.jump_force); - - // Add movement speed to position to make the character move, but apply over time with delta time - pos += movement_speed_ * timer::time_step::get_fixed_delta_time(); - - // Do not let player to go out of the screen to top - if (pos.y() <= 0.f) { - pos.set_y(0.f); - movement_speed_.set_y(0.f); - } - - // Set the new position value - registry.replace(player_, pos); - - // ROTATION - // Retrieve props of the player - auto &props = registry.get(player_); - - // Increase the rotation a little by applying delta time - float new_rotation = props.rotation + constants.rotate_speed * timer::time_step::get_fixed_delta_time(); - - // If jump button is tapped, reset rotation, - // If rotation is higher than the max angle, set it to max angle - if (jump_key_tapped) - new_rotation = 0.f; - else if (props.rotation > constants.max_angle) - new_rotation = constants.max_angle; - - // Set the properties - registry.replace(player_, transform::properties{.rotation = new_rotation}); -} -``` - -Name this logic system after the class. - -```cpp -// Name this system -REFL_AUTO (type(player_logic)); -``` - -`player_logic` is ready to be used in the `game_scene`. - -In the earlier function, `create_logic_systems` create the `player_logic` function. - -`player_logic` requires the `player` entity as an argument. - -Modify the function as follows. - -```cpp -// Create logic systems -void create_logic_systems(entt::entity player) { - system_manager_.create_system_rt(); - system_manager_.create_system_rt(player); -} -``` - -When the game is launched the physics is in a paused state. The game begins when the player pressed the jump button. - -Make two functions that enable and disable both logic functions. - -```cpp -// Pause physics -void pause_physics() { - system_manager_.disable_systems(); -} - -// Resume physics -void resume_physics() { - system_manager_.enable_systems(); -} -``` - -Use a boolean to indicate whether the player has started playing. - -```cpp -// States -bool started_playing_{false}; -``` - -Add a function which resets this state value. - -```cpp -// Reset state values -void reset_state_variables() { - started_playing_ = false; -} -``` - -In the `init_dynamic_objects` function, feed the `player` entity to the `create_logic_systems` function, pause physics, and reset state variables. - -```cpp -// Initialize dynamic objects, this function is called at start and resets -void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create player - auto player = create_player(registry); - - // Create logic systems - create_logic_systems(player); - - // Reset state variables - reset_state_variables(); -} -``` - -Check for a jump button press. This starts the game. - -Check only whether the player has not yet begun to play. - -```cpp -// Check if start game is requested at the pause state -void check_start_game_request() { - // If game is not started yet and jump key is tapped - if (!started_playing_ && input::virtual_input::is_tapped("jump")) { - // Game starts, player started playing - started_playing_ = true; - resume_physics(); - } -} -``` - -Call this function in the update function that is called every tick. - -```cpp -// Update the game every tick -void update() noexcept final { - // Check if player requested to start the game - check_start_game_request(); -} -``` - -Here is the complete code up to this point in the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Player - const std::string player_image_name{"player.png"}; - const float player_pos_x{400.0f}; - const float gravity{2000.f}; - const float jump_force{650.f}; - const float rotate_speed{100.f}; - const float max_angle{60.f}; - - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; - const float scroll_speed{200.f}; - - // Background - const float ground_thickness{100.0f}; - const float grass_thickness{20.0f}; - const graphics::color background_color{82, 189, 199}; - const graphics::color ground_color{220, 209, 143}; - const graphics::color grass_color{132, 227, 90}; - const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird columns - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } - - // Factory for creating a Flappy Bird background - void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } - } - - // Factory for creating the player - entt::entity create_player(entt::registry ®istry) { - // Retrieve constants - const auto[_, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - auto entity = graphics::blueprint_sprite(registry, - graphics::sprite{constants.player_image_name.c_str()}, - transform::position_2d{constants.player_pos_x, canvas_height * 0.5f}); - registry.assign>(entity); - registry.assign>(entity); - tag_game_scene(registry, entity, true); - - return entity; - } -} - -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry) noexcept : system(registry) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - - // Move pipes, and retrieve column position x - float column_pos_x = move_pipe(registry, col.top_pipe); - move_pipe(registry, col.bottom_pipe); - - // Test whether column is out of the screen - if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); - } - } - } - -private: - // Find the furthest pipe's position X - float furthest_pipe_position(entt::registry ®istry) { - float furthest = 0.f; - - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - float x = entity_registry_.get(col.top_pipe.body).x(); - if (x > furthest) furthest = x; - } - - return furthest; - } - - // Move the pipe and return the x position - float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the pipe - auto pos = registry.get(pipe.body); - - // Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second - // Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels - auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); - - // Set the new position value - registry.replace(pipe.body, new_pos_x, pos.y()); - - // Set cap position too - auto cap_pos = registry.get(pipe.cap); - registry.replace(pipe.cap, new_pos_x, cap_pos.y()); - - // Return the information about whether this pipe is out of the screen - return new_pos_x; - } -}; - -// Name this system -REFL_AUTO (type(column_logic)); - -// Player Logic System -class player_logic final : public ecs::logic_update_system { -public: - player_logic(entt::registry ®istry, entt::entity player) noexcept : system(registry), player_(player) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the player - auto pos = registry.get(player_); - - // Add gravity to movement speed, multiply with delta time to apply it over time - movement_speed_.set_y(movement_speed_.y() + constants.gravity * timer::time_step::get_fixed_delta_time()); - - // Check if jump key is tapped - bool jump_key_tapped = input::virtual_input::is_tapped("jump"); - - // If jump is tapped, jump by adding jump force to the movement speed Y - if (jump_key_tapped) movement_speed_.set_y(-constants.jump_force); - - // Add movement speed to position to make the character move, but apply over time with delta time - pos += movement_speed_ * timer::time_step::get_fixed_delta_time(); - - // Do not let player to go out of the screen to top - if (pos.y() <= 0.f) { - pos.set_y(0.f); - movement_speed_.set_y(0.f); - } - - // Set the new position value - registry.replace(player_, pos); - - // ROTATION - // Retrieve props of the player - auto &props = registry.get(player_); - - // Increase the rotation a little by applying delta time - float new_rotation = props.rotation + constants.rotate_speed * timer::time_step::get_fixed_delta_time(); - - // If jump button is tapped, reset rotation, - // If rotation is higher than the max angle, set it to max angle - if (jump_key_tapped) - new_rotation = 0.f; - else if (props.rotation > constants.max_angle) - new_rotation = constants.max_angle; - - // Set the properties - registry.replace(player_, transform::properties{.rotation = new_rotation}); - } - -private: - entt::entity player_; - math::vec2f movement_speed_{0.f, 0.f}; -}; - -// Name this system -REFL_AUTO (type(player_logic)); - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), system_manager_(system_manager) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - // Check if player requested to start the game - check_start_game_request(); - } - - // Check if start game is requested at the pause state - void check_start_game_request() { - // If game is not started yet and jump key is tapped - if (!started_playing_ && input::virtual_input::is_tapped("jump")) { - // Game starts, player started playing - started_playing_ = true; - resume_physics(); - } - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create player - auto player = create_player(registry); - - // Create logic systems - create_logic_systems(player); - - // Reset state variables - reset_state_variables(); - } - - // Create logic systems - void create_logic_systems(entt::entity player) { - system_manager_.create_system_rt(); - system_manager_.create_system_rt(player); - } - - // Reset state values - void reset_state_variables() { - started_playing_ = false; - } - - // Pause physics - void pause_physics() { - system_manager_.disable_systems(); - } - - // Resume physics - void resume_physics() { - system_manager_.enable_systems(); - } - - // System manager reference - ecs::system_manager &system_manager_; - - // States - bool started_playing_{false}; -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Create virtual input system - system_manager_.create_system(); - - // Define the buttons for the jump action - input::virtual_input::create("jump", - {input::key::space, input::key::w, input::key::up}, - {input::mouse_button::left, input::mouse_button::right}); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_, system_manager_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## Collision Between Player and Columns, Death, and Game Reset - -The game ends when the player flies into the columns and dies. - -Start by adding the collision system header ``. - -Make another logic system, `collision_logic`. The constructor receives the player entity and a reference to the `player_dead` variable, so that the collision result can be reported. - -Store both in the class as follows. - -```cpp -entt::entity player_; -bool &player_died_; -``` - -Create the class and constructor. - -```cpp -// Collision Logic System -class collision_logic final : public ecs::logic_update_system { -public: - collision_logic(entt::registry ®istry, entt::entity player_, bool &player_died_) noexcept : system(registry), - player_(player_), - player_died_(player_died_) {} -``` - -Add a function to check for a collision between the player and the pipes, `check_player_pipe_collision`. - -Remember that columns are on `layer<3>`. - -Retrieve the columns by using the `view` function, `registry.view>()`. - -Use the `collisions::basic_collision_system::query_rect` function with `player_` and `entity`, which is the pipe. - -If a collision is detected, mark `player_died_` as `true`. - -```cpp -// Loop all columns to check collisions between player and the pipes -void check_player_pipe_collision(entt::registry ®istry) { - for (auto entity : registry.view>()) { - // Check collision between player and a collidable object - if (collisions::basic_collision_system::query_rect(registry, player_, entity)) { - // Mark player died as true - player_died_ = true; - } - } -} -``` - -Call this function in the `update` function that is called every tick. However, if `player_died_` is `true`, there is no need to check for a collision; simply stop the function. - -```cpp -// Update, this will be called every tick -void update() noexcept final { - auto ®istry = entity_registry_; - - // Do not check anything if player is already dead - if (player_died_) return; - - // Check collision - check_player_pipe_collision(registry); -} -``` - -As before, name this system outside of the class. - -```cpp -// Name this system -REFL_AUTO (type(collision_logic)); -``` - -The completed class is as follows. - -```cpp -// Collision Logic System -class collision_logic final : public ecs::logic_update_system { -public: - collision_logic(entt::registry ®istry, entt::entity player_, bool &player_died_) noexcept : system(registry), - player_(player_), - player_died_(player_died_) {} - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Do not check anything if player is already dead - if (player_died_) return; - - // Check collision - check_player_pipe_collision(registry); - } - -private: - // Loop all columns to check collisions between player and the pipes - void check_player_pipe_collision(entt::registry ®istry) { - for (auto entity : registry.view>()) { - // Check collision between player and a collidable object - if (collisions::basic_collision_system::query_rect(registry, player_, entity)) { - // Mark player died as true - player_died_ = true; - } - } - } - - entt::entity player_; - bool &player_died_; -}; - -// Name this system -REFL_AUTO (type(collision_logic)); -``` - -Add the class to the game scene. - -```cpp -// Create logic systems -void create_logic_systems(entt::entity player) { - system_manager_.create_system_rt(); - system_manager_.create_system_rt(player); - system_manager_.create_system_rt(player, player_died_); -} -``` - -Add a few more state variables for player death, game over, and reset query. - - -```cpp -// States -bool started_playing_{false}; -bool player_died_{false}; -bool game_over_{false}; -bool need_reset_{false}; -``` - -Add the needed values for game restart to `reset_state_variables`. - -```cpp -// Reset state values -void reset_state_variables() { - started_playing_ = false; - player_died_ = false; - game_over_ = false; -} -``` - -Since `player_died_` is filled by `collision_logic`, the logic can read the value within this class. - -When the value is `true`, mark `game_over_` as `true` and pause physics. This stops the game when the player dies. Mark `player_died_` to `false` here also, so that these functions are not triggered again. - -```cpp -// Check if the player died -void check_death() { - // If the player died, game over, and pause physics - if (player_died_) { - player_died_ = false; - game_over_ = true; - pause_physics(); - } -} -``` - -Another function checks for a jump button press after the game is over. - -When the jump button is pressed, the game restarts. - -```cpp -// Check if reset is requested at game over state -void check_reset_request() { - // If game is over, and jump key is pressed, reset game - if (game_over_ && input::virtual_input::is_tapped("jump")) reset_game(); -} -``` - -Call these two functions in the `update` function. - -```cpp -// Update the game every tick -void update() noexcept final { - // Check if player requested to start the game - check_start_game_request(); - - // Check if the player died - check_death(); - - // Check if player requested reset after death - check_reset_request(); -} -``` - -Defin the `reset_game` function. - -```cpp -// Reset game -void reset_game() { - // Destroy all dynamic objects - destroy_dynamic_objects(); - - // Queue reset to reinitialize - this->need_reset_ = true; -} -``` - -The `reset_game` function destroys dynamic objects. - -To achieve this, retrieve all the dynamic entities with the `dynamic` tag that were set previously, then destroy them using the registry. - -For the logic system deletions, mark items for deletion with the function below. - -```cpp -// Destroy dynamic objects -void destroy_dynamic_objects() { - // Retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - // Iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - // Delete systems - system_manager_.mark_systems(); -} -``` - -Those systems are deleted after the whole update tick is completed. They should no be reinitialize in `reset_game`. Instead, queue the reset by setting `need_reset_` to `true`, and reinitialize in the `post_update` function, as follows. - -```cpp -// Post update -void post_update() noexcept final { - // If reset is requested - if (need_reset_) { - // Reinitialize all these - init_dynamic_objects(entity_registry_); - need_reset_ = false; - } -} -``` - -Flappy Bird now collides with pipes, dies, and enters the “game over” state. Afterwards, by pressing the jump button, all the dynamic entities and logic systems are destroyed, then reinitialized. - -Here is the full code up to this point in the tutorial. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Player - const std::string player_image_name{"player.png"}; - const float player_pos_x{400.0f}; - const float gravity{2000.f}; - const float jump_force{650.f}; - const float rotate_speed{100.f}; - const float max_angle{60.f}; - - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; - const float scroll_speed{200.f}; - - // Background - const float ground_thickness{100.0f}; - const float grass_thickness{20.0f}; - const graphics::color background_color{82, 189, 199}; - const graphics::color ground_color{220, 209, 143}; - const graphics::color grass_color{132, 227, 90}; - const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird columns - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } - - // Factory for creating a Flappy Bird background - void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } - } - - // Factory for creating the player - entt::entity create_player(entt::registry ®istry) { - // Retrieve constants - const auto[_, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - auto entity = graphics::blueprint_sprite(registry, - graphics::sprite{constants.player_image_name.c_str()}, - transform::position_2d{constants.player_pos_x, canvas_height * 0.5f}); - registry.assign>(entity); - registry.assign>(entity); - tag_game_scene(registry, entity, true); - - return entity; - } -} - -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry) noexcept : system(registry) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - - // Move pipes, and retrieve column position x - float column_pos_x = move_pipe(registry, col.top_pipe); - move_pipe(registry, col.bottom_pipe); - - // Test whether column is out of the screen - if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); - } - } - } - -private: - // Find the furthest pipe's position X - float furthest_pipe_position(entt::registry ®istry) { - float furthest = 0.f; - - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - float x = entity_registry_.get(col.top_pipe.body).x(); - if (x > furthest) furthest = x; - } - - return furthest; - } - - // Move the pipe and return the x position - float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the pipe - auto pos = registry.get(pipe.body); - - // Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second - // Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels - auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); - - // Set the new position value - registry.replace(pipe.body, new_pos_x, pos.y()); - - // Set cap position too - auto cap_pos = registry.get(pipe.cap); - registry.replace(pipe.cap, new_pos_x, cap_pos.y()); - - // Return the information about whether this pipe is out of the screen - return new_pos_x; - } -}; - -// Name this system -REFL_AUTO (type(column_logic)); - -// Player Logic System -class player_logic final : public ecs::logic_update_system { -public: - player_logic(entt::registry ®istry, entt::entity player) noexcept : system(registry), player_(player) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the player - auto pos = registry.get(player_); - - // Add gravity to movement speed, multiply with delta time to apply it over time - movement_speed_.set_y(movement_speed_.y() + constants.gravity * timer::time_step::get_fixed_delta_time()); - - // Check if jump key is tapped - bool jump_key_tapped = input::virtual_input::is_tapped("jump"); - - // If jump is tapped, jump by adding jump force to the movement speed Y - if (jump_key_tapped) movement_speed_.set_y(-constants.jump_force); - - // Add movement speed to position to make the character move, but apply over time with delta time - pos += movement_speed_ * timer::time_step::get_fixed_delta_time(); - - // Do not let player to go out of the screen to top - if (pos.y() <= 0.f) { - pos.set_y(0.f); - movement_speed_.set_y(0.f); - } - - // Set the new position value - registry.replace(player_, pos); - - // ROTATION - // Retrieve props of the player - auto &props = registry.get(player_); - - // Increase the rotation a little by applying delta time - float new_rotation = props.rotation + constants.rotate_speed * timer::time_step::get_fixed_delta_time(); - - // If jump button is tapped, reset rotation, - // If rotation is higher than the max angle, set it to max angle - if (jump_key_tapped) - new_rotation = 0.f; - else if (props.rotation > constants.max_angle) - new_rotation = constants.max_angle; - - // Set the properties - registry.replace(player_, transform::properties{.rotation = new_rotation}); - } - -private: - entt::entity player_; - math::vec2f movement_speed_{0.f, 0.f}; -}; - -// Name this system -REFL_AUTO (type(player_logic)); - -// Collision Logic System -class collision_logic final : public ecs::logic_update_system { -public: - collision_logic(entt::registry ®istry, entt::entity player, bool &player_died) noexcept : system(registry), - player_(player), - player_died_(player_died) {} - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Do not check anything if player is already dead - if (player_died_) return; - - // Check collision - check_player_pipe_collision(registry); - } - -private: - // Loop all columns to check collisions between player and the pipes - void check_player_pipe_collision(entt::registry ®istry) { - for (auto entity : registry.view>()) { - // Check collision between player and a collidable object - if (collisions::basic_collision_system::query_rect(registry, player_, entity)) { - // Mark player died as true - player_died_ = true; - } - } - } - - entt::entity player_; - bool &player_died_; -}; - -// Name this system -REFL_AUTO (type(collision_logic)); - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), - system_manager_(system_manager) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - // Check if player requested to start the game - check_start_game_request(); - - // Check if the player died - check_death(); - - // Check if player requested reset after death - check_reset_request(); - } - - // Check if start game is requested at the pause state - void check_start_game_request() { - // If game is not started yet and jump key is tapped - if (!started_playing_ && input::virtual_input::is_tapped("jump")) { - // Game starts, player started playing - started_playing_ = true; - resume_physics(); - } - } - - // Check if the player died - void check_death() { - // If the player died, game over, and pause physics - if (player_died_) { - player_died_ = false; - game_over_ = true; - pause_physics(); - } - } - - // Check if reset is requested at game over state - void check_reset_request() { - // If game is over, and jump key is pressed, reset game - if (game_over_ && input::virtual_input::is_tapped("jump")) reset_game(); - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create player - auto player = create_player(registry); - - // Create logic systems - create_logic_systems(player); - - // Reset state variables - reset_state_variables(); - } - - // Create logic systems - void create_logic_systems(entt::entity player) { - system_manager_.create_system_rt(); - system_manager_.create_system_rt(player); - system_manager_.create_system_rt(player, player_died_); - } - - // Reset state values - void reset_state_variables() { - started_playing_ = false; - player_died_ = false; - game_over_ = false; - } - - // Pause physics - void pause_physics() { - system_manager_.disable_systems(); - } - - // Resume physics - void resume_physics() { - system_manager_.enable_systems(); - } - - // Destroy dynamic objects - void destroy_dynamic_objects() { - // Retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - // Iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - // Delete systems - system_manager_.mark_systems(); - } - - // Reset game - void reset_game() { - // Destroy all dynamic objects - destroy_dynamic_objects(); - - // Queue reset to reinitialize - this->need_reset_ = true; - } - - // Post update - void post_update() noexcept final { - // If reset is requested - if (need_reset_) { - // Reinitialize all these - init_dynamic_objects(entity_registry_); - need_reset_ = false; - } - } - - // System manager reference - ecs::system_manager &system_manager_; - - // States - bool started_playing_{false}; - bool player_died_{false}; - bool game_over_{false}; - bool need_reset_{false}; -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Create virtual input system - system_manager_.create_system(); - - // Define the buttons for the jump action - input::virtual_input::create("jump", - {input::key::space, input::key::w, input::key::up}, - {input::mouse_button::left, input::mouse_button::right}); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_, system_manager_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` - -## Score and UI - -Without scores there is no measure of achievement, and no motivation to play again for improvement. - -Only one constant is needed: `font_size`. - -```cpp -struct flappy_bird_constants { - // UI - const unsigned long long font_size{32ull}; -``` - -#### Creating the Score - -The score increases by one each time the player passes a column. - -Mark a passed column as `scored`. Put a variable into the `struct column`. - -```cpp -// Is score taken from this column -bool scored{false}; -``` - -Define a score struct that has the current score, max score, and UI text. - -```cpp -// Score struct, has current value, max record, and the UI text -struct score { - int value; - int max_score; - entt::entity text; -}; -``` - -Make a function which constructs the UI text and places it under logic functions, `namespace`. - -```cpp -// Create the UI string -std::string score_ui_text(int score = 0, int best_score = 0) { - return "Score: "s + std::to_string(score) + - "\nBest: "s + std::to_string(best_score) + - "\n\nW / UP / Space / Mouse to FLAP"s; -} -``` - -Make the `create_score` function that makes an entity. - -Retrieve constants and canvas size. - -```cpp -// Factory to create score entity -entt::entity create_score(entt::registry ®istry) { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); -``` - -#### Create the Text - -Create `text_entity` using the `graphics::blueprint_text` function, feed the text `score_ui_text` and `font_size` from `constants`. - -```cpp -// Create text -auto text_entity = graphics::blueprint_text(registry, graphics::text{score_ui_text(), constants.font_size}, - transform::position_2d{canvas_width * 0.03f, canvas_height * 0.03f}, graphics::white); -``` - -Set the layer to `layer<9>`, as the text must be in front of everything. Tag the text as `game_scene`. - -```cpp -registry.assign>(text_entity); -tag_game_scene(registry, text_entity); -``` - -Create a fresh entity and assign `struct score` to it with `0` score, max record values, and the `text_entity` value. Tag this entity as `high_score` and `game_scene`, then return it. - -```cpp -// Create a fresh entity -auto entity = registry.create(); - -// Create score -registry.assign(entity, 0, 0, text_entity); -registry.assign>(entity); -tag_game_scene(registry, entity); - -return entity; -``` - -Add a member for the entity in `game_scene`. - -```cpp -entt::entity score_entity_; -``` - -Create the entity inside the `game_scene` constructor using the `create_score` function. - -```cpp -game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), - system_manager_(system_manager) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - score_entity_ = create_score(registry); - create_background(registry); - init_dynamic_objects(registry); -} -``` - -#### Updating the Score - -Make the function that updates the score. - -This function does two things: increment the score by one and reset the score when the game is reset. - -This requires a parameter, `reset`, for information about the reset. - -To achieve this, retrieve the `struct score` from the entity. If a reset is requested, set the `value` to zero. - -If a reset is not requested, increment the `value` by one, check whether the value is higher than the `max_score`, and update the `max_score` if this is the case. - -```cpp -void update_score(entt::registry ®istry, entt::entity entity, bool reset = false) { - score &sc = registry.get(entity); - - // If reset is asked, set score to 0 - if (reset) sc.value = 0; - // Else, increase the score, - // Compare it with the max score, and update max score if it's greater - else if (++sc.value > sc.max_score) sc.max_score = sc.value; -``` - -Update the `struct score` inside the score entity. - -```cpp -// Update the score entity -registry.replace(entity, sc); -``` - -Update the contents of `graphics::text` with the `score_ui_text` using the new values. - -```cpp -// Update the UI text entity with the current values -auto &text = registry.get(sc.text); -text.contents = score_ui_text(sc.value, sc.max_score); -registry.replace(sc.text, text); -``` - -The completed function is as follows. - -```cpp -// Update score -void update_score(entt::registry ®istry, entt::entity entity, bool reset = false) { - score &sc = registry.get(entity); - - // If reset is asked, set score to 0 - if (reset) sc.value = 0; - // Else, increase the score, - // Compare it with the max score, and update max score if it's greater - else if (++sc.value > sc.max_score) sc.max_score = sc.value; - - // Update the score entity - registry.replace(entity, sc); - - // Update the UI text entity with the current values - auto &text = registry.get(sc.text); - text.contents = score_ui_text(sc.value, sc.max_score); - registry.replace(sc.text, text); -} -``` - -The function must be called when the player passes a column. The function needs the score entity. Pass the function to `column_logic` with the constructor. - -The first step is to have a class member for entity. - -```cpp -entt::entity score_entity_; -``` - -Then fill this with the constructor. - -```cpp -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry, entt::entity score) noexcept : system(registry), - score_entity_(score) { - disable(); - } -``` - -Update the creation line also, feeding the score entity. - -```cpp -void create_logic_systems(entt::entity player) { - system_manager_.create_system_rt(score_entity_); -``` - -Return to the `update` function of this class and, inside the `for` loop that loops through all columns, add the check for the score. - -At first the column should be new with the `score` field set to `false`. - -Once the column position is to the left side of the player position (after the player passes), use a simple `<` comparison of the column and the player’s position on the `X` axis. - -Inside, call the `update_score` function and mark the column `scored` as `true`. - -```cpp -// If this column is not scored and if the player passed this column -if (!col.scored && column_pos_x < constants.player_pos_x) { - // Increase the score - update_score(registry, score_entity_); - - // Set column as scored - col.scored = true; -} -``` - -#### Reset the Score Value at Game Over - -Reset this score value when the game is over and `reset_game` is called. - -Use the `update_score` function to this effect, but this time set the last parameter, `reset`, as `true`. - -```cpp -// Reset game -void reset_game() { - // Destroy all dynamic objects - destroy_dynamic_objects(); - - // Queue reset to reinitialize - this->need_reset_ = true; - - // Reset current score, but keep the max score - update_score(entity_registry_, score_entity_, true); -} -``` - -A visual example of the result. - -
- - - -
- -Here is the full code. - -```cpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For convenience -using namespace antara::gaming; -using namespace std::string_literals; - -// Constants -struct flappy_bird_constants { - // Player - const std::string player_image_name{"player.png"}; - const float player_pos_x{400.0f}; - const float gravity{2000.f}; - const float jump_force{650.f}; - const float rotate_speed{100.f}; - const float max_angle{60.f}; - - // Pipes - const float gap_height{265.f}; - const float column_start_distance{700.f}; - const float column_min{0.2f}; - const float column_max{0.8f}; - const float column_thickness{100.f}; - const float column_distance{400.f}; - const std::size_t column_count{6}; - const float pipe_cap_extra_width{10.f}; - const float pipe_cap_height{50.f}; - const graphics::color pipe_color{92, 181, 61}; - const graphics::outline_color pipe_outline_color{2.0f, graphics::color{76, 47, 61}}; - const float scroll_speed{200.f}; - - // Background - const float ground_thickness{100.0f}; - const float grass_thickness{20.0f}; - const graphics::color background_color{82, 189, 199}; - const graphics::color ground_color{220, 209, 143}; - const graphics::color grass_color{132, 227, 90}; - const graphics::outline_color grass_outline_color{2.0f, graphics::color{76, 47, 61}}; -}; - -// Random number generator -namespace { - std::random_device rd; // Will be used to obtain a seed for the random number engine - std::mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() - float random_float(float lower, float higher) { - std::uniform_real_distribution dist(lower, higher); - return dist(gen); - } -} - -// A Flappy Bird column which has two pipes -struct pipe { - entt::entity body{entt::null}; - entt::entity cap{entt::null}; - - // Destroy pipe - void destroy(entt::registry ®istry) { - registry.destroy(body); - registry.destroy(cap); - } -}; - -// Column is made of two pipes -struct column { - // Entities representing the Flappy Bird pipes - pipe top_pipe{entt::null}; - pipe bottom_pipe{entt::null}; - - // Destroy pipes and this column - void destroy(entt::registry ®istry, entt::entity entity) { - top_pipe.destroy(registry); - bottom_pipe.destroy(registry); - registry.destroy(entity); - } -}; - -// Logic functions -namespace { - void tag_game_scene(entt::registry ®istry, entt::entity entity, bool dynamic = false) { - // Tag game scene - registry.assign>(entity); - - // Tag dynamic - if(dynamic) registry.assign>(entity); - } - - // Returns a random gap start position Y - float get_random_gap_start_pos(const entt::registry ®istry) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - float top_limit = canvas_height * constants.column_min; - float bottom_limit = canvas_height * constants.column_max - constants.gap_height; - - return random_float(top_limit, bottom_limit); - } -} - -// Factory functions -namespace { - // Factory for pipes. This requires information about whether the pipe is a top pipe, and the position x of the column, and the starting gap position Y - pipe create_pipe(entt::registry ®istry, bool is_top, float pos_x, float gap_start_pos_y) { - // Retrieve constants - const auto canvas_height = registry.ctx().canvas.size.y(); - const auto constants = registry.ctx(); - - // PIPE BODY - // Top pipe is at Y: 0 and bottom pipe is at canvas_height, bottom of the canvas - transform::position_2d body_pos{pos_x, is_top ? 0.f : canvas_height}; - - // Size X is the column thickness, - // Size Y is the important part. - // If this is a top pipe, gap_start_pos_y is the bottom of the rectangle - // Half size is gap_start_pos_y since the center of the rectangle is at 0 - // If this is the bottom pipe, the top of the rectangle is at gap_start_pos_y + gap_height - // Half size is canvas_height - (gap_start_pos_y + gap_height) - // Since these are half-sizes, and the position is at the screen border, multiply these sizes by two - math::vec2f body_size{constants.column_thickness, - is_top ? - gap_start_pos_y * 2.0f : - (canvas_height - (gap_start_pos_y + constants.gap_height)) * 2.0f}; - - auto body = geometry::blueprint_rectangle(registry, body_size, constants.pipe_color, body_pos, - constants.pipe_outline_color); - - // PIPE CAP - // Prepare the pipe cap - // Size of the cap is defined in constants - math::vec2f cap_size{constants.column_thickness + constants.pipe_cap_extra_width, constants.pipe_cap_height}; - - // Position X is the same as the body. The bottom of the cap is aligned with the bottom of the body, - // or start of the gap, use the start of the gap minus half of the cap height - transform::position_2d cap_pos{body_pos.x(), - is_top ? - gap_start_pos_y - constants.pipe_cap_height * 0.5f : - gap_start_pos_y + constants.gap_height + constants.pipe_cap_height * 0.5f - }; - - // Construct the cap - auto cap = geometry::blueprint_rectangle(registry, cap_size, constants.pipe_color, cap_pos, - constants.pipe_outline_color); - - // Set layers, cap should be in front of body - registry.assign>(cap); - registry.assign>(body); - tag_game_scene(registry, cap, true); - tag_game_scene(registry, body, true); - - // Construct a pipe with body and cap and return it - return {body, cap}; - } - - // Factory to create single column - void create_column(entt::registry ®istry, float pos_x) noexcept { - // Create a fresh entity for a new column - auto entity_column = registry.create(); - - // Get a random gap start position Y, between pipes - float gap_start_pos_y = get_random_gap_start_pos(registry); - - // Create pipes, is_top variable is false for bottom one - auto top_pipe = create_pipe(registry, true, pos_x, gap_start_pos_y); - auto bottom_pipe = create_pipe(registry, false, pos_x, gap_start_pos_y); - - // Make a column from these two pipes and mark it as "column" - registry.assign(entity_column, top_pipe, bottom_pipe); - registry.assign>(entity_column); - tag_game_scene(registry, entity_column, true); - } - - // Factory for creating a Flappy Bird columns - void create_columns(entt::registry ®istry) noexcept { - // Retrieve constants - const auto constants = registry.ctx(); - - // Spawn columns out of the screen, out of the canvas - const float column_pos_offset = constants.column_start_distance + constants.column_thickness * 2.0f; - - // Create the columns - for (std::size_t i = 0; i < constants.column_count; ++i) { - // Horizontal position (X) increases for every column, keeping the distance - float pos_x = column_pos_offset + i * constants.column_distance; - - create_column(registry, pos_x); - } - } - - // Factory for creating a Flappy Bird background - void create_background(entt::registry ®istry) noexcept { - // Retrieve constants - const auto[canvas_width, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - // Create Sky - { - // The sky is the whole canvas, so the position is in the middle of the canvas - transform::position_2d pos{canvas_width * 0.5f, canvas_height * 0.5f}; - - // The size is the full canvas - math::vec2f size{canvas_width, canvas_height}; - - auto sky = geometry::blueprint_rectangle(registry, size, constants.background_color, pos); - registry.assign>(sky); - tag_game_scene(registry, sky); - } - - // Create Grass - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the top of the ground, so the height of the ground is canvas_height minus ground_thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness}; - - // Size X is full canvas but the height is defined in constants - // Make the rectangle longer by adding the thickness of the outline to hide the outline at the sides - math::vec2f size{canvas_width + constants.grass_outline_color.thickness * 2.0f, constants.grass_thickness}; - - auto grass = geometry::blueprint_rectangle(registry, size, constants.grass_color, pos, - constants.grass_outline_color); - registry.assign>(grass); - tag_game_scene(registry, grass); - } - - // Create Ground - { - // The ground expands to the whole canvas width, so the position is in the center X value of the canvas, - // Position Y is at the bottom of the screen, so the height is the full canvas_height minus half of the ground thickness - transform::position_2d pos{canvas_width * 0.5f, canvas_height - constants.ground_thickness * 0.5f}; - - // Size X is full canvas but the height is defined in constants - math::vec2f size{canvas_width, constants.ground_thickness}; - - auto ground = geometry::blueprint_rectangle(registry, size, constants.ground_color, pos); - registry.assign>(ground); - tag_game_scene(registry, ground); - } - } - - // Factory for creating the player - entt::entity create_player(entt::registry ®istry) { - // Retrieve constants - const auto[_, canvas_height] = registry.ctx().canvas.size; - const auto constants = registry.ctx(); - - auto entity = graphics::blueprint_sprite(registry, - graphics::sprite{constants.player_image_name.c_str()}, - transform::position_2d{constants.player_pos_x, canvas_height * 0.5f}); - registry.assign>(entity); - registry.assign>(entity); - tag_game_scene(registry, entity, true); - - return entity; - } -} - -// Column Logic System -class column_logic final : public ecs::logic_update_system { -public: - explicit column_logic(entt::registry ®istry) noexcept : system(registry) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Loop all columns - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - - // Move pipes, and retrieve column position x - float column_pos_x = move_pipe(registry, col.top_pipe); - move_pipe(registry, col.bottom_pipe); - - // Test whether column is out of the screen - if (column_pos_x < -constants.column_distance) { - // Remove this column - col.destroy(registry, entity); - - // Create a new column at far end - create_column(registry, furthest_pipe_position(registry) + constants.column_distance); - } - } - } - -private: - // Find the furthest pipe's position X - float furthest_pipe_position(entt::registry ®istry) { - float furthest = 0.f; - - for (auto entity : registry.view()) { - auto &col = registry.get(entity); - float x = entity_registry_.get(col.top_pipe.body).x(); - if (x > furthest) furthest = x; - } - - return furthest; - } - - // Move the pipe and return the x position - float move_pipe(entt::registry ®istry, pipe &pipe) { - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the pipe - auto pos = registry.get(pipe.body); - - // Shift pos X to the left by scroll_speed, but multiply the value by dt, as this occurs many times per second - // Delta time ensures that the movement occurs over time, so that over the course of one second the movement covers scroll_speed pixels - auto new_pos_x = pos.x() - constants.scroll_speed * timer::time_step::get_fixed_delta_time(); - - // Set the new position value - registry.replace(pipe.body, new_pos_x, pos.y()); - - // Set cap position too - auto cap_pos = registry.get(pipe.cap); - registry.replace(pipe.cap, new_pos_x, cap_pos.y()); - - // Return the information about whether this pipe is out of the screen - return new_pos_x; - } -}; - -// Name this system -REFL_AUTO (type(column_logic)); - -// Player Logic System -class player_logic final : public ecs::logic_update_system { -public: - player_logic(entt::registry ®istry, entt::entity player) noexcept : system(registry), player_(player) { - disable(); - } - - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Retrieve constants - const auto constants = registry.ctx(); - - // Get current position of the player - auto pos = registry.get(player_); - - // Add gravity to movement speed, multiply with delta time to apply it over time - movement_speed_.set_y(movement_speed_.y() + constants.gravity * timer::time_step::get_fixed_delta_time()); - - // Check if jump key is tapped - bool jump_key_tapped = input::virtual_input::is_tapped("jump"); - - // If jump is tapped, jump by adding jump force to the movement speed Y - if (jump_key_tapped) movement_speed_.set_y(-constants.jump_force); - - // Add movement speed to position to make the character move, but apply over time with delta time - pos += movement_speed_ * timer::time_step::get_fixed_delta_time(); - - // Do not let player to go out of the screen to top - if (pos.y() <= 0.f) { - pos.set_y(0.f); - movement_speed_.set_y(0.f); - } - - // Set the new position value - registry.replace(player_, pos); - - // ROTATION - // Retrieve props of the player - auto &props = registry.get(player_); - - // Increase the rotation a little by applying delta time - float new_rotation = props.rotation + constants.rotate_speed * timer::time_step::get_fixed_delta_time(); - - // If jump button is tapped, reset rotation, - // If rotation is higher than the max angle, set it to max angle - if (jump_key_tapped) - new_rotation = 0.f; - else if (props.rotation > constants.max_angle) - new_rotation = constants.max_angle; - - // Set the properties - registry.replace(player_, transform::properties{.rotation = new_rotation}); - } - -private: - entt::entity player_; - math::vec2f movement_speed_{0.f, 0.f}; -}; - -// Name this system -REFL_AUTO (type(player_logic)); - -// Collision Logic System -class collision_logic final : public ecs::logic_update_system { -public: - collision_logic(entt::registry ®istry, entt::entity player, bool &player_died) noexcept : system(registry), - player_(player), - player_died_(player_died) {} - // Update, this will be called every tick - void update() noexcept final { - auto ®istry = entity_registry_; - - // Do not check anything if player is already dead - if (player_died_) return; - - // Check collision - check_player_pipe_collision(registry); - } - -private: - // Loop all columns to check collisions between player and the pipes - void check_player_pipe_collision(entt::registry ®istry) { - for (auto entity : registry.view>()) { - // Check collision between player and a collidable object - if (collisions::basic_collision_system::query_rect(registry, player_, entity)) { - // Mark player died as true - player_died_ = true; - } - } - } - - entt::entity player_; - bool &player_died_; -}; - -// Name this system -REFL_AUTO (type(collision_logic)); - -// Game Scene -class game_scene final : public scenes::base_scene { -public: - game_scene(entt::registry ®istry, ecs::system_manager &system_manager) noexcept : base_scene(registry), - system_manager_(system_manager) { - // Set the constants that will be used in the program - registry.set(); - - // Create everything - create_background(registry); - init_dynamic_objects(registry); - } - - // Scene name - std::string scene_name() noexcept final { - return "game_scene"; - } - -private: - // Update the game every tick - void update() noexcept final { - // Check if player requested to start the game - check_start_game_request(); - - // Check if the player died - check_death(); - - // Check if player requested reset after death - check_reset_request(); - } - - // Check if start game is requested at the pause state - void check_start_game_request() { - // If game is not started yet and jump key is tapped - if (!started_playing_ && input::virtual_input::is_tapped("jump")) { - // Game starts, player started playing - started_playing_ = true; - resume_physics(); - } - } - - // Check if the player died - void check_death() { - // If the player died, game over, and pause physics - if (player_died_) { - player_died_ = false; - game_over_ = true; - pause_physics(); - } - } - - // Check if reset is requested at game over state - void check_reset_request() { - // If game is over, and jump key is pressed, reset game - if (game_over_ && input::virtual_input::is_tapped("jump")) reset_game(); - } - - // Initialize dynamic objects, this function is called at start and resets - void init_dynamic_objects(entt::registry ®istry) { - create_columns(registry); - - // Create player - auto player = create_player(registry); - - // Create logic systems - create_logic_systems(player); - - // Reset state variables - reset_state_variables(); - } - - // Create logic systems - void create_logic_systems(entt::entity player) { - system_manager_.create_system_rt(); - system_manager_.create_system_rt(player); - system_manager_.create_system_rt(player, player_died_); - } - - // Reset state values - void reset_state_variables() { - started_playing_ = false; - player_died_ = false; - game_over_ = false; - } - - // Pause physics - void pause_physics() { - system_manager_.disable_systems(); - } - - // Resume physics - void resume_physics() { - system_manager_.enable_systems(); - } - - // Destroy dynamic objects - void destroy_dynamic_objects() { - // Retrieve the collection of entities from the game scene - auto view = entity_registry_.view>(); - - // Iterate the collection and destroy each entities - entity_registry_.destroy(view.begin(), view.end()); - - // Delete systems - system_manager_.mark_systems(); - } - - // Reset game - void reset_game() { - // Destroy all dynamic objects - destroy_dynamic_objects(); - - // Queue reset to reinitialize - this->need_reset_ = true; - } - - // Post update - void post_update() noexcept final { - // If reset is requested - if (need_reset_) { - // Reinitialize all these - init_dynamic_objects(entity_registry_); - need_reset_ = false; - } - } - - // System manager reference - ecs::system_manager &system_manager_; - - // States - bool started_playing_{false}; - bool player_died_{false}; - bool game_over_{false}; - bool need_reset_{false}; -}; - -// Game world -struct flappy_bird_world : world::app { - // Game entry point - flappy_bird_world() noexcept { - // Load the graphical system - auto &graphic_system = system_manager_.create_system(); - - // Load the resources system - entity_registry_.set(entity_registry_); - - // Load the input system with the window from the graphical system - system_manager_.create_system(graphic_system.get_window()); - - // Create virtual input system - system_manager_.create_system(); - - // Define the buttons for the jump action - input::virtual_input::create("jump", - {input::key::space, input::key::w, input::key::up}, - {input::mouse_button::left, input::mouse_button::right}); - - // Load the scenes manager - auto &scene_manager = system_manager_.create_system(); - - // Change the current_scene to "game_scene" by pushing it. - scene_manager.change_scene(std::make_unique(entity_registry_, system_manager_), true); - } -}; - -int main() { - // Declare the world - flappy_bird_world game; - - // Run the game - return game.run(); -} -``` diff --git a/docs/basic-docs/antara/antara-tutorials/gateways-module-tutorial.md b/docs/basic-docs/antara/antara-tutorials/gateways-module-tutorial.md deleted file mode 100644 index 80d6cf806..000000000 --- a/docs/basic-docs/antara/antara-tutorials/gateways-module-tutorial.md +++ /dev/null @@ -1,1111 +0,0 @@ -# Gateways Module Tutorial - -## Tutorial - -In this tutorial, we will create a gateway that can serve to represent KMD. The following are the steps in the gateway-creation process: - -- Create a new Smart Chain and provide representative tokens -- Prepare a special oracle to monitor Komodo's chain state -- Bind the tokens and the oracle to our gateway -- Deposit KMD into the gateway -- Exchange tokens with other tokens on-chain -- Use the tokens to withdraw KMD - -Please ensure that you have the KMD main chain downloaded and synced before continuing further in the guide. - -Also, please open an empty text file and save all output transaction ids and hex-encoded data from each step. You will need the information at various stages. - -#### Manually Compile and Install Komodo From Source - -For this tutorial, please compile and install Komodo software from the source repositories. - -[Information on manual installations can be found at this linked documentation.](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#linux) - -#### Create a New Blockchain - -For this tutorial we will create a temporary Smart Chain called `HELLOWORLD` for educational purposes. - -Make sure that the total `ac_supply` of this Smart Chain is fairly large. `777777` coins will do for our purposes. - -[Follow these linked instructions](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html) before continuing. - -Recall also that a user must have a `pubkey` enabled when interacting with an Antara-related Smart Chain. [View this linked material for an explanation.](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) - -If desired, the reader may use an existing Smart Chain instead of a temporary educational chain. [Follow this link](https://github.com/jl777/komodo/blob/master/src/assetchains.old) for a list of asset-chain launch parameters. - -#### Create a Token to Represent an External Cryptocurrency - -For the GatewaysCC module to function it must have access to tokens that can represent an external cryptocurrency. We use the [Tokens](../../../basic-docs/antara/antara-api/tokens.html) CC module to this effect. - -#### Decide the Number of Tokens to Create - -We want the number of total tokens to be the maximum possible amount of the represented cryptocurrency that we expect to hold. - -Each token is created not from a full coin, but rather from a satoshi. - -For example, `1` HELLOWORLD coin creates `100000000` tokens. - -The HELLOWORLD satoshis should pair on a one-to-one basis with KMD satoshis. - -For our purposes, we will use `1000` coins of HELLOWORLD. - -#### Creating the tokens - -To create the tokens, execute the following command: - -```bash -./komodo-cli -ac_name=HELLOWORLD tokencreate KMD 1000 KMD_equivalent_token_for_gatewaysCC -``` - -This creates a `100000000000` token supply of on-chain tokens with the name of `KMD`, which represent the external cryptocurrency, `KMD`. - -For more details on the above command, see [tokencreate.](../../../basic-docs/antara/antara-api/tokens.html#tokencreate) - -This command returns a hex value as a response: - -````json -{ - "result": "success", - "hex": "01000000022c223cfc9c3349aed24ca89e44af6fcdb030150443bd6ac55e2080ce4b097c3002000000484730440220316605c400c47e2d5aa6104ac5c5229e71683b8db9482efa1655d257690d338802202344f254b208a6d724f52f4503531cf005a8ca68119bde4b6cb281ab9fccaf1101ffffffff80e66c0c47311449c5effc2782134006f05fd31e79659bc4b0608d7e247e280c0000000049483045022100ec494d3fa5c76fe0382e83980affdfd091509fb4e18b20fff8c095374e6b6bee022015ddaf95dc8b03e8cbba00ff7a377b80a7bd2200a68669718c329c617549757701ffffffff0400a0724e18090000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc1027000000000000232102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702acc01f66fa15090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000396a37e3632103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc0354414b0e54657374696e672070686173652e00000000" } ``` -```` - -Select the hex value (`01000000022c223c...`) and copy it (CTRL + SHFT + C). - -Broadcast this value using [sendrawtransaction:](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex -``` - -This returns a string, and this string is our `tokenid`. - -```bash -315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf -``` - -Copy the `tokenid` into the text editor we opened at the beginning of the tutorial and keep it available for future use. - -Watch the mempool using [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getrawmempool) to verify that the `tokenid` is successfully mined: - -```bash -./komodo-cli -ac_name=HELLOWORLD getrawmempool -``` - -Once the `tokenid` disappears from the mempool the transaction is mined. - -If this Smart Chain were receiving full dPoW security services, at this point it would be appropriate to wait for notarization. We can use [getinfo](../../../basic-docs/smart-chains/smart-chain-api/control.html#getinfo) to watch for the `notarizations` property to increase: - -```bash -./komodo-cli -ac_name=HELLOWORLD getinfo -``` - -On this educational Smart Chain, however, we can continue without waiting for notarization. - -We can check to see that our token is successfully created on the chain using [tokeninfo](../../../basic-docs/antara/antara-api/tokens.html#tokeninfo) - -```bash -./komodo-cli -ac_name=HELLOWORLD tokeninfo insert_token_id -``` - -We can check the balance of our `pubkey` using [tokenbalance:](../../../basic-docs/antara/antara-api/tokens.html#tokenbalance) - -```bash -./komodo-cli -ac_name=HELLOWORLD tokenbalance insert_tokenid insert_pubkey -``` - -#### Create an Oracle - -We use the [Oracles](../../../basic-docs/antara/antara-api/oracles.html#introduction) Module to add external data to the blockchain. - -The name of our oracle should be identical to the name of our tokens, `KMD`, and the data format must start with `Ihh` (height, blockhash, merkleroot): - -Create the oracle using [oraclescreate:](../../../basic-docs/antara/antara-api/oracles.html#oraclescreate) - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclescreate KMD blockheaders Ihh -``` - -This returns a hex value: - -```json -{ - "result": "success", - "hex": "010000000185b76ed0fbdb9ee2bdb5693f491b6ea23de6498f42c6e83f9f36c1eaf411dd990200000049483045022100aa198a2ae959ee191e1359df48867480bf5a1a5bd4fa76b4398481c89ff3095102205034824dcd56b312183acd65c27a002a13dae84f5d22c767f1efaae09ef63a5c01ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aac378740a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000001c6a1aec43064e5957544852014c0e5765617468657220696e204e594300000000" -} -``` - -Broadcast the returned hex data using [sendrawtransaction:](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_data -``` - -This returns a transaction id, which is the `oracleid`: - -```bash -0df7c4d844f08dba08abd4bb174558739f17cfe268feb005fb6333b3761d9203 -``` - -Record this in the text editor. - -Before registering as an oracle publisher, we need to run the `oraclesfund` method: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclesfund 7b6e7745058ffded423546eecc61dcc05069279b90776384c52692765246b64c -``` - - - -Send the raw transaction by broadcasting the hex value: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0400008085202f890124839445f1cdca84c42563fa87742a562824815729625184117c80dc2a06510e0000000049483045022100c4442ff211289ebc5967da35843f1d210c4a8985d5797a11c42e245aafdf6985022031e7dfb40e3778033f1fb92c0f1175cb4a658bb32749469d69379968fcf92be701ffffffff031027000000000000302ea22c802083071e46d28313148751bdd5e4ffd0509c4234f4770c4c0550cc48b6d45215188103120c008203000401cce0950b5402000000232102c59cc849a87ef401942abb5b5fe81c1a468454fd68c94c849c20b13f5ebd91a5ac00000000000000004f6a4c4cec464cb64652769226c5846377909b276950c0dc61ccee463542edfd8f0545776e7b2102c59cc849a87ef401942abb5b5fe81c1a468454fd68c94c849c20b13f5ebd91a5102700000000000000000000b60700000000000000000000000000 - -``` - -Response: - - - -(Use `./komodo-cli -ac_name=HELLOWORLD getrawmempool` to ensure that the transaction receives confirmation.) - -To prepare for the oraclefeed instance, use [oraclesregister](../../../basic-docs/antara/antara-api/oracles.html#oraclesregister) to register as a publisher for the oracle. This must be done on a node which can post KMD block headers and which can execute withdrawal transactions: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclesregister insert_oracleid data_fee_in_satoshis` -``` - -This returns a hex value (not shown for brevity), which we now broadcast: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_value -``` - -Retrieve the data publisher's `pubkey` using [oraclesinfo:](../../../basic-docs/antara/antara-api/oracles.html#oraclesinfo) - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclesinfo insert_oracleid -``` - - - -The property, `"publisher"`, in the entry, `"registered"`, of the returned json object is the data publisher's `pubkey`, also called the `publisherpubkey`. - -Subscribe to the oracle using [oraclessubscribe](../../../basic-docs/antara/antara-api/oracles.html#oraclessubscribe) to receive utxo information for data publishing. - -The frequency of data-publishing transactions we can perform in a block is equal to the number of active subscriptions committed to the oracle. Therefore, we must have at least one subscription for the oracle to allow publishing. - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclessubscribe insert_oracleid insert_publisherpubkey insert_amount_of_funds_to_add -``` - -This returns a hex value (not shown for brevity), which we now broadcast: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_value -``` - -::: warning Note -Execute the oraclessubscribe and sendrawtransaction methods several times and with the same amount. This gives us the opportunity to broadcast more than one sample of data per block. In our example, we want to publish data for more than one KMD-height per block. -::: - -Verify the oracle information to ensure it is properly established: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclesinfo insert_oracleid -``` - -#### Activating Gateway Binding - -We now create a gateway and bind our information to it, using the [gatewaysbind](../../../basic-docs/antara/antara-api/gateways.html#gatewaysbind) method. - -This method requires that we decide how many total gateway signatures we desire (`N`), and how many signatures are required to withdraw funds (`M`). - -For our educational example, we may set both `N` and `M` equal to `1`, for simplicity. - -As a part of this command we will need to indicate the `pubtype`, `p2shtype`, and `wiftype` values for our chosen coin. For KMD, these values are `60`, `85` and `188` respectively. - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysbind insert_tokenid insert_oracleid KMD insert_tokensupply 1 1 insert_gatewayspubkey 60 85 188 -``` - -This method returns a hex value (not shown for brevity), which we now broadcast: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_value -``` - -The broadcast returns a transaction id, also called the `bindtxid`. Copy this information into the text editor. - -Assuming everything is properly created and executed, we may now review our new gateway using [gatewaysinfo:](../../../basic-docs/antara/antara-api/gateways.html#gatewaysinfo) - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid -``` - -Use the returned information to verify that the `tokenid` and `oracleid` match the information in our text editor. - -#### Assemble an Oracle Instance - -An oracle instance automates the transfer of merkleroot data to our oracle. The Komodo software suite includes built-in tools for creating an oracle instance. - -Change into the correct directory (this command assumes we installed Komodo in the default directory): - -```bash -cd ~/komodo/src/ -``` - -Compile the instance: - -```bash -gcc cc/dapps/oraclefeed.c -lm -o oraclefeed -``` - -Run the instance: - -```bash -./oraclefeed HELLOWORLD insert_oracleid insert_mypubkey Ihh insert_bindtxid & -``` - - - -#### Using the Gateway - -With our gateway created and our oracle instance running as a background process, we are finally prepared to test our gateway. - -First, we need the `gatewaysDepositAddress`. This is the address where we will deposit our KMD on the main KMD chain. - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid -``` - - - -The `deposit` property contains the `gatewaysDepositAddress`. When we send funds to this address, we receive in return HELLOWORLD KMD tokens to an on-chain address that we indicate as follows. - -Use the [z_sendmany](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-sendmany) method to send funds to two addresses simultaneously. The first address is the normal address for the `pubkey` that corresponds to our pubkey on the HELLOWORLD Smart Chain which will receive tokens. The second address is the `gatewaysDepositAddress` on the KMD chain. We send a nominal amount into the first address, and the amount we wish to have available for trading into the second address. This is done on the external chain -- in this case, KMD. - -```bash -./komodo-cli z_sendmany "insert_address_where_KMD_funds_are_currently_held" '[{"address":"addressOfPubkeyForTokenizedKmd","amount":0.0001},{"address":"gatewaysDepositAddress","amount":0.1}]' -``` - -The returned string is the `operation_id`. Use this with the [z_getoperationstatus](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-getoperationstatus) method. - -```bash -./komodo-cli z_getoperationstatus '["insert_operation_id"]' -``` - -Execute this every few seconds until the `status` property reads `success`. Once this occurs, find the `txid` value. This is our `cointxid`, and we copy this into our text editor. - -Wait for the transaction to be mined. Once confirmed, execute the [gettransaction](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#gettransaction) method with the `cointxid` to obtain more information we will need later. - -```bash -./komodo-cli gettransaction insert_cointxid -``` - -Via the returned information from the `gettransaction` method, we can verify the addresses were correct by looking at the `vout` properties. At the bottom, there is a `hex` value. Copy the value to the text editor for later. - -In the returned results there is also a `blockhash` value, which we can use to find out the height of the block which contains the `cointtxid` by using the method below. - -```bash -./komodo-cli getblock insert_blockhash | jq '.height' -``` - -Next, execute the following command for more information: - -```bash - ./komodo-cli gettxoutproof '["insert_cointxid"]' -``` - -This returns a `proof` value. Transfer this to the text editor. - -We now have the necessary data to execute the [gatewaysdeposit](../../../basic-docs/antara/antara-api/gateways.html#gatewaysdeposit) method on the HELLOWORLD Smart Chain. - -The `gatewaysdeposit` method broadcasts the relevant data on the Smart Chain so that the gateway nodes may validate the information and prepare to distribute the KMD tokens. - -Here is the information we need for this call: - -- `BINDTXID`: our bindtxid -- `HEIGHT`: the `height` value of the `blockhash` containing the `cointxid` transaction -- `COIN`: KMD for this example -- `COINTXID`: the `cointxid` returned from `z_sendmany` -- `CLAIMVOUT`: the `vout` of the claim (this value should be 0, as it is our first use) -- `DEPOSITHEX`: the `hex` value that is found by executing `gettransaction` on the cointxid -- `PROOF`: the `proof` value returned after executing `gettxoutproof` on the cointxid -- `DESTPUB`: the public key where the KMD tokens should be received on the Smart Chain (the same pubkey used earlier to retrieve the first address for the z_sendmany method) -- `AMOUNT`: the amount of the deposit (in this case 0.1) - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysdeposit BINDTXID HEIGHT COIN COINTXID CLAIMVOUT DEPOSITHEX PROOF DESTPUB AMOUNT -``` - -Successfully executing this command will return a hex value. - -Broadcast the hex data: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_data -``` - -The broadcast returns a transaction id. Copy this to the text editor. It is the `deposittxid`. - -::: warning Note -For the deposit to process successfully, the oraclefeed instance must first process the block height of the z_sendmany transaction through the oracle -::: - -#### Claim the Funds on the Smart Chain - -To claim the funds we must spend the marker and the deposit asset, and perform the claim. - -This method is only available to the owner of the `privkey` corresponding to the pubkey used previously in the `gatewaysdeposit` method. The pubkey should be the `-pubkey=$PUBKEY` parameter used to launch the daemon. - -- `BINDTXID`: our bindtxid -- `COIN`: KMD for this example -- `DEPOSITTXID`: the transaction id returned from the `gatewaysdeposit` call -- `DESTPUB`: the public key where these tokens should be received on the Smart Chain -- `AMOUNT`: the amount of the deposit (in this case 0.1) - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysclaim BINDTXID COIN DEPOSITTXID DESTPUB AMOUNT -``` - -Broadcast the returned hex value: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_data -``` - -Once this transaction is successfully confirmed, the gateway will credit tokens to our indicated pubkey. These tokens are now usable as regular Token CC tokens. - -::: warning Note -For the claim to process successfully, the deposit and bind transaction must be confirmed first. This requires either 101 confirmations, or if the chain has dPoW, 1 notarization. -::: - -#### Withdrawing KMD Funds - -When finished with our tokens, we may send them to the gateway and withdraw the corresponding KMD funds via the [gatewayswithdraw](../../../basic-docs/antara/antara-api/gateways.html#gatewayswithdraw) method. Only the current owner of the KMD funds may execute the `gatewayswithdraw` method for these funds. - -::: tip -Recall that for the gateway to function, the oracle instance must be running. -::: - -Before we execute `gatewayswithdraw`, we must first import the private key for the `gatewaysdeposit address` on node which has oraclefeed instance running (this is needed only once). - -Find the `gatewayDepositAddress` in the `deposit` property of the returned values of the following command: - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid -``` - -Find the private key returned from this command: - -```bash -./komodo-cli -ac_name=HELLOWORLD dumprivkey insert_gatewayDepositAddress -``` - -Execute the following commands on the node running the oraclefeed instance: - -```bash -./komodo-cli importprivkey "insert_private_key" "label" false -``` - -Information for the next command: - -- `BINDTXID`: our bindtxid -- `COIN`: KMD for this example -- `WITHDRAWPUB`: the pubkey where the withdrawn coins should appear on the external chain; in this case, the KMD pubkey -- `AMOUNT`: the amount to withdraw - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewayswithdraw insert_bindtxid KMD insert_withdraw_pubkey insert_desired_withdraw_amount -``` - -Once executed, the remaining portion of the withdrawal process should happen automatically. - -Congratulations, you have successfully completed the cycle of the Gateways CC module. - -## Full Example - -The following content provides the full terminal input and output of a complete gateway cycle. - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD tokencreate KMD 1 testing -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100ab0161028985d24b473d758ee9cbb944006c27b69eb6ec5b0625e7c72bdab400000000494830450221008914c99e55f8471d7985db10fead22d4abdd52670709da9c962e20a1dd77064c022022e1900ab245872eede0439e3acbd8e481304a9ba71039590ee4ca452a628fa801ffffffff0400e1f50500000000302ea22c802090bc95b90831a7837c7ef178f6fd47f26a933bcf8de56da4a2f62894ab6c73fc8103120c008203000401cc1027000000000000232102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702ace0707c48180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000326a30e36321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0034b4d440774657374696e6700000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD tokeninfo 315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclescreate KMD testing Ihh -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100d7be6a83f6398b2b30315d6a9fb6af048971fbdc233e36fb4307fde654ab5a0000000049483045022100a0155127857c36c35d72e718f052a8a6b2ac5003f8a67e622c006f2f071e5d020220087febeac78eba36a2b6c92a860f32141f9dc453f77988f9da6cfaa14d1e9d9001ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aace051724e180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000146a12ec43034b4d44034968680774657374696e6700000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclesregister 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 10000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100da09e69ee37b713b3bbc5e4cf5f7b9525766af13c86fd5bddb246aff675cbe000000004847304402202d1aa9c1c39ed4428f381d727780fdd6fddfeef616595b7add6b0c7dac66e35f022070c227072ea93b099941daa1b5a2a41afa84ea955a536727c2307c10dc5aa53c01ffffffff041027000000000000232102407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9eac1027000000000000302ea22c802070f8ca74a159596583083b3744665976848f8c9f2e6d61b962e66c8a0d6b225d8103120c008203000401ccd02a724e180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac00000000000000004f6a4c4cec52407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9e21024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0102700000000000000000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclesinfo 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD oraclessubscribe 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 1 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100e078a6ecd74f0b1609656ea3e7ee54c4a95ae66bfd19929c2e2cdc781b0f410000000049483045022100d48c862acde5e8756d11ef14ea9aaae26cf3da4344b49eb0e496b639c91499e602204dd685b86aae4dd8685e0b14b53c8a2957f5980a61f36d30eb8886726894570401ffffffff0400e1f50500000000302ea22c8020d5ad5ece52f2a6c9dd46cd4e658abce5dc1881e9c470d5cdf1f3f71199996f788103120c008203000401cc1027000000000000232102407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9eace0707c48180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac00000000000000004f6a4c4cec53407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9e21024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff000e1f5050000000000000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysbind 315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 KMD 100000000 1 1 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 60 85 188 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000101069d6ef8a20a726959a9802151f3367558a3e2360bb5620cf269c5949777430000000048473044022065e97dc3e0f8aee9c6bc041c728c18ab021c174b8570a8c332a170ec7a94773f022023c19d04002940298ae961d1c155e889df29ae9976bb61cfebd87715de3d7fbf01ffffffff031027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cce051724e180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000796a4c76f142034b4d443c5500bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d3100e1f5050000000001010121024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9e00000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysinfo 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD dumpprivkey RXEXoa1nRmKhMbuZovpcYwQMsicwzccZBp -``` - - - -Command: - -```bash -./komodo-cli importprivkey "privkey" "label" false -``` - - - -Command: - -```bash -./oraclefeed HELLOWORLD 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 Ihh 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d -``` - - - -#### Example Continues - From Gateway USER Node - -Make a Deposit - -```bash -./komodo-cli listaddressgroupings -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD getaccountaddress "" -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysinfo 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d -``` - - - -Command: - -```bash -./komodo-cli z_sendmany "RFUL6arBgucq9TUPvTaUTnpQ2DkrcxtSxx" '[{"address":"RBm4FN3JhjhbVFaGKJ8DQgtgPHKXvhFMs3","amount":0.0001},{"address":"RXEXoa1nRmKhMbuZovpcYwQMsicwzccZBp","amount":0.1}]' -``` - - - -Command: - -```bash -./komodo-cli z_getoperationstatus '["opid-fbe98b01-a870-4bd5-9bc9-b937b08c79b5"]' -``` - - - -Wait until this height is oraclized by the `oraclefeed` instance. - -Find the `height` and `hex` values here: - -Command: - -```bash -./komodo-cli getrawtransaction 907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98 1 -``` - - - -Command: - -```bash -./komodo-cli gettxoutproof '["907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98"]' -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysdeposit 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d 1116196 KMD 907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98 0 010000000197d6ea16c68dc5db95b72e029a0e23cb403ae0a33b561b863963cfd9cbfec747000000006b483045022100aca47515602989979b514b6211c375e4d0d9471dd8297c5238c12245ad01dd830220191105caf1b63313c6988194f5f03fd6f70d4a30edc7820add1185d35edff1bb012102924664b536f3710a8e8abea38bb4bf71b470a653a4dceabd50df08d7b2a38436ffffffff0310270000000000001976a9141b355cb6b76cab1b16cb873db8828fe5d2521ae488ac80969800000000001976a914f0d1fc29f8962ac2805a1659192d9ad26794d22988ac38c7fa00000000001976a91482804b943dd6a2008af73f8ba40449c062f0935188ac50e6fd5b 04000000380b8fd2b9bdf570358980a4c9fc94e418ac656913999b5f9a016ec5afc46b0b188320f231637a0ded0b0bdada1f34c81ad5873b8c3f096b2014018af13f43980000000000000000000000000000000000000000000000000000000000000000b2e6fd5ba786061d57fff87a00000000000046430000000000000200000000000000000000000000fd40050035435dd2c1df5c20cb48e0617b6cee81f5349f0735b36fe93f17f82d678ad3eb374d0e398b049fddcb21a4d7ddf7345867c6a363eddcfe61f31d49dbc35652794c60da61bd5f164fd554f17b5bd669f636744412822af2ebd0f318dacb71514720164c59c392ef2b1ccc3a5dc5c9c83cd37a11f98b97c8f5170a357a972ec3cacbeb0dab34b757354883b46a598f2b93fcd735b4163db6b2b037f7d7d71a773e909ac4ce3f1228012d5bebfd9edad9842ae8c6cddf6942c543594b85013591a604c4223a3d2e007ed25f5994e9d8f6b6a704daf57cad41aea9609923612eee2fc55ad075c91c23a8cc46af9a45a7390c537d2e2302994239ae44230537ceaa2188e7f4eb6a0ab55471d152b9177e9fd90843504f29d3e92fd3d7142caae018b51318ec6b86083b7e2d155ce868f6b673b13cf1ed59107d15c6c84201441dde14074930f4755ec64975f354a99bd957021c073768f575dde3ab020dd73b488e2d03d57bc414a16d45b3e2052b24fb2360ec5f73524525fc59d2151b89310b19764541b801ad72171085bc6275832222484b8d7ee6ed91ab6a544c45af5c4d8445b0624f04a234aec6997eecf007f0e971eea33b21e45ba8f72825fa84605cdfa929aeb6dc425f2612000e7ce2ba04ff8c53061154eb38cba7f6d0bfe5dab031dadea2095e01e93f9e063d0b42e412f865572625f77aa8b10b58f7b0428ea0ff530ea10d37150496bb181e37fc5814ad524ce4618955e9158b6aebb956b02b961f920ee48eb5a08efc39d27fc2fd4ec175e38798bcca7331a7b5da2ca6c56fcb98e740c2f471eac6b67ced78125c5fcecd4f76eac1d76233aa58ed808e398b9e2b1eaa74e773d18276b732239403ce0c452cb26f0f34156a0a63e007ccfbd76f168fb941fbd2fbe23b57e519835c804ace6e22e281b3d0adda7c4b93a87d94500103315c780fe91ee67320a422eecb4a6daedc2d774567bfebc1d5b72fa693178f3443aa1eb47f18d6931f7b0fc6ec151caad4eae5f787c2a963c3963ffc924ba66a7ea1754763faf2884de0c86a0f75fe7f8dfb1265b449184668cb7348520810cf731663f5180ac31642d6b135d5ce7de88ba63d6db3d6c5dfa19492281dfed3b3765451717f3497ac2b4c040e2e4e77219b2586c227cd138b8d94ccc273fbfbb51a35523870c503e2d8527b840ced11917075e8a41ae9616f1df8d41df5bae39c6d6de5bb8d43d401bb9089723db59f0f06aa4fdf4145a905812ef799eb574abb9985de878a289e5f4b1256ca2121d553465f44065580cb5bde170459d1c22e8d388cbec9e37dc3cca07e489a9859942a9ccef4a5e45eed7228b94c86d10a233b5a1ddfcb1735cb9b16de6e8f49f3c841796acba31a8e9c90b531952ed03bd72e0b00fa3373ea4bc845d7469afae305639c772285a5223bf2d86a12c92312dc19db86400c6760b9e75af40ce4c16278bba8a804d5a69b88290dd4c2b43423bee9eb97c54261f956a32d80fdd3f421d1199ee45d42ad657e928be2e9fa54d844cff60b06bc525ce54daca9689e0616bfdbdbc36e09bea11a276d25d3ca9a80ed7109183784dfd1d23b7c791a7913a633e2d28948c655e68ade706654e38f717fe29119af4282430c8d1f702a52ea189f1e9e6faafb213205a195dab1c2d01dc6a3711f671ea118e8a3c995632903c58ebbd4eae5dbc4555b24c1649e89e03efb92134b9e24fb9fc649462f928d992fa33d45edcb4ef13f0d5c2cb6663e7dbf2414b5ed617e56b8715ace6910807e4a901ba603dab4092f9eeb46566ec3f38f3a1789c60822530c390d19b1d939217b7a691abb91454fce76cccf3557ddb3fc55bd4f44761aa9363db0f38360adf60e743ba3b902788bb254637f6074df62460400000003a973b7134b7fcbcb1fe70fdfaaf056c209a9f5dd77800eb37b065ca8317cbb3a980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890445df562c183ed7279f2f8e37ba249447439884d5b7030eac6485112eb07ea2d010b 02d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d 0.1 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000010db4b1686d1f27de5e2a11c793dfd30f09b296754f95ae8649858cca97d5b07a0000000049483045022100ad6bc26f0c66b89f5d63aff251c78965a50201f909a997b8ed6469da0334aa0c0220136d71f5ad1f4496785df81864f9be3ae7b8dd012dae08d59fd544869eacb3ba01ffffffff041027000000000000302ea22c80205fd998129698de9cf1455f4f4795794c9e57bf1fd5f28598b5e6c0322de5d0358103120c008203000401cc1027000000000000232102980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890acd02a724e18090000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000fd04096a4d0009f144034b4d440d8d1f63bf680d6191b100d90992b0f6bf6ce1cc851f259da8b49e74524e7a890121024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0012fea85ecfda42975a2aaed72e946792df41a486033af8dc45ab1e4ddcb34b1b424081100980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee12789000000000fd080230313030303030303031393764366561313663363864633564623935623732653032396130653233636234303361653061333362353631623836333936336366643963626665633734373030303030303030366234383330343530323231303061636134373531353630323938393937396235313462363231316333373565346430643934373164643832393763353233386331323234356164303164643833303232303139313130356361663162363333313363363938383139346635663033666436663730643461333065646337383230616464313138356433356564666631626230313231303239323436363462353336663337313061386538616265613338626234626637316234373061363533613464636561626435306466303864376232613338343336666666666666666630333130323730303030303030303030303031393736613931343162333535636236623736636162316231366362383733646238383238666535643235323161653438386163383039363938303030303030303030303139373661393134663064316663323966383936326163323830356131363539313932643961643236373934643232393838616333386337666130303030303030303030313937366139313438323830346239343364643661323030386166373366386261343034343963303632663039333531383861633530653666643562fd360604000000380b8fd2b9bdf570358980a4c9fc94e418ac656913999b5f9a016ec5afc46b0b188320f231637a0ded0b0bdada1f34c81ad5873b8c3f096b2014018af13f43980000000000000000000000000000000000000000000000000000000000000000b2e6fd5ba786061d57fff87a00000000000046430000000000000200000000000000000000000000fd40050035435dd2c1df5c20cb48e0617b6cee81f5349f0735b36fe93f17f82d678ad3eb374d0e398b049fddcb21a4d7ddf7345867c6a363eddcfe61f31d49dbc35652794c60da61bd5f164fd554f17b5bd669f636744412822af2ebd0f318dacb71514720164c59c392ef2b1ccc3a5dc5c9c83cd37a11f98b97c8f5170a357a972ec3cacbeb0dab34b757354883b46a598f2b93fcd735b4163db6b2b037f7d7d71a773e909ac4ce3f1228012d5bebfd9edad9842ae8c6cddf6942c543594b85013591a604c4223a3d2e007ed25f5994e9d8f6b6a704daf57cad41aea9609923612eee2fc55ad075c91c23a8cc46af9a45a7390c537d2e2302994239ae44230537ceaa2188e7f4eb6a0ab55471d152b9177e9fd90843504f29d3e92fd3d7142caae018b51318ec6b86083b7e2d155ce868f6b673b13cf1ed59107d15c6c84201441dde14074930f4755ec64975f354a99bd957021c073768f575dde3ab020dd73b488e2d03d57bc414a16d45b3e2052b24fb2360ec5f73524525fc59d2151b89310b19764541b801ad72171085bc6275832222484b8d7ee6ed91ab6a544c45af5c4d8445b0624f04a234aec6997eecf007f0e971eea33b21e45ba8f72825fa84605cdfa929aeb6dc425f2612000e7ce2ba04ff8c53061154eb38cba7f6d0bfe5dab031dadea2095e01e93f9e063d0b42e412f865572625f77aa8b10b58f7b0428ea0ff530ea10d37150496bb181e37fc5814ad524ce4618955e9158b6aebb956b02b961f920ee48eb5a08efc39d27fc2fd4ec175e38798bcca7331a7b5da2ca6c56fcb98e740c2f471eac6b67ced78125c5fcecd4f76eac1d76233aa58ed808e398b9e2b1eaa74e773d18276b732239403ce0c452cb26f0f34156a0a63e007ccfbd76f168fb941fbd2fbe23b57e519835c804ace6e22e281b3d0adda7c4b93a87d94500103315c780fe91ee67320a422eecb4a6daedc2d774567bfebc1d5b72fa693178f3443aa1eb47f18d6931f7b0fc6ec151caad4eae5f787c2a963c3963ffc924ba66a7ea1754763faf2884de0c86a0f75fe7f8dfb1265b449184668cb7348520810cf731663f5180ac31642d6b135d5ce7de88ba63d6db3d6c5dfa19492281dfed3b3765451717f3497ac2b4c040e2e4e77219b2586c227cd138b8d94ccc273fbfbb51a35523870c503e2d8527b840ced11917075e8a41ae9616f1df8d41df5bae39c6d6de5bb8d43d401bb9089723db59f0f06aa4fdf4145a905812ef799eb574abb9985de878a289e5f4b1256ca2121d553465f44065580cb5bde170459d1c22e8d388cbec9e37dc3cca07e489a9859942a9ccef4a5e45eed7228b94c86d10a233b5a1ddfcb1735cb9b16de6e8f49f3c841796acba31a8e9c90b531952ed03bd72e0b00fa3373ea4bc845d7469afae305639c772285a5223bf2d86a12c92312dc19db86400c6760b9e75af40ce4c16278bba8a804d5a69b88290dd4c2b43423bee9eb97c54261f956a32d80fdd3f421d1199ee45d42ad657e928be2e9fa54d844cff60b06bc525ce54daca9689e0616bfdbdbc36e09bea11a276d25d3ca9a80ed7109183784dfd1d23b7c791a7913a633e2d28948c655e68ade706654e38f717fe29119af4282430c8d1f702a52ea189f1e9e6faafb213205a195dab1c2d01dc6a3711f671ea118e8a3c995632903c58ebbd4eae5dbc4555b24c1649e89e03efb92134b9e24fb9fc649462f928d992fa33d45edcb4ef13f0d5c2cb6663e7dbf2414b5ed617e56b8715ace6910807e4a901ba603dab4092f9eeb46566ec3f38f3a1789c60822530c390d19b1d939217b7a691abb91454fce76cccf3557ddb3fc55bd4f44761aa9363db0f38360adf60e743ba3b902788bb254637f6074df62460400000003a973b7134b7fcbcb1fe70fdfaaf056c209a9f5dd77800eb37b065ca8317cbb3a980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890445df562c183ed7279f2f8e37ba249447439884d5b7030eac6485112eb07ea2d010b2102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d809698000000000000000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysclaim 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d KMD 07d79e39354cc38a76dfe2ca8a5fb711432192237608ea066621662f13e0c08e 02d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d 0.1 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000030a9a982a898012f4cc982796f381f16c9e2e5fe28e0be58ad59c7c90409530f8020000004847304402207959e4befae9e917cde7d6ba6f5e62e4cf679858b1a5c8b1eb270b1c7eac7c7e0220503ea9a24245db21b4db8ae68e48da6c5d33ef436371c6d03872d45d1364047c01ffffffffc6fc3b75a37a6ed10507a1bb73f2c5d5c8f75bcb358b0aa4bab3b80b5aa39f19010000007b4c79a276a072a26ba067a565802103ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb408140d4c46b8282d42d7e7ebe99361264c21b9ee221b7b3a47e1549e06bf06659fa194298618a2969a421543753a5994ebc3944e93ac6072a233ab617b229b3922a52a100af038001f1a10001ffffffff8ec0e0132f66216606ea08762392214311b75f8acae2df768ac34c35399ed707000000007b4c79a276a072a26ba067a565802102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d8140f3938953c9087e1e25c31263c5a717dd59d2f7d6f0815cfd7c0cb01a6c4d586b630b11cca1e60a19036d937095941660e488a07494fc721471d4a53f5eb89a25a100af038001f1a10001ffffffff048096980000000000302ea22c8020abd72b18452f1bc72f4312dbb1cd341b7c7f38a994ddacd8b35412231f01cb088103120c008203000401cc804a5d0500000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc1027000000000000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000936a4c90e374bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d31034b4d440d8d1f63bf680d6191b100d90992b0f6bf6ce1cc851f259da8b49e74524e7a898ec0e0132f66216606ea08762392214311b75f8acae2df768ac34c35399ed7072102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d809698000000000000000000 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD tokenbalance 315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf -``` - - - -#### User Withdraws Funds - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewayswithdraw 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d KMD 0271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328 0.1 -``` - - - -Command: - -```bash -./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000020e2778e5c0917b00a995ffd0e027ac896492b70b2004ca0096d5309bc1d695ce0000000048473044022072bd3e74c1fb6a56111fc34caab1d605cedfbcb0a9dcd1a4c8d0dae9db61d43902205ccea739077b3374559353af3392e637b7c462ca699f9b9dba786b5398491b4201ffffffff8425c1bf730444ceac45a47376164d66a156e6c2a48116ec14cd17a88f8ab8e5010000007b4c79a276a072a26ba067a565802102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d814051e39b89bace8226f3ca1779b754f2b57ee480e9636b16322bb36a89ec22de967ea66cdc906debb5f6b7c26a51ac2d089966aeb92d07aacc43507b1555c02313a100af038001f1a10001ffffffff058096980000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc102700000000000023210271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328ac1027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401ccd02a724e18090000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000536a4c50f157bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d31034b4d44210271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328809698000000000000000000 -``` - - diff --git a/docs/basic-docs/antara/antara-tutorials/introduction-to-antara-tutorials.md b/docs/basic-docs/antara/antara-tutorials/introduction-to-antara-tutorials.md deleted file mode 100644 index 94d80541d..000000000 --- a/docs/basic-docs/antara/antara-tutorials/introduction-to-antara-tutorials.md +++ /dev/null @@ -1,14 +0,0 @@ -# Introduction to Antara Tutorials - -Welcome to the Antara tutorial documentation. - -This section contains tutorials that are specifically designed for the aspects of Komodo Smart Chain software that deal with the Antara framework. - -The Antara framework encompasses many of the enhancements and innovations that Komodo adds to upstream technologies. Aspects of Antara include the Antara Customizations for a Smart Chain and Antara Modules, which allow for advanced blockchain functionality. - -For tutorials regarding other Komodo software, such as AtomicDEX, which offers cross-chain atomic-swap compatibility, please see the respective documentation centers. - -For a targeted learning approach to Komodo's Smart Chain software, please see the Learning Launchpad. - -[Link to Learning Launchpad](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html) - diff --git a/docs/basic-docs/antara/antara-tutorials/musig-module-tutorial.md b/docs/basic-docs/antara/antara-tutorials/musig-module-tutorial.md deleted file mode 100644 index 269618ece..000000000 --- a/docs/basic-docs/antara/antara-tutorials/musig-module-tutorial.md +++ /dev/null @@ -1,664 +0,0 @@ -# Musig Module Tutorial - -## Installation - -MuSig is currently only available on MacOS and Linux operating systems. - -Please check with the Komodo team on [Discord](https://komodoplatform.com/discord) for information regarding Windows functionality. - -### Install Dependencies - -Ensure that local repositories are up to date: - -```bash -sudo apt-get update && sudo apt-get upgrade -y -``` - -Install Dependencies: - -```bash -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl libcurl4-gnutls-dev cmake clang libsodium-dev -y -``` - -### Build instructions - -Build `komodod` by executing the following series of commands. Each line should be executed separately: - -```bash -git clone https://github.com/jl777/komodo -cd komodo -git checkout jl777 -./zcutil/fetch-params.sh -./zcutil/build.sh -j$(nproc) -``` - -Compile the appropriate library: - -```bash -cd src/cc -./makecclib -cp sudokucc.so ../libcc.so -cd ../.. -make -j$(nproc) -``` - -### Update - -Update the `komodod` daemon by executing the following series of commands. Each line should be executed separately: - -```bash -cd komodo -git checkout jl777 -git pull -cd src/cc -./makecclib -cd ../.. -make -j$(nproc) -``` - -### Launch the Smart Chain - -Change into the `~/komodo/src` directory: - -```bash -cd ~/komodo/src -``` - -Launch the MuSig Smart Chain using the following launch parameters. - -```bash -./komodod -ac_name=MUSIG -ac_supply=100000 -ac_reward=10000000 -pubkey= -ac_cclib=sudoku -ac_cc=2 -addnode=5.9.102.210 & -``` - -### Obtain a Pubkey - -Without a pubkey, the MuSig Smart Chain will not function properly on the user's local machine. Follow these instruction for obtaining and setting a pubkey: - -- [Instructions for obtaining and setting a pubkey](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html#creating-and-launching-with-a-pubkey) - -Once the Smart Chain is relaunched with the new pubkey included as a launch parameter, the MuSig Smart Chain is prepared for use. - -### Acquire Funds for Testing - -::: tip Note - -The reader should launch the Smart Chain with a pubkey whose private key is already imported to the wallet. If this is not the case, restart the Smart Chain with an appropriate pubkey, or use the [importprivkey](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#importprivkey) method to import the private key of the desired pubkey. - -::: - -The MuSig Smart Chain has an available faucet. The faucet allows a user to obtain a nominal amount of funds for testing and orientation purposes. - -Ensure that the terminal's working directory is in the `~/komodo/src` directory: - -```bash -cd ~/komodo/src -``` - -Execute the `faucetget` method: - -```bash -./komodo-cli -ac_name=MUSIG faucetget -``` - -This method returns a hex value in the terminal. Select the entire hex value and copy it to the clipboard. (Use `CTRL + SHFT + C` to copy within the terminal) - -Broadcast the hex value using the `sendrawtransaction` method: - -```bash -./komodo-cli -ac_name=MUSIG sendrawtransaction -``` - -Wait for the transaction to be confirmed. - -Once the broadcast transaction is confirmed, check the balance using the `getbalance` method: - -```bash -./komodo-cli -ac_name=MUSIG getbalance -``` - -There should be a small amount of funds in the balance. - -## Full Example - -The aim of this example is to create a `20f2` MuSig pubkey, fund it, and spend from it. - -To accomplish this, two nodes are necessary. - -In this MuSig example we use the following pubkeys on our two nodes: - -- Node1's daemon is launched using the pubkey: `0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a` -- Node2's daemon is launched using the pubkey: `02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567` - -The `EVALCODE` for the MuSig module is `18`. - -For this example, we use [the normal array formatting for cclib methods](../../../basic-docs/smart-chains/smart-chain-api/cclib.html#cclib-formatting), as we are not creating a bash script. - -Steps 1 through 5 and 11 through 12 need to be executed only on the first node. - -#### Step 1: combine - -Use the [combine](../../../basic-docs/antara/antara-api/musig.html#combine) method to create a `combined_pk` address: - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib combine 18 '["0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a","02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567"]' -``` - - - - - -Copy the values of `pkhash` and `combined_pk` and save them in a secure location for later use. - -#### Step 2: send - -Use the [send](../../../basic-docs/antara/antara-api/musig.html#send) method to send `1` coin to the `combined_pk` address: - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib send 18 '["03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",1]' -``` - - - - - -Copy the `hex` value to your clipboard. - -#### Step 3: Broadcast the hex Value and Retrieve the sendtxid - -Use the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method to broadcast the raw hex value: - -Command: - -```bash -./komodo-cli -ac_name=MUSIG sendrawtransaction 0400008085202f890b02b1bdd8707f82bc6f4cdeb4756eb04dfc3cc7a4b5ac38a388c0205cf8f31a0e0000000048473044022004de31b5132f03f761fc0d0d9761efbf77bb27b07ee99f2cc54928e2150f1f16022069381b36bb9839cc9cb3e1d584e00dbd52efadf7e2f3fa092e0bcca839cdce6801ffffffff04949d5bf1722c5df04f58cf2c7e662f32ab65de2f7990ce4c734df4f2991eb60000000049483045022100ab3ab2bb95ef095763dd3eeb56961d1234aa25efd91a30fa14e397717368e6a0022048d7f8268463cfb44f34467bd77eb2aee962eaec09a079741c75c5de898b4f6c01ffffffff0476a06188887bf93bec4e64a3a5681b5e271cb7055a11d0667dc565e498b6190000000048473044022022ef03c33b5942b1af16f7e4a9acd2aa485d73f6f6b5e0a01e15f70238cd85cd022063779c69511ee4eba179b40ce28d80da22d43f19110be2a9a97d0b47d6a5cca201ffffffff045587699381853735482dbfb1fe25dda8d5a7a238c05b872ecfcd97be38232f00000000484730440220051e6047dd9e82b004c29a2837bf127f94caa638c65d96c761371c18ff36170002204e73ddfbbe748f295d7a93e46d942618f291d302b7a666b78b49ab38594a89ac01ffffffff0426d8098ed0c5ee19ac8d4254ec9887ab7a231c68a8d9b024a50f417f0a94ff0000000049483045022100ebd193262a04f8c9cf1872527d2a7d4933222f8ce8ea11add90e263c483ca56a02204a29902ae6b31dc41f84b5ffad3b2076755ad19f25be47479704b2ab5e37463a01ffffffff040e294b76ca4492909b75b829566b3702b35245595e8c4806b7ef6a7f612dd6000000004847304402201573d230af50aa6d326b607ac6ba77bb15c1a143256e5141197ce6729195b0e602201301be6ad22ba5599597205cdfb7e2cf6823ce4597e5b902b6d4336958e0fbe101ffffffff03d9a453070627c94d940f57b40829713ee6b6bce4d801e591117c801221225900000000494830450221009d5eec551265274ade816fdb3a0dfee20e716a7d3f56155b698a9d0c41ccd11202202e811c4611ebf982b34db8a43002c759c54a077023ced1498421c4af2b12a0f901ffffffff03ce7cb872bdfdf264576c45ed899c00731959051cade1a19b088eabc02e07780000000049483045022100a9c8c795e34a393fafb839ef4bbf11e4adf04b4c8a8493ef0bd2353e7a1ddd430220251ff7eb5ca3d2ed4ee4145906532af803caaed756ff3d21e86ac4876333067e01ffffffff030d66186013342f71335bc67d0d87240b4a27809e67ba55e01dd72e7ae1b0af0000000049483045022100d4c82867562aa040a7695ffd53056018e0dc3a071d971b3774cdb8511b0f49aa022029b72c5af1b9c16e27d81827d478910ec3135415037cf2b3492922ff618538bc01ffffffff02f9b92abfa0324272e0ce465b856e6d9b53e3e2e0828934c8a0c8c2c10e67d5000000004847304402205df4c99c581bfe95ea95740320b16c423531663b42e25b97315d3126250c24a202206dff5da29fbb0fe21ae6ce3da7bac1e502feb8fdd7b803c0fafa6541e80ec0ff01ffffffff02bd8679e8383e6d9c4a10917b68b8918ed3f518fe2deef5b23e0012461fbf370000000049483045022100a04210427173ea0721f3cf859b99328c8e234ba39250c033aebfb37fb2c5a1d502200d5cb16ed0dccc5dfc0385a8763340cf98a162e863994069354a5fee187b8bd401ffffffff031008f60500000000302ea22c8020c71ddb3aac7f9b9e4bdacf032aaa8b8e4433c4ff9f8a43cebb9c1f5da96928a48103120c008203000401cc604898000000000023210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac0000000000000000266a2412782103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a000000003f0800000000000000000000000000 -``` - - - - - -The returned value is our `sendtxid`. Copy this to a secure location for later use. - -#### Step 4: Obtain the change_script Value - -Use the [getrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#getrawtransaction) method to decode the raw transaction. - -Command: - -```bash -./komodo-cli -ac_name=MUSIG getrawtransaction 09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293 1 -``` - -In the response there are a series of `vout` values, each of which has an array of json objects. Search for the `vout` value that has the `"type":"pubkey"` key pair listed. In this object, retrieve the `hex` value from the `scriptPubkey`: - -```json - -... (omitted for brevity) ... - -"vout": [ - - ... (omitted for brevity) ... - - { - "value": 0.09980000, - "valueSat": 9980000, - "n": 1, - "scriptPubKey": { - "asm": "0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a OP_CHECKSIG", - "hex": "210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac", - "reqSigs": 1, - "type": "pubkey", - "addresses": [ - "RUfCUd3UryKJ49baQvSuAs42wakNunvvfT" - ] - } - }, - - ... (omitted for brevity) ... - - ] - -... (omitted for brevity) ... - -``` - -This `hex` is our `change_script` value. Save this to a secure location for later use. - -#### Step 5: calcmsg - -Use the `calcmsg` method to calculate the `msg` value. The `calcmsg` method needs the `sendtxid` and `change_script` values retrieved from previous commands. - -**cclib calcmsg 18 '["insert_sendtxid_here","insert_change_script_here"]'** - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib calcmsg 18 '["09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293","210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac"]' -``` - - - - - -Copy the `msg` value to a secure location for later use. - -#### Step 6: session - -From this point forward, all steps should be executed on both nodes 1 and 2. - -After each step performed on each node, copy the relevant data to the opposing node. - -##### Node 1 - -The following `session` command requires an array of arguments. The arguments are as follows: - -1. `ind`: the index of the signatory in the set. In this example our current node, Node 1, is `0` -2. `numsigners`: the number of pubkeys participating in the multi-signature transaction -3. `combined_pk`: the `combined_pk` address, retrieved previously -4. `pkhash`: the `pkhash` value, retrieved previously -5. `msg`: the `msg` to be signed, retrieved previously - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib session 18 '[0,2,"03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9","3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603"]' -``` - - - - - -Copy the value of `commitment` both to a secure location and to Node 2. - -##### Node 2 - -Execute the same command as before, only change the `ind` value from `0` to `1` to indicate Node 2. - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib session 18 '[1,2,"03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9","3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603"]' -``` - - - - - -Copy the `commitment` value both to a secure location and to Node 1. - -#### Step 7: commit - -##### Node 1 - -The `commit` method requires an array of arguments. The arguments are as follows: - -1. `pkhash`: the `pkhash` value, retrieved previously -2. `ind`: the index of the opposite node. In our example, Node 2 is `1` -3. `commitment`: the `commitment` value from the opposing node - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib commit 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"2854473733147ebdbf2fb70b956c8086c9d7659ca0093627fe0371098f8bc003"]' -``` - - - - - -Copy the `nonce` value both to a secure location and to Node 2. - -##### Node 2 - -Execute the same command as before, only change the value of `ind` to `0` to indicate Node 1. - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib commit 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",0,"a886a3a3c57efec161f6f72554b66f837de89ffdabe0acc46ae4cd59aab8129e"]' -``` - - - - - -Copy the `nonce` value both to a secure location and to Node 1. - -#### Step 8: nonce - -##### Node 1 - -The `nonce` method requires an array of arguments. The arguments are as follows: - -1. `pkhash`: the `pkhash` value, retrieved previously -2. `ind`: the index of the opposing node. In our example, the index of Node 2 is `1`. -3. `nonce`: the `nonce` from the opposing node - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib nonce 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"02402fe26abd7ed2cf22d872a6b22ced4309aac8ec273b9c89e0f8f5b77f1574db"]' -``` - - - - - -Copy the `partialsig` value both to a secure location and to Node 2. - -##### Node 2 - -Execute the same command, only change the `ind` value to `0` to indicate Node 1, and change the `nonce` to the value retrieved from Node 1. - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib nonce 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",0,"0379f6f42cf4c2cb30d064a6cac22ab6ffb3d93388d49b07f0623ff9bc8d191f89"]' -``` - - - - - -Copy the `partialsig` value both to a secure location and to Node 1. - -#### Step 9: partialsig - -##### Node 1 - -The `partialsig` method requires an array of arguments. The arguments are as follows: - -1. `pkhash`: the `pkhash` value, retrieved previously -2. `ind`: the index of the opposing node. In our example, the index of Node 2 is `1` -3. `partialsig`: the `partialsig` retrieved from the opposing node - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib partialsig 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"9e964dfd402f973ea1e9407e19918b1c3897ff6544d60dcdb19cfb0e5bc4c0c1"]' -``` - - - - - -Copy the `combinedsig` value both to a secure location and to Node 2. - -##### Node 2 - -Execute the same command, but change the `ind` value to `0` to indicate Node 1, and change the `partialsig` to the value retrieved from Node 1 previously. - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib partialsig 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",0,"dc913a9e7532c8edf2f822f482afdcf48c61919bf905fb77f6684a2d7e58d972"]' -``` - - - - - -Copy the `combinedsig` value to a secure location. - -If the values of `combinedsig` produced by both nodes is the same, then you have followed the example without any errors to this point. Visually verify that this `combinedsig` value matches with the `combinedsig` value returned on Node 1. - -#### Step 10: verify - -##### Node 1 - -The `verify` method requires an array of arguments. The arguments are as follows: - -1. `msg`: the `msg` value, retrieved previously -2. `combined_pk`: the `combined_pk` value, retrieved previously -3. `combinedsig`: the `combinedsig` value, retrieved previously - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib verify 18 '["3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603","03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' -``` - - - - - -##### Node 2 - -Execute the same command on Node 2. - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib verify 18 '["3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603","03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' -``` - - - - - -The response from both nodes should display a `"result": "success"` key pair. If this is not the case, you made an error in a previous step. - -#### Step 11: spend - -::: tip Note -Currently, each node will output different raw transaction values, as both nodes are attempting to spend funds to their own wallets. Of the two, the node that broadcasts its returned raw transaction value first will receive the coins. The other node does not need to create or broadcast a transaction value. -::: - -##### Node 1 - -We are now prepared to execute the `spend` method. - -The `spend` method requires an array of arguments. The arguments are as follows: - -1. `sendtxid`: the `sendtxid`, retrieved previously -2. `change_script`: the `change_script` value, retrieved previously -3. `combinedsig`: the `combinedsig` value, retrieved previously - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib spend 18 '["09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293","210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' -``` - - - - - -Copy the `hex` value to a secure location. - -##### Node 2 - -In this example, our desire is to receive the transferred coins on Node 1, not on Node 2. - -Therefore, it is not necessary to execute the `spend` method again, nor is it necessary for Node 2 to execute the following step. - -#### Step 12: sendrawtransaction - -##### Node 1 - -Broadcast the `hex` value using [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction): - -```bash -./komodo-cli -ac_name=MUSIG sendrawtransaction "0400008085202f890193c200495d92c09a3eb527a552c129bf3c991a29478356f92870e1b65ca4da09000000007b4c79a276a072a26ba067a5658021032d29d6545a2aafad795d9cf50912ecade549137163934dfb2895ebc0e211ce8a81401272d03e011f002a464aa75e8c3d093d45a2c4865b7b334998c8dc2fbaa814c17a2f34c9746d2921483b884d577b86465095ce64a4716b4b5d2f0b578860e149a100af03800112a10001ffffffff0200e1f5050000000023210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac0000000000000000686a4c6512792103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a404b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f200000000470800000000000000000000000000" -``` - -Once the broadcast transaction is mined and notarized, the MuSig transaction is complete. - -You have now successfully executed a full cycle of the MuSig module. - - diff --git a/docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.md b/docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.md deleted file mode 100644 index a5702630d..000000000 --- a/docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.md +++ /dev/null @@ -1,256 +0,0 @@ -# Overview of Antara Modules - Part I - -## Introduction - -Welcome to an Overview of Antara Modules - Part I. - -Part I of this discussion covers the basic aspects of Antara modules, without delving deeply into the technical aspects of the technology. - -The conversation should be attainable for a normal developer in the Komodo ecosystem, as well as for non-developers who otherwise possess experience in the blockchain industry. - -A later discussion, [Overview of Antara Modules - Part II](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.html), covers additional conceptual aspects of this technology. Part II is recommended for anyone who intends to utilize Antara technology in a development environment. - -## Smart Contracts on the Komodo Platform - -Komodo is built on the Bitcoin protocol, which features a simple programming language, called Bitcoin Script, that allows a developer to perform rudimentary scripting tasks. - -Traditionally, Bitcoin Script is considered to be incapable of supporting the complex "smart contracts" found on other blockchain platforms. This limitation is mostly from the fact that Bitcoin Script is (intentionally) not Turing complete. - -Now, the capabilities of extending Bitcoin Script into a competitive, and arguably stronger, method for creating smart-contract-like modules is changing through Komodo's Antara Framework. This framework integrates a broader technology, called CryptoConditions, which allows for complex utxo-based logic. - -As is often the case, Komodo Platform is leading the blockchain industry in this brand new technology. This section will explain Antara's implementation of CryptoConditions, how it works, and how utxo-based smart contracts will dramatically alter the blockchain landscape. - -## A Brief Review of Bitcoin Script - -The very first block in the Bitcoin blockchain was mined on or around January 3, 2009. Since then, this revolutionary technology has exploded, forever changing the way we think of money and currency. We owe many of these developments to Satoshi Nakamoto and his original Bitcoin-core code. - -The Bitcoin-core code itself is written in C++. A time-tested and well-known programming language, C++ is Turing complete and can therefore do all that any other Turing complete programming language can do. - -However, Bitcoin transactions are not executed with C++. Instead, transactions are carried out with a special protocol called Bitcoin Script. This scripting language has a number of "opcodes", or commands, that tell nodes how to deal with any specific transaction request. - -While most computer programming languages are considered Turing complete, Bitcoin Script is not. It’s widely accepted that this was an intentional decision. But before we can discuss the relative merits of making a programming language Turing complete, let’s take a moment to understand what exactly "Turing complete" means. - -## Turing Completeness - -In 1936, a British computer scientist and mathematician named Alan Turing published an academic paper called “On Computable Numbers, with an Application to the Entscheidungsproblem.” It is a seminal essay in the fields of computer science and computational theory. - -In the essay, Turing describes a hypothetical machine that, when granted a few basic assumptions, can theoretically “compute any computable sequence.” This basically means it can solve any mathematical problem that uses only computable numbers. According to Turing’s definition, “a number is computable if its decimal can be written down by a machine.” - -Turing called this device a “universal machine” but it is now better known as a “Turing machine.” - -Turing machines are generally described in this way: Imagine a simple device that can read and write numbers. This device also has the ability to store data. (Turing assumes that the device has an infinitely large storage capacity, but this is not essential to understanding the concept of Turing completeness.) - -Now, imagine that this simple machine moves from left to right along a thin, infinitely long piece of tape. It reads a number, decides what to do based on a series of instructions to which it is bound, and then executes the instructions accordingly. - -In simply reading numbers, executing commands, and writing numbers, this simple machine can solve any computational sequence. It may take an arbitrarily long period of time but, theoretically, the machine would eventually solve the problem. - -So what does all of this actually mean? Why is it important? - -The idea of something being “Turing complete” is derived from this idea of a Turing machine. While we know that no machine has an infinitely large memory, we can use the basic theoretical framework to decide whether or not a machine can solve any computable sequence. - -It is in this sense that computer languages are said to be Turing complete. A language is Turing complete if it can solve any mathematical problem made up of computable numbers. - -As we noted above, Bitcoin Script is not Turing complete. This means that there are some problems and sequences that Bitcoin Script is not capable of solving. - -## Gas-based Smart Contract Platforms - -This is where the gas-based smart contract platforms of Ethereum, EOS, NEO, and many other blockchain platforms enter the picture. We will focus on Ethereum, as it is the originator of this model, and it is currently the most popular. - -In December 2013, Vitalik Buterin released [Ethereum’s first white paper.](https://github.com/ethereum/wiki/wiki/White-Paper) One of the major contributions Ethereum offered was a Turing complete programming language, called Solidity, that can be used to write smart contracts. - -In fact, Buterin makes this perfectly clear on the first page of the white paper: - -“What Ethereum intends to provide is a blockchain with a built-in fully fledged Turing-complete programming language that can be used to create 'contracts' that can be used to encode arbitrary state transition functions, allowing users to create any of the systems described above, as well as many others that we have not yet imagined, simply by writing up the logic in a few lines of code.” - -In many ways, Ethereum's 'smart-contract' language is an improvement over Bitcoin Script. It allows “systems which automatically move digital assets according to arbitrary pre-specified rules”, and this opened up a new world of possibilities for blockchain technology. - -At the same time, Turing completeness creates a few vulnerabilities. Let’s discuss. - -## Pros and Cons of Turing Completeness - -Any Turing complete programming language has the ability to create “loops.” A loop just means that a certain operation or set of commands can be written once but commanded to execute an arbitrary number of times. - -In a language that is not Turing complete, like Bitcoin Script, loops are not available. A programmer needs to copy and paste the same piece of code `X` number of times when he wants a computer to execute the operation `X` times. - -While loops are beneficial in some ways, they also present vulnerabilities. A programmer may accidentally write an infinite loop into a smart contract, unnecessarily burdening the network with an infinite number of meaningless operations to perform. - -If malicious spammers want to attack an unprepared network that runs on a Turing-complete language, they can unleash a great number of smart contracts each bearing infinite loops. These pointless, endless operations can cause crippling congestion. - -To avoid this possibility, Buterin introduced the idea of “gas” to the Ethereum network. - -## Gas: A Way to Avoid Infinite Loops - -In short, users must pay a fee for every single operation that they want the network’s nodes to perform. These fees are simply called “gas.” Gas prices discourage malicious actors from spamming the network. It also encourages developers to write efficient contracts that require as few processes as possible. - -Moreover, gas prevents an accidental infinite loop from wreaking havoc on the network, because once all the gas is used up, the network stops processing the contract. The loop runs out of gas and the nodes stop executing the loop. - -An important benefit the gas-based platform brought to the world is that it broke the barrier for allowing developers to decentralize software execution in a p2p environment. - -For example, in a non-decentralized p2p software application, users typically must rely on a centralized server or other impersonal third-party to maintain sanity in the execution of software instructions. Decentralized applications allow users to interact with software while relying not on a centralized server, but on the decentralized blockchain. - -## The Problem with the Gas-based Model - -While the concept of gas is a clever innovation, it also makes complex applications prohibitively expensive, and it hinders innovation and audience growth. - -If a particular contract or dApp needs the network to perform a large number of operations to function as designed, it costs too much money to keep it running. - -Take these two competing statements from Buterin by way of illustration. In January of 2014 he said, “...Our goal is to provide a platform for decentralized applications – an android of the cryptocurrency world, where all efforts can share a common set of APIs, trustless interactions and no compromises.” [But later, in July 2018, Buterin had this to say:](https://www.coindesk.com/vitalik-ethereum-app-builders-screwed-scaling-limits/) “If you want to build a decentralized Uber and Lyft on top of an unscalable Ethereum, you are screwed. Full stop.” - -The "Uber" reference is to a popular phone app where users can hail and share a freelance-taxi service. On average, this app processes 12 financial transactions per second. At the time of Buterin's statement, Ethereum can process 15 transactions per second. Let's make a rough analysis of the cost to maintain this one dApp on Ethereum. - -The value of the gas fees for an Uber-like decentralized app would have to cover ~80% of the cost of maintaining the Ethereum blockchain (`(12 txs / 15 txs) * 100 = 80%`). Today (cr. 2018-2019), it costs about [\$150,000 USD per hour](http://www.crypto51.app/) to maintain the Ethereum hash rate. The dApp developer and their end-users would be responsible for 80% of this, so they would have to pay gas fees of at least $120,000 per hour, which translates to ~$30 per second. - -Therefore, looking only at the costs, and not at the lack of space for multiple dApps, we begin to see the enormous flaws of the gas-based model. While existing large corporations and their customer bases may be able to afford this financial burn rate, it is difficult to conceive of a startup that can afford it. The ongoing gas fees to continually maintain the functionality of this dApp are simply too expensive. - -All this is assuming that the dApp only processes one transaction per ride, per customer. If the dApp is instead a game that has a looping function, the gas fees can grow even more absurd. - -Furthermore, all dApps on the Ethereum platform have to share the same gas, and the same blockchain, and this compounds the problem. If an existing business running a dApp on the platform becomes suddenly popular, the surge of people wanting to use the dApp must purchase gas, and this causes the price of gas to rapidly rise. The burst of activity can also cause the blockchain to grind to a halt. - -While the spike in the price of gas can be advantageous for financial speculation, the spike is arguably terrible for many necessary blockchain use cases. For example, a startup business that wants to serve a new customer base using the same gas-based platform must now convince their potential customers to purchase the platform's gas at an unpredictably high price. - -Until blockchain technology is capable of processing potentially billions, if not trillions, of transactions per second on a single blockchain, the gas-based blockchain platform is fundamentally flawed for today's market. The more popular a gas-based platform becomes, the more difficult, expensive, and prohibitive it is for businesses to develop on it, and for users to buy into it. - -Having observed crucial flaws in the currently popular gas-based smart-contract platform, we are now prepared to turn to the smart-contract solution Komodo proposes. - -## Introducing Antara Modules - -Recall that Satoshi Nakamoto's Bitcoin Script is not Turing complete. This choice was deliberate. Leaving Bitcoin Script in a simple form was a quicker, safer alternative to a Turing complete language. This is true because it removes the possibility of infinite loops clogging the Bitcoin network. - -However, at the same time, the lack of Turing completeness also prevented smart-contract like functionality on Bitcoin-protocol based blockchains — until now. - -Komodo now offers Antara Modules. These modules allow for the same functionalities found in smart contracts, and even more advanced features. This new technology is compatible with Bitcoin-protocol based blockchains, and this includes all Komodo Smart Chains. - -Furthermore, Antara Modules gain more usefulness when combined with Komodo's unique design. Recall that Komodo is built not to require all developers and users to function on the main Komodo blockchain. Rather, Komodo empowers developers with their own independent blockchain, each secured with the hash rate of Bitcoin. This facilitates an interconnected network between all Smart Chains through Komodo's other technologies, such as atomic-swaps, cross-chain syncing, and more. - -This combination of Komodo technologies overcomes the challenges of the currently popular, gas-based, single-blockchain platforms. - -With Antara Modules, the developer can maintain interactivity with the Komodo ecosystem, while also being able to run on a private blockchain. Because the developer has the full blockchain all to themselves, they are able to safely occupy the full transaction capacity without fear of interruption by activity elsewhere in the ecosystem. Developers of highly active blockchains can even split their single blockchain into multiple blockchains, using the Antara framework. - -Likewise, end-users of a blockchain service in the Komodo ecosystem need only purchase the currency of the developer's Smart Chain; there is no need to purchase KMD. Therefore, for the end-user, the price of participating in the developer's business is tied only to the design and success of the developer's blockchain software, and not to the unpredictability of the ecosystem at large. - -In short, if you want to use blockchain technology to compete with the Uber taxi app, Komodo is the platform for you. - -## Antara Modules are Based on Utxo Technology - -Antara Modules function in a completely different manner from the popular gas-based model of other platforms. Before we can explain how Antara Modules work, we must first briefly explain the concept of an "unspent transaction", also called a "utxo," for short. Utxos are integral to a blockchain's functionality, but many users do not know they exist. - -A utxo is simply a bill of value sitting in your digital wallet — much like the many small fiat dollar bills you may have sitting in your physical wallet. The collection of utxos in your digital wallet make up the total balance. - -For example, a user could have in their digital wallet a utxo worth 1 KMD, another utxo worth 2 KMD, and another worth 7 KMD. Altogether, in the software interface the user would see that they have 10 KMD total. Most users would never know that they actually have three separate utxos that make up the full balance, as utxos are typically managed automatically by blockchain software. - -When the user spends money, the blockchain software automatically splits the money they spend into new utxos. If our user desires to spend 6 KMD, the software splits the 7 KMD utxo into two pieces: a 6 KMD utxo is sent to the destination address, as the user instructed, and the remaining 1 KMD is returned to the user as "change." - -The user now has a 1 KMD utxo, a 2 KMD utxo, and another 1 KMD utxo. The total that they see in their wallet is 4 KMD. - -## Antara Modules: Utxo-based Smart Contracts - -Coming to this from a programmer's perspective, a utxo is a programmable object. As with many objects, it allows software to add and subtract properties from it, including properties that allow for Turing-complete programming. In Komodo, utxos allow us to create a smart-contract functionality that is dramatically cheaper to utilize, and more secure in practice; than the gas-based models of other platforms. - -In its simplest form, an Antara Module locks a utxo in a publicly-known address and prevents it from being spent until a certain set of conditions are met. Once the conditions are fulfilled, the utxo is unlocked and sent to the appropriate address. The idea behind it really is that simple. - -It is fundamentally different than the gas-based model. In the gas-based model, a user has a total balance and they instruct their blockchain software to execute a smart-contract either until the contract is complete, or their total balance is gone. - -With Komodo's Antara Modules, a user locks a series of utxos in a contract with a set of instructions that must be met before the utxo can be sent to its final destination. - -This is a dramatically more secure setup. Only the utxos that have been indicated as belonging to an instance of an Antara Module can be spent. This is different from the gas-based model, where a bug in the software can (and frequently does) allow a faulty smart contract to drain the full balance of a wallet. - -Before diving any deeper into Antara Modules, we need to understand a few things about Bitcoin Scripts. - -## How Antara Modules Interact with Bitcoin Script - -There are several different ways to execute a Bitcoin payment. In particular, there are pay-to-pubkey payments, pay-to-pubkey-hash payments, and pay-to-script-hash payments. These three payment types represent the overwhelming majority of Bitcoin transactions, and each type of payment is limited in the possibilities it allows to the user and the developer. - -Now, Komodo has implemented an additional type of payment script that designates a utxo as belonging to a specific instance of an Antara Module. In other words, this new payment script puts constraints on the utxo. The name of this new script is called a "CryptoCondition," and we explore the specifications of this script in later articles. - -#### Antara Modules Maintain Scarcity Within the Module - -Every Antara Module has its own unique code, called an "EVAL" code, and this keeps funds in one module separate from another, and separate from the main Smart Chain's coins. - -When a user spends funds in a manner that links a utxo with an Antara Module, the utxo is locked to this EVAL code in the utxo-data structure. - -This keeps the utxo associated with the Antara Module, and thus the utxo is not free to enter into another Antara Module unless the current module allows this behavior. - -#### A User Has a Unique Address for Each Antara Module -For each Antara Module, the user has a unique address that can only be used with funds created as a part of this module. This keeps funds that are created within an Antara Module separate from funds that are created in other Antara Modules. In this manner, there is never any confusion about where funds are sent. - -#### Each Module Has a Global Address - -Each Antara Module also has a global address that is known and usable by everyone. Even the private key to this address is public. - -Making the private key public allows users to interact with the module using lite-mode software (i.e. syncing the blockchain is not required). Also, the global address serves as a repository of information for all users within the module. - -The global address allows all users to query the state of the module and discover current and past behavior. - -#### Developers Set the Rules for Each Module-Related Transaction - -At the same time, the funds within this module cannot be moved until all the conditions of the module are satisfied. - -For example, the module can require that funds only be spent to a specific and approved address, as set in advance by a group of collaborating users. This is similar to the Bitcoin Lightning Network's intended effect, yet dramatically simpler in design. - -With these rules in place, an Antara Module effectively becomes a miniature consensus mechanism. The module forces consensus for its participants, just like the master consensus mechanism of the Smart Chain. - -Now let's take a closer look at the many advantages of Antara Modules. - -## Advantages Of Antara Modules - -#### Access to Established and Turing Complete Languages - -Antara Modules are hard-coded into the Komodo code base, which means they can be written in C and C++. They can also be written in any compiled programming language that can create a linkable library capable of calling and being called by C/C++ functions. In that sense, Komodo’s utxo-based contracts are language agnostic. - -The C and C++ programming languages are widely understood, time-tested, and, perhaps most importantly, Turing complete. Thus, utxo-based smart contracts can be programmed to do anything that any other existing program or application is able to do. - -#### No Need for a Virtual Machine - -Because Antara Modules on Komodo run in the daemon, developers can avoid the limitations and hassles of having to run code in a virtual machine, as is the case with the many gas-based smart contract platforms. On Komodo, you have far more speed, flexibility, and power. This is made possible by our unique design of connecting independent blockchains together, rather than forcing all users to run on a layer-one main chain. - -#### Utxos are More Secure Than Balance-Based Programming - -Utxo-based modules are more secure than balance-based smart contracts. This is true in several ways. For example, because Komodo’s modules are utxo-based, it is far more difficult, if not impossible, to use a module to flood the main chain's coin supply with illegitimate coins. - -This is not the case with balance-based smart contracts. Because the smart contracts are linked to balances, rather than blockchain-enforced utxos, a malicious actor can manipulate balances to disastrous ends. We have seen this happen again and again and again. - -#### RPCs Make Module Consumption Easy - -Utxo-based smart contracts are also essentially an extension of the Bitcoin protocol, so a series of Remote Procedure Calls (RPCs) can be established. With an RPC, a normal developer can bring the functionality of an existing Antara Module into a foreign software environment with a simple command. - -With many Antara Modules, a Graphic User Interface (GUI) can allow non-technical users to make use of the technology without needing to work through the command line. Eventually, once a large variety of RPC calls are available, a normal developer should be able to build decentralized software using RPC calls alone. - -#### Instantaneous Confirmation - -A challenge that many developers face in the blockchain industry is the aspect of creating software that must wait for decentralized consensus before the software's users can assume finality. - -Antara Modules allow the developer to overcome this challenge. Antara Modules allow for zero-confirmation micro-payments. These micro-payments are secured by Komodo’s delayed Proof of Work security mechanism. The payments are fully peer-to-peer, and are considered confirmed as soon as they are initiated. - -#### No Need for Gas - -Antara Modules do not require a shared “gas” coin for every process executed. Recall that the smart contracts and dApps built on Ethereum must pay in Ethereum's ecosystem-wide gas (Ether) for every single step of progress. The tremendous expense placed on common users and developers makes complex blockchain-based software nigh impossible. - -Komodo, on the other hand, is far more scalable as the cost of blockchain processing is tied only to an individual Smart Chain's native coin, and not to the main Komodo coin (KMD) that ties the ecosystem together. - -## Difficult to Create, but Easy to Reuse - -Creating a new Antara Module is more difficult than creating a new smart contract on a gas-based platform. However, the functionality of a module need only be programmed once, and then other users in the Komodo ecosystem can reuse the finished module. - -Building and designing a new Antara Module requires a strong proficiency in blockchain technology and in advanced programming techniques. The module must be stable and secure enough to withstand the pressure of the wild-open Internet. - -However, once created, other users may rely on the module's RPC commands to utilize the module's functionality without having to understand how the module functions. - -For example, consider how the MuSig Antara Module serves non-blockchain developers. This module relies on Antara to enable a complicated technology called Schnorr Signatures, which are a new method for creating multi-signature blockchain transactions. The RPC's for this module allow any developer of essentially any skill level to adopt the MuSig functionality into the developer's software without having to gain an in-depth understanding of Schnorr technology. - -[See the MuSig module documentation here](../../../basic-docs/antara/antara-api/musig.html#introduction) - -As the library of available modules grows, so too do the advantages to the many types of developers in the Komodo ecosystem. For this reason, members of the Komodo community express gratitude to the more experienced blockchain developers who build and share Antara Modules via open-source ideology. - -## Komodo is Developing and Testing Default Modules - -The Komodo team has already created many Antara Modules that are freely available for all developers in the Komodo ecosystem. The team is also exhaustively testing the Antara Modules' code prior to implementation, to ensure a quality and bug-free environment. - -Once complete, the modules are embedded into the default source code of a Komodo Smart Chain. This technology is provided using open-source philosophy, and thus anyone can verify the code of the modules. - -If you would like to have an Antara Module available that is not already in the code base, submit a Pull Request to the Komodo repository on Github with the details of your desired module. If accepted, Komodo will write the module and make it available to all users during our next hard fork. This occurs on an annual or semi-annual basis. - -To our knowledge, no other blockchain project has successfully implemented utxo-based contracts on a live chain. Considering atomic swaps, on-demand scalability, cross-chain interoperability syncing, and utxo-based modules, the Komodo team continues to develop technologies at the bleeding edge of the blockchain industry. - -Join us for Part II of this discussion. Part II delves a little deeper into the methods of Antara Module functionality, and continues preparing the developer for Antara Module utilization. - -[Link to Part II of an Overview of Antara Modules](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.html) diff --git a/docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.md b/docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.md deleted file mode 100644 index 9c8477539..000000000 --- a/docs/basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.md +++ /dev/null @@ -1,115 +0,0 @@ -# Overview of Antara Modules - Part II - -## Introduction - -Welcome to an Overview of Antara Modules - Part II. - -The following content is provided for developers desiring to discover deeper levels of potential in Komodo software. The content covers technical aspects of Antara Modules that are not necessary for a common user to understand. Learning this content can help any developer in the Komodo ecosystem utilize or create new Antara Modules. - -#### Assumptions for this Content - -This discussion is intended for developers who feel confident in at least one mainstream programming language, and who understand the core concepts of blockchain and Komodo technology. - -Other readers, such as business or marketing developers, may also find the content useful, although some topics may be difficult to understand. We invite any interested reader to reach out to our team on [Discord](https://komodoplatform.com/discord) with questions. - -Consider reading the following resources, if necessary. - -- [Overview of Antara Modules - Part I](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.html) -- [Core Technology Discussions](../../../basic-docs/start-here/core-technology-discussions/introduction.html) -- [Mastering Bitcoin](https://github.com/bitcoinbook/bitcoinbook) - -#### Before We Begin: A Brief Note for Normal Developers - -Creating a new Antara Module is challenging. Fortunately, not every developer in the Komodo ecosystem is expected to program new modules from scratch. Rather, Komodo anticipates that many developers will consume existing modules without attempting to create new modules. - -Each module built on the Antara framework can be designed to have Remote Procedure Calls (RPC's) that can be called quickly and easily from other software and programming languages. - -A good example can be seen in the MuSig module. This module uses the Antara framework to enable a complicated and useful technology called Schnorr Signatures. The RPC's for this module allow any developer of essentially any skill level to adopt MuSig functionality into their software without having to gain an in-depth understanding of Schnorr technology. - -[See the MuSig module documentation here](../../../basic-docs/antara/antara-api/musig.html#introduction) - -As the library of available modules grows, so too do the advantages to the many types of developers in the Komodo ecosystem. - -## Understanding the Problem that Antara Modules Solve - -Antara is Komodo's technology framework that developers use while creating decentralized software. Antara Modules are but one aspect of the wider Antara framework. The modules are a crucial element of the framework, as they allow any capable developer to directly add arbitrary code into the Smart Chain itself. - -The reader may better understand the purpose and use case of Antara Modules by first understanding the key problem that they solve. - -#### A Consensus Mechanism Is Not Easy to Create or Change - -Adding new code into a blockchain's consensus mechanism (CM) is a challenging task. Creating an entirely new CM is more difficult by an order of magnitude. Yet, despite these facts, often when an experienced developer first approaches blockchain technology with creative intent, their initial impulse is to dive directly into the CM itself. As time passes, the developer can come to a realization that they are attempting to solve a problem that is too large for any one person. - -Consider the Bitcoin consensus mechanism. This protocol is approximately ten years old and receives perhaps more attention than all other blockchain protocols combined. Every year, thousands upon thousands of the world's most intelligent developers, mathematicians, and cryptographers pore over the intricacies of this profitable technology. Yet, despite this valuable insight, mistakes in the code continue to reveal themselves: in 2018, the Bitcoin Core and Bitcoin Cash teams together [discovered a flaw in the code](https://www.coindesk.com/the-latest-bitcoin-bug-was-so-bad-developers-kept-its-full-details-a-secret) that would have allowed a malicious user to print an arbitrary number of new Bitcoins. - - - -Mistakes in the code of a CM can cause economic instability, and volatility of this nature can wreak havoc on the lives of the CM's users. For this reason, seasoned blockchain engineers often avoid changing the CM altogether, once it is relatively stable. - -For those few projects that create a useful and unique consensus mechanism, a new challenge immediately presents itself. If the CM relies on a Proof of Work type model, the project team must attract a sufficient number of miners. If the CM is more akin to Proof of Stake, the team must ensure the blockchain's total stake is distributed in a manner that ensures trustlessness. Neither of these tasks are easy to achieve. - -In light of these challenges, the blockchain engineer finds themselves confronted with a paradox. The engineer desires to create something new, and at the same time, they cannot easily change the core software. - -#### A Popular, But Flawed Solution: The Decentralized Virtual Machine - -A popular solution to this paradox is to associate the consensus mechanism (CM) with a virtual machine (VM). This method was made popular by the Ethereum project. - -In this model, the CM's design can be similar to existing and stable CM's, but it has one difference. The CM listens to instructions given by an external VM that is decentralized across all validating nodes. While code inside the VM can be arbitrary, the CM does not listen to the code's execution. Instead, the CM only listens to the same data as before: the history of transactions and associated meta data. - -This solution is more effective than writing an entirely new CM, yet the solution is limited. The limitations include: the requirement of working in the mandatory VM programming language, such as Solidity; an excessive dependency on the core-software development team; volatile economics, and a lack of blockchain processing and storage capacity. - -The requirement of the limited programming language derives from security concerns. All validating nodes in the decentralized VM must run all blockchain-related code in the ecosystem. Having this code written in a unique language designed for the VM reduces the available opportunities to malicious actors. While the limitation provides baseline security, the customized and often unstable nature of the VM programming language can make the creative process difficult. Also, the need to master a new language adds an additional burden to the developer. - -The dependency on the blockchain's core engineers also slows creative progress for ecosystem developers. When the ecosystem developer discovers a new core-level technology that would increase the developer's productivity and creativity, they must convince the main chain's core-software team to implement the new feature. The core-software engineers, however, may have conflicting interests, as their decisions must meet the needs of all developers and users in their ecosystem. - -In many of the VM-based models, economics for blockchain usage can be volatile. The underlying "gas" token that the VM requires (such as Ether) can change in price and value according to the interests of the uneducated masses. This may sound advantageous to a speculator, but a practical business will find that the volatility scares away new users. - -The fact that the VM frequently relies on a single blockchain further hinders developers and users. Block space can be in short supply due to high demand on popular chains. Furthermore, data that is entirely irrelevant to the developer can become required baggage. - -These challenges make the VM model unpleasant for many experienced blockchain engineers. In fact, before Komodo existed, these very concerns inspired the Komodo engineers to avoid the VM model in search of a better solution. - -Antara Modules provide this solution through Komodo's integration of a technology called CryptoConditions. - -## CryptoConditions: An Industry-Wide Standard - -CryptoConditions is a technology that allows for arbitrary logical conditions and fulfillments to be evaluated as a part of consensus. This allows for a Smart Chain's consensus mechanism to evaluate the results of arbitrary code and update state in the blockchain's data in a decentralized and secure fashion. - -CryptoConditions technology is not a new concept. The [Interledger](https://interledger.org/) team originally proposed this technology in 2016. - -The [original proposal](https://tools.ietf.org/html/draft-thomas-crypto-conditions-01) was that it would be an open-source industry-wide standard format. The Interledger team does not seem to have continued exploring the technology beyond the original proposal. - -Komodo, on the other hand, found the CryptoConditions concept to be intriguing. In 2018, Komodo adopted this open-source technology into the suite of offerings in our Antara framework. - -Our implementation uses many of the key ideas put forth by the Interledger team, and at the same time we depart in several significant ways. Those who are curious for specific details on this topic can explore the open-source code in the respective repositories. - -The important takeaway is that Antara Modules rely on a core technology called, CryptoConditions (CC). This technology allows a developer to add arbitrary logical conditions and fulfillment to their Smart Chain, and to rely on the consensus mechanism to ensure state integrity in a decentralized environment. - -## Creativity at the Consensus Level, Without Losing the Consensus Mechanism - -Antara Modules and CryptoConditions together allow a developer to add arbitrary code at the consensus level, and within the core software's daemon, without interfering with the existing consensus mechanism (CM). This grants the developer the ability to add core-level features and innovations without waiting for the approval of other members of the Komodo ecosystem. Combined with Komodo's Bitcoin-hash rate security, the simplicity of Antara Modules provides the developer with a competitive level of creative freedom. - -The entry point between Antara Modules and the CM is a new Bitcoin-script [operation code](https://bitcoin.org/en/glossary/op-code), "OP_CHECKCRYPTOCONDITIONS", or OP_CCC for short. When executed, OP_CCC is able to initiate additional arbitrary code that is written in any programming language, assuming the language can call and execute C/C++ code in return. The arbitrary code is separate from the CM, thus maintaining the CM's reliability. When the arbitrary code completes, OP_CCC returns a `true` or `false` statement to the daemon. If the returned OP_CCC value is `true`, the daemon performs a transaction. - -The transaction can contain meta data in the normal manner. Therefore, these transactions can also implement other data-storage features of Komodo software. Examples include the [key-value storage](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#kvupdate) feature, the [Oracles Antara Module](../../../basic-docs/antara/antara-api/oracles.html#introduction), or the native `vout` and `batontxid` key-value pairs. - -With access to the meta data established, Antara Modules are able to act as an application-state manager. State-related data is held in utxos that are accessible to the CM. As application-state management is based on the utxo model, the management also follows the CM's rules for consensus. This powerful combination allows the developer to collect, organize, and act upon data in a securely decentralized manner. - -In addition, once the data is notarized, it can also be called by other Komodo-based Smart Chains, depending on the manner in which the developer(s) form their chain. This allows developers to form clusters of blockchains to enhance their software, as opposed to relying on a single blockchain, or on a single child chain. The speed and data-storage capabilities of a cluster are thus exponentially greater than the offerings of many VM-based competitors. - -Also of note is the simplicity of the Antara Module architecture. All new code created for an individual Antara Module is contained in an optional library. Modules from the library are included in compilation only on participating blockchains. In this manner, developers who desire a module's functionality can include the necessary libraries, and those who do not require the module can avoid this excess baggage. - -The Komodo daemon has no need of an external VM. This eliminates what would otherwise be a cumbersome requirement for the developer and the core engineers. At the same time, the daemon offers all the capabilities of a VM-based blockchain — ⁠and arguably more. - -## Antara Modules In Action: Accomplishing Years' Worth of Work In But A Weekend - -Examples of the power of Antara Modules can be found by observing existing modules. Consider how Antara allowed the Komodo ecosystem to swiftly and easily upgrade the Komodo consensus mechanism (CM) to include quantum-proofing capabilities. - -In years past, other blockchain projects in the cryptocurrency community had focused on manually upgrading their CM for quantum-proofing protection. Although this feature appeared to be an advantage, this was not true. Adding customized code to the CM itself to protect addresses from quantum-capable computers was a time-consuming and expensive process. - -Paradoxically, once the new quantum-proof CM was achieved, it only served to isolate the project team. The code itself was untested and unreliable, and the users of the cryptocurrency community had to endure these roadblocks. Furthermore, the customized CM was often incompatible with much of the activity in the open-source blockchain ecosystem; for each industry-wide technological advancement, the team often had to adapt their customized CM on their own. - -Komodo's engineers chose not to spend energy building a new quantum-proof CM, but rather they worked to add Antara Modules first. Once this technology was available, the Komodo core software team took existing quantum-proofing technology, read summaries published by academics and researchers, and created a new Antara Module to add quantum-proofing functionality to the Komodo CM. - -The time between project initiation and releasing a beta version for community testing was approximately one weekend. Only one core developer's attention was required. The Komodo daemon remains compatible with all other software features as before, able to quickly adopt new ideas from others in the open-source community as soon as they arrive. At the same time, users who desire quantum proofing for their long-term financial interests have a module readily available, and users who are not interested have not experienced an interruption in their blockchain services. - -The ability to adopt the ideas of others quickly, while maintaining the accomplishments, security, and compatibilities of one's predecessors, makes Antara Modules a wise choice for experienced developers who wish to have the most advanced technology available without a significant hassle. diff --git a/docs/basic-docs/antara/antara-tutorials/pegs-module-creator-tutorial.md b/docs/basic-docs/antara/antara-tutorials/pegs-module-creator-tutorial.md deleted file mode 100644 index 0fcb36da5..000000000 --- a/docs/basic-docs/antara/antara-tutorials/pegs-module-creator-tutorial.md +++ /dev/null @@ -1,495 +0,0 @@ -# Pegs Module Creator Tutorial - -::: tip - -The Pegs Module is in the final stages of production. - -The following tutorial is currently only compatible with computer-hardware setups that are running Linux OS's Ubuntu/Debian-based distributions. - -For questions and assistance, please reach out to the Komodo team using the `#cc-pegs` channel on the [Komodo Discord](https://komodoplatform.com/discord) live-chat server. Thank you. - -::: - -## Tutorial Overview - -This tutorial assists the reader in discovering the process of creating a new Smart Chain with an active stablecoin using the [Pegs Antara Module.](./pegs.html) - -#### Tutorial Outline - -- Launch a new test Smart Chain (`CREATORUSDK`) to activate the Pegs Module -- Peg the test chain's coins to `USD` and create a pathway for users to back the stablecoin with `KMD` -- Create tokens to represent the `KMD` coins -- Create an oracle, register as a publisher, and subscribe to it -- Create a gateway and bind the previously created token and oracle to it -- Start the `oraclefeed` software to bring the `blockheader` data from the `KMD` chain to the `CREATORUSDK` chain through the oracle -- Create a peg by attaching the gateway to it - -Upon completion of this tutorial, the reader may follow the [user tutorial](./pegs-module-user-tutorial.html) and use the Smart Chain created here to discover the possibilities of the Pegs Module. - -## Installation - -::: warning - -The following installation procedure creates a version of the Komodo software daemon that should not be used for any purpose other than testing. Several of the customizations active on this particular version of the daemon are intended for testing purposes only. - -::: - -#### Dependencies - -Execute the following commands to install the necessary dependencies. - -```bash -sudo apt-get update && sudo apt-get upgrade -y -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl clang libcurl4-gnutls-dev cmake clang libsodium-dev -y -``` - -#### Create a Swap Partition (Optional) - -For tutorial users using a VPS with a low amount of RAM, create a swap partition. - -On the VPS, execute the following commands to create a 4GB SWAP file. (If sufficient space is available, consider creating an 8GB swap file instead, as this can facilitate better software performance.) - -```bash -sudo swapon --show -free -h -df -h -sudo fallocate -l 4G /swapfile -ls -lh /swapfile -sudo chmod 600 /swapfile -ls -lh /swapfile -sudo mkswap /swapfile -sudo swapon /swapfile -sudo swapon --show -free -h -sudo cp /etc/fstab /etc/fstab.bak -echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab -sudo sysctl vm.swappiness=10 # This setting will persist until the next reboot. We can set this value automatically at restart by adding the line to our /etc/sysctl.conf file: -sudo nano /etc/sysctl.conf -vm.swappiness=10 -``` - -## Build the Komodo daemon - -Execute the following commands to build the Komodo daemon. - -```bash -git clone https://github.com/Mixa84/komodo -cd komodo -git checkout pegsCC -export CONFIGURE_FLAGS='CPPFLAGS=-DTESTMODE' # Tweaks some settings to make it easy for testing -./zcutil/fetch-params.sh -./zcutil/build.sh -j$(nproc) -cd src -``` - -This tutorial requires that the tutorial reader compile the Komodo daemon from source code. For more instructions, please see the [installation section](#installation) .If you have access to two VPS, follow [this guide](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html). If you want to launch this Smart Chain in your Personal Computer or using a single VPS, follow [this guide](../../../basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.html) - -#### Obtain a pubkey - -Recall also that a user must have a `pubkey` enabled when interacting with an Antara-related Smart Chain. [View this linked material for an explanation.](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) - -## Launch the Test Smart Chain - -The command below creates and launches a new Smart Chain. - -The following list explains a few of the Smart Chain customizations that are necessary and desirable for a Smart Chain designed for testing purposes. - - - `-ac_name=CREATORUSDK` — the name of this Smart Chain is set to `CREATORUSDK` - - `-ac_import=PEGSCC` — the key customization that activated the Pegs Antara Module on the new Smart Chain - - `-ac_end=1` — sets the mining block reward to zero (after the first block) - - `-debug` — a debug parameter that instructs the daemon to track various information for console output - - `-printoconsole` — instructs the daemon to print the information from the `debug` parameter to the console - - `-ac_supply=1000000` — the amount of intial coin supply for the chain (an arbitrary amount here that includes enough coin to manage testing purposes of the chain) - -Consult the [Antara Customizations](../../../basic-docs/antara/antara-setup/antara-customizations.html) documentation for explanations of the other parameters in the command. - -```bash -./komodod -ac_supply=1000000 -ac_reward=10000 -ac_name=CREATORUSDK -ac_cc=2 -ac_import=PEGSCC -ac_end=1 -ac_perc=0 -ac_cbopret=5 -debug=pegscc-2 -debug=importcoin -debug=cctokens -debug=gatewayscc -printtoconsole=1 -``` - -## Create a Token to Represent KMD Coins - -To create tokens that are capable of representing `KMD` (although the tokens are not yet tied to actual `KMD`), execute the following command on the test chain. - -```bash -./komodo-cli -ac_name=CREATORUSDK tokencreate KMD 100000 "KMD_BTC,BTC_USD,*,1" -``` - -This creates a total of `100000 * 10^8` tokens named `KMD` on the `CREATORUSDK` chain. Each token is capable of representing a single satoshi of the external coin `KMD`. - -All the tokens combined allow up to `100000` `KMD` coins on the `CREATORUSDK` chain. - -The description of the token, `"KMD_BTC,BTC_USD,*,1"` specifies the synthetic price to be used by a peg (not yet created). - -`"KMD_BTC,BTC_USD,*,1"` means `(KMD/BTC) * (BTC/USD) * 1`. This simplifies to `KMD/USD`, which provides an exchange price between the two currencies. This provides the necessary information to peg the `CREATORUSDK` stablecoin to `USD` and to back the coin using `KMD`. - -The command returns a hex value as a response. - -```json -{ - "result": "success", - "hex": "0100000001c05c55f5183a412750a912579bf5f915a261b68d51b2ce5e2664659e9dcce3010000000049483045022100e4a0fffaf4aa10be58716561a1f2043dfdc2c3a4b595e74031582bac9edcc7690220211a5984f8ab480ff7641073f9dc8622b02ee602228fe27fda788443cd6aadb401ffffffff041027000000000000302ea22c8020432de388aabcb6b4e3326351d1d815cee8be9a8d37b055cd1c0cf8782e5c50c08103120c008203000401cc00a0724e18090000302ea22c80205dcc33b0b3f0573b306ab85ffa9ce8622fbcb81cb6ad8ec00f366935bbf500f78103120c008203000401cc1f0493c2da510000232102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567ac0000000000000000426a40f2632102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567074b4d4454455354134b4d445f4254432c4254435f5553442c2a2c3100000000" -} -``` - -Select the hex value (`0100000001c05c55f5183a412750a...`) and copy it using (CTRL + SHFT + C). - -Broadcast this value using [sendrawtransaction.](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction insert_hex -``` - -The value of the response is called the `tokenid`. - -```bash -0946d12135cca0757a12931944ff930657f21fd676966c12d66d5750848ea712 -``` - -Copy the `tokenid` into a text editor and keep it available for future use. - -Watch the mempool using [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getrawmempool) to verify that the `tokenid` is successfully mined. - -```bash -./komodo-cli -ac_name=CREATORUSDK getrawmempool -``` - -Once the `tokenid` disappears from the mempool the transaction is mined. - -Use [tokeninfo](../../../basic-docs/antara/antara-api/tokens.html#tokeninfo) to check that the token is successfully created. - -```bash -./komodo-cli -ac_name=CREATORUSDK tokeninfo 0946d12135cca0757a12931944ff930657f21fd676966c12d66d5750848ea712 -``` - - - -The tutorial reader may now check the balance of the `pubkey` used to launch the daemon using [tokenbalance](../../../basic-docs/antara/antara-api/tokens.html#tokenbalance). - -```bash -./komodo-cli -ac_name=CREATORUSDK tokenbalance insert_tokenid insert_pubkey -``` - -## Create an Oracle - -The [Oracles](../../../basic-docs/antara/antara-api/oracles.html#introduction) Module is able to add external data to a blockchain. This modules allows the Pegs module to obtain the information needed regarding user activity and accurate prices. - -When creating a new oracle, the name of the oracle is identical to the name of the tokens, `KMD` and the data format starts with `Ihh` (height, blockhash, merkleroot). - -Create the oracle using [oraclescreate](../../../basic-docs/antara/antara-api/oracles.html#oraclescreate). - -```bash -./komodo-cli -ac_name=CREATORUSDK oraclescreate KMD blockheaders Ihh -``` - -The response is a hex value. - -```json -{ - "hex": "0400008085202f890112a78e8450576dd6126c9676d61ff2570693ff441993127a75a0cc3521d14609020000004847304402206d05f874b04808f5d989325e140e0a618de8081909bc20db24fd70ebfd53fedc02205f88c98f2399119ab680a246ac0613dffabb4a77022cc755b9fca6c96f50c52d01ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aacffb592c2da510000232102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567ac00000000000000001d6a1bec43074b4d4454455354034968680c626c6f636b6865616465727300000000280100000000000000000000000000", - "result": "success" -} -``` - -Broadcast the returned hex value using [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction). - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction insert_hex_data -``` - -The response is a transaction id, called the `oracleid`. - -```bash -ee684674d3671daf596395a9ca6c409381d1cf6c2c7ff05c65c6bb5c16967a0e -``` - -Record this value in the text editor. - -Execute the `oraclesfund` method to fund the oracle. - -```bash -./komodo-cli -ac_name=CREATORUSDK oraclesfund ee684674d3671daf596395a9ca6c409381d1cf6c2c7ff05c65c6bb5c16967a0e -``` - - - -Send the raw transaction by broadcasting the hex value. - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction 0400008085202f89010e7a96165cbbc6655cf07f2c6ccfd18193406ccaa9956359af1d67d3744668ee01000000494830450221008f3db99deddacc6cf6c39260faac62aa00395a808715923e0301d6063a23618d022044565a478e2fbf316f843ac96c2921f267da71701f51fd0c244aff1aedb00ed101ffffffff031027000000000000302ea22c8020de1ac583c081d079fd4118ec0c29fe975121739d8fba70103e5fb45614913cbe8103120c008203000401ccdf6792c2da510000232102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567ac00000000000000004f6a4c4cec460e7a96165cbbc6655cf07f2c6ccfd18193406ccaa9956359af1d67d3744668ee2102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567102700000000000000000000290100000000000000000000000000 -``` - -Response: - - - -Optionally use the [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getrawmempool) method to ensure that the transaction receives confirmation. - -To prepare for the oraclefeed instance, use [oraclesregister](../../../basic-docs/antara/antara-api/oracles.html#oraclesregister) to register as a publisher for the oracle. This command must be executed on a node which can post `KMD` block headers and which can execute withdrawal transactions. - -```bash -./komodo-cli -ac_name=CREATORUSDK oraclesregister insert_oracleid data_fee_in_satoshis` -``` - -This returns a hex value which must be broadcast using [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction). (Not shown for brevity) - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction insert_hex_value -``` - -Retrieve the data publisher's `pubkey` using [oraclesinfo](../../../basic-docs/antara/antara-api/oracles.html#oraclesinfo). - -```bash -./komodo-cli -ac_name=CREATORUSDK oraclesinfo insert_oracleid -``` - - - -The key, `"publisher"`, in the entry, `"registered"`, of the returned json object is the data publisher's `pubkey`, also called the `publisherpubkey`. - -Subscribe to the oracle using [oraclessubscribe](../../../basic-docs/antara/antara-api/oracles.html#oraclessubscribe) to receive utxo information for data publishing. - -The frequency of data-publishing transactions that can be included in a block is equal to the number of active subscriptions committed to the oracle. Therefore, there must be at least one subscription for the oracle to allow publishing. - -Subscribe to the oracle using the following command. - -```bash -./komodo-cli -ac_name=CREATORUSDK oraclessubscribe insert_oracleid insert_publisherpubkey insert_amount_of_funds_to_add -``` - -This returns a hex value that must be broadcast using sendrawtransaction (not shown for brevity). - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction insert_hex_value -``` - -In this tutorial example, the tutorial reader needs to be able to publish data more than once per block. Therefore, execute the oraclessubscribe and sendrawtransaction methods several times and with the same amount. - -Verify the oracle information to ensure it is properly established. - -```bash -./komodo-cli -ac_name=CREATORUSDK oraclesinfo insert_oracleid -``` - - - -## Bind the Token and Oracle to a Gateway - -Create a gateway and bind the data from this tutorial to the gateway using the [gatewaysbind](../../../basic-docs/antara/antara-api/gateways.html#gatewaysbind) method. - -This method requires that tutorial reader decide how many total gateway signatures are desired (represented by the value `N`), and how many signatures are required to withdraw funds (represented by the value `M`). - -For this tutorial, the reader may set both `N` and `M` equal to `1` for simplicity. - -The gatewaysbind command requires that the user indicate the `pubtype`, `p2shtype`, and `wiftype` values for the chosen coin. For Smart Chains, these values are `60`, `85` and `188` respectively. - -```bash -./komodo-cli -ac_name=CREATORUSDK gatewaysbind insert_tokenid insert_oracleid KMD insert_tokensupply 1 1 insert_gatewayspubkey 60 85 188 -``` - -This method returns a hex value that must be broadcast using sendrawtransaction (not shown for brevity). - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction insert_hex_value -``` - -The broadcast returns a transaction id, also called the `bindtxid`. Copy this information to the text editor. - -Assuming everything is properly created and executed, review the new gateway using [gatewaysinfo](../../../basic-docs/antara/antara-api/gateways.html#gatewaysinfo). - -```bash -./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid -``` - - - -Use the returned information to verify that the `tokenid` and `oracleid` match the information copied from this tutorial to the text editor. - -## Start the oraclefeed software - -The `oraclefeed` software instance automates the transfer of merkleroot data from the `KMD` chain to the oracle on the `CREATORUSDK` chain. - -Change into the directory where `komodod` and `komodo-cli` are compiled. - -```bash -cd ~/komodo/src/ -``` - -Compile the `oraclefeed` software instance. - -```bash -gcc cc/dapps/oraclefeed.c -lm -o oraclefeed -``` - -Initiate the instance. - -```bash -./oraclefeed CREATORUSDK insert_oracleid insert_mypubkey Ihh insert_bindtxid "cli command to access te external coin(KMD)" -``` - -Inserting the values. - -```bash -./oraclefeed CREATORUSDK ee684674d3671daf596395a9ca6c409381d1cf6c2c7ff05c65c6bb5c16967a0e 02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567 Ihh 0b5716554e523aa4678112a8ac3d15039e0aae6f4812b9d4c631cc9cfbf48786 "./komodo-cli" -``` - - - -## Create the Peg - -Create a peg that will create `CREATORUSDK` coins pegged to USD and backed by `KMD` using the [pegscreate](../../../basic-docs/antara/antara-api/pegs.html#pegscreate) method. - -The pegscreate method is capable of creating a peg that is backed by more than one external coin. This is accomplished by adding more than one `bindtxid` to the `pegscreate` command. - -Each associated gateway requires a unique token, oracle, and a running instance of the `oraclefeed` software, as previously described in this tutorial. - -For the sake of simplicity, this tutorial utilizes only one gateway (bound to `KMD` coins). - -```bash -./komodo-cli -ac_name=CREATORUSDK pegscreate 100000 1 0b5716554e523aa4678112a8ac3d15039e0aae6f4812b9d4c631cc9cfbf48786 -``` - -This method returns a hex value that must be broadcast using sendrawtransaction (not shown for brevity). - -```bash -./komodo-cli -ac_name=CREATORUSDK sendrawtransaction insert_hex_value -``` - -The broadcast returns a transaction id, also called the `pegstxid`. Copy this information to the text editor. - -The `pegstxid` is the reference to the peg created in this tutorial. To make sure all the nodes running the `CREATORUSDK` chain are aware of the correct pegs contract, after the `pegstxid` transaction is mined the reader must shutdown any daemons running the chain. The tutorial reader then restarts the nodes, but with a slightly modified version of the launch parameters. The parameters now include `-earlytxid`, and this parameter is set equal to the value of `pegstxid`. - -In the following command, replace the text `` with the `pegstxid` from this tutorial. - -```bash -./komodod -ac_supply=1000000 -ac_reward=10000 -ac_name=CREATORUSDK -ac_cc=2 -ac_import=PEGSCC -ac_end=1 -ac_perc=0 -ac_cbopret=5 -debug=pegscc-2 -debug=importcoin -debug=cctokens -debug=gatewayscc -printtoconsole=1 -earkytxid= -``` - - -:::tip Note - -For any Smart Chain, the `-earlytxid` must be added to the launch parameters before the chain reaches a total block height of `100`. The tutorial reader may control the pace of mining on a Smart Chain with the commands `./komodo-cli setgenerate true 1` (starting) and `./komodo-cli setgenerate false` (stopping). - -::: - -Any new node joining the `CREATORUSDK` network must use the new launch parameters with the `-earlytxid` included. - -## Test the Setup - -Follow the [Pegs Module Tutorial - User](./pegs-module-user-tutorial.html) documentation to continue learning about the Pegs Antara Module. diff --git a/docs/basic-docs/antara/antara-tutorials/pegs-module-user-tutorial.md b/docs/basic-docs/antara/antara-tutorials/pegs-module-user-tutorial.md deleted file mode 100644 index 8b0f1321f..000000000 --- a/docs/basic-docs/antara/antara-tutorials/pegs-module-user-tutorial.md +++ /dev/null @@ -1,674 +0,0 @@ -# Pegs Module User Tutorial - -::: tip - -The Pegs Module is in the final stages of production. - -The following tutorial is currently only compatible with computer-hardware setups that are running Linux OS's Ubuntu/Debian-based distributions. - -For questions and assistance, please reach out to the Komodo team using the `#cc-pegs` channel of the [Komodo Discord](https://komodoplatform.com/discord) live-chat server. Thank you. - -::: - -## Tutorial Overview - -This tutorial uses the `USDKTEST` test and development Smart Chain to introduce the process and workflow of a user of the [Pegs Antara Module.](../antara-api/pegs.html) - -#### Tutorial Outline - -- Connect to the test Smart Chain `USDKTEST` -- Deposit `KMD` coins (on the `KMD` Smart Chain) in the address associated with the `USDKTEST` Gateways Module -- Claim tokenized `KMD` on the `USDKTEST` chain -- Lock tokenized `KMD` in the Pegs Module and receive `USDK` coins -- Redeem tokenized `KMD` using the `pegsredeem` method -- Return tokenized `KMD` to the Gateway to receive `KMD` coins on the `KMD` Smart Chain - -## Installation - -::: warning - -The following installation procedure creates a version of the Komodo software daemon that should not be used for any purpose other than testing. Several of the customizations active on this particular version of the daemon are intended for testing purposes only. - -::: - -### Dependencies - -Execute the following commands in the Unix terminal. - -```bash -sudo apt-get update && sudo apt-get upgrade -y -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl clang libcurl4-gnutls-dev cmake clang libsodium-dev -y -``` - -#### Create a Swap Partition (Optional) - -For tutorial users using a VPS with a low amount of RAM, create a swap partition. - -On the VPS, execute the following commands to create a 4GB SWAP file. (If sufficient space is available, consider creating an 8GB swap file instead, as this can facilitate better software performance.) - -```bash -sudo swapon --show -free -h -df -h -sudo fallocate -l 4G /swapfile -ls -lh /swapfile -sudo chmod 600 /swapfile -ls -lh /swapfile -sudo mkswap /swapfile -sudo swapon /swapfile -sudo swapon --show -free -h -sudo cp /etc/fstab /etc/fstab.bak -echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab -sudo sysctl vm.swappiness=10 # This setting persists until the next reboot of the VPS. To instead set this value automatically at restart, execute the following lines to edit the /etc/sysctl.conf file: -sudo nano /etc/sysctl.conf -vm.swappiness=10 -``` - -### Build the Komodo daemon - -```bash -git clone https://github.com/Mixa84/komodo -cd komodo -git checkout pegsCC -export CONFIGURE_FLAGS='CPPFLAGS=-DTESTMODE' # Tweaks some settings to make it easy for testing -./zcutil/fetch-params.sh -./zcutil/build.sh -j$(nproc) -cd src -``` - -## Connect and Sync to USDKTEST and KMD - -Navigate to the source directory. - -```bash -cd ~/komodo/src -``` - -Execute the following launch parameters. - -In the following command, replace the text, ``, with the appropriate pubkey. [To learn more about setting a proper pubkey, please read this linked article from the Komodo documentation.](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) - -```bash -./komodod -ac_supply=1000000 -ac_reward=10000 -ac_name=USDKTEST -ac_cc=2 -ac_import=PEGSCC -ac_end=1 -ac_perc=0 -ac_cbopret=5 -debug=pegscc-2 -debug=importcoin -debug=cctokens -debug=gatewayscc -printtoconsole=1 -addnode=116.203.17.140 -addnode=116.203.17.141 -earlytxid=a9539ec8db34ee44ff213cda59f412a02795821cf05844b0bc184660711371f7 -pubkey= & -``` - -Import the private key corresponding to the pubkey used to start the `USDKTEST` chain. Note the text `` that must be replaced in the following command. - -```bash -./komodo-cli -ac_name=USDKTEST importprivkey -``` - -Allow the chain to sync. - -Check the sync status using the [getinfo](../../../basic-docs/smart-chains/smart-chain-api/control.html#getinfo) method. When the keys `blocks` and `longestchain` have the same value, the chain is synced. Once the chain is synced, begin mining the `USDKTEST` chain. - -Mine until the balance returned from the [getinfo](../../../basic-docs/smart-chains/smart-chain-api/control.html#getinfo) method is at least `30k` satoshis. This requires mining approximately `3` blocks. - -```bash -./komodo-cli -ac_name=USDKTEST setgenerate true 1 -``` - -#### Sync the KMD Smart Chain - -In a new terminal, change into the Komodo source directory and execute the following command. - -```bash -./komodod & -``` - -Use the getinfo method, as before, while waiting until the blockchain syncs. - -```bash -./komodo-cli getinfo -``` - -## Start Testing - -::: tip Key Information for this Tutorial - -The following key information is used throughout this tutorial. Refer back to this content as often as needed. - -- KMD token (tokenid): 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 -- Oracle (oracletxid): a6a59fbdc0ba8b138a4d14ff334a533f0358144091aa999ef45fd7498ab4189a -- Gateways (bindtxid): 50384e7668bd6908d8e0b67f1450c56f017186d802b1065c3258302a30b5adb2 -- Faucet: 7bc2dafc4d71c7e178b3a2a89e7ddc894cb14dbeff5937fa869915adf1af5108 -- Pegs (pegstxid): a9539ec8db34ee44ff213cda59f412a02795821cf05844b0bc184660711371f7 - -::: - -::: tip - -The types of transactions performed in this tutorial require at least one confirmation from the network before the user should proceed to the next step in the outline. - -When performing cross-chain operations, the user may need to wait for two or three confirmations on the source chain before any related activity will appear on the destination chain. - -::: - -### Deposit KMD in the Associated USDKTEST Gateways Address - -Execute the following command to discover the address associated with the Gateways Module. - -```bash -./komodo-cli -ac_name=USDKTEST gatewaysinfo 50384e7668bd6908d8e0b67f1450c56f017186d802b1065c3258302a30b5adb2 -``` - -Response: - -```json -{ - "result": "success", - "name": "Gateways", - "M": 2, - "N": 2, - "pubkeys": [ - "038814d60d99a594b4b1092247df4384bc21a50733d3acd0e29499e5f03737374d", - "023a447741707e95bc889fbbb08295d402332217075752bd1bb3999b092e4753ab" - ], - "coin": "KMD", - "oracletxid": "a6a59fbdc0ba8b138a4d14ff334a533f0358144091aa999ef45fd7498ab4189a", - "taddr": 0, - "prefix": 60, - "prefix2": 85, - "wiftype": 188, - "deposit": "bPFkXSYYYDWBLbp8AxfY5KKGgxt5RPfN9p", - "tokenid": "1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1", - "totalsupply": "100000.00000000", - "remaining": "99999.86000000", - "issued": "0.14000000" -} -``` - -The `deposit` address is `bPFkXSYYYDWBLbp8AxfY5KKGgxt5RPfN9p`. - -Go to the `KMD` chain and execute one transaction that sends a few `KMD` coins to two addresses. - -The first address is the address above, and this should receive the majority of the `KMD` sent in this transaction. - -The second address is the address corresponding to the tutorial user's `pubkey` used to launch the `USDKTEST` Smart Chain. This second address requires only a small amount of `KMD` (a few satoshis); this part of the transaction creates a marker that indicates to the Gateways Module the owner of the `KMD` funds. - -The [z_sendmany](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-sendmany) allows the user to send coins to two addresses in a single address, as follows. - -```bash -./komodo-cli z_sendmany "FROM_ADDRESS" '[{"address":"ADDRESS_CORRESPONDING_TO_USER_PUBLIC_KEY","amount":SMALL_MARKER_AMOUNT},{"address":"GATEWAYS_MULTISIG_ADDRESS","amount":MAIN_AMOUNT_TO_DEPOSIT}]' -``` - -Observe the following example. - -```bash -./komodo-cli z_sendmany "RSVF6SecrtU1ppBGPm3SyNw2D8nSpFcA57" '[{"address":"RFmQiF4Zbzxchv9AG6dw6ZaX8PbrA8FXAb","amount":0.0001},{"address":"bPFkXSYYYDWBLbp8AxfY5KKGgxt5RPfN9p","amount":0.01}]' -``` - -#### Obtain the txid of the Deposit Transaction - -The [z_sendmany](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-sendmany) returns an operation id, `opid`. Use this `opid` to obtain the `txid` of the transaction. - -(Alternatively, check the website [explorer](https://kmdexplorer.io/) for the `txid` by searching for any of the addresses associated with the transaction and searching for the most recent transaction.) - -Use the `opid` as follows to obtain the `txid` of the transaction. - -```bash -./komodo-cli z_getoperationstatus '["opid-4b661588-9924-47ba-bbba-4884eff36395"]' -``` - -Output: - -```json -[ - { - "id": "opid-4b661588-9924-47ba-bbba-4884eff36395", - "status": "success", - "creation_time": 1573737131, - "result": { - "txid": "5569e66859a8269b3b7a512ac66a42b1a4d375bb404fc73abaf2faf3080ec4af" - }, - "execution_secs": 0.009735896000000001, - "method": "z_sendmany", - "params": { - "fromaddress": "RSVF6SecrtU1ppBGPm3SyNw2D8nSpFcA57", - "amounts": [ - { - "address": "RFmQiF4Zbzxchv9AG6dw6ZaX8PbrA8FXAb", - "amount": 0.0001 - }, - { - "address": "bPFkXSYYYDWBLbp8AxfY5KKGgxt5RPfN9p", - "amount": 0.01 - } - ], - "minconf": 1, - "fee": 0.0001 - } - } -] -``` - -## Wait for the Deposit Transaction to Reach the Oracle - -#### Wait for the Deposit Transaction to be Mined - -Before the transaction can reach the Oracle, a miner on the `KMD` chain must mine the transaction. - -Use the [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#getrawmempool) method to obtain a list of transactions waiting to be mined and search for the `txid` of the deposit transaction. If the `txid` is not there, a miner has mined the transaction. - -```bash -./komodo-cli getrawmempool -``` - -Once the transaction is mined, use the [getrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#getrawtransaction) method to find the block height at which the transaction was mined. - -In the following command, replace the text `` with the deposit `txid` retrieved earlier. - -```bash -./komodo-cli getrawtransaction "" 1 -``` - -From the response, take note of the value associated with the `height` key. The `txid` transaction was mined at this height. - -#### Observe the txid Reach the Oracle - -Check whether the block header associated with the `KMD` block of height `height` has been submitted to the Oracle on the `USDKTEST` chain. - -Find the pubkey of the publisher associated with the Token, Gateway, and Peg using the [tokeninfo](../../../basic-docs/antara/antara-api/tokens.html#tokeninfo) method. - -```bash -./komodo-cli -ac_name=USDKTEST tokeninfo 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 -``` - -Take note of the value of the `owner` key in the response. This is the pubkey of the publisher. - -Use the [oraclesinfo](../../../basic-docs/antara/antara-api/oracles.html#oraclesinfo) method to find the baton address for this publiser. - -```bash -./komodo-cli -ac_name=USDKTEST oraclesinfo a6a59fbdc0ba8b138a4d14ff334a533f0358144091aa999ef45fd7498ab4189a -``` - -Among the registered publishers in the response, notice that there is a publisher whose pubkey matches the one we took note from the `tokeninfo` call. The value of the key named `baton` is needed to get the past samples published by this publisher. - -In the following command, replace the text `` with the `baton` from the previous step. - -```bash -./komodo-cli -ac_name=USDKTEST oraclessamples a6a59fbdc0ba8b138a4d14ff334a533f0358144091aa999ef45fd7498ab4189a 5 -``` - -This returns the `5` latest data points published by the publisher associated with the Peg system. - -Note the block height in the returned data points. Wait until the highest block height is `>=` greater than or equal to the block height of the deposit transaction discovered earlier in the tutorial. (This is the process of transferring information between the `KMD` and `USDKTEST` chains.) - -### Inform the Gateways Module and Claim the Tokenized KMD - -Use the [gatewaysdeposit](../../../basic-docs/antara/antara-api/gateways.html#gatewaysdeposit) method to inform the Gateways Module of the deposit. - -Structure of the command to be executed: - -`gatewaysdeposit bindtxid height coin cointxid claimvout deposithex proof destpub amount` - -#### Details - -- `gatewaysdeposit` — The name of the method, submitted as-is -- `bindtxid` — The Gateway's `bindtxid` (see above) -- `height` — The `height` of the block in which the deposit `txid` was confirmed in the earlier step -- `coin` — Ticker of the `coin` deposited (`KMD` in this example) -- `cointxid` — `txid` of the deposit -- `claimvout` — The marker utxo's vout number in the external deposit transaction; this value is always `0` when the `z_sendmany` method is used, as shown in this tutorial -- `deposithex` — The hex value from `gettransaction` call for the deposited `txid` (the method for retrieving this value is shown in the following section) -- `proof` — The `proof` value returned from the `gettxoutproof` method using the deposit `txid` (the method for retrieving this value is shown in the following section) -- `destpub` — The user's `pubkey` used to launch the `USDKTEST` Smart Chain -- `amount` — The `amount` of coin (`KMD`) deposited - -The following commands retrieve the missing information. - -#### deposithex - -The following command returns the `deposithex` value. - -```bash -./komodo-cli getrawtransaction 5569e66859a8269b3b7a512ac66a42b1a4d375bb404fc73abaf2faf3080ec4af -``` - -Response: - -``` -0400008085202f89010cacb0895bbd5cbbe12a13875c06dac59ad6154780df59d86b28d1da0d64c3c5000000006b483045022100cabf2fc63cebf2eecb186e92053da1d4cebf984980ca645ac050b1fb49e0fc43022070f59307d8f442c295dea500d93a4545a650f1b80d06dab9154562af7c3a28c1012102decc2e49c24ca9f06b96665e8e39836ea1d8c73671166fa6ee917b4bcb307b44ffffffff0310270000000000001976a9144726f2838fc4d6ac66615e10604e18926e9b556e88ac40420f000000000017a9147374f811b053e81a4b4e6e282a2421aaf170afaa8798db2d36000000001976a91408ba4152fe80ffc33f805b166ec9c03c288109b488ac6f52cd5d87b118000000000000000000000000 -``` - -#### proof - -Use the [gettxoutproof](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#gettxoutproof) method with the deposit `txid`. This returns the `proof` as a hex value. - -```bash -./komodo-cli gettxoutproof '["5569e66859a8269b3b7a512ac66a42b1a4d375bb404fc73abaf2faf3080ec4af"]' -``` - -Response: - -``` -0400000012a703d96b522f36fe13711c96de92b3f17bdbd41eda1a6753e2cd22924c1b0e47dd0fb69db925741977975a5803d8c885c72651b5c0427685e20e16cba73a43a2d8a734eb73a4dc734072dbfd12406f1e7121bfe0e3d6c10922495c44e5cc1cba52cd5dddaf001dffef8831000000000000b22a0000000000000200000000000000000000000000fd40050029a91e2967f03d92e838d3bf73067ed2431bde7f23432431f5d41ef6bd4245f0216b3b9a389d3f8c0813f27547948aec070a0302892468513f07653a83ac3a8c9a373cf12a4ddcb473f92d350417081a7c3696027f82781522fd39ac95449a24bfebf30ae39c328913e777ddca29a3d5b6b15374e1b84e09c9d2af243404e800ed03c3ec32dee990fa10d2b61d43db9987760fb169841e6cc985c6d651a4be3cd9f60cded6232e03f610267e1ed8873a5580c40c07353b0440398032251401ad3063d117d1ba83e674782f65e6d7b525691637434d0c0a0cd758c26b8be9fce02afdc81b6d4a2733432193242135d58d9762874d2d26ac85fbe43d0d324b512ac8012756e68100ce76b9b8bb761053501ea99224b88b66f8c86f236c23d8e0b9ca1ad9000c0e5fbf34a583c245fd9942e94c547345a62731a61a17bf895d2c17dcbb647ce2b7f3e29e5264c01e6d7300d7b9c9881c08e7d5ec71e3adb47de2061513094f13d654d22c502f596225b22ff05d457e479e9895ad05eecb63f71697639b5510e79a9973b5d8561144e41773a8d3e40eb10d5fc352db2e31ed555a8beb8a830aea6e654414a9853dfab20d37300fb0a776d5ccef137cd379ce98204728d7f2117111a59ead081894330faa17677889216b4c3d54c8a97f189296465ebcb739f61b8f53cf8ad6ced60d924b78d0677c3d1d16ab0fa1e0b94c6176d5f12617f6de5e665a99dbd8e84814f53d3fa0ccc383afa5d1cd6ac664bd27c44f0f4620344aacd78b8f0e96b8c853a0ceeafe35d6b338b5338e959b26a710bb3cdc9347fae575da0fae720eb312416cee371cf827cf7875edeb71da95bf07d864a812ffa8c4ddec2b87cf60f3bd2f636306b040976d0f1591a401fecdc304bce3754bd8d8fea5649e93da601995138c8c0bc69d44bc96ad786dc30e5ea13698c900c553d2c01972ad1ffce071a2980271c3525e932508f1f955bca7dee3e94997f8f6c92e4ef1447a3c47053563940ea4b88987fdb0ce0a7ddd8ea2bf375922297947ea8bb18985f6bbe3eab2d03f12f6687f911b12c7ce2b9050995523f0f23a03984f15cfc6785bd92af3ad60daac650ff3a718183967665f92b17eaf5d1459d2eb8255b94b0bd1f279aa18a04a87339941ee4cf11f31c357f31b9ff54858fb43085ebfc7b9868001bbbcd126dfcfeff478063fccde8736c15d1bb16108f1d710aad0694dffb181cc4e57f2b5d00276c18c19ccbacd7096be13a8fdf2c280cd237cbc46466c2e33cd745b465c60c1fdae6399b326ccf9e6164ff24021fce569dc8b6df8dfd26406906f1b25656f37a10626f153ff3239a8cfd35664155cb92ac54205ae517731afa77a86627177435cf5cb4371ab3a35fc99d0fc4731db98fb2ac959dc3757053ff6c41e5db1dc6da501456734a6155287cdc50038f2c43b74acfb683436510e0c6b3e1a0acfbf00663978d88ede7802b5703b05107dfb90a05ae78c9bb62375c4c6e591d9b7a35d2430066e8f528af96c32c2645566305387023dcd4a091ec0ec1bd4a454cc87f17426a65c1543759a7b503129aab79ed9e4b6efcb951da7f00c42d31cda7e4511f164e037762a63ebd2c617195f455687197bdc9f51cc26126ae291d3b0a4578bb8d6d386ac65b5859403bfde32cb619bb7f63f9c100f6b29a771837e3e1f06c83eccd5c2b3ca4d5af1ee5fc42fa4de6aa778402cf72a55e64cd2c5768862f2a65ec24a63da1946092e5bc5789a91cfccd4a553a3eeff0620f3ba53622e1513b6d59babb509a21516a6e9bb5657a6c4ff9a9423a65d555b9236caa510879d3ce809572db65cefa31783a5b5fcf0e6b9e44662536877f96e5e7bfce6593f912611095e905dcb5ef443b626e585a9a056e1d70900000005752526306830c6259c1659fa8ca3bfd85fa782c17efd04ec51cf7b13cc93de02afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e66955227fdec6d08be9fa88128f0d3c0681a5ba271ae5e27cfa60daa95e938c02f80da2499fa7619612a9acc3398f993475d4b981579f881f39adc29d1beb976be1c02e4e1bb76d33a81fa5f9065c8945a6a7aa2ceed88276ea9723c80bbb314ef89f023700 -``` - -#### Call the gatewaysdeposit Method - -Execute the [gatewaysdeposit](../../../basic-docs/antara/antara-api/gateways.html#gatewaysdeposit) method using the acquired information. Observe the following example as necessary. - -```bash -./komodo-cli -ac_name=USDKTEST gatewaysdeposit 50384e7668bd6908d8e0b67f1450c56f017186d802b1065c3258302a30b5adb2 1618112 KMD 5569e66859a8269b3b7a512ac66a42b1a4d375bb404fc73abaf2faf3080ec4af 0 0400008085202f89010cacb0895bbd5cbbe12a13875c06dac59ad6154780df59d86b28d1da0d64c3c5000000006b483045022100cabf2fc63cebf2eecb186e92053da1d4cebf984980ca645ac050b1fb49e0fc43022070f59307d8f442c295dea500d93a4545a650f1b80d06dab9154562af7c3a28c1012102decc2e49c24ca9f06b96665e8e39836ea1d8c73671166fa6ee917b4bcb307b44ffffffff0310270000000000001976a9144726f2838fc4d6ac66615e10604e18926e9b556e88ac40420f000000000017a9147374f811b053e81a4b4e6e282a2421aaf170afaa8798db2d36000000001976a91408ba4152fe80ffc33f805b166ec9c03c288109b488ac6f52cd5d87b118000000000000000000000000 0400000012a703d96b522f36fe13711c96de92b3f17bdbd41eda1a6753e2cd22924c1b0e47dd0fb69db925741977975a5803d8c885c72651b5c0427685e20e16cba73a43a2d8a734eb73a4dc734072dbfd12406f1e7121bfe0e3d6c10922495c44e5cc1cba52cd5dddaf001dffef8831000000000000b22a0000000000000200000000000000000000000000fd40050029a91e2967f03d92e838d3bf73067ed2431bde7f23432431f5d41ef6bd4245f0216b3b9a389d3f8c0813f27547948aec070a0302892468513f07653a83ac3a8c9a373cf12a4ddcb473f92d350417081a7c3696027f82781522fd39ac95449a24bfebf30ae39c328913e777ddca29a3d5b6b15374e1b84e09c9d2af243404e800ed03c3ec32dee990fa10d2b61d43db9987760fb169841e6cc985c6d651a4be3cd9f60cded6232e03f610267e1ed8873a5580c40c07353b0440398032251401ad3063d117d1ba83e674782f65e6d7b525691637434d0c0a0cd758c26b8be9fce02afdc81b6d4a2733432193242135d58d9762874d2d26ac85fbe43d0d324b512ac8012756e68100ce76b9b8bb761053501ea99224b88b66f8c86f236c23d8e0b9ca1ad9000c0e5fbf34a583c245fd9942e94c547345a62731a61a17bf895d2c17dcbb647ce2b7f3e29e5264c01e6d7300d7b9c9881c08e7d5ec71e3adb47de2061513094f13d654d22c502f596225b22ff05d457e479e9895ad05eecb63f71697639b5510e79a9973b5d8561144e41773a8d3e40eb10d5fc352db2e31ed555a8beb8a830aea6e654414a9853dfab20d37300fb0a776d5ccef137cd379ce98204728d7f2117111a59ead081894330faa17677889216b4c3d54c8a97f189296465ebcb739f61b8f53cf8ad6ced60d924b78d0677c3d1d16ab0fa1e0b94c6176d5f12617f6de5e665a99dbd8e84814f53d3fa0ccc383afa5d1cd6ac664bd27c44f0f4620344aacd78b8f0e96b8c853a0ceeafe35d6b338b5338e959b26a710bb3cdc9347fae575da0fae720eb312416cee371cf827cf7875edeb71da95bf07d864a812ffa8c4ddec2b87cf60f3bd2f636306b040976d0f1591a401fecdc304bce3754bd8d8fea5649e93da601995138c8c0bc69d44bc96ad786dc30e5ea13698c900c553d2c01972ad1ffce071a2980271c3525e932508f1f955bca7dee3e94997f8f6c92e4ef1447a3c47053563940ea4b88987fdb0ce0a7ddd8ea2bf375922297947ea8bb18985f6bbe3eab2d03f12f6687f911b12c7ce2b9050995523f0f23a03984f15cfc6785bd92af3ad60daac650ff3a718183967665f92b17eaf5d1459d2eb8255b94b0bd1f279aa18a04a87339941ee4cf11f31c357f31b9ff54858fb43085ebfc7b9868001bbbcd126dfcfeff478063fccde8736c15d1bb16108f1d710aad0694dffb181cc4e57f2b5d00276c18c19ccbacd7096be13a8fdf2c280cd237cbc46466c2e33cd745b465c60c1fdae6399b326ccf9e6164ff24021fce569dc8b6df8dfd26406906f1b25656f37a10626f153ff3239a8cfd35664155cb92ac54205ae517731afa77a86627177435cf5cb4371ab3a35fc99d0fc4731db98fb2ac959dc3757053ff6c41e5db1dc6da501456734a6155287cdc50038f2c43b74acfb683436510e0c6b3e1a0acfbf00663978d88ede7802b5703b05107dfb90a05ae78c9bb62375c4c6e591d9b7a35d2430066e8f528af96c32c2645566305387023dcd4a091ec0ec1bd4a454cc87f17426a65c1543759a7b503129aab79ed9e4b6efcb951da7f00c42d31cda7e4511f164e037762a63ebd2c617195f455687197bdc9f51cc26126ae291d3b0a4578bb8d6d386ac65b5859403bfde32cb619bb7f63f9c100f6b29a771837e3e1f06c83eccd5c2b3ca4d5af1ee5fc42fa4de6aa778402cf72a55e64cd2c5768862f2a65ec24a63da1946092e5bc5789a91cfccd4a553a3eeff0620f3ba53622e1513b6d59babb509a21516a6e9bb5657a6c4ff9a9423a65d555b9236caa510879d3ce809572db65cefa31783a5b5fcf0e6b9e44662536877f96e5e7bfce6593f912611095e905dcb5ef443b626e585a9a056e1d70900000005752526306830c6259c1659fa8ca3bfd85fa782c17efd04ec51cf7b13cc93de02afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e66955227fdec6d08be9fa88128f0d3c0681a5ba271ae5e27cfa60daa95e938c02f80da2499fa7619612a9acc3398f993475d4b981579f881f39adc29d1beb976be1c02e4e1bb76d33a81fa5f9065c8945a6a7aa2ceed88276ea9723c80bbb314ef89f023700 0217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06 0.01 -``` - -This method returns a response that has a hex value that must be broadcast. - -Response: - -```json -{ - "hex": "0400008085202f890201cbaa60fc93f3e7005f6622999c4abb7258931c3869a6004282014e229358250000000049483045022100f75b4b3dd2a3cac01d389e2957f7337889129f31453a3bf67aa3a6b807417cf0022076ccbb1fd65a6606a2b1e8a816e90edd66d17e6e336755043ab109a1d6cc07f901ffffffff001f6f50578b79a46d6285d9b3c6668104bc1101b7763a33a5e0784b2933fbd7000000004847304402203a76e7c860454b47d653fe9c306a5c53c3b5bda3c68d3c58af89f3754c1d91f3022033c144d67703cd0a1313b31d241bba3eb925200806783cd2557ec18d4669401501ffffffff031027000000000000302ea22c80207f6d7586423d9d8f716988f94728224df39bb0c98bb75655d22a778aea922a208103120c008203000401cc1027000000000000232102afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e66955ac0000000000000000fd67096a4d6309f144034b4d44b2adb5302a3058325c06b102d88671016fc550147fb6e0d80869bd68764e38500121023a447741707e95bc889fbbb08295d402332217075752bd1bb3999b092e4753ab01524571b97a2bf1b546379e59479430ca188f274215b411e90d2cd51295b12b98c0b01800afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e6695500000000fd2a023034303030303830383532303266383930313063616362303839356262643563626265313261313338373563303664616335396164363135343738306466353964383662323864316461306436346333633530303030303030303662343833303435303232313030636162663266633633636562663265656362313836653932303533646131643463656266393834393830636136343561633035306231666234396530666334333032323037306635393330376438663434326332393564656135303064393361343534356136353066316238306430366461623931353435363261663763336132386331303132313032646563633265343963323463613966303662393636363565386533393833366561316438633733363731313636666136656539313762346263623330376234346666666666666666303331303237303030303030303030303030313937366139313434373236663238333866633464366163363636313565313036303465313839323665396235353665383861633430343230663030303030303030303031376139313437333734663831316230353365383161346234653665323832613234323161616631373061666161383739386462326433363030303030303030313937366139313430386261343135326665383066666333336638303562313636656339633033633238383130396234383861633666353263643564383762313138303030303030303030303030303030303030303030303030fd77060400000012a703d96b522f36fe13711c96de92b3f17bdbd41eda1a6753e2cd22924c1b0e47dd0fb69db925741977975a5803d8c885c72651b5c0427685e20e16cba73a43a2d8a734eb73a4dc734072dbfd12406f1e7121bfe0e3d6c10922495c44e5cc1cba52cd5dddaf001dffef8831000000000000b22a0000000000000200000000000000000000000000fd40050029a91e2967f03d92e838d3bf73067ed2431bde7f23432431f5d41ef6bd4245f0216b3b9a389d3f8c0813f27547948aec070a0302892468513f07653a83ac3a8c9a373cf12a4ddcb473f92d350417081a7c3696027f82781522fd39ac95449a24bfebf30ae39c328913e777ddca29a3d5b6b15374e1b84e09c9d2af243404e800ed03c3ec32dee990fa10d2b61d43db9987760fb169841e6cc985c6d651a4be3cd9f60cded6232e03f610267e1ed8873a5580c40c07353b0440398032251401ad3063d117d1ba83e674782f65e6d7b525691637434d0c0a0cd758c26b8be9fce02afdc81b6d4a2733432193242135d58d9762874d2d26ac85fbe43d0d324b512ac8012756e68100ce76b9b8bb761053501ea99224b88b66f8c86f236c23d8e0b9ca1ad9000c0e5fbf34a583c245fd9942e94c547345a62731a61a17bf895d2c17dcbb647ce2b7f3e29e5264c01e6d7300d7b9c9881c08e7d5ec71e3adb47de2061513094f13d654d22c502f596225b22ff05d457e479e9895ad05eecb63f71697639b5510e79a9973b5d8561144e41773a8d3e40eb10d5fc352db2e31ed555a8beb8a830aea6e654414a9853dfab20d37300fb0a776d5ccef137cd379ce98204728d7f2117111a59ead081894330faa17677889216b4c3d54c8a97f189296465ebcb739f61b8f53cf8ad6ced60d924b78d0677c3d1d16ab0fa1e0b94c6176d5f12617f6de5e665a99dbd8e84814f53d3fa0ccc383afa5d1cd6ac664bd27c44f0f4620344aacd78b8f0e96b8c853a0ceeafe35d6b338b5338e959b26a710bb3cdc9347fae575da0fae720eb312416cee371cf827cf7875edeb71da95bf07d864a812ffa8c4ddec2b87cf60f3bd2f636306b040976d0f1591a401fecdc304bce3754bd8d8fea5649e93da601995138c8c0bc69d44bc96ad786dc30e5ea13698c900c553d2c01972ad1ffce071a2980271c3525e932508f1f955bca7dee3e94997f8f6c92e4ef1447a3c47053563940ea4b88987fdb0ce0a7ddd8ea2bf375922297947ea8bb18985f6bbe3eab2d03f12f6687f911b12c7ce2b9050995523f0f23a03984f15cfc6785bd92af3ad60daac650ff3a718183967665f92b17eaf5d1459d2eb8255b94b0bd1f279aa18a04a87339941ee4cf11f31c357f31b9ff54858fb43085ebfc7b9868001bbbcd126dfcfeff478063fccde8736c15d1bb16108f1d710aad0694dffb181cc4e57f2b5d00276c18c19ccbacd7096be13a8fdf2c280cd237cbc46466c2e33cd745b465c60c1fdae6399b326ccf9e6164ff24021fce569dc8b6df8dfd26406906f1b25656f37a10626f153ff3239a8cfd35664155cb92ac54205ae517731afa77a86627177435cf5cb4371ab3a35fc99d0fc4731db98fb2ac959dc3757053ff6c41e5db1dc6da501456734a6155287cdc50038f2c43b74acfb683436510e0c6b3e1a0acfbf00663978d88ede7802b5703b05107dfb90a05ae78c9bb62375c4c6e591d9b7a35d2430066e8f528af96c32c2645566305387023dcd4a091ec0ec1bd4a454cc87f17426a65c1543759a7b503129aab79ed9e4b6efcb951da7f00c42d31cda7e4511f164e037762a63ebd2c617195f455687197bdc9f51cc26126ae291d3b0a4578bb8d6d386ac65b5859403bfde32cb619bb7f63f9c100f6b29a771837e3e1f06c83eccd5c2b3ca4d5af1ee5fc42fa4de6aa778402cf72a55e64cd2c5768862f2a65ec24a63da1946092e5bc5789a91cfccd4a553a3eeff0620f3ba53622e1513b6d59babb509a21516a6e9bb5657a6c4ff9a9423a65d555b9236caa510879d3ce809572db65cefa31783a5b5fcf0e6b9e44662536877f96e5e7bfce6593f912611095e905dcb5ef443b626e585a9a056e1d70900000005752526306830c6259c1659fa8ca3bfd85fa782c17efd04ec51cf7b13cc93de02afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e66955227fdec6d08be9fa88128f0d3c0681a5ba271ae5e27cfa60daa95e938c02f80da2499fa7619612a9acc3398f993475d4b981579f881f39adc29d1beb976be1c02e4e1bb76d33a81fa5f9065c8945a6a7aa2ceed88276ea9723c80bbb314ef89f023700210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f0000000000000000006a9900000000000000000000000000", - "result": "success" -} -``` - -Use the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method to broadcast the hex value from the response. - -```bash -./komodo-cli -ac_name=USDKTEST sendrawtransaction 0400008085202f890201cbaa60fc93f3e7005f6622999c4abb7258931c3869a6004282014e229358250000000049483045022100f75b4b3dd2a3cac01d389e2957f7337889129f31453a3bf67aa3a6b807417cf0022076ccbb1fd65a6606a2b1e8a816e90edd66d17e6e336755043ab109a1d6cc07f901ffffffff001f6f50578b79a46d6285d9b3c6668104bc1101b7763a33a5e0784b2933fbd7000000004847304402203a76e7c860454b47d653fe9c306a5c53c3b5bda3c68d3c58af89f3754c1d91f3022033c144d67703cd0a1313b31d241bba3eb925200806783cd2557ec18d4669401501ffffffff031027000000000000302ea22c80207f6d7586423d9d8f716988f94728224df39bb0c98bb75655d22a778aea922a208103120c008203000401cc1027000000000000232102afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e66955ac0000000000000000fd67096a4d6309f144034b4d44b2adb5302a3058325c06b102d88671016fc550147fb6e0d80869bd68764e38500121023a447741707e95bc889fbbb08295d402332217075752bd1bb3999b092e4753ab01524571b97a2bf1b546379e59479430ca188f274215b411e90d2cd51295b12b98c0b01800afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e6695500000000fd2a023034303030303830383532303266383930313063616362303839356262643563626265313261313338373563303664616335396164363135343738306466353964383662323864316461306436346333633530303030303030303662343833303435303232313030636162663266633633636562663265656362313836653932303533646131643463656266393834393830636136343561633035306231666234396530666334333032323037306635393330376438663434326332393564656135303064393361343534356136353066316238306430366461623931353435363261663763336132386331303132313032646563633265343963323463613966303662393636363565386533393833366561316438633733363731313636666136656539313762346263623330376234346666666666666666303331303237303030303030303030303030313937366139313434373236663238333866633464366163363636313565313036303465313839323665396235353665383861633430343230663030303030303030303031376139313437333734663831316230353365383161346234653665323832613234323161616631373061666161383739386462326433363030303030303030313937366139313430386261343135326665383066666333336638303562313636656339633033633238383130396234383861633666353263643564383762313138303030303030303030303030303030303030303030303030fd77060400000012a703d96b522f36fe13711c96de92b3f17bdbd41eda1a6753e2cd22924c1b0e47dd0fb69db925741977975a5803d8c885c72651b5c0427685e20e16cba73a43a2d8a734eb73a4dc734072dbfd12406f1e7121bfe0e3d6c10922495c44e5cc1cba52cd5dddaf001dffef8831000000000000b22a0000000000000200000000000000000000000000fd40050029a91e2967f03d92e838d3bf73067ed2431bde7f23432431f5d41ef6bd4245f0216b3b9a389d3f8c0813f27547948aec070a0302892468513f07653a83ac3a8c9a373cf12a4ddcb473f92d350417081a7c3696027f82781522fd39ac95449a24bfebf30ae39c328913e777ddca29a3d5b6b15374e1b84e09c9d2af243404e800ed03c3ec32dee990fa10d2b61d43db9987760fb169841e6cc985c6d651a4be3cd9f60cded6232e03f610267e1ed8873a5580c40c07353b0440398032251401ad3063d117d1ba83e674782f65e6d7b525691637434d0c0a0cd758c26b8be9fce02afdc81b6d4a2733432193242135d58d9762874d2d26ac85fbe43d0d324b512ac8012756e68100ce76b9b8bb761053501ea99224b88b66f8c86f236c23d8e0b9ca1ad9000c0e5fbf34a583c245fd9942e94c547345a62731a61a17bf895d2c17dcbb647ce2b7f3e29e5264c01e6d7300d7b9c9881c08e7d5ec71e3adb47de2061513094f13d654d22c502f596225b22ff05d457e479e9895ad05eecb63f71697639b5510e79a9973b5d8561144e41773a8d3e40eb10d5fc352db2e31ed555a8beb8a830aea6e654414a9853dfab20d37300fb0a776d5ccef137cd379ce98204728d7f2117111a59ead081894330faa17677889216b4c3d54c8a97f189296465ebcb739f61b8f53cf8ad6ced60d924b78d0677c3d1d16ab0fa1e0b94c6176d5f12617f6de5e665a99dbd8e84814f53d3fa0ccc383afa5d1cd6ac664bd27c44f0f4620344aacd78b8f0e96b8c853a0ceeafe35d6b338b5338e959b26a710bb3cdc9347fae575da0fae720eb312416cee371cf827cf7875edeb71da95bf07d864a812ffa8c4ddec2b87cf60f3bd2f636306b040976d0f1591a401fecdc304bce3754bd8d8fea5649e93da601995138c8c0bc69d44bc96ad786dc30e5ea13698c900c553d2c01972ad1ffce071a2980271c3525e932508f1f955bca7dee3e94997f8f6c92e4ef1447a3c47053563940ea4b88987fdb0ce0a7ddd8ea2bf375922297947ea8bb18985f6bbe3eab2d03f12f6687f911b12c7ce2b9050995523f0f23a03984f15cfc6785bd92af3ad60daac650ff3a718183967665f92b17eaf5d1459d2eb8255b94b0bd1f279aa18a04a87339941ee4cf11f31c357f31b9ff54858fb43085ebfc7b9868001bbbcd126dfcfeff478063fccde8736c15d1bb16108f1d710aad0694dffb181cc4e57f2b5d00276c18c19ccbacd7096be13a8fdf2c280cd237cbc46466c2e33cd745b465c60c1fdae6399b326ccf9e6164ff24021fce569dc8b6df8dfd26406906f1b25656f37a10626f153ff3239a8cfd35664155cb92ac54205ae517731afa77a86627177435cf5cb4371ab3a35fc99d0fc4731db98fb2ac959dc3757053ff6c41e5db1dc6da501456734a6155287cdc50038f2c43b74acfb683436510e0c6b3e1a0acfbf00663978d88ede7802b5703b05107dfb90a05ae78c9bb62375c4c6e591d9b7a35d2430066e8f528af96c32c2645566305387023dcd4a091ec0ec1bd4a454cc87f17426a65c1543759a7b503129aab79ed9e4b6efcb951da7f00c42d31cda7e4511f164e037762a63ebd2c617195f455687197bdc9f51cc26126ae291d3b0a4578bb8d6d386ac65b5859403bfde32cb619bb7f63f9c100f6b29a771837e3e1f06c83eccd5c2b3ca4d5af1ee5fc42fa4de6aa778402cf72a55e64cd2c5768862f2a65ec24a63da1946092e5bc5789a91cfccd4a553a3eeff0620f3ba53622e1513b6d59babb509a21516a6e9bb5657a6c4ff9a9423a65d555b9236caa510879d3ce809572db65cefa31783a5b5fcf0e6b9e44662536877f96e5e7bfce6593f912611095e905dcb5ef443b626e585a9a056e1d70900000005752526306830c6259c1659fa8ca3bfd85fa782c17efd04ec51cf7b13cc93de02afc40e08f3faf2ba3ac74f40bb75d3a4b1426ac62a517a3b9b26a85968e66955227fdec6d08be9fa88128f0d3c0681a5ba271ae5e27cfa60daa95e938c02f80da2499fa7619612a9acc3398f993475d4b981579f881f39adc29d1beb976be1c02e4e1bb76d33a81fa5f9065c8945a6a7aa2ceed88276ea9723c80bbb314ef89f023700210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f0000000000000000006a9900000000000000000000000000 -``` - -Output: - -``` -9e08b1c5ac37cbce997ceaa68d4ca2d1368b815e8de275bb54d5e230a1341b5f -``` - -This is the deposit `txid`. - -#### Claim the Tokenized KMD - -Use the [gatewaysclaim](../../../basic-docs/antara/antara-api/gateways.html#gatewaysclaim) method to claim the tokenized `KMD` on the `USDKTEST` Smart Chain. - -Method structure: - -`gatewaysclaim bindtxid coin deposittxid destpub amount` - -#### Details - -- `gatewaysclaim` — The name of the method, executed as-is -- `bindtxid` — This is the creation txid of the Gateway; supplied at the beginning of the tutorial -- `coin` — Ticker of the `coin` deposited -- `deposittxid` — The `txid` returned from the `gatewaysdeposit` transaction -- `destpubkey` — The user pubkey used to launch the `USDKTEST` daemon -- `amount` — The `amount` deposited - -Observe the following example structure. - -```bash -./komodo-cli -ac_name=USDKTEST gatewaysclaim 50384e7668bd6908d8e0b67f1450c56f017186d802b1065c3258302a30b5adb2 KMD 9e08b1c5ac37cbce997ceaa68d4ca2d1368b815e8de275bb54d5e230a1341b5f 0217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06 0.01 -``` - -Output: - -```json -{ - "hex": "0400008085202f89028a91efc8a0073e1d2fd879d71ee5b3771f16ad307cdcf69d477400de679c879801000000804c7ea27ba077a26ba067a565802103ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb408140edb95c621f7cc2a57447c230e2c8750941fb747bb80cee91dc6cdc9cdf57342042b01dbef69d7dd7600e3b129d423f11615173cfa2f3f3c0cb303e0918c75e5ca100af038001f1af038001f2a10001ffffffff5f1b34a130e2d554bb75e28d5e818b36d1a24c8da6ea7c99cecb37acc5b1089e000000007b4c79a276a072a26ba067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140dbba871356bd3241c73baafd98c134385e156813bdce9c864058de920c3a24d66eb808c4a329e38552756172c0bd1d93bcfb870eec246cd8dd97b08637edaa18a100af038001f1a10001ffffffff0240420f0000000000302ea22c8020d62369afdb9fbe16bae7a6ac394333e9337ecc0b7671cda491df2fa82e48a20d8103120c008203000401cc0000000000000000ba6a4cb7f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf101210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e061370f143b2adb5302a3058325c06b102d88671016fc550147fb6e0d80869bd68764e3850034b4d445f1b34a130e2d554bb75e28d5e818b36d1a24c8da6ea7c99cecb37acc5b1089e210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f000000000000000000a29900000000000000000000000000", - "result": "success" -} -``` - -Broadcast the returned hex value using sendrawtransaction. - -```bash -./komodo-cli -ac_name=USDKTEST sendrawtransaction 0400008085202f89028a91efc8a0073e1d2fd879d71ee5b3771f16ad307cdcf69d477400de679c879801000000804c7ea27ba077a26ba067a565802103ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb408140edb95c621f7cc2a57447c230e2c8750941fb747bb80cee91dc6cdc9cdf57342042b01dbef69d7dd7600e3b129d423f11615173cfa2f3f3c0cb303e0918c75e5ca100af038001f1af038001f2a10001ffffffff5f1b34a130e2d554bb75e28d5e818b36d1a24c8da6ea7c99cecb37acc5b1089e000000007b4c79a276a072a26ba067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140dbba871356bd3241c73baafd98c134385e156813bdce9c864058de920c3a24d66eb808c4a329e38552756172c0bd1d93bcfb870eec246cd8dd97b08637edaa18a100af038001f1a10001ffffffff0240420f0000000000302ea22c8020d62369afdb9fbe16bae7a6ac394333e9337ecc0b7671cda491df2fa82e48a20d8103120c008203000401cc0000000000000000ba6a4cb7f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf101210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e061370f143b2adb5302a3058325c06b102d88671016fc550147fb6e0d80869bd68764e3850034b4d445f1b34a130e2d554bb75e28d5e818b36d1a24c8da6ea7c99cecb37acc5b1089e210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f000000000000000000a29900000000000000000000000000 -``` - -Output: - -``` -e38b3f2022364cb0f0b9b60e9b2d89bad0a3974206e783ed78f1f1b09fa0299c -``` - -#### Verify the Returned Tokenized KMD - -Use the tokeninfo method to check that the above commands result in a deposit in the tutorial user's account of the appropriate amount of tokenized `KMD`. - -```bash -./komodo-cli -ac_name=USDKTEST tokeninfo 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 -``` - -Output: - -```json -{ - "result": "success", - "tokenid": "1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1", - "owner": "038814d60d99a594b4b1092247df4384bc21a50733d3acd0e29499e5f03737374d", - "name": "KMD", - "supply": 10000000000000, - "description": "KMD_BTC,BTC_USD,*,1" -} -``` - -The description `"KMD_BTC,BTC_USD,*,1"` indicates to the Pegs modules the price to be considered. - -```bash -./komodo-cli -ac_name=USDKTEST tokenbalance 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 -``` - -Output: - -```json -{ - "result": "success", - "CCaddress": "RTcbFr8dH9dPGgGephMoDevHefndQQehxq", - "tokenid": "1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1", - "balance": 1000000 -} -``` - -### Exchange Tokenized KMD for USDK Coins - -Use the [pegsfund](../../../basic-docs/antara/antara-api/pegs.html#pegsfund) method to lock the tokenized `KMD`. - -```bash -./komodo-cli -ac_name=USDKTEST pegsfund a9539ec8db34ee44ff213cda59f412a02795821cf05844b0bc184660711371f7 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 0.01 -``` - -Output: - -```json -{ - "hex": "0400008085202f89024c386ef60103e74f339867bd7c38b7f187ceee842b8e57ab9a42a16b0721be23040000007b4c79a276a072a26ba067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece8140213fbd380d7905f770709725fe462e5f0a731eca4e56435c4b2f7c96d5b6201433e7c780d313795ddf9ae1d0b689b4f950af6e0e07dd9bcbc293b46f2a349ef4a100af038001eea10001ffffffff9c29a09fb0f1f178ed83e7064297a3d0ba892d9b0eb6b9f0b04c3622203f8be3000000007b4c79a276a072a26ba067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0681409a7fa29976f948038b77573fb1103836340ebbcdfbbba8dc852186be1666811c034adf2ec9d9515eb58f14df81925f46fb152b2964e8f392b70bafdfe3a8af83a100af038001f2a10001ffffffff051027000000000000302ea22c8020e39343ebe1b40dcc747d145f140983b38f230dcf7963f2b58051265c765f2efa81031210008203000401cc1027000000000000302ea22c8020d77058bfd93eebe366e1c82fc1475690fd290214ed43b8c9dd25374077b35cbe81031210008203000401cc40420f0000000000302ea22c802002bc3497bdabeac3d0c40ac845fa105685724d1b70c84bd6c5cef2ff4c353e7881032214008203000401cc3cdf993b00000000302ea22c802039452b774825750cd9390c3f05c96e486ecf2f21779466efbcd214220a7f288a8103120c008203000401cc0000000000000000c86a4cc5f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf102210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e062103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece175cee46f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f000000000040420f0000000000000000000000000000000000a79900000000000000000000000000", - "result": "success" -} -``` - -Broadcast the hex value. - -```bash -./komodo-cli -ac_name=USDKTEST sendrawtransaction 0400008085202f89024c386ef60103e74f339867bd7c38b7f187ceee842b8e57ab9a42a16b0721be23040000007b4c79a276a072a26ba067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece8140213fbd380d7905f770709725fe462e5f0a731eca4e56435c4b2f7c96d5b6201433e7c780d313795ddf9ae1d0b689b4f950af6e0e07dd9bcbc293b46f2a349ef4a100af038001eea10001ffffffff9c29a09fb0f1f178ed83e7064297a3d0ba892d9b0eb6b9f0b04c3622203f8be3000000007b4c79a276a072a26ba067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0681409a7fa29976f948038b77573fb1103836340ebbcdfbbba8dc852186be1666811c034adf2ec9d9515eb58f14df81925f46fb152b2964e8f392b70bafdfe3a8af83a100af038001f2a10001ffffffff051027000000000000302ea22c8020e39343ebe1b40dcc747d145f140983b38f230dcf7963f2b58051265c765f2efa81031210008203000401cc1027000000000000302ea22c8020d77058bfd93eebe366e1c82fc1475690fd290214ed43b8c9dd25374077b35cbe81031210008203000401cc40420f0000000000302ea22c802002bc3497bdabeac3d0c40ac845fa105685724d1b70c84bd6c5cef2ff4c353e7881032214008203000401cc3cdf993b00000000302ea22c802039452b774825750cd9390c3f05c96e486ecf2f21779466efbcd214220a7f288a8103120c008203000401cc0000000000000000c86a4cc5f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf102210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e062103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece175cee46f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f000000000040420f0000000000000000000000000000000000a79900000000000000000000000000 -``` - -Output: - -``` -298cfa125e1a38a7aa2a8da8282b017a45cd0c1dc70935712692c00abf48ba3f -``` - -Use the [pegsget](../../../basic-docs/antara/antara-api/pegs.html#pegsget) method to retrieve the `USDK` coins. - -```bash -./komodo-cli -ac_name=USDKTEST pegsget a9539ec8db34ee44ff213cda59f412a02795821cf05844b0bc184660711371f7 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 0.001 -``` - -Output: - -```json -{ - "hex": "0400008085202f8903b68353f713e1d70cf2fe4fa538de32a8723e603d507c8ee2d42277f3fd7334ad00ca9a3b0201e2ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c2900000000a74ca5a281a1a0819ca28194a067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece81402e06d560cac761ee7d7720f6ed0f307520fda7c66b2ac0d16cd3c34a33f004393f735429a7ad445a1c970723a7a9d173e1fcc62b54ed164dfb40f23542c9627da129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c2901000000a74ca5a281a1a0819ca28194a067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140152ff019e1e4346d450ab149f1ef9115ea84c9ff7c3bb60444a7e48eda0784a46ecefbf1a35f0062513033d9c3fce45a083f70b7ccc41103763c267598bcadcca129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff041027000000000000302ea22c8020e39343ebe1b40dcc747d145f140983b38f230dcf7963f2b58051265c765f2efa81031210008203000401cc1027000000000000302ea22c8020d77058bfd93eebe366e1c82fc1475690fd290214ed43b8c9dd25374077b35cbe81031210008203000401cca08601000000000023210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06ac0000000000000000fd22016a4d1e01e211b68353f713e1d70cf2fe4fa538de32a8723e603d507c8ee2d42277f3fd7334ad00000400008085202f89013fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c290000000000ffffffff01a086010000000000ab6a4ca8e28efefefe7f065045475343433e140a06d1f028a3abce516bd5d08ebfd860da116dfb0c3a22003b57f0809b5400f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9f1eb0ab5bb63b9b36cd1a44d0a30f35d1c113efb5cf5fd4e549ae7f11297451a210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06a08601000000000040420f0000000000a08601000000000000000000b0990000000000000000000000000000000000000000000000000000000000000000", - "result": "success" -} -``` - -Broadcast the returned hex value. - -```bash -./komodo-cli -ac_name=USDKTEST sendrawtransaction 0400008085202f8903b68353f713e1d70cf2fe4fa538de32a8723e603d507c8ee2d42277f3fd7334ad00ca9a3b0201e2ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c2900000000a74ca5a281a1a0819ca28194a067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece81402e06d560cac761ee7d7720f6ed0f307520fda7c66b2ac0d16cd3c34a33f004393f735429a7ad445a1c970723a7a9d173e1fcc62b54ed164dfb40f23542c9627da129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c2901000000a74ca5a281a1a0819ca28194a067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140152ff019e1e4346d450ab149f1ef9115ea84c9ff7c3bb60444a7e48eda0784a46ecefbf1a35f0062513033d9c3fce45a083f70b7ccc41103763c267598bcadcca129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff041027000000000000302ea22c8020e39343ebe1b40dcc747d145f140983b38f230dcf7963f2b58051265c765f2efa81031210008203000401cc1027000000000000302ea22c8020d77058bfd93eebe366e1c82fc1475690fd290214ed43b8c9dd25374077b35cbe81031210008203000401cca08601000000000023210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06ac0000000000000000fd22016a4d1e01e211b68353f713e1d70cf2fe4fa538de32a8723e603d507c8ee2d42277f3fd7334ad00000400008085202f89013fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c290000000000ffffffff01a086010000000000ab6a4ca8e28efefefe7f065045475343433e140a06d1f028a3abce516bd5d08ebfd860da116dfb0c3a22003b57f0809b5400f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9f1eb0ab5bb63b9b36cd1a44d0a30f35d1c113efb5cf5fd4e549ae7f11297451a210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06a08601000000000040420f0000000000a08601000000000000000000b0990000000000000000000000000000000000000000000000000000000000000000 -``` - -Output: - -``` -8f18ab623cb91c94ea27b16c455d98df1e057dd120341e54b453090a2c9c9adf -``` - -Examine the tutorial user's account history using the [pegsaccounthistory](../../../basic-docs/antara/antara-api/pegs.html#pegsaccounthistory) method. - -```bash -./komodo-cli -ac_name=USDKTEST pegsaccounthistory a9539ec8db34ee44ff213cda59f412a02795821cf05844b0bc184660711371f7 -``` - -Output: - -```json -{ - "result": "success", - "name": "pegsaccounthistory", - "account history": [ - { - "action": "fund", - "amount": 1000000, - "accounttxid": "298cfa125e1a38a7aa2a8da8282b017a45cd0c1dc70935712692c00abf48ba3f", - "token": "KMD", - "deposit": 1000000, - "debt": 0 - }, - { - "action": "get", - "amount": 100000, - "accounttxid": "8f18ab623cb91c94ea27b16c455d98df1e057dd120341e54b453090a2c9c9adf", - "token": "KMD", - "deposit": 1000000, - "debt": 100000 - } - { - "action": "get", - "amount": 600000, - "accounttxid": "8e79ed0a76f359ba048563a0fa2a29ab88ab86b1895e8eff9718f348a04dd1f3", - "token": "KMD", - "deposit": 1000000, - "debt": 700000 - } - { - "action": "get", - "amount": 30000, - "accounttxid": "9a10581ae047fabe91495cfe558961e3b7362a19b700b2fcea216d06c44d9720", - "token": "KMD", - "deposit": 1000000, - "debt": 730000 - } - ] -} -``` - -(If there are duplicate entries in the above call, please ignore them. This is a known bug and will be fixed.) - -Use [getbalance](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#getbalance) or [listunspent](../../../basic-docs/smart-chains/smart-chain-setup/nspv.html#listunspent) methods to verify that the `USDKTEST` coins are in the tutorial user's account. - -At this point, a normal user may use the stablecoins (`USDKTEST` in this example) to buy, sell, and trade. - -#### Redeeming the Stablecoins for the Locked Funds - -When finished with the stablecoins, the user may send to the Pegs Module the precise amount of `USDKTEST` coins withdrawn in order to receive the locked `KMD` tokens. - -Use the [pegsredeem](../../../basic-docs/antara/antara-api/pegs.html#pegsredeem) method to redeem the tokens. - -```bash -./komodo-cli -ac_name=USDKTEST pegsredeem a9539ec8db34ee44ff213cda59f412a02795821cf05844b0bc184660711371f7 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 -``` - -Output: - -```json -{ - "hex": "0400008085202f891e045ffbf7d56aba87d1527a8bd50c7cbfb44f376b1c0a6815c741a5f6e107f02d00000000484730440220064f36926ed7d6975ad1ecb358df866897554d29d623447b95d0f9d1f575ff0a02203ca4d9ea407c2310cd49be1315887cde4e54619de93d6882f0c2fe871820ef3201ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c29030000007b4c79a276a072a26ba067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece81400301711d3ddb1753c3a004c250616ea580f0bf75c1c03f791f76327a6efa69792f19eae5fa3c73ab29a4b6754a91111935a46fa1c28d4cdaacdcb24ec571a45fa100af038001eea10001ffffffff20974dc4066d21eafcb200b7192a36b7e3618955fe5c4991befa47e01a58109a00000000a74ca5a281a1a0819ca28194a067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece81409ffd2bb29f40dbf7b3e741e00e3a97c7e66f49526ea9dd33ec724eb30a81b21b16cdac1ea840cbf902f36ef17b9ac81014a735e97377d6d5f07a6e8ac04556f8a129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff20974dc4066d21eafcb200b7192a36b7e3618955fe5c4991befa47e01a58109a01000000a74ca5a281a1a0819ca28194a067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140bbfdfb024c50111ed7184b3fd4c7c462ea5093ab9969bab386d54965e248184a00a5cb2a1f625116d3bd02b470f4b33dab11a38ffd4d050fcdbe01e8ae754e70a129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c2902000000ac4caaa281a6a081a1a28194a067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140bfb34bd8abc720bef5c13708ad9280893df2b9fb1e70eb6063c05614245f5d3538d3048b9f6e4fbfc3053e594df7e638dd22e42c833c75aa174edf010fb45419a129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eeaf038001f2a10001ffffffff0dfe7aecdaed2498f6a3c29bcd53f15913ae2b36bf7643efcb8d3eb93354fbad00000000484730440220403e6284a585ed11b58207279786396101ea442d79b9df44688ebdaa7467e04d0220474f38ecc4ff53f9d685538805d0f0b7eaf008c9736ddf677a4bb88919e5680e01ffffffff0491bd559806afc9638763c8fb8e550b5e13df6d18ed0eeb7209f8e7e6ccb90f0000000048473044022078b520bbaa03883e03321a98cfca3282f7f1d70d91a977ed81b50d0f91440b3402205d1f346312ffbe4b76c614fb8d9dfcfd38069eca55a8f7d2ae84d4cae6fb481901ffffffff0d5e3529d01acc37c5cfbac0a3321870a5097134029ed474db42023bcbf18bb50000000049483045022100e6ccd2403781c60d928fa090d78d3f42cfa812dcd37ca5c65c91969a81a6d8ab022067f917bd432c69a44fd338a4897462e294b40304ea44dfe544a826bdb75232b901ffffffff07c9ea3dcb2164a8b5e839b23f39e6d2e0d3b8a7848ea188dca6e61a9833a8d00000000048473044022061ffebbf638055097c9bfaf654135e65925e7107cdd86d553264df3c16eefd3f0220401de8c419a842ad1f72eab0eaeca0f63ff95419e222a94141b04b5eaa3e341701ffffffff0ac35ee065ed0090ef129c389f0b84c91feaf9bf8a4ae6c12480a4d435cd550400000000484730440220710f15cebed5631fdaee51b651456b2b56e1d83968526745241a4920c6719b2b022000abc38a4b9ae4f6a7c53c1e80049c7d9109f97e26daf76a27021ee805a21a1d01ffffffff0aee5de22398ff1a61bca8d95d3304337be9cb00d401afa088cf95d31f121b1d000000004847304402207e4c1793bb91c550e462d38531734dd9fece17bab40ad0d2e8c2e9cd741f342302202c4973b14c9a5768a72aa5a4ab752de8fb388fd208280b6e5ef529e918dcca4101ffffffff0bd4eeed3d68d4f361e4e65a06f1e437739d209c5b593adfb9c908a11e5c4b1e0000000049483045022100a3e1e8f18bdd72f3794d3e2bfef1d807f904c93c511d396d33f66a9a84ea988b02203954987e94629cf77982568f115a148d64b44f1619c285d9ea229ac81268a16c01ffffffff023035ddb47d6d6ba1a1e760a750325f912f66934130059313bd2460dd3626a80000000049483045022100be9bc941d1afcc3e816a70e2e49e0c0b5279d8c704b14e8ea6f0a5b8e644f999022016ac0c28af028149a3026eb3cbe266604809643b303ff3ae4c27f4a11ed7059901ffffffff0d0db11a4bfaeb4293d26d4f540f8ae7b8ac648998d32ee4902eb6445bf3b4f4000000004948304502210093896862f4c679d6db6eb57951b5117a6201eda285b257dd60c57a45a3254cbb02205a7d32b4ffbf0f8d90cf1fca8a0f4f09e36da21c536e32f7002a28d6d56d132b01ffffffff0623be2e2bd36d04b45df4fcb8349f0b10095ec1aac30613fd21ca40054361300000000049483045022100d24bb6d6720e876a57607c8e29348f29357181d4369e41b044be9a4ac699272c022046e536c70a5ae151c99cff8795b9a1a6fbf159cfdac0c36bbceced6f6c7cec6b01ffffffff0cc55d115db43ac735fef6a662896b24f288b2fbb7b793c1f96948f6820338ed00000000494830450221009d6ffacd7e7c167c254ad79e03184d30f3598a75baf5422f62a74fbee20f8d35022029c7348297580926f64d6f3dd69f54aaec45b428594fae57af252ccf2fb804e401ffffffff08230c57a73ae1167c7c99c5e135af4e52b21468c9ef6de6528e51700d611fcd00000000484730440220645c65d17a44532e80bec8c40fd683dfbf614a6d64acec64eb2567788bbf9ea402205976d7399e33d20e588230ff6d65cef4dde327ffbb42a15e2191400896b34a4a01ffffffff083ae311d476e71cbd214e90aa7065bc3f8e3735fccdb951e84be2f35dbe86e90000000049483045022100aedf51f885b813acbce5799f976dff5200658396d3c33dd36f5768d5225215e3022070faaccac58b8aee064a312d6ed01301ac947c9e5cfd6be3d81d5cabb48ddf0901ffffffff012f6500ac7ff9cf0a6a624ca7a49e684fc6d28b5646a47c1f65d693965b1c430000000049483045022100ea4eca020c79db8fe46ae1a970c15deda516180c875bbbdb7c43a73e884a60f202207278af9cd50ee2806f6e4f16a5f2e4454881deacbcade363289239fdd54a982d01ffffffff08359b7d0efb9eede36cf0a5d9fdc5f4a83308c8a11099a3fa4cbb1fadbfcfde0000000049483045022100d1c1ed48608d61ae88cd957281e9320311861dbdc3596136533f058313883b6a02200ba029992e819196fd7c83b51a8d108c1b3c9b1f03a7faf2290acfced66c113a01ffffffff083f857139d0711209eef17e2f6177cb4ed0f68c00f520038a587744262445b90000000049483045022100cd94b3dd563ad7a37bd531a89cb0d988f4ec92949df7302ba43e13bdb88082c1022003be0f619ae4b3de597f8716a9374d63becf81d3d3943b3c741ee636b7e5cd8401ffffffff09cb8b189715b655a0c07456648951c3c178a6c6270c484dd3cfad5b18f859880000000048473044022025b7fc3db1a0b33471e5eccd3cb54a71fec8c5366837388489f3d9c90ad80d070220485c4c79790e2cfac55566869a52dbd86426f4d1db9fa23314d82b26ffc8f06d01ffffffff070d10ba3a3bb2f50fbc88549ab14aea8424bfa5cf4932653a82b2af987a82200000000048473044022047ac9d547dbf96cebd1f6dc29aad99d752c60b316df54987b577b7cc04cb6a9302204ae6a4707e6f270a4bfdc1d55e31bbbaf95e233a6c26ae6823b3f592cb39656301ffffffff0be472c9362d31a026a7f22d0fa14f294c95b0457ae66cd7179bb29a1f30278d0000000049483045022100e54335c0b652f35a3ae2eda351638b3b5d1ff76bf256bfcfe6a3e8810fd131ad02202865894c90cdbea6e1f052a83a085236606da96afc03e47a79159c5f9ee1398401ffffffff051c297d636cc51d90a5996a23ffc7c5374a4e3df397f770b5113585749bb5480000000049483045022100d67d9b0c34aa8f8d6c4ed261af543ce4cd9b95fcae7bbbb94c0f2521982037be02207fa0b75e74f2c2e9a5009d160addb3b191cf751e0887f0186526023f7f79b80401ffffffff0b19234b25da56339d70722c5845e39a56513ce6b70c7c26486e7d3b8c5bd02c000000004948304502210086f6f6dc5005207cc4206ff43d29e1ca42fc6cf5ce30e870d6bfa39002264a9c02200be78b519d6d2f7448ded31e96077b00960532c7d7b1484c37fe6a1d6990237e01ffffffff0d628dfaece395d197c0b810668b7af212d083e5f441a4c729b164ab3df91b510000000049483045022100c6ca324eeaafc9bacae5c260981baf9ae8f5c0eb3f83533c8631ecbe592d470c022014d44bc921909246002d64e4c029af2a4abb26812a6902cf61f69782630ce9c901ffffffff039d71284b8643c45e14b5bfc8c9439a17474376a78cec7be3d6b688a40bc4fc000000004847304402206b8320f3ea3cdd73fa9e4ee43a62144076b6ffc6cf58fdb06233b542d6924db402205a2310f7fc382407c8466b5677691988a6dc2a0fe3f3b4c6bc1f1a01d1820e7901ffffffff02803fb66f0c03fa8211d4086ad2262e50ea5dd99f30603e9999603cdfac367c0000000049483045022100837fec21e7ba574c2283ec160bc418485f2dd6fbb5f5dd575156c41450e7deb6022058aefedcc08274f523c52981b69f124197a431580d5692c2a5f6e8af6bef594801ffffffff0af2f9ced5de00310114f70d6756db7df65205aeac26b5607bd71333812f68e40000000049483045022100d5fdd26ad4682b6aa2d522c1b75097f9cb3df94632e5cfc2454d79b76f9401660220193d741cc875e75cf04ad70de582915b14b41a6283967527e931c50565cdb62f01ffffffff071027000000000000302ea22c8020e39343ebe1b40dcc747d145f140983b38f230dcf7963f2b58051265c765f2efa81031210008203000401cc1027000000000000302ea22c8020d77058bfd93eebe366e1c82fc1475690fd290214ed43b8c9dd25374077b35cbe81031210008203000401cc40420f0000000000302ea22c8020d62369afdb9fbe16bae7a6ac394333e9337ecc0b7671cda491df2fa82e48a20d8103120c008203000401cc90230b0000000000232102f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9ac2cb8993b00000000302ea22c802039452b774825750cd9390c3f05c96e486ecf2f21779466efbcd214220a7f288a8103120c008203000401cc102700000000000023210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06ac0000000000000000a66a4ca3f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf101210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06175cee52f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f00000000000000000000000000000000000000000000000000209d00000000000000000000000000", - "result": "success" -} -``` - -Broadcast the hex value. - -```bash -./komodo-cli -ac_name=USDKTEST sendrawtransaction 0400008085202f891e045ffbf7d56aba87d1527a8bd50c7cbfb44f376b1c0a6815c741a5f6e107f02d00000000484730440220064f36926ed7d6975ad1ecb358df866897554d29d623447b95d0f9d1f575ff0a02203ca4d9ea407c2310cd49be1315887cde4e54619de93d6882f0c2fe871820ef3201ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c29030000007b4c79a276a072a26ba067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece81400301711d3ddb1753c3a004c250616ea580f0bf75c1c03f791f76327a6efa69792f19eae5fa3c73ab29a4b6754a91111935a46fa1c28d4cdaacdcb24ec571a45fa100af038001eea10001ffffffff20974dc4066d21eafcb200b7192a36b7e3618955fe5c4991befa47e01a58109a00000000a74ca5a281a1a0819ca28194a067a565802103c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece81409ffd2bb29f40dbf7b3e741e00e3a97c7e66f49526ea9dd33ec724eb30a81b21b16cdac1ea840cbf902f36ef17b9ac81014a735e97377d6d5f07a6e8ac04556f8a129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff20974dc4066d21eafcb200b7192a36b7e3618955fe5c4991befa47e01a58109a01000000a74ca5a281a1a0819ca28194a067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140bbfdfb024c50111ed7184b3fd4c7c462ea5093ab9969bab386d54965e248184a00a5cb2a1f625116d3bd02b470f4b33dab11a38ffd4d050fcdbe01e8ae754e70a129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eea10001ffffffff3fba48bf0ac09226713509c71d0ccd457a012b28a88d2aaaa7381a5e12fa8c2902000000ac4caaa281a6a081a1a28194a067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e068140bfb34bd8abc720bef5c13708ad9280893df2b9fb1e70eb6063c05614245f5d3538d3048b9f6e4fbfc3053e594df7e638dd22e42c833c75aa174edf010fb45419a129a52780209de43b2cf09dcb2107822237e0afba0b0917b1592457b6fbfddb34fff3d302ae8103020000af038001eeaf038001f2a10001ffffffff0dfe7aecdaed2498f6a3c29bcd53f15913ae2b36bf7643efcb8d3eb93354fbad00000000484730440220403e6284a585ed11b58207279786396101ea442d79b9df44688ebdaa7467e04d0220474f38ecc4ff53f9d685538805d0f0b7eaf008c9736ddf677a4bb88919e5680e01ffffffff0491bd559806afc9638763c8fb8e550b5e13df6d18ed0eeb7209f8e7e6ccb90f0000000048473044022078b520bbaa03883e03321a98cfca3282f7f1d70d91a977ed81b50d0f91440b3402205d1f346312ffbe4b76c614fb8d9dfcfd38069eca55a8f7d2ae84d4cae6fb481901ffffffff0d5e3529d01acc37c5cfbac0a3321870a5097134029ed474db42023bcbf18bb50000000049483045022100e6ccd2403781c60d928fa090d78d3f42cfa812dcd37ca5c65c91969a81a6d8ab022067f917bd432c69a44fd338a4897462e294b40304ea44dfe544a826bdb75232b901ffffffff07c9ea3dcb2164a8b5e839b23f39e6d2e0d3b8a7848ea188dca6e61a9833a8d00000000048473044022061ffebbf638055097c9bfaf654135e65925e7107cdd86d553264df3c16eefd3f0220401de8c419a842ad1f72eab0eaeca0f63ff95419e222a94141b04b5eaa3e341701ffffffff0ac35ee065ed0090ef129c389f0b84c91feaf9bf8a4ae6c12480a4d435cd550400000000484730440220710f15cebed5631fdaee51b651456b2b56e1d83968526745241a4920c6719b2b022000abc38a4b9ae4f6a7c53c1e80049c7d9109f97e26daf76a27021ee805a21a1d01ffffffff0aee5de22398ff1a61bca8d95d3304337be9cb00d401afa088cf95d31f121b1d000000004847304402207e4c1793bb91c550e462d38531734dd9fece17bab40ad0d2e8c2e9cd741f342302202c4973b14c9a5768a72aa5a4ab752de8fb388fd208280b6e5ef529e918dcca4101ffffffff0bd4eeed3d68d4f361e4e65a06f1e437739d209c5b593adfb9c908a11e5c4b1e0000000049483045022100a3e1e8f18bdd72f3794d3e2bfef1d807f904c93c511d396d33f66a9a84ea988b02203954987e94629cf77982568f115a148d64b44f1619c285d9ea229ac81268a16c01ffffffff023035ddb47d6d6ba1a1e760a750325f912f66934130059313bd2460dd3626a80000000049483045022100be9bc941d1afcc3e816a70e2e49e0c0b5279d8c704b14e8ea6f0a5b8e644f999022016ac0c28af028149a3026eb3cbe266604809643b303ff3ae4c27f4a11ed7059901ffffffff0d0db11a4bfaeb4293d26d4f540f8ae7b8ac648998d32ee4902eb6445bf3b4f4000000004948304502210093896862f4c679d6db6eb57951b5117a6201eda285b257dd60c57a45a3254cbb02205a7d32b4ffbf0f8d90cf1fca8a0f4f09e36da21c536e32f7002a28d6d56d132b01ffffffff0623be2e2bd36d04b45df4fcb8349f0b10095ec1aac30613fd21ca40054361300000000049483045022100d24bb6d6720e876a57607c8e29348f29357181d4369e41b044be9a4ac699272c022046e536c70a5ae151c99cff8795b9a1a6fbf159cfdac0c36bbceced6f6c7cec6b01ffffffff0cc55d115db43ac735fef6a662896b24f288b2fbb7b793c1f96948f6820338ed00000000494830450221009d6ffacd7e7c167c254ad79e03184d30f3598a75baf5422f62a74fbee20f8d35022029c7348297580926f64d6f3dd69f54aaec45b428594fae57af252ccf2fb804e401ffffffff08230c57a73ae1167c7c99c5e135af4e52b21468c9ef6de6528e51700d611fcd00000000484730440220645c65d17a44532e80bec8c40fd683dfbf614a6d64acec64eb2567788bbf9ea402205976d7399e33d20e588230ff6d65cef4dde327ffbb42a15e2191400896b34a4a01ffffffff083ae311d476e71cbd214e90aa7065bc3f8e3735fccdb951e84be2f35dbe86e90000000049483045022100aedf51f885b813acbce5799f976dff5200658396d3c33dd36f5768d5225215e3022070faaccac58b8aee064a312d6ed01301ac947c9e5cfd6be3d81d5cabb48ddf0901ffffffff012f6500ac7ff9cf0a6a624ca7a49e684fc6d28b5646a47c1f65d693965b1c430000000049483045022100ea4eca020c79db8fe46ae1a970c15deda516180c875bbbdb7c43a73e884a60f202207278af9cd50ee2806f6e4f16a5f2e4454881deacbcade363289239fdd54a982d01ffffffff08359b7d0efb9eede36cf0a5d9fdc5f4a83308c8a11099a3fa4cbb1fadbfcfde0000000049483045022100d1c1ed48608d61ae88cd957281e9320311861dbdc3596136533f058313883b6a02200ba029992e819196fd7c83b51a8d108c1b3c9b1f03a7faf2290acfced66c113a01ffffffff083f857139d0711209eef17e2f6177cb4ed0f68c00f520038a587744262445b90000000049483045022100cd94b3dd563ad7a37bd531a89cb0d988f4ec92949df7302ba43e13bdb88082c1022003be0f619ae4b3de597f8716a9374d63becf81d3d3943b3c741ee636b7e5cd8401ffffffff09cb8b189715b655a0c07456648951c3c178a6c6270c484dd3cfad5b18f859880000000048473044022025b7fc3db1a0b33471e5eccd3cb54a71fec8c5366837388489f3d9c90ad80d070220485c4c79790e2cfac55566869a52dbd86426f4d1db9fa23314d82b26ffc8f06d01ffffffff070d10ba3a3bb2f50fbc88549ab14aea8424bfa5cf4932653a82b2af987a82200000000048473044022047ac9d547dbf96cebd1f6dc29aad99d752c60b316df54987b577b7cc04cb6a9302204ae6a4707e6f270a4bfdc1d55e31bbbaf95e233a6c26ae6823b3f592cb39656301ffffffff0be472c9362d31a026a7f22d0fa14f294c95b0457ae66cd7179bb29a1f30278d0000000049483045022100e54335c0b652f35a3ae2eda351638b3b5d1ff76bf256bfcfe6a3e8810fd131ad02202865894c90cdbea6e1f052a83a085236606da96afc03e47a79159c5f9ee1398401ffffffff051c297d636cc51d90a5996a23ffc7c5374a4e3df397f770b5113585749bb5480000000049483045022100d67d9b0c34aa8f8d6c4ed261af543ce4cd9b95fcae7bbbb94c0f2521982037be02207fa0b75e74f2c2e9a5009d160addb3b191cf751e0887f0186526023f7f79b80401ffffffff0b19234b25da56339d70722c5845e39a56513ce6b70c7c26486e7d3b8c5bd02c000000004948304502210086f6f6dc5005207cc4206ff43d29e1ca42fc6cf5ce30e870d6bfa39002264a9c02200be78b519d6d2f7448ded31e96077b00960532c7d7b1484c37fe6a1d6990237e01ffffffff0d628dfaece395d197c0b810668b7af212d083e5f441a4c729b164ab3df91b510000000049483045022100c6ca324eeaafc9bacae5c260981baf9ae8f5c0eb3f83533c8631ecbe592d470c022014d44bc921909246002d64e4c029af2a4abb26812a6902cf61f69782630ce9c901ffffffff039d71284b8643c45e14b5bfc8c9439a17474376a78cec7be3d6b688a40bc4fc000000004847304402206b8320f3ea3cdd73fa9e4ee43a62144076b6ffc6cf58fdb06233b542d6924db402205a2310f7fc382407c8466b5677691988a6dc2a0fe3f3b4c6bc1f1a01d1820e7901ffffffff02803fb66f0c03fa8211d4086ad2262e50ea5dd99f30603e9999603cdfac367c0000000049483045022100837fec21e7ba574c2283ec160bc418485f2dd6fbb5f5dd575156c41450e7deb6022058aefedcc08274f523c52981b69f124197a431580d5692c2a5f6e8af6bef594801ffffffff0af2f9ced5de00310114f70d6756db7df65205aeac26b5607bd71333812f68e40000000049483045022100d5fdd26ad4682b6aa2d522c1b75097f9cb3df94632e5cfc2454d79b76f9401660220193d741cc875e75cf04ad70de582915b14b41a6283967527e931c50565cdb62f01ffffffff071027000000000000302ea22c8020e39343ebe1b40dcc747d145f140983b38f230dcf7963f2b58051265c765f2efa81031210008203000401cc1027000000000000302ea22c8020d77058bfd93eebe366e1c82fc1475690fd290214ed43b8c9dd25374077b35cbe81031210008203000401cc40420f0000000000302ea22c8020d62369afdb9fbe16bae7a6ac394333e9337ecc0b7671cda491df2fa82e48a20d8103120c008203000401cc90230b0000000000232102f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9ac2cb8993b00000000302ea22c802039452b774825750cd9390c3f05c96e486ecf2f21779466efbcd214220a7f288a8103120c008203000401cc102700000000000023210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06ac0000000000000000a66a4ca3f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf101210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06175cee52f7711371604618bcb04458f01c829527a012f459da3c21ff44ee34dbc89e53a9210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e0640420f00000000000000000000000000000000000000000000000000209d00000000000000000000000000 -``` - -Output: - -``` -ff95e70f0d551748f460e61b7e75b279b8de355cb37df6c5895dfb8a49ee348a -``` - -#### Verify that the Tokens are Redeemed - -Use the [tokenbalance](../../../basic-docs/antara/antara-api/tokens.html#tokenbalance) method to verify that the tokens are redeemed and available in the tutorial user's local wallet. - -```bash -./komodo-cli -ac_name=USDKTEST tokenbalance 1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1 -``` - -Output: - -```json -{ - "result": "success", - "CCaddress": "RTcbFr8dH9dPGgGephMoDevHefndQQehxq", - "tokenid": "1a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1", - "balance": 1000000 -} -``` - -### Retrieve the KMD Coins on the KMD Smart Chain - -Send the `KMD` tokens to the Gateways Module using the [gatewayswithdraw](../../../basic-docs/antara/antara-api/gateways.html#gatewayswithdraw) method. - -Method structure: - -`gatewayswithdraw bindtxid coin withdrawpub amount` - -#### Details - -- `gatewayswithdraw` — The name of the method, executed as-is -- `bindtxid` — The Gateway Module's `bindtxid` -- `coin` — Ticker of the `coin` deposited -- `withdrawpub` — The user's pubkey to which the `KMD` coins should be sent on the `KMD` chain -- `amount` — The `amount` to be sent - -```bash -./komodo-cli -ac_name=USDKTEST gatewayswithdraw 50384e7668bd6908d8e0b67f1450c56f017186d802b1065c3258302a30b5adb2 KMD 03fa41b540b99161257c3a51e7c1598666361b739dce6a171d2d426255c92fb0e1 0.01 -``` - -Output: - -```json -{ - "hex": "0400008085202f89020012559aaf7b951b3cd33a29051dc1a185018ba8f1ad8a3f7778b48fa4dff8e9000000004847304402202b5a8c854de0d17a7fa47c8afa1b2d52c306eda1b5e0bb97fae59365351a9ecf02202d0468c2692036444d00a8312b866fe90af502a7235b7ee6bfa027dca50dcee401ffffffff8a34ee498afb5d89c5f67db35c35deb879b2757e1be660f44817550d0fe795ff020000007b4c79a276a072a26ba067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06814054a28d2f23721da7e5406db542178cc451c1232a2ee485cb429b3638cac5bc5b0bc61f242371fec25746d599f5186e6c24f21da4389391439a785e3c83ac15afa100af038001f2a10001ffffffff031027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc40420f0000000000302ea22c8020bed294e15cd2e327d2f1e6bcf55e2ebe571b7bc2e672363950ca680c8b89226381032210008203000401cc00000000000000009a6a4c97f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1012103ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb401350f157b2adb5302a3058325c06b102d88671016fc550147fb6e0d80869bd68764e3850034b4d442103fa41b540b99161257c3a51e7c1598666361b739dce6a171d2d426255c92fb0e140420f000000000000000000cc9f00000000000000000000000000", - "result": "success" -} -``` - -Broadcast the hex value. - -```bash -./komodo-cli -ac_name=USDKTEST sendrawtransaction 0400008085202f89020012559aaf7b951b3cd33a29051dc1a185018ba8f1ad8a3f7778b48fa4dff8e9000000004847304402202b5a8c854de0d17a7fa47c8afa1b2d52c306eda1b5e0bb97fae59365351a9ecf02202d0468c2692036444d00a8312b866fe90af502a7235b7ee6bfa027dca50dcee401ffffffff8a34ee498afb5d89c5f67db35c35deb879b2757e1be660f44817550d0fe795ff020000007b4c79a276a072a26ba067a56580210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06814054a28d2f23721da7e5406db542178cc451c1232a2ee485cb429b3638cac5bc5b0bc61f242371fec25746d599f5186e6c24f21da4389391439a785e3c83ac15afa100af038001f2a10001ffffffff031027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc40420f0000000000302ea22c8020bed294e15cd2e327d2f1e6bcf55e2ebe571b7bc2e672363950ca680c8b89226381032210008203000401cc00000000000000009a6a4c97f2741a459712f1e79a544efdf55cfb3e111c5df3300a4da4d16cb3b963bbb50aebf1012103ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb401350f157b2adb5302a3058325c06b102d88671016fc550147fb6e0d80869bd68764e3850034b4d442103fa41b540b99161257c3a51e7c1598666361b739dce6a171d2d426255c92fb0e140420f000000000000000000cc9f00000000000000000000000000 -``` - -Output: - -``` -62c6a41171cb428625c2d02d7e7077c4fea1e2b4aea839c549be54fc41150be5 -``` - -The user will now receive the requested `KMD` coins in the address of the chosen pubkey. - -### Liquidation - -A user that does not yet have a pegs account (obtained via the [pegsfund](../../../basic-docs/antara/antara-api/pegs.html#pegsfund) and [pegsexchange](../../../basic-docs/antara/antara-api/pegs.html#pegsexchange) methods) can exchange the Pegs-related Smart Chain's coins for deposited tokens of another user's account whose debt ratio is in the "yellow zone" (`80%` to `90%`). - -The [pegsworstaccounts](../../../basic-docs/antara/antara-api/pegs.html#pegsworstaccounts) method can be used to retrieve a list of all accounts that are in the "red zone" (where the debt ratio exceeds `90%`). - -The [pegsliquidate](../../../basic-docs/antara/antara-api/pegs.html#pegsliquidate) method can be used to liquidate any of these accounts by repaying the account's outstanding debt using the Pegs-related Smart Chain's coins. This gives the executor of the method an immediate `5%` profit. The remaining amount in the indebted user's account is disbursed to the Pegs Module for stablecoin price maintenance. diff --git a/docs/basic-docs/antara/antara-tutorials/rogue-module-tutorial.md b/docs/basic-docs/antara/antara-tutorials/rogue-module-tutorial.md deleted file mode 100644 index 212daa21f..000000000 --- a/docs/basic-docs/antara/antara-tutorials/rogue-module-tutorial.md +++ /dev/null @@ -1,892 +0,0 @@ -# Rogue Module Tutorial - -This tutorial documentation is associated with the Rogue API documentation. - -[Link to Rogue API documentation](../../../basic-docs/antara/antara-api/rogue.html) - -## Introduction - -The Rogue Antara module serves as a proof-of-concept to demonstrate Antara's capabilities as a blockchain-based gaming technology. - -The Rogue module is based on the classic [Rogue](http://www.livingroguelike.com/rl-games/the-original-rogue-information-and-how-to-play-online/) game. As such, it can be categorized as a [Roguelike.](http://www.livingroguelike.com/roguelike-info-discussions/what-is-a-roguelike/) - -The core aspects of Rogue gameplay occur on the blockchain. These aspects include such data as character health points, items, movement, attacks, and other relevant game states. - -Komodo's Rogue implementation makes use of the classic on-screen visual representation of gameplay. This interface relies on ASCII characters to represent characters, items, and other in-game objects and actions. - -The procedures to launch and finish a game require the execution of various methods (RPCs). To make the game more easy to start and finish for players who are not comfortable with the terminal, the Komodo team has created a Terminal User Interface (TUI). - -The following installation and walkthrough tutorials can assist the reader in testing Rogue. For more information, please reach out to our community on [Discord](https://komodoplatform.com/discord). The #cc-rogue channel is available for questions and assistance. - -## Installation - -### Requirements - -Rogue is available for modern MacOS, Linux, and Windows operating systems. - -### Download Software Bundles - -Komodo provides downloadable software bundles that contain all necessary components. The user need only download and unzip the contents for their appropriate operating system and they are ready for gameplay. - -Software bundles can be found in the link below: - -[Link to software bundles](https://github.com/tonymorony/komodo_customconsensus_tui/releases) - -Please feel free to ask on our #cc-rogue channel on [Discord](https://komodoplatform.com/discord) for updates and assistance. - -### Compile Rogue Software Manually - -The following instructions are necessary only for users/developers who wish to compile Rogue software from source code. Users who have already downloaded the software bundles linked above do not need to compile source code manually. - -#### Install Dependencies - -##### Linux - -```bash -sudo apt-get update && sudo apt-get upgrade -y -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl libcurl4-gnutls-dev cmake clang libsodium-dev -y -``` - -##### MacOS (OSX) - -Use the terminal to ensure the MacOS XCode tools are installed: - -```bash -xcode-select --install -``` - -Ensure the latest version of `brew` is installed. If necessary, execute the following command: - -```bash -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -``` - -Once `brew` is installed, execute each of the following commands: - -```bash -brew update -brew upgrade -brew tap discoteq/discoteq; brew install flock -brew install autoconf autogen automake -brew install gcc@6 -brew install binutils -brew install protobuf -brew install coreutils -brew install wget -``` - -##### Windows - -Playing Rogue on Windows requires an installation of MinGW, which can be downloaded here: - -[Link to MinGW](http://www.mingw.org/) - -Once installed, use a Debian cross-compilation setup and run the following commands in Linux: - -```bash -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl cmake mingw-w64 -curl https://sh.rustup.rs -sSf | sh -source $HOME/.cargo/env -rustup target add x86_64-pc-windows-gnu -``` - -#### Clone & Compile Komodo - -##### Linux - -```bash -cd ~ -git clone https://github.com/jl777/komodo -cd komodo -git checkout FSM -./zcutil/fetch-params.sh -./zcutil/build.sh -j$(nproc) -``` - -##### MacOS - -```bash -cd ~ -git clone https://github.com/jl777/komodo -cd komodo -git checkout FSM -./zcutil/fetch-params.sh -./zcutil/build-mac.sh -j8 -``` - -##### Windows - -```bash -git clone https://github.com/jl777/komodo -cd komodo -git checkout FSM -./zcutil/fetch-params.sh -./zcutil/build-win.sh -j8 -#This can take some time. -``` - - -::: tip -Change the `8` in the `-j8` portion of the last command to any number of processor threads desired and/or appropriate for your machine. -::: - -##### Update `komodod` - -```bash -cd ~/komodo -git checkout FSM -git pull -./zcutil/build.sh -j$(nproc) -``` - -#### Launch the `ROGUE` chain and Set `pubkey` Value - -##### Step 1 - Start the chain - -Start the ROGUE chain with the following command in a terminal window and wait for the daemon to sync. Keep this terminal open and the daemon running for the duration of your Rogue gameplay. - -```bash -cd ~/komodo/src -./komodod -ac_name=ROGUE -ac_supply=1000000 -addnode=5.9.102.210 -ac_cclib=rogue -ac_perc=10000000 -ac_reward=100000000 -ac_cc=60001 -ac_script=2ea22c80203d1579313abe7d8ea85f48c65ea66fc512c878c0d0e6f6d54036669de940febf8103120c008203000401cc -daemon -``` - -##### Step 2 - -Open a new terminal. This terminal can be used to execute all remaining installation and gameplay commands. - -```bash -./komodo-cli -ac_name=ROGUE getnewaddress -``` - -The returned value is a ROGUE address. We need to find the associated pubkey for this address. - -##### Step 3 - -Use the `validateaddress` method with the address. - -```bash -./komodo-cli -ac_name=ROGUE validateaddress insert_address_here -``` - -The `validateaddress` method will return information similar to the following: - -```JSON -{ - "isvalid": true, - "address": "RPCeZmqW4Aam52DFLmMraWtu5CuXPxqk92", - "scriptPubKey": "76a91498b5caa42ffe9868844c51ba6e085e5e7e92fc2588ac", - "segid": 13, - "ismine": true, - "iswatchonly": false, - "isscript": false, - "pubkey": "02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2", - "iscompressed": true, - "account": "" -} -``` - -Look for the `pubkey` value: - -```bash -"pubkey": "02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2", -``` - -This is the `pubkey` for our address. - -##### Step 4 - -Set the pubkey for the ROGUE Smart Chain. - -```bash -./komodo-cli -ac_name=ROGUE setpubkey 02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2 -``` - - - - - -The pubkey is now set. - -To reuse this pubkey in the future, include the pubkey as a [pubkey](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#pubkey) launch parameter. - -Include the `pubkey` in the `-pubkey` launch parameter as follows: - -```bash -cd ~/komodo/src -./komodod -ac_name=ROGUE -pubkey=02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2 -ac_supply=1000000 -addnode=5.9.102.210 -ac_cclib=rogue -ac_perc=10000000 -ac_reward=100000000 -ac_cc=60001 -ac_script=2ea22c80203d1579313abe7d8ea85f48c65ea66fc512c878c0d0e6f6d54036669de940febf8103120c008203000401cc -daemon -``` - -#### Installing the TUI (Optional) - -Komodo offers an unofficial Terminal User Interface (TUI) to allow players to launch and conclude a game without having to interact with the module's API commands. The TUI software is provided for testing and ease-of-use purposes only. - -Use of the TUI is optional, but recommended for most players. - -The TUI software can be found in the downloadable software bundles: - -[Link to downloadable software bundles](https://github.com/tonymorony/komodo_customconsensus_tui/releases) - -## Walkthrough for API - -Under normal circumstances, a user does not need to manually execute methods in the terminal to launch and conclude a game. Rather, the downloadable software bundles contain all necessary tools to play. - -For users/developers who need a reference for the manual process, the following walkthroughs provide detailed step-by-step instructions. - -- [Single-Player Mode Walkthrough](../../../basic-docs/antara/customconsensus/rogue.html#single-player-mode-walkthrough) -- [Multi-Player Mode Walkthrough](../../../basic-docs/antara/customconsensus/rogue.html#multi-player-mode-walkthrough) - -### Single-Player Mode Walkthrough - -#### Step 1 - -Open a new terminal and navigate to the `~/komodo/src` directory: - -```bash -cd ~/komodo/src -``` - -#### Step 2 - -Create a new game via the [newgame](../../../basic-docs/antara/antara-api/rogue.html#newgame) method. For this example, we choose to have a single player with a `0` buy-in requirement. - -Methods for ROGUE require the use of the [cclib](../../../basic-docs/smart-chains/smart-chain-api/cclib.html#cclib) method. The Rogue module's required `EVALCODE` for the `cclib` method is `17`. - -Command: - -```bash -./komodo-cli -ac_name=ROGUE cclib newgame 17 "[1]" -``` - - - - - -The ROGUE software currently broadcasts the `hex` value automatically. It is not necessary to use the `sendrawtransaction` method. - -The returned transaction id `txid` is the `gametxid`. Save this for future use. - -#### Step 3 - -Check the game's state using the [gameinfo](../../../basic-docs/antara/antara-api/rogue.html#gameinfo) method: - -Command: - -```bash -./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' -``` - - - - - -In the returned json object, observe the `run` value. This lists the specific command that must be executed in the terminal to register the game. - -#### Step 4 - -Register the `gametxid` using the [register](../../../basic-docs/antara/antara-api/rogue.html#register) method: - -```bash -./komodo-cli -ac_name=ROGUE cclib register 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' -``` - - - - - - -#### Step 5 - -Check the game's current state again using the [gameinfo](../../../basic-docs/antara/antara-api/rogue.html#gameinfo) method. Use the `gametxid` as an argument: - -```bash -./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' -``` - - - - - -Note that the `gameinfo` method now returned a `seed` value, as well as player data. - -In the returned json object, find the `run` value. This is the exact command needed to start the game. - -#### Step 6 - Play - -Wait until the network mines the `register_txid`. Optionally, use the [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getrawmempool) method to monitor the status of the transaction. - -Once the transaction is mined, execute the `run` command (found in the returned json object earlier) to start the game: - -```bash -cc/rogue/rogue 3767108440867690538 09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70 -``` - -The game is now running and should be visible on-screen. - -#### Step 7 - Play the Game - -For instructions on in-game controls and objectives, [read this linked section.](../../../basic-docs/antara/antara-tutorials/rogue-module-tutorial.html#introduction) - -#### Step 8 - Bailout - -If your character is still alive and you would like to leave the game while keeping your profits, follow this procedure to save your character: - -To quit the game, type the letter `Q` on the keyboard. This opens a context menu. Type the letter `n` and press `Enter`. - -This begins the process of leaving the game, but you are not finished yet. - -Wait for the ROGUE network to mine all [`keystrokes`](../../../basic-docs/antara/antara-api/rogue.html#keystrokes) transactions. To see a list of all `keystrokes` created, check the `keystrokes.log` file in the `~/komodo/src` directory, and use the [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getrawmempool) method to verify when the last `keystrokes` are mined. - -When the last transactions are mined, execute the [bailout](../../../basic-docs/antara/antara-api/rogue.html#bailout) method to leave the game while keeping the character and items in your `pubkey`, and the method will also transfer your in-game gold to `ROGUE` coins. - -For example: - -```bash -./komodo-cli -ac_name=ROGUE cclib bailout 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' -``` - -After the `bailout` transaction is mined the player may view their surviving character(s) via the [players](../../../basic-docs/antara/antara-api/rogue.html#players) and [playerinfo](../../../basic-docs/antara/antara-api/rogue.html#playerinfo) methods. - -#### Step 9: Highlander Victory - -In this walkthrough we have used single-player mode. The following [highlander](../../../basic-docs/antara/antara-api/rogue.html#highlander) method is only available if the character manages to capture the `amulet` and safely exit the dungeon. In a normal multi-player game, the `highlander` method is available to either the first player to safely retrieve the `amulet`, or to the last player standing after all others have died. - -The player that successfully executes the `highlander` method receives a prize: the collective value of all `ROGUE` coins that were contributed during the buy-in stage. - -The `highlander` method is executed as follows: - -```bash -./komodo-cli -ac_name=ROGUE cclib highlander 17 '["4fd6f5cad0fac455e5989ca6eef111b00292845447075a802e9335879146ad5a"]' -``` - -After the `highlander` transaction is mined the player may view their surviving character(s) via the [players](../../../basic-docs/antara/antara-api/rogue.html#players) and [playerinfo](../../../basic-docs/antara/antara-api/rogue.html#playerinfo) methods. - -### Multi-Player Mode Walkthrough - -In this walktrough we use two nodes to play a multi-player game of Rogue. - -- Node 1 is `player1` -- Node 2 is `player2` - -For educational purposes, we execute all methods manually, as opposed to using the [TUI](../../../basic-docs/antara/antara-tutorials/rogue-module-tutorial.html#installing-the-tui-optional). - -#### Step 1: Create a Multi-Player Game - -Open a new terminal and navigate to the `~/komodo/src` directory: - -```bash -cd ~/komodo/src -``` - -For this game, we choose the following details: - -- the max number of players: `2` -- the cost in `ROGUE` coins of the game `buyin`: `0.1` - -Execute the [newgame](../../../basic-docs/antara/antara-api/rogue.html#newgame) method on `player1` as follows: - -```bash -./komodo-cli -ac_name=ROGUE cclib newgame 17 '["2","0.1"]' -``` - - - - - -Save the returned `txid` value for future use. This is our `gametxid`. - -Use the [gameinfo](../../../basic-docs/antara/antara-api/rogue.html#gameinfo) method to check information about the game: - -```bash -./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' -``` - - - - - -As shown in the returned json object, the game has a `maxplayers` value of `2` and an `openslots` value of `0`, as no players have joined. - -Note that the `gameheight` value is `54265`. This is the block height at which the `gametxid` was created. - -Also note that the `start` value is `54270`. This is the block height at which the `seed` value will be revealed, allowing players to generate the level design and begin the game. - -#### Step 2: Register for the Game - -For our example, `player1` would like to use an existing character that survived a previous game. This allows `player1` to start with all the advantages this character achieved previously, including character statistics and items. - -To activate the existing character, `player1` includes the associated `playertxid` for the character when executing the [register](../../../basic-docs/antara/antara-api/rogue.html#register) method. (The `playertxid` values of any `pubkey` can be found using the [players](../../../basic-docs/antara/antara-api/rogue.html#players) method.) - -The player also includes the `gametxid` as the first argument of the `register` method. - -```bash -./komodo-cli -ac_name=ROGUE cclib register 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde","8005f81a604df6bbfae91dc8252505df43edbdf06492a2201362cb42dba4d8f2"]' -``` - - - - - -In our example, the `player2` node does not have a character from a previous game, and therefore `player2` executes the `register` method with only the `gametxid`. - -```bash -./komodo-cli -ac_name=ROGUE cclib register 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' -``` - - - - - -Wait until the `txid` values returned on both nodes are mined. (Use the [getrawmempool](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getrawmempool) method to check the transaction's status.) - -After the transactions are mined, use the [gameinfo](../../../basic-docs/antara/antara-api/rogue.html#gameinfo) method to check the game's status again: - -```bash -./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' -``` - - - - - -The `openslots` value is now `0`, as `2` players have joined. - -Note also that the `start` block height has past, and therefore the `seed` value is available. - -Also note that the response includes information about the `playertxid` character provided by `player1` during registration. - -The game is prepared. Both players may begin the game using the command found in the returned `run` value. - -```bash -cc/rogue/rogue 3928429259918614461 4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde -``` - -#### Step 3: Play and Finish the Game - -[View this linked section for instructions on gameplay.](../../../basic-docs/antara/antara-tutorials/rogue-module-tutorial.html#introduction) - -In our example, `player1` decides to bail out of the game without waiting until `player2` dies, and without retrieving the `amulet` from the dungeon. - -To exit, `player1` executes the [bailout](../../../basic-docs/antara/antara-api/rogue.html#bailout) method: - -```bash -./komodo-cli -ac_name=ROGUE cclib bailout 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' -``` - - - - - -With the `bailout` transaction mined, the `gameinfo` method now returns updated information: - -Command: - -```bash -./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' -``` - - - - - -Note that the `alive` property has a value of `1`, indicating that the `player1` character has left and the `player2` character remains. Also note that in the `players` array, the first json object (which describes the `player1` node) has a `status` of `finished`. - -Since `player1` left early, `player2` is the last character standing. The [highlander](../../../basic-docs/antara/antara-api/rogue.html#highlander) method is now available to him. - -`player2` first begins the exit procedure by entering `Q`, then `y + Enter`. - -With the exit process in motion, `player2` executes the `highlander` method: - -```bash -./komodo-cli -ac_name=ROGUE cclib highlander 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' -``` - - - - - -The multi-player game is now finished. The `player2` node received the `highlander` prize, including the total `buyin` amount and an increased conversion rate of in-game gold to `ROGUE` coins. - -After the `bailout` and `highlander` transactions are mined, the players may view their surviving character via the [players](../../../basic-docs/antara/antara-api/rogue.html#players) and [playerinfo](../../../basic-docs/antara/antara-api/rogue.html#playerinfo) methods. - - -## Gameplay Documentation - -As Komodo's Rogue implementation is based off of the classic Rogue game, the classic manual provides the basic instructions for the game: - -[Link to Classic Rogue Manual Here](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) - -After reading the linked manual, there are additional aspects to keep in mind for Komodo's unique implementation. - -### Gameplay Modes - -Komodo's Rogue features two different game modes. There is one mode for single-player gameplay, where the `maxplayer` value is set to `1`, and one mode for multi-player gameplay, where the `maxplayer` value is greater than `1`. - -#### Single-Player Mode - -The single-player mode is more limited in nature. In general, this mode is for practicing or farming purposes. - -There are no time limits. - -As soon as the `register_txid` is confirmed the player may begin to play. - -When concluding the game, the conversion of in-game gold to `ROGUE` coins is halved. See the [highlander](../../../basic-docs/antara/antara-api/rogue.html#highlander) and [bailout](../../../basic-docs/antara/antara-api/rogue.html#bailout) methods for further details. - -#### Multi-Player Mode - -If more than one player is allowed in the game parameters, the game goes into "Highlander" mode. In this mode, there can be only one winner of each game. The winner is either the last player standing, or the first player to retrieve the `amulet` and successfully exit the dungeon. - -Multi-player mode also adds a time limit that is based on the frequency of keystrokes. So long as the players are frequently entering commands, the time limit will expire in approximately one hour. If players are not frequently entering keystrokes, the time limit can vary. - -There is a waiting period after the `gametxid` is confirmed. This ensures that no player receives an unfair advantage via advanced knowledge of the start time. The delay is `5` blocks. On a default Smart Chain, this creates a `5` minute wait period. Once the `5` blocks are mined, the Smart Chain automatically reveals a `seed` that is created using blockchain-based provable randomization. The `seed` provides the basis for level-design generation. After the level is generated, the players may begin to play. - -Due to the fact that the entropy (based on the `seed`) was the same for both players during level generation, both players will begin at dungeon-level `1`. However, the generation of levels greater than `1` take into account the gameplay of the characters, and therefore the level designs will be different for each player. - -There are two methods for winning the game. The most direct way to win the game is to obtain the `amulet` and return from the dungeon. Alternatively, the player also may win by having the last surviving character. The winner receives all of the `buyin` coins that were originally contributed, as well as an increased conversion ratio for their in-game gold to `ROGUE` reward. - -See the [highlander](../../../basic-docs/antara/antara-api/rogue.html#highlander) method for further details. - -### The Mechanics of Saving, Trading, and Reusing Characters - -::: tip Note - -Due to the nature of saving and reusing characters, the Komodo implementation of Rogue changes the manner in which the user saves characters. Instead of typing `s` on the keyboard, type `Q + y + Enter`, then execute the [bailout](../../../basic-docs/antara/antara-api/rogue.html#bailout) method to conclude the game. - -::: - -If a player successfully uses either the [highlander](../../../basic-docs/antara/antara-api/rogue.html#highlander) or [bailout](../../../basic-docs/antara/antara-api/rogue.html#bailout) method to conclude a game, the player may save their character, items, and achieved characteristics. They also convert the character's in-game gold to `ROGUE` coins. The ratio of conversion depends upon the game conditions; see the `highlander` and `bailout` methods for further details. - -#### Recalling an Existing Character - -When either of these methods are executed, the returned response includes a `playertxid` transaction id. The `playertxid` represents the state of this character at the completion of the game. It is used as an argument for the [register](../../../basic-docs/antara/antara-api/rogue.html#register) method when recalling the character, items, and achieved characteristics into a future game. - -The `playertxid` value changes with each game, and therefore only the most recent `playertxid` for a character should be used. To see a complete list of current `playertxid` values belonging to the user's `pubkey`, use the [playerinfo](../../../basic-docs/antara/antara-api/rogue.html#playerinfo) method. - -When the user registers an existing character, the game dungeon's difficulty begins at level `1`, and the character has no gold (as it was converted to `ROGUE` coins). Also, even if the character has armor and a wielded weapon in their item list, these items are not equipped by default. The player must equip them at the start of the game by typing the letters `w` for weapon and `W` for armor. - -One gameplay element that the Komodo team has changed from classic Rogue is the ability to scale the amount of inventory the character may carry according to the character's strength. The formula is as follows: - -``` -current max inventory = character strength * 2 -``` - -The highest `max inventory` value is `23` unique letters. Throwable-object packages count as a single item. - -If the user bails out of a game while holding more items than they are allowed to carry, the game will automatically flush items from the character's inventory as a part of the `bailout` method. - -#### Trading an Existing Character - -A character that survived a game is also a non-fungible asset and can be traded on the blockchain. When trading a character, the user does not use the `playertxid` value. Rather, the user employs the `tokentxid` value. This `tokentxid` is used in coordination with the [Tokens Antara Module](../../../basic-docs/antara/antara-api/tokens.html#introduction) module for on-chain trading. - -The `tokentxid` can be found by using the [playerinfo](../../../basic-docs/antara/antara-api/rogue.html#playerinfo) method and submitting the known `playertxid` as an argument. For more information, see the `playerinfo` method. - -The `tokentxid` is created at the character's initial creation and does not change throughout the character's life. When the character dies, the `tokentxid` is sent to a burn address, making the character permanently unplayable. - diff --git a/docs/basic-docs/antara/antara-tutorials/understanding-antara-addresses.md b/docs/basic-docs/antara/antara-tutorials/understanding-antara-addresses.md deleted file mode 100644 index 6609d6525..000000000 --- a/docs/basic-docs/antara/antara-tutorials/understanding-antara-addresses.md +++ /dev/null @@ -1,93 +0,0 @@ -# Understanding Antara Addresses - -The method of transferring module-related assets is often slightly different than the typical Smart Chain transaction. - -When making a transaction on a Smart Chain, you normally deal with a sending address and a receiving address. To move coins, you might use methods such as sendtoaddress or z_sendmany. - -When using Antara, however, there are a few new types of addresses to keep in mind when working with transactions. It is not necessary to fully understand all of the address types; only a general understanding is needed. - -### Creating and Launching With a Pubkey - -The first address you must understand is the pubkey. Any user using an Antara based module must have a pubkey indicated in their daemon. This forms the basis for all addresses related to various modules. - - - -To get a pubkey, launch the chain with the normal launch parameters and execute the [getnewaddress](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#getnewaddress) API command. - -```bash -./komodo-cli -ac_name=HELLOWORLD getnewaddress -``` - -This will return a new address: - -```bash -DO_NOT_USE_ADDRESSgg2ionaes1J5L786 -``` - -Now, execute the [validateaddress](../../../basic-docs/smart-chains/smart-chain-api/util.html#validateaddress) command. - -```bash -./komodo-cli -ac_name=HELLOWORLD validateaddress DO_NOT_USE_ADDRESSgg2ionaes1J5L786 -``` - -This will return a json object with many properties. In the properties you will see: - -```bash -"pubkey": "DO_NOT_USE_ADDRESS019a79b0921a1be6d3ca6f9e8a050feb14eb845fe46b9d756" -``` - -This is will be your module pubkey; you must now indicate it to the daemon. - -To do this, first stop the daemon. - -```bash -./komodo-cli -ac_name=HELLOWORLD stop -``` - -Then relaunch your daemon using the required parameters, and make sure to include your pubkey as an additional parameter. For example: - -```bash -./komodod -ac_name=HELLOWORLD -ac_supply=777777 -ac_cc=777 -pubkey=DO_NOT_USE_ADDRESS019a79b0921a1be6d3ca6f9e8a050feb14eb845fe46b9d756 -``` - -#### CC Addresses - -The daemon will now use the above pubkey as the basis for all addresses used for the different modules. - -To discover the addresses the pubkey provides, you will typically use an `address` related API command from the list of available commands of your chosen module. For example, the [faucetaddress](../../../basic-docs/antara/antara-api/faucet.html#faucetaddress) command would return a response like this: - -```json -{ - "result": "success", - "FaucetCCaddress": "R9zHrofhRbub7ER77B7NrVch3A63R39GuC", - "Faucetmarker": "RKQV4oYs4rvxAWx1J43VnT73rSTVtUeckk", - "GatewaysPubkey": "03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40", - "FaucetCCassets": "RQ3ZQycSBM5MPPEopxoEC6R7VLRo1Fmk6f", - "myCCaddress": "RReGLfH2MTrkeLSepkVy5vnQPE29g7KofS", - "myaddress": "RJYiWn3FRCSSLf9Pe5RJcbrKQYosaMburP" -} -``` - -`FaucetCCaddress` is the address that corresponds to the default Faucet module. - - - -`myCCaddress` is the address your node uses for interacting with the Faucet module. This is the user address for managing funds in an Antara module. - -The `myaddress` property is the normal address that corresponds to your pubkey. This is the user's address for the Smart Chain's main coin. - -::: tip - -For readers who are curious, the letters "CC" are an abbreviation of an internal technology that all Antara modules use while creating unique addresses. - -::: - -The use-cases of the different addresses depends on the functionality in question, and the desired outcome. - -Also, each module has its own API commands for moving coins or tokens. For example, the Tokens module offers the [tokentransfer](../../../basic-docs/antara/antara-api/tokens.html#tokentransfer) method. diff --git a/docs/basic-docs/antara/introduction-to-antara.md b/docs/basic-docs/antara/introduction-to-antara.md deleted file mode 100644 index 1dec7d6a8..000000000 --- a/docs/basic-docs/antara/introduction-to-antara.md +++ /dev/null @@ -1,40 +0,0 @@ -# Introduction to Antara - -Welcome to the Antara technical documentation. - -#### About the Antara Section - -This documentation is intended for developers learning about, building, and interacting with the Antara framework. - -Users who are not interested in these activities, but are searching for documentation assistance, can find support in the Komodo Support Center. - -[Link to Komodo Support Center](https://support.komodoplatform.com/support/home) - -#### Conceptual Overview - -A brief conceptual overview of the Antara framework can be found in the Start Here > Product Introductions > Smart Chains & Antara section. - -[Link to "Smart Chains & Antara" Introduction](../../../basic-docs/start-here/about-komodo-platform/product-introductions.html#smart-chains-antara) - -The [Antara Tutorials](../../../basic-docs/antara/antara-tutorials/introduction-to-antara-tutorials.html) section contains more thorough conceptual explanations of Antara. - -Please consult our [Learning Path Outlines](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html) section for more details on approaches to learning Antara from both a conceptual and technical perspective. - -#### About Antara Setup - -The Antara Setup section contains basic information about setting up and using an Antara-enabled environment. Example topics include: - -- [Understanding Antara Addresses](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) -- [Antara Customizations Available for Smart Chains During Creation and Hard Forks ](../../../basic-docs/antara/antara-setup/antara-customizations.html) - -#### About Antara Tutorials - -The Antara Tutorials section contains various tutorials that provide instruction for Antara usage and creation. - -For a walkthrough covering multiple tutorials in a targeted fashion, please see the [Learning Launchpad](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html) section. - -#### About Antara API - -The Antara API section contains all available API commands for all default Antara modules. - -These API commands can also be called Remote Procedure Calls, or RPCs. diff --git a/docs/basic-docs/smart-chains/README.md b/docs/basic-docs/smart-chains/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/smart-chains/changelog.md b/docs/basic-docs/smart-chains/changelog.md deleted file mode 100644 index df0c189d5..000000000 --- a/docs/basic-docs/smart-chains/changelog.md +++ /dev/null @@ -1,18 +0,0 @@ -# Change Log - -Version 0.5.0 of the Komodo daemon includes the following changes. - -#### List of Changes - -- zMempool fix -- KMDnuke fix -- POS staking algo change -- AC related fixes -- CC fixes and additions -- add season 3.5 pubkey array -- protocol version bump -- update libsodium 1.0.18 -- update libgmp URL -- update libsnark URL -- update channelsCC test -- use kmd metrics art diff --git a/docs/basic-docs/smart-chains/introduction-to-smart-chain-documentation.md b/docs/basic-docs/smart-chains/introduction-to-smart-chain-documentation.md deleted file mode 100644 index 49602648d..000000000 --- a/docs/basic-docs/smart-chains/introduction-to-smart-chain-documentation.md +++ /dev/null @@ -1,46 +0,0 @@ -# Introduction to Smart Chain Documentation - -Welcome to the Smart Chain technical documentation. - -#### About the Smart Chain Section - -This documentation is intended for developers learning about, building, and interacting with Smart Chain products. - -Users who are not interested in these activities, but are searching for assistance, can find support in the Komodo Support Center. - -[Link to Komodo Support Center](https://support.komodoplatform.com/support/home) - -[Link to Simple Installation Procedure](../../basic-docs/start-here/about-komodo-platform/simple-installations.html#simple-installations) - -#### Conceptual Overview - -A conceptual overview of Smart Chain technology can be found in the Start Here > Product Introductions section. - -[Link to Smart Chain Product Introduction](../basic-docs/start-here/about-komodo-platform/product-introductions.html#smart-chains-antara) - -Also, the reader may turn to the Core Technology Discussion section for a thorough explanation. - -[Link to Core Technology Discussion section](../../../basic-docs/start-here/core-technology-discussions/introduction.html) - -#### About Smart Chain Setup - -The Smart Chain Setup section contains basic information about Smart Chains and their creation. Topics include the following: - -- [Installing Smart Chain Software from Source Code](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#installing-smart-chain-software-from-source-code) -- [Interacting with Smart Chains](../../../basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.html) - -- [Smart Chain Launch Parameters Common to Most Blockchain Software](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html) - -#### About Smart Chain Tutorials - -The Smart Chain Tutorials section contains various tutorials that provide instruction in Smart Chain creation and usage. - -For a walkthrough covering multiple tutorials in a targeted fashion, please see the [Learning Launchpad](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html) section. - -#### About Smart Chain API - -The Smart Chain API section contains all available API commands for a default Smart Chain daemon. - -These API commands can also be called Remote Procedure Calls, or RPCs. - -The API section does not include commands that are unique to Antara modules, as Antara modules are not active by default on a Smart Chain daemon. Please see the Antara section for further information. diff --git a/docs/basic-docs/smart-chains/smart-chain-api/README.md b/docs/basic-docs/smart-chains/smart-chain-api/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/smart-chains/smart-chain-api/address.md b/docs/basic-docs/smart-chains/smart-chain-api/address.md deleted file mode 100644 index 4b01beb09..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/address.md +++ /dev/null @@ -1,637 +0,0 @@ -# Address Index - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## getaddressbalance - -**getaddressbalance '{ "addresses" : [ "address" , ... ] }'** - -The `getaddressbalance` method returns the confirmed balance for an address, or addresses. It requires [addressindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| --------- | -------- | ----------- | -| "address" | (string) | the address | - -### Response - -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------------------------------ | -| "balance" | (number) | the current confirmed balance in satoshis | -| "received" | (number) | the total confirmed number of satoshis received (including change) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaddressbalance '{"addresses":["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressbalance", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaddressdeltas - -**getaddressdeltas '{ "addresses" : [ "address" , ... ] }'** - -**getaddressdeltas '{ "addresses" : [ "address" , ... ] , "start": start, "end": end, "chainInfo": boolean }'** - -The `getaddressdeltas` method returns all confirmed balance changes of an address. The user can optionally limit the response to a given interval of blocks. The method requires [addressindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| ----------- | --------- | ----------------------------------------------------------------------- | -| "address" | (string) | the address | -| "start" | (number) | the start block height | -| "end" | (number) | the end block height | -| "chainInfo" | (boolean) | include chain info in results (only applies if start and end specified) | - -### Response - -| Name | Type | Description | -| ---------- | -------- | --------------------------------- | -| "satoshis" | (number) | the difference in satoshis | -| "txid" | (string) | the related transaction id | -| "index" | (number) | the related input or output index | -| "height" | (number) | the block height | -| "address" | (string) | the address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaddressdeltas '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' -``` - - - -Command: - -```bash -./komodo-cli getaddressdeltas '{"addresses":["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"],"start":1,"end":200,"chainInfo":true}' -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"],"start":1,"end":200,"chainInfo":true}]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaddressmempool - -**getaddressmempool '{ "addresses" : [ "address" , ... ] }'** - -The `getaddressmempool` method returns all mempool deltas for an address, or addresses. The method requires [addressindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| --------- | -------- | ----------- | -| "address" | (string) | the address | - -### Response - -| Name | Type | Description | -| ----------- | -------- | ------------------------------------------------------ | -| "address" | (string) | the address | -| "txid" | (string) | the related txid | -| "index" | (number) | the related input or output index | -| "satoshis" | (number) | the difference in satoshis | -| "timestamp" | (number) | the time the transaction entered the mempool (seconds) | -| "prevtxid" | (string) | the previous txid (if spending) | -| "prevout" | (string) | the previous transaction output index (if spending) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaddressmempool '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressmempool", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaddresstxids - -**getaddresstxids '{ "addresses" : [ "address" , ... ] }'** - -The `getaddresstxids` method returns the txids for an address, or addresses. It requires [addressindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| --------- | -------- | ---------------------- | -| "address" | (string) | the address | -| "start" | (number) | the start block height | -| "end" | (number) | the end block height | - -### Response - -| Name | Type | Description | -| ---------------- | -------- | ------------------ | -| "transaction_id" | (string) | the transaction id | - -#### :pushpin: Examples - -Command: - -```bash -komodo-cli getaddresstxids '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb","RQUAkqRiRMqxcNrB29B4duTK4qkqfV9HVJ"]}' -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddresstxids", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaddressutxos - -**getaddressutxos '{ "addresses" : [ "address" , ... ], "chaininfo" }'** - -The `getaddressutxos` method returns all unspent outputs for an address. It requires [addressindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| ----------- | --------- | ------------------------------- | -| "address" | (string) | the address | -| "chainInfo" | (boolean) | include chain info with results | - -### Response - -| Name | Type | Description | -| ------------- | -------- | ------------------------------------ | -| "address" | (string) | the address | -| "txid" | (string) | the output txid | -| "height" | (number) | the block height | -| "outputIndex" | (number) | the output index | -| "script" | (string) | the script hex encoded | -| "satoshis" | (number) | the number of satoshis of the output | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaddressutxos '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' -``` - - - -Command: - -```bash -./komodo-cli getaddressutxos '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"], "chainInfo": true}' -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"], "chainInfo": true}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getsnapshot - -**getsnapshot top** - -The `getsnapshot` method returns a snapshot of addresses and their amounts at the Smart Chain's current height. - -The method requires [addressindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| ----- | ------------------ | ----------------------------------------------------- | -| "top" | (number, optional) | Only return this many addresses, i.e. top N rich list | - -### Response - -| Name | Type | Description | -| ----------------- | ---------------- | --------------------------------------------------- | -| "addresses" | (array of jsons) | the array containing the address and amount details | -| "addr" | (string) | an address | -| "amount" | (number) | the amount of coins in the above address | -| "total" | (numeric) | the total amount in snapshot | -| "average" | (numeric) | the average amount in each address | -| "utxos" | (number) | the total number of utxos in snapshot | -| "total_addresses" | (number) | the total number of addresses in snapshot, | -| "start_height" | (number) | the block height snapshot began | -| "ending_height" | (number) | the block height snapshot finished, | -| "start_time" | (number) | the unix epoch time snapshot started | -| "end_time" | (number) | the unix epoch time snapshot finished | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getsnapshot 5 -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsnapshot", "params": ["5"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/blockchain.md b/docs/basic-docs/smart-chains/smart-chain-api/blockchain.md deleted file mode 100644 index e06a66c69..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/blockchain.md +++ /dev/null @@ -1,2232 +0,0 @@ -# Blockchain - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## coinsupply - -**coinsupply height** - -The `coinsupply` method returns the coin supply information for the indicated block `height`. If no height is given, the method defaults to the blockchain's current height. - -::: tip -To use this method for large block heights, first execute the method for a small block height, such as `1000`. Then execute the method for an incrementally higher block height, such as `10000`. Continue increasing the height until reaching the desired height. -::: - -### Arguments - -| Name | Type | Description | -| -------- | ------------------- | ------------------------ | -| "height" | (integer, optional) | the desired block height | - -### Response - -| Name | Type | Description | -| -------- | --------- | ------------------------------------------------------------- | -| "result" | (string) | whether the request was successful | -| "coin" | (string) | the ticker symbol of the coin for Smart Chains, otherwise KMD | -| "height" | (integer) | the height of this coin supply data | -| "supply" | (float) | the transparent coin supply | -| "zfunds" | (float) | the shielded coin supply (in `z`addrs) | -| "sprout" | (float) | the sprout coin supply (in `zc`addrs) | -| "total" | (float) | the total coin supply, i.e. `sum of supply + zfunds` | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli coinsupply 80000 -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "coinsupply", "params": ["80000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getbestblockhash - -**getbestblockhash** - -The `getbestblockhash` method returns the hash of the best (tip) block in the longest block chain. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -### Response - -| Name | Type | Description | -| ----- | -------- | --------------------------- | -| "hex" | (string) | the block hash, hex encoded | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getbestblockhash -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getblock - -**getblock hash|height ( verbose )** - -The `getblock` method returns the block's relevant state information. - -The verbose input is optional. The default value is true, and it will return a json object with information about the indicated block. If verbose is `false`, the command returns a string that is serialized hex-encoded data for the indicated block. - -### Arguments - -| Name | Type | Description | -| ---------------- | --------------------------------- | ---------------------------------------------------------- | -| hash `OR` height | string `OR` number, respectively | the block hash `OR` the block height | -| verbose | (boolean, optional, default=true) | true returns a json object, false returns hex-encoded data | - -### Response (verbose = true) - -| Name | Type | Description | -| ------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | -| "hash" | (string) | the block hash (same as provided hash) | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this block); the returned value is `-1` if the block is not on the main chain | -| "size" | (numeric) | the block size | -| "height" | (numeric) | the block height or index (same as provided height) | -| "version" | (numeric) | the block version | -| "merkleroot" | (string) | the merkle root | -| "tx" : [ "transaction_id" ,...] | (array of strings) | -| "time" | (numeric) | the block time in seconds since epoch (Jan 1 1970 GMT) | -| "nonce" | (numeric) | the nonce | -| "bits" | (string) | the bits | -| "difficulty" | (numeric) | the difficulty | -| "previousblockhash" | (string) | the hash of the previous block | -| "nextblockhash" | (string) | the hash of the next block | - -### Response - -| Name | Type | Description | -| ------ | -------- | --------------------------------------------------------------------- | -| "data" | (string) | a string that is serialized, hex-encoded data for the indicated block | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblock "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" -``` - - - -Command: - -```bash -./komodo-cli getblock "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" false -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320", false] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -Command: - -```bash -./komodo-cli getblock 120 -``` - - - -Command: - -```bash -./komodo-cli getblock 120 false -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["120"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["120", false] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getblockchaininfo - -**getblockchaininfo** - -The `getblockchaininfo` method returns a json object containing state information about blockchain processing. - -::: tip - -When the chain tip is at the last block before a network upgrade activation, the consensus.chaintip value is not equal to the consensus.nextblock value. - -::: - -The `getblockchaininfo` method now returns a new size_on_disk key, which is the size of the blockchain, on disk, in bytes. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| "chain" | (string) | the current network name, as defined in BIP70 (main, test, regtest) | -| "blocks" | (numeric) | the current number of blocks processed in the server | -| "headers" | (numeric) | the current number of headers we have validated | -| "bestblockhash" | (string) | the hash of the currently best block | -| "difficulty" | (numeric) | the current difficulty | -| "verificationprogress" | (numeric) | an estimate of verification progress [0..1] | -| "chainwork" | (string) | the total amount of work in the active chain, in hexadecimal | -| "pruned" | (bool) | whether the current state is in pruning mode; if true, the blockchain will not keep all transaction and block information, to preserve disk space | -| "size_on_disk" | (numeric) | the size of the blockchain on disk, measured in bytes | -| "commitments" | (numeric) | the current number of note commitments in the commitment tree | -| "softforks": { ..... } | (array) | the status of softforks in progress | -| "id" | (string) | the name of the softfork | -| "version" | (numeric) | the block version | -| "enforce": { ... } | (object) | the progress toward enforcing the softfork rules for blocks of the new version | -| "status" | (boolean) | true if threshold reached | -| "found" | (numeric) | the number of blocks with the new version found | -| "required" | (numeric) | the number of blocks required to trigger | -| "window" | (numeric) | the maximum size of the examined window of recent blocks | -| "reject": { ... } | (object) | the progress toward rejecting pre-softfork blocks (same fields as "enforce") | -| "upgrades": | (object) | the status of network upgrades | -| "xxxxxxxxx_string": | (string) | the branch ID of the upgrade | -| "name" | (string) | the name of upgrade | -| "activationheight" | (numeric) | the block height of activation | -| "status" | (string) | the status of the upgrade | -| "info" | (string) | additional information about the upgrade | -| "consensus": { ..... } | (object) | branch IDs of the current and upcoming consensus rules | -| "chaintip" | (string) | branch ID used to validate the current chain tip | -| "nextblock" | (string) | branch ID under which the next block will be validated | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblockchaininfo -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getblockcount - -**getblockcount** - -The `getblockcount` method returns the number of blocks in the best valid block chain. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ---- | --------- | ----------------------- | -| data | (numeric) | the current block count | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblockcount -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getblockhash - -**getblockhash index** - -The `getblockhash` method returns the hash of the indicated block index, according to the best blockchain at the time provided. - -### Arguments - -| Name | Type | Description | -| ----- | ------------------- | --------------- | -| index | (numeric, required) | the block index | - -### Response - -| Name | Type | Description | -| ------ | -------- | -------------- | -| "hash" | (string) | the block hash | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblockhash 100 -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getblockhashes - -**getblockhashes high low '{"noOrphans": bool, "logicalTimes": bool}'** - -The `getblockhashes` method returns an array of hashes of blocks within the timestamp range provided. - -The method requires [timestampindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#timestampindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| -------------- | ------------------- | ------------------------------------------------------------------------------------------ | -| high | (numeric, required) | the newer block timestamp | -| low | (numeric, required) | the older block timestamp | -| options | (string, required) | a json object | -| "noOrphans" | (boolean) | a value of `true` implies that the method will only include blocks on the main chain | -| "logicalTimes" | (boolean) | a value of `true` implies that the method will only include logical timestamps with hashes | - -### Response - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| "hash" | (string) | the block hash | -| "blockhash" | (string) | the block hash | -| "logicalts" | (numeric) | the logical timestamp | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblockhashes 1531614698 1531614498 -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -``` -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhashes", "params": [1531614698, 1531614498] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -Command: - -```bash -./komodo-cli getblockhashes 1531614698 1531614498 '{"noOrphans":false, "logicalTimes":true}' -``` - - - -## getblockheader - -**getblockheader "hash" ( verbose )** - -The `getblockheader` method returns information about the indicated block. - -The verbose input is optional. If verbose is false, the method returns a string that is serialized, hex-encoded data for the indicated blockheader. If verbose is true, the method returns a json object with information about the indicated blockheader. - -### Arguments - -| Name | Type | Description | -| ------- | --------------------------------- | ---------------------------------------------------------- | -| "hash" | (string, required) | the block hash | -| verbose | (boolean, optional, default=true) | true returns a json object, false returns hex-encoded data | - -### Response (verbose = `true`) - -| Name | Type | Description | -| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- | -| "hash" | (string) | the block hash (same as provided) | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this block); if the block is not on the main chain, a value of `-1` is returned | -| "height" | (numeric) | the block height or index | -| "version" | (numeric) | the block version | -| "merkleroot" | (string) | the merkle root | -| "time" | (numeric) | the block time in seconds since epoch (Jan 1 1970 GMT) | -| "nonce" | (numeric) | the nonce | -| "bits" | (string) | the bits | -| "difficulty" | (numeric) | the difficulty | -| "previousblockhash" | (string) | the hash of the previous block | -| "nextblockhash" | (string) | the hash of the next block | - -### Response (verbose = `false`) - -| Name | Type | Description | -| ------ | -------- | -------------------------------------------------------------------- | -| "data" | (string) | a string that is serialized hex-encoded data for the indicated block | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblockheader "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" -``` - - - -Command: - -```bash -./komodo-cli getblockheader "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" false -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheader", "params": ["0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getchaintips - -**getchaintips** - -The `getchaintips` method returns information about all known tips in the block tree, including the main chain and any orphaned branches. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ----------- | --------- | ------------------------------------------------------------- | -| "height" | (numeric) | the height of the chain tip | -| "hash" | (string) | the block hash of the tip | -| "branchlen" | (numeric) | `0` for main chain | -| "status" | (string) | `"active"` for the main chain | -| "height" | (numeric) | the height of the branch tip | -| "hash" | (string) | the blockhash of the branch tip | -| "branchlen" | (numeric) | the length of the branch connecting the tip to the main chain | -| "status" | (string) | the status of the chain | - -### Possible values for the returned status property - -| Status | Description | -| --------------- | ----------------------------------------------------------------------------- | -| "invalid" | this branch contains at least one invalid block | -| "headers-only" | not all blocks for this branch are available, but the headers are valid | -| "valid-headers" | all blocks are available for this branch, but they were never fully validated | -| "valid-fork" | this branch is not part of the active chain, but is fully validated | -| "active" | this is the tip of the active main chain, which is certainly valid | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getchaintips -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintips", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getchaintxstats - -**getchaintxstats nblocks blockhash** - -The method `getchaintxstats` returns statistics about the total number and rate of transactions in the chain. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------- | --------------------------------------------- | -| nblocks | (numeric, optional) | the number of blocks in the averaging window. | -| blockhash | (string, optional) | the hash of the block which ends the window | - -### Response - -| Name | Type | Description | -| ------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------- | -| "time" | (numeric) | the timestamp for the final block in the window in UNIX format | -| "txcount" | (numeric) | the total number of transactions in the chain up to this point | -| "window_final_block_hash" | (string) | the hash of the final block in the window | -| "window_block_count" | (numeric) | the size of the window in the number of blocks | -| "window_tx_count" | (numeric) | the number of transactions in the window; this value is only returned if `window_block_count` is > 0. | -| "window_interval" | (numeric) | the elapsed time in the window in seconds; this value is only returned if `window_block_count` is > 0. | -| "txrate" | (numeric) | the average rate of transactions per second in the window; this value is only returned if `window_interval` is > 0. | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getchaintxstats -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintxstats", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getdifficulty - -**getdifficulty** - -The `getdifficulty` method returns the proof-of-work difficulty as a multiple of the minimum difficulty. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | --------- | -------------------------------------------------------------------- | -| number | (numeric) | the proof-of-work difficulty as a multiple of the minimum difficulty | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getdifficulty -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getlastsegidstakes - -**getlastsegidstakes depth** - -The `getlastsegidstakes` method returns an object containing the number of blocks staked by each segid in the last `X` number of blocks, where the value of `X` is equal to the indicated `depth`. - -::: tip Note -Only applies to `-ac_staked` Smart Chains -::: - -### Arguments - -| Name | Type | Description | -| ----- | ------------------- | ------------------------------------------------------------------------------------ | -| depth | (numeric, required) | the number of blocks to scan, starting from the current height and working backwards | - -### Response - -| Name | Type | Description | -| --------- | ------------- | ---------------------------------------------------------------------------------------------------------- | -| "NotSet" | (numeric) | the number of blocks that have no `SegId` set | -| "PoW" | (numeric) | the number of blocks created through `PoW` | -| "PoSPerc" | (numeric) | the percentage of blocks created through `PoS` | -| "SegIds" | (json object) | the json containing the data of number of blocks in each `SegId` | -| "n" | (numeric) | the number of blocks staked from `SegId n` in the last X blocks, where X is equal to the indicated `depth` | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getlastsegidstakes 1000 -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```json -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getlastsegidstakes", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getmempoolinfo - -**getmempoolinfo** - -The `getmempoolinfo` method returns details on the active state of the transaction memory pool. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -### Response - -| Name | Type | Description | -| ------- | --------- | -------------------------------------- | -| "size" | (numeric) | the current transaction count | -| "bytes" | (numeric) | the sum of all transaction sizes | -| "usage" | (numeric) | the total memory usage for the mempool | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getmempoolinfo -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getrawmempool - -**getrawmempool ( verbose )** - -The `getrawmempool` method returns all transaction ids in the memory pool as a json array of transaction ids. - -The verbose input is optional and is false by default. When it is true, the method instead returns a json object with various related data. - -### Arguments - -| Name | Type | Description | -| ------- | ---------------------------------- | ----------------------------------------------------------------- | -| verbose | (boolean, optional, default=false) | true for a json object, false for a json array of transaction ids | - -### Response (verbose = `false`) - -| Name | Type | Description | -| ---------------- | -------- | ------------------ | -| "transaction_id" | (string) | the transaction id | - -### Response (verbose = `true`) - -| Name | Type | Description | -| -------------------------- | ------------- | ----------------------------------------------------------------------- | -| "transaction_id": { .... } | (json object) | -| "size" | (numeric) | the transaction size in bytes | -| "fee" | (numeric) | the transaction fee | -| "time" | (numeric) | the local time transaction entered pool in seconds since 1 Jan 1970 GMT | -| "height" | (numeric) | the block height wherein the transaction entered the mempool | -| "startingpriority" | (numeric) | the priority when the transaction entered the mempool | -| "currentpriority" | (numeric) | the transaction priority at the current height | -| "depends": { ... } | (array) | unconfirmed transactions used as inputs for this transaction | -| "transaction_id" | (string) | the parent transaction id | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getrawmempool true -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawmempool", "params": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getspentinfo - -**getspentinfo '{"txid": "txid_string", "index"}'** - -The `getspentinfo` method returns the transaction id and index where the given output is spent. - -The method requires [spentindex](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#spentindex) to be enabled. - -### Arguments - -| Name | Type | Description | -| ------- | -------- | ------------------------------------ | -| "txid" | (string) | the hex string of the transaction id | -| "index" | (number) | the output's index | - -### Response - -| Name | Type | Description | -| ------- | -------- | ------------------------ | -| "txid" | (string) | the transaction id | -| "index" | (number) | the spending input index | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getspentinfo '{"txid": "4479f2c05ba22adf2333db724f247a09effcc9edea8c079da0da05d3a0451064", "index": 0}' -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getspentinfo", "params": [{"txid": "4479f2c05ba22adf2333db724f247a09effcc9edea8c079da0da05d3a0451064", "index": 0}] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## gettxout - -**gettxout "txid_string" vout_number ( includemempool_bool )** - -The `gettxout` method returns details about an unspent transaction output. - -### Arguments - -| Name | Type | Description | -| -------------- | ------------------- | ------------------------------ | -| "txid" | (string, required) | the transaction id | -| vout | (numeric, required) | the vout value | -| includemempool | (boolean, optional) | whether to include the mempool | - -### Response - -| Name | Type | Description | -| ------------------ | ------------------ | ----------------------------------------------------------------------------------- | -| "bestblock" | (string) | the block hash | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service aware | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this block with this transaction) | -| "value" | (numeric) | the transaction value | -| "scriptPubKey": | (json object) | | -| "asm" | (string) | `scriptPubKey` in assembly format | -| "hex" | (string) | `scriptPubKey` in hex format | -| "reqSigs" | (numeric) | the number of required signatures | -| "type" | (string) | the type, e.g. pubkeyhash | -| "addresses" | (array of strings) | an array of Komodo addresses | -| "address" | (string) | the blockchain address | -| "version" | (numeric) | the version | -| "coinbase" | (boolean) | whether this is a coinbase transaction | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli gettxout "d7f9b34ad3e86f48fce55dbec1f2925b8dcbd15199977fd75d224254db9ae80d" 1 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxout", "params": ["d7f9b34ad3e86f48fce55dbec1f2925b8dcbd15199977fd75d224254db9ae80d", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## gettxoutproof - -**gettxoutproof '["transaction_id", ... ]' ( "blockhash_string" )** - -The `gettxoutproof` method returns a hex-encoded proof showing that the indicated transaction was included in a block. - -::: tip -The gettxoutproof method relies on the txindex runtime parameter. This parameter is enabled by default on all KMD-based blockchains, and should never be disabled. -::: - -### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | --------------------------------------------------------------------------------- | -| "txid" | (string) | a transaction hash | -| "blockhash" | (string, optional) | if specified, the method looks for the relevant transaction id in this block hash | - -### Response - -| Name | Type | Description | -| ------ | -------- | ------------------------------------------------------------- | -| "data" | (string) | a string that is a serialized, hex-encoded data for the proof | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli gettxoutproof '["c71f4a2ebf87bdd588e3aa168917933ee4be1661245ebf52d5708a8339cf9d7a"]' "0a28e2fb630b282138bf23bb79f597b11acff6f57c8d9c1c10fa54770035c813" -``` - - - -## gettxoutsetinfo - -**gettxoutsetinfo** - -The `gettxoutsetinfo` method returns statistics about the unspent transaction output set. - -::: tip -Note this call may take a long time to complete, depending on the state of your blockchain. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------------------ | --------- | --------------------------------- | -| "height" | (numeric) | the current block height (index) | -| "bestblock" | (string) | the best block hash hex | -| "transactions" | (numeric) | the number of transactions | -| "txouts" | (numeric) | the number of output transactions | -| "bytes_serialized" | (numeric) | the serialized size | -| "hash_serialized" | (string) | the serialized hash | -| "total_amount" | (numeric) | the total amount | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli gettxoutsetinfo -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutsetinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## kvsearch - -**kvsearch "key_string"** - -The `kvsearch` method searches for a key stored via the [kvupdate](../.././basic-docs/smart-chains/smart-chain-api/blockchain.html#kvupdate) command. - -::: tip -This feature is only available for Smart Chains. -::: - -### Arguments - -| Name | Type | Description | -| ---- | ------------------ | ------------------------------------------------------ | -| key | (string, required) | the key for which the user desires to search the chain | - -### Response - -| Name | Type | Description | -| --------------- | --------- | --------------------------------------------------------- | -| "coin" | (string) | the chain on which the key is stored | -| "currentheight" | (numeric) | the current height of the chain | -| "key" | (string) | the key | -| "keylen" | (string) | the length of the key | -| "owner" | (string) | a hex string representing the owner of the key | -| "height" | (numeric) | the height at which the key was stored | -| "expiration" | (numeric) | the height at which the key will expire | -| "flags" | (numeric) | `1` if the key was created with a password; `0` otherwise | -| "value" | (string) | the stored value | -| "valuesize" | (string) | the amount of characters stored | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli kvsearch examplekey -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "kvsearch", "params": ["examplekey"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## kvupdate - -**kvupdate "key_string" "value_string" days "passphrase_string"** - -The `kvupdate` method stores a key/value pair via OP_RETURN. - -::: tip -This feature is available only for Smart Chains. The maximum value memory size is 8kB. -::: - -### Arguments - -| Name | Type | Description | -| ------------ | ------------------- | ---------------------------------------------------------------------- | -| "key" | (string, required) | key (should be unique) | -| "value" | (string, required) | value | -| "days" | (numeric, required) | amount of days before the key expires (1440 blocks/day); minimum 1 day | -| "passphrase" | (string, optional) | passphrase required to update this key | - -### Response - -| Name | Type | Description | -| ------------ | --------- | ----------------------------------------- | -| "coin" | (string) | the chain on which the key is stored | -| "height" | (numeric) | the height at which the key was stored | -| "expiration" | (numeric) | the height at which the key will expire | -| "flags" | (string) | the amount of days the key will be stored | -| "key" | (numeric) | the stored key | -| "keylen" | (numeric) | the length of the key | -| "value" | (numeric) | the stored value | -| "valuesize" | (string) | the length of the stored value | -| "fee" | (string) | the transaction fee paid to store the key | -| "txid" | (string) | the transaction id | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli kvupdate "examplekey" "examplevalue" 2 "examplepassphrase" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "kvupdate", "params": ["examplekey", "examplevalue", "2", "examplepassphrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:9801 -``` - - - -## minerids - -**minerids height** - -The `minerids` method returns information about the notary nodes and external miners at a specific block height. The response will calculate results according to the 2000 blocks proceeding the indicated "height" block. - -### Arguments - -| Name | Type | Description | -| ------- | -------- | ------------------------------ | -| heights | (number) | the block height for the query | - -### Response - -| Name | Type | Description | -| ------------ | -------- | ----------------------------------------- | -| "mined": | | -| "notaryid" | (number) | the id of the specific notary node | -| "kmdaddress" | (string) | the KMD address of the notary node | -| "pubkey" | (string) | the public signing key of the notary node | -| "blocks" | (number) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli minerids 1000000 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "minerids", "params": ["1000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## notaries - -**notaries height timestamp** - -**notaries height** - -**notaries timestamp** - -The `notaries` method returns the public key, BTC address, and KMD address for each Komodo notary node. - -Either or both of the height and timestamp parameters will suffice. - -### Arguments - -| Name | Type | Description | -| --------- | -------- | ------------------------------------------------ | -| height | (number) | the block height desired for the query | -| timestamp | (number) | the timestamp of the block desired for the query | - -### Response - -| Name | Type | Description | -| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| "notaries": [ ... ] | (array) | -| "pubkey" | (string) | the public signing key of the indicated notary node, used on the KMD network to create notary-node authorized transactions | -| "BTCaddress" | (string) | the public BTC address the notary node uses on the BTC blockchain to create notarizations | -| "KMDaddress" | (string) | the public KMD address the notary node uses on the KMD blockchain to create notarizations | -| "numnotaries" | (number) | the number of notary nodes; typically this value is 64, but the value may vary on rare circumstances, such as during election seasons | -| "height" | (number) | the block height number at which the notary-node information applies | -| "timestamp" | (number) | the timestamp at which the notary-node information applies | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli notaries 1536365515 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "notaries", "params": ["1000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## verifychain - -**verifychain ( checklevel numblocks )** - -The `verifychain` method verifies the coin daemon's blockchain database. - -::: tip -Depending on the state of your blockchain database and daemon, this call can take a prolonged period of time to complete. -::: - -### Arguments - -| Name | Type | Description | -| ---------- | --------------------------------------- | ------------------------------------------------ | -| checklevel | (numeric, optional, 0-4, default=3) | indicates the thoroughness of block verification | -| numblocks | (numeric, optional, default=288, 0=all) | indicates the number of blocks to verify | - -### Response - -| Name | Type | Description | -| ---------- | --------- | --------------------------------------- | -| true/false | (boolean) | whether the verification was successful | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli verifychain -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifychain", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## verifytxoutproof - -**verifytxoutproof "proof_string"** - -The `verifytxoutproof` method verifies that a proof points to a transaction in a block. It returns the transaction to which the proof is committed, or it will throw an RPC error if the block is not in the current best chain. - -### Arguments - -| Name | Type | Description | -| -------------- | ------------------ | ------------------------------------------------ | -| "proof_string" | (string, required) | the hex-encoded proof generated by gettxoutproof | - -### Response - -| Name | Type | Description | -| ------ | -------- | ------------------------------------------------------------------------------------------ | -| "txid" | (string) | the transaction ids to which the proof commits; the array is empty if the proof is invalid | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli verifytxoutproof "040000004cd8bd98c66020496d0b34a5f5412400146ba10d6c7ab4286f84f7008d8d390e9ca9575183f60906e293e9766997396bec59f1c0b966085de3d17f8ac3c9d5280000000000000000000000000000000000000000000000000000000000000000da05975bf50e0f202d004b81fcc388cfd411d8c7c59a548e070b5affe938ce8ce830f10b298b00002402939a9a31df1305b40d26d9748283b102c708258717248d0d63f01d2957d8e3dcf56f6e03000000022e4babc29707fbdd8da2e4277b7c8b8b09e837f409eb047c936904d75fc8e6267a9dcf39838a70d552bf5e246116bee43e93178916aae388d5bd87bf2e4a1fc7010d" -``` - - - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifytxoutproof", "params": ["040000004cd8bd98c66020496d0b34a5f5412400146ba10d6c7ab4286f84f7008d8d390e9ca9575183f60906e293e9766997396bec59f1c0b966085de3d17f8ac3c9d5280000000000000000000000000000000000000000000000000000000000000000da05975bf50e0f202d004b81fcc388cfd411d8c7c59a548e070b5affe938ce8ce830f10b298b00002402939a9a31df1305b40d26d9748283b102c708258717248d0d63f01d2957d8e3dcf56f6e03000000022e4babc29707fbdd8da2e4277b7c8b8b09e837f409eb047c936904d75fc8e6267a9dcf39838a70d552bf5e246116bee43e93178916aae388d5bd87bf2e4a1fc7010d"] }' -H 'content-type: text/plain;' http://127.0.0.1:9801 -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/cclib.md b/docs/basic-docs/smart-chains/smart-chain-api/cclib.md deleted file mode 100644 index 29dc3a6a0..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/cclib.md +++ /dev/null @@ -1,318 +0,0 @@ -# CC Lib - -The following methods interact with Antara Modules that make use of the `-ac_cclib` parameter. - -## cclib - -**cclib insert_method insert_evalcode \\"[%22json_string%22, json_integer, ... ]\\"** - -The `cclib` method allows the user to interact with the dynamic Antara Module associated with `evalcode`. - -Each `evalcode` module has unique methods and json parameters associated, as well as unique responses. - -#### cclib formatting - -Arguments for `cclib` methods are supplied as arrays. When executed in the terminal, the values for the array can be added in a normal fashion. However, when `cclib` methods are executed as a part of a script, the shell cannot parse the arrays without additional formatting. - -##### Array Formatting for Terminal - -In the terminal, the array is bound by `''` single-quotation characters and strings are bound by `""` double-quotation characters. - -Terminal format: - -```bash -./komodo-cli -ac_name=MUSIG cclib send 18 '["03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",1]' -``` - -##### Array Formatting for Bash Scripts - -In a bash-script, the array is bound by `\"\"` escaped double-quotation characters and strings within the array are bound by `%22 %22` characters. (`0x22` is the ASCII encoding for `"`.) - -This format can be used in a terminal directly or in shell scripts, and therefore some developers may default to it, although the format is not always necessary. - -Script format: - -```bash -./komodo-cli -ac_name=MUSIG cclib send 18 \"[%2203d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a%22,1]\" -``` - -::: tip -The [cclibinfo](../../../basic-docs/smart-chains/smart-chain-api/cclib.html#cclibinfo) method returns a complete list of available methods and their parameters for each unique `evalcode`. -::: - -### Arguments - -| Name | Type | Description | -| ----------- | ---------------- | ----------------------------------------------------------------- | -| method | (string) | the unique name of the method | -| evalcode | (decimal number) | the `EVALCODE` of the module of interest | -| json_params | (array) | the parameters to be supplied to the method, provided as an array | - -### Response - -| Name | Type | Description | -| ----------------------------------------------- | ---- | ----------- | -| (the response for each `EVALCODE` is different) | | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclib combine 18 \"[%220225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a%22,%2202d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567%22]\" -``` - - - - - -## cclibaddress - -**cclibaddress evalcode pubkey** - -The `cclibaddress` method returns information about the addresses related to the specified `pubkey`, and according to the Antara Module associated with the specified `evalcode`. If no `pubkey` is provided, the `pubkey` used to the launch the daemon is the default. - -### Arguments - -| Name | Type | Description | -| -------- | ------------------ | ----------------------------------------------------------- | -| evalcode | (decimal number) | the `EVALCODE` of the module of interest | -| pubkey | (string, optional) | the public key related to the requested address information | - -### Response - -| Name | Type | Description | -| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- | -| result | (string) | whether the command executed successfully | -| CClibCCAddress | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the Antara Module's privkey | -| CCbalance | (number) | the amount of coins in the `CClibCCAddress` | -| CClibNormalAddress | (string) | the unmodified public address generated from the Antara Module's privkey | -| CClibCCTokensAddress | (string) | this property is used for development purposes only and can otherwise be ignored | -| myAddress | (string) | the normal address generated from the `pubkey` | -| myCCAddress(CClib) | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the `pubkey` | -| PubkeyCCaddress(CClib) | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the `pubkey` | -| myCCaddress | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the `pubkey` | -| myCCbalance | (number) | the amount of coins in `myCCaddress` | -| mybalance | (number) | the amount of coins in `myAddress` | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclibaddress 18 0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "cclibaddress", "params": ["18", "0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## cclibinfo - -**cclibinfo** - -The `cclibinfo` method displays all the methods of all the modules that are available in the current library. - -The library is loaded at runtime using the [-ac_cclib](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-cclib) parameter. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -### Response - -| Name | Type | Description | -| --------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| result | (string) | whether the command executed successfully | -| CClib | (string) | the name of the given CClibrary | -| methods | (array of json objects) | an array containing json objects, each of which describe a method of a module | -| evalcode | (decimal number) | the `EVALCODE` of the given Antara Module | -| funcid | (character) | this value is a mnemonic in the `OP_RETURN` for all generated transactions; if the provided method does not generate a transaction, this value is a single character that has no relevant meaning | -| name | (string) | the name of the Antara module | -| method | (string) | the name of the method | -| help | (string) | help for the method, including a description of the method's arguments | -| params_required | (decimal number) | the number of parameters that are required for the method to succeed | -| params_max | (decimal number) | the maximum number of parameters the method can accept | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=MUSIG cclibinfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "cclibinfo", "params": [ ] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/control.md b/docs/basic-docs/smart-chains/smart-chain-api/control.md deleted file mode 100644 index 34b727ae6..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/control.md +++ /dev/null @@ -1,302 +0,0 @@ -# Control - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - - - -## getinfo - -**getinfo** - -The `getinfo` method returns an object containing various state info. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ----------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | -| "version" | (numeric) | the server version | -| "protocolversion" | (numeric) | the protocol version | -| "walletversion" | (numeric) | the wallet version | -| "balance" | (numeric) | the total balance of the wallet | -| "blocks" | (numeric) | the current number of blocks processed in the server | -| "timeoffset" | (numeric) | the time offset | -| "connections" | (numeric) | the number of connections | -| "proxy" | (string, optional) | the proxy used by the server | -| "difficulty" | (numeric) | the current difficulty | -| "testnet" | (boolean) | if the server is using testnet or not | -| "keypoololdest" | (numeric) | the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool | -| "keypoolsize" | (numeric) | how many new keys are pre-generated | -| "unlocked_until" | (numeric) | the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked | -| "paytxfee" | (numeric) | the transaction fee set in COIN/kB | -| "relayfee" | (numeric) | minimum relay fee for non-free transactions in COIN/kB | -| "errors" | (string) | any error messages | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getinfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## help - -**help ( "command" )** - -The `help` method lists all commands, or all information for a specified command. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | -------------------------------- | -| "command" | (string, optional) | the command requiring assistance | - -### Response - -| Name | Type | Description | -| --------- | ------------------ | -------------------------------- | -| "command" | (string, optional) | the command requiring assistance | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli help -``` - - - -Command: - -```bash -./komodo-cli help getaddressbalance -``` - - - -## stop - -**stop** - -The `stop` method instructs the coin daemon to shut down. - -The amount of time it takes to shut down the chain will vary depending on the chain's current state. - -::: warning -Forcefully stopping the chain should be avoided, as it may corrupt the local database. In the event of a corrupted database, the user will need to resync. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ----------------------------- | ---- | ----------- | -| Komodo server stopping | | -| [COIN] Komodo server stopping | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli stop -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "stop", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/crosschain.md b/docs/basic-docs/smart-chains/smart-chain-api/crosschain.md deleted file mode 100644 index a6b07c2f2..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/crosschain.md +++ /dev/null @@ -1,1420 +0,0 @@ ---- -sidebarDepth: 3 ---- - -# Cross-Chain API - -## Introduction - -The Crosschain API allows a user to transfer (or "migrate") assets from one chain to another. Compatible forms of assets include coins and tokens. - -The fundamental principle of migration is that a specific amount of assets are burned in the source chain and then the same specific amount of assets are created on the destination chain. - -#### Different methods of migration using the Komodo Platform - -- MoMoM notarized migration - - "MoMoM" stands for "Merkle root of Merkle roots of Merkle roots" -- An alternative migration method with notarization of the given burn transaction by notary operators (this is a backup solution to the above MoMoM method) -- Self-managed import - -#### Crosschain API Flow - -- Make an export or burn transaction in the source chain. -- Create an "import" transaction for the burned value. - - This is created on the source chain, but the transaction is sent on the destination chain -- Komodo's validation code checks that for the import transaction there exists a corresponding burn transaction, and that this transaction is not spent more than once. - -#### Requirement - -The source and destination chains should have the same `CCid` parameter ([ac_cc](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-cc)). The value of this parameter should be greater than 100; this indicates to the Komodo software that the coins on both chains are fungible with each other. - -:::tip Note - -- In the examples, we use two chains. The source chain is CFEKHOUND and the destination chain is CFEKDRAGON. - -::: - -## MoMoM Notarized Migration - -The MoMoM notarized migration API allows the migration of coin or token value using Komodo's notary network. This facilitates the highly scalable multi-chain architecture of Smart Chains on the Komodo Platform. - -Notary nodes store "fingerprints" of the blocks belonging to the blockchains of the various assets in the main Komodo chain (KMD). The "fingerprints" can also be referred to as MoM, or `merkle root of merkle roots`. - -The fingerprints of fingerprints are delivered back into the blockchain of the assets as back notarizations. To learn more about the notarization process, [please visit this linked article](https://komodoplatform.com/komodo-platforms-new-scalability-tech/). - -### Workflow of the MoMoM value migration - -- On the source chain, the user calls the method [migrate_createburntransaction](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html#migrate-createburntransaction) and broadcasts the hex of the returned burn transaction (`BurnTxHex`) using the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#createrawtransaction) method. The user also receives the `payouts object` from this method -- On the source chain, the user runs [migrate_createimporttransaction](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html#migrate-createimporttransaction) with the hex value of the burn transaction and the `payouts object` in hex format as arguments -- On the main Komodo chain (KMD) the user calls [migrate_completeimporttransaction](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html#migrate-completeimporttransaction) with the import transaction in hex format which was received from the previous call as an argument. - - As a part of this process, the proof object for the burn transaction inside the import transaction is extended with MoMoM data. This allows verification of the burn transaction on the destination chain by using the standard Komodo notarization process without the need to create additional proof objects - -### migrate_createburntransaction - -**migrate_createburntransaction destChain destAddress amount [tokenid]** - -The `migrate_createburntransaction` method creates a transaction burning a specific amount of coins or tokens. This method also creates a `payouts object` which is later used to create an import transaction for the value corresponding to the burned amount. This method should be called on the source chain. - -The method creates a burn transaction and returns it. This should be broadcast to the source chain using the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method. After the burn transaction is successfully mined, the user might have to wait for some amount of time for the back notarization to reach the source chain. The back notarization contains the `MoMoM` fingerprints of the mined block that contains the burn transaction. - -The hex value of the burn transaction along with the other returned value `payouts` are used as arguments for the `migrate_createimporttransaction` method. - -#### Arguments - -| Name | Type | Description | -| ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| "destChain" | (string, required) | the name of the destination chain | -| "destAddress" | (string, required) | the address on the destination chain where coins are to be sent; the pubkey if tokens are to be sent | -| "amount" | (numeric, required) | the amount in coins or tokens that should be burned on the source chain and created on the destination chain; if the indicated assets are tokens, the amount can be set only to 1, as only migration of non-fungible tokens are supported at this time | -| "tokenid" | (string, optional) | token id in hex; if set, the software assumes that the user is migrating tokens | - -#### Response - -| Name | Type | Description | -| ----------- | -------- | --------------------------------------------------------------------------------------------------------- | -| "payouts" | (string) | a hex string of the created payouts; this value is passed into the migrate_createimporttransaction method | -| "BurnTxHex" | (string) | a hex string of the returned burn transaction | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND migrate_createburntransaction CFEKDRAGON RBQ1XwmzduHvciRJbXbWY9YBSNtaqZvfC4 7.77 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_createburntransaction", "params": ["CFEKDRAGON","RBQ1XwmzduHvciRJbXbWY9YBSNtaqZvfC4","7.77"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -Broadcast the transaction: - -```bash -./komodo-cli -ac_name=CFEKHOUND sendrawtransaction 0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c00000000000000000000000000 -``` - - - -### migrate_converttoexport - -**migrate_converttoexport rawtx dest_symbol** - -The `migrate_converttoexport` method allows the user to create a customized burn transaction (as opposed to a fully automated burn transaction). This method converts a given transaction to a burn transaction. - -The method adds proof data to the transaction, extracts the transaction vouts, calculates their value, and burns the value by sending it to an opreturn vout. This vout is then added to the created transaction. (An opreturn vout cannot be spent at a later date, and therefore funds sent to an opreturn vout are permanently burnt.) - -The other returned value, `payouts`, is used in the `migrate_createimporttransaction` method. - -The caller of the method bears the responsibility to fund and sign the returned burn transaction using the methods [fundrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#fundrawtransaction) and [signrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#signrawtransaction). - -The signed burn transaction must be broadcast to the source chain using the [sendrawtansaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method. - -::: warning Limitations - -- The migrate_converttoexport method supports only coins (tokens are not supported) -- The burn transaction must be stored in the import transaction's opreturn vout. Because an opreturn's data size is limited to 10,001 bytes, we recommend that the user limit the burn transaction's size to 30% of the opreturn object - -::: - -#### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | ---------------------------------- | -| "burntx" | (string, required) | the burn transaction in hex format | -| "destChain" | (string, required) | the name of the destination chain | - -#### Response - -| Name | Type | Description | -| ---------- | -------- | --------------------------------------------------------------------------------------------------- | -| "payouts" | (string) | a hex string of the created payouts; this is passed into the migrate_createimporttransaction method | -| "exportTx" | (string) | a hex string of the returned burn transaction | - -#### :pushpin: Examples - -Create a raw transaction: - -```bash -./komodo-cli -ac_name=CFEKHOUND createrawtransaction '[{"txid":"ad930d24e0d1c060d7acf46170e31b6863cb429969449d81babd7a644745bfff","vout":6}]' '{"RBQ1XwmzduHvciRJbXbWY9YBSNtaqZvfC4":0.077}' -``` - - - -Convert it to an export transaction: - -```bash -./komodo-cli -ac_name=CFEKHOUND migrate_converttoexport 0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000000ffffffff01207e7500000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac00000000f36f00000000000000000000000000 CFEKDRAGON -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_converttoexport", "params": ["0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000000ffffffff01207e7500000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac00000000f36f00000000000000000000000000","CFEKDRAGON"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -Sign the export transaction: - -```bash -./komodo-cli -ac_name=CFEKHOUND signrawtransaction 0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000000ffffffff0130a57500000000003b6a39e283150a4346454b445241474f4efa2fe05c5d6cb0bf5a9be2aec4f1cd7a10c9472d6abc1e9bb9dc5903a4ec1a5b0a094346454b484f554e4400000000f36f00000000000000000000000000 -``` - - - -Broadcast the export transaction (using the method [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction), with the option `allowhighfees` set to `true`) - -```bash -./komodo-cli -ac_name=CFEKHOUND sendrawtransaction 0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000049483045022100f609176d691bade4060799424d7d3813ea3337ad8aabc79bb6fd51797b6ec9c80220073d1ba3a74da7e33bcccf5851c2152d66fcd7aa0d2c1521ec8b2ab444d656f801ffffffff0130a57500000000003b6a39e283150a4346454b445241474f4efa2fe05c5d6cb0bf5a9be2aec4f1cd7a10c9472d6abc1e9bb9dc5903a4ec1a5b0a094346454b484f554e4400000000f36f00000000000000000000000000 true -``` - - - -To see the rest of the process when `migrate_converttoexport` is used, click the following button: - - - -### migrate_createimporttransaction - -**migrate_createimporttransaction burntx payouts [notaryTxid1]...[notaryTxidN]** - -- The `migrate_createimporttransaction` method performs the initial step in creating an import transaction. This method should be called on the source chain. -- This method returns a created import transaction in hex format. This string should be passed to the `migrate_completeimporttransaction` method on the main KMD chain to be extended with the `MoMoM` proof object. -- When using the MoMoM backup solution (described later), the created import transaction is not passed to the `migrate_completeimporttransaction` method. -- The user may need to wait for some time before the back notarizations objects are stored in the destination chain. - -#### Arguments - -| Name | Type | Description | -| ------------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | -| "burntx" | (string, required) | the burn transaction in hex format returned from the previous method | -| "payouts" | (string, required) | the payouts object in hex format returned from the previous method and used for creating an import transaction | -| "notaryTxid1" | (string, optional) | the notary approval transaction id 1, to be passed if the `MoMoM` backup solution is used for notarization | -| "notaryTxidN" | (string, optional) | the notary approval transaction id N, to be passed if the `MoMoM` backup solution is used for notarization | - -#### Response - -| Name | Type | Description | -| ------------- | -------- | -------------------------------------------- | -| "ImportTxHex" | (string) | the created import transaction in hex format | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND migrate_createimporttransaction 0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c00000000000000000000000000 014014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_createimporttransaction", "params": ["0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c00000000000000000000000000","014014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### migrate_completeimporttransaction - -**migrate_completeimporttransaction importtx** - -The `migrate_completeimporttransaction` method performs the finalizing step in creating an import transaction. This method should be called on the KMD (Komodo) chain. - -This method returns the import transaction in hex format, updated with the `MoMoM` proof object. This object provides confirmation that the burn transaction exists in the source chain. - -The finalized import transaction should be broadcast on the destination chain through the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method. - -Komodo recommends that the user wait until the notarization objects are stored in the destination chain before broadcasting the import transaction. Otherwise an error message is returned. - -In the event that an error is returned, simply wait until the notarization objects are stored in the KMD chain and try again. - -#### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | -| "importtx" | (string, required) | the import transaction in hex format created using the previous method | -| "offset" | (string, optional) | the number of blocks below the current KMD(Komodo) blockchain height in which a `MoMoM` proof must be searched | - -#### Response - -| Name | Type | Description | -| ------------- | -------- | --------------------------------------------------------------------------- | -| "ImportTxHex" | (string) | import transaction in hex extended with the MoMoM proof of burn transaction | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli migrate_completeimporttransaction 0400008085202f89011016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd100ca9a3b0201e2ffffffff024014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac0000000000000000fdc9016a4dc501e211da14c5a904dcf9dcc5c4471bae0f3e90274bc782fcaf7a828c23190dbbd3392205042cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b6f7fb8e5644af270917b10fa879a0c5636de719d308efd245ff5613450b934a5f32fd21b84a67d7b6be78b5d625af836cf7efddab3c6e8fea54345bab9ea7732cf073ef25f0b8a0764d928c8a420d45beb793fa8ea93432a908c808e4f47daadf0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c0000000000000000000000000000000000000000000000000000000000000000 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_completeimporttransaction", "params": ["0400008085202f89011016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd100ca9a3b0201e2ffffffff024014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac0000000000000000fd49026a4d4502e211a2f7550475bf21bac89b760b8c1e6a114d77c22de1584f3d65a09b98fe73360945082cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b6f7fb8e5644af270917b10fa879a0c5636de719d308efd245ff5613450b934a5f32fd21b84a67d7b6be78b5d625af836cf7efddab3c6e8fea54345bab9ea7732cf073ef25f0b8a0764d928c8a420d45beb793fa8ea93432a908c808e4f47daadfdfaa753cfdd54be8cc63b15bc2544964c03c43e0645a1ea9302522a1c9daf4c19dd9ff959973a556e4761ae171363572f782f5660a89acde315cd811a1b42140fa6d1de2ced3e371e4f8e4bca493a23d6121a608ccc0d66eb45b3ccce9518612bef75468f0fe5310972c8059e9aabf86b59a824bf5e2ac6f6b6eeb7dc171ebcb0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c0000000000000000000000000000000000000000000000000000000000000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -Broadcast the transaction: - -```bash -./komodo-cli CFEKDRAGON sendrawtransaction 0400008085202f89011016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd100ca9a3b0201e2ffffffff024014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac0000000000000000fd49026a4d4502e211a2f7550475bf21bac89b760b8c1e6a114d77c22de1584f3d65a09b98fe73360945082cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b6f7fb8e5644af270917b10fa879a0c5636de719d308efd245ff5613450b934a5f32fd21b84a67d7b6be78b5d625af836cf7efddab3c6e8fea54345bab9ea7732cf073ef25f0b8a0764d928c8a420d45beb793fa8ea93432a908c808e4f47daadfdfaa753cfdd54be8cc63b15bc2544964c03c43e0645a1ea9302522a1c9daf4c19dd9ff959973a556e4761ae171363572f782f5660a89acde315cd811a1b42140fa6d1de2ced3e371e4f8e4bca493a23d6121a608ccc0d66eb45b3ccce9518612bef75468f0fe5310972c8059e9aabf86b59a824bf5e2ac6f6b6eeb7dc171ebcb0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c0000000000000000000000000000000000000000000000000000000000000000 -``` - - - -## Notarization Backup Solution - -There is an alternative solution to notarize burn transactions. This method is useful when the automated MoMoM notarization method fails or is slow. - -In this method, the user sends burn transactions to a special publishing resource that is monitored by the notary operators. The notary operators check this publishing resource, pick a burn transaction, validate and check the existence of the burn transaction in its source chain. The notary operators then create an approval transaction in the destination chain and return the transaction ids to the publishing resource. - -### Alternative Transfer Method Flow - -- A user creates a burn transaction using the [migrate_createburntransaction](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html#migrate-createburntransaction) method and publishes the transaction in hex format to a publishing resource - - The publishing resource is monitored by the notary operators (currently the discord channel: [#cc-momom](https://discord.gg/JE9tkmN)) -- The notary operators must collect the burn transaction, and check its validity and existence in the source chain - - To check the transaction, the notary operators use the `migrate_checkburntransactionsource` method - - If the burn transaction is successfully validated, the notary operators must create approval transactions using the method [migrate_createnotaryapprovaltransaction](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html#migrate-createnotaryapprovaltransaction) in the destination chain and publish their transaction ids back into the publishing resource -- The user collects the transaction ids and calls the [migrate_createimporttransaction](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html#migrate-createimporttransaction) method, passing the collected notary approval transaction ids as arguments in the destination chain - - Currently, the user must have at least 5 successful notary-approval transactions for an import transaction to be considered as valid in the destination chain - -### migrate_checkburntransactionsource - -**migrate_checkburntransactionsource burntxid** - -The `migrate_checkburntransactionsource` method allows a notary operator to check the burn transaction's structure and verify its presence in the source chain. - -#### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | ------------------------- | -| "burntxid" | (string, required) | the burn transaction's id | - -#### Response - -| Name | Type | Description | -| -------------- | ------------------ | ----------------------------------------------------------------- | -| "sourceSymbol" | (string) | the source chain's name | -| "targetSymbol" | (string) | the target chain's name | -| "targetCCid" | (number) | the target chain's `CCid` | -| "tokenid" | (string, optional) | the token id if a token is to be migrated | -| "TxOutProof" | (string) | the proof of the burn transaction's existence in the source chain | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND migrate_checkburntransactionsource d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_checkburntransactionsource", "params": ["d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### migrate_createnotaryapprovaltransaction - -**migrate_createnotaryapprovaltransaction burntxid txoutproof** - -A notary operator uses the `migrate_createnotaryapprovaltransaction` method to create an approval transaction in the destination chain with the proof of the burn transaction's existence in the source chain. - -The returned notary approval transaction should be broadcast to the destination chain using the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method. - -#### Arguments - -| Name | Type | Description | -| ------------ | ------------------ | --------------------------------------------- | -| "burntxid" | (string, required) | the burn transaction's id | -| "txoutproof" | (string, required) | the proof of the burn transaction's existence | - -#### Response - -| Name | Type | Description | -| ------------- | -------- | ----------------------------------------- | -| "NotaryTxHex" | (string) | notary approval transaction in hex format | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND migrate_createnotaryapprovaltransaction d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610 040000009c6c2e1c0607ea57d44d6d0518cebc341a76e8f294ad6d2844d84f09983b35013bfacfeb3d1a412c1261f59f122fae6ae3d657d3a1871902282519a0b0d08045fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493ec64bd45c8fab0220360057fb64b4378bb1a33d9dcf9acf6e5b7c42f6a08db8eb87bfaad001910000143427efb28257954cb4e6596f4e06bdcad43cb9a402000000022cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b61016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd10105 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_createnotaryapprovaltransaction", "params": ["d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610","040000009c6c2e1c0607ea57d44d6d0518cebc341a76e8f294ad6d2844d84f09983b35013bfacfeb3d1a412c1261f59f122fae6ae3d657d3a1871902282519a0b0d08045fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493ec64bd45c8fab0220360057fb64b4378bb1a33d9dcf9acf6e5b7c42f6a08db8eb87bfaad001910000143427efb28257954cb4e6596f4e06bdcad43cb9a402000000022cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b61016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd10105"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## Self Import API - -The Self Import API is a special API available only in chains that need a pubkey to create new coins arbitrarily. - -### selfimport - -**selfimport destAddress amount** - -The Self Import API allows a trusted pubkey to create more coins on the same chain. - -#### Requirements - -The chain must have the custom parameters `-ac_import=PUBKEY` and `-ac_pubkey` set to a pubkey which is allowed to create coins. - -#### Self Import Flow - -- For creating more coins in the chain with `-ac_import=PUBKEY` enabled, use the selfimport method -- The method returns a source transaction that contains a parameter with the amount of coins to create - - The returned value is a proof of the trusted pubkey owner's intention to create new coins in the chain -- The returned source transaction should be broadcast to the chain using the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method. The source transaction spends a `txfee=10000 satoshis` from the `-ac_pubkey` owner's uxtos -- After the source transaction is mined, the import transaction should also be broadcasted to the chain with the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) method. After this transaction is mined, its vout contains the amount of created coins in the chosen destination address - -#### Arguments - -| Name | Type | Description | -| ------------- | ------------------ | -------------------------------------------------- | -| "destAddress" | (string, required) | the address where the created coins should be sent | -| "amount" | (number, required) | the amount in coins to create | - -#### Response - -| Name | Type | Description | -| ------------- | -------- | ------------------------------------ | -| "SourceTxHex" | (string) | the source transaction in hex format | -| "ImportTxHex" | (string) | the import transaction in hex format | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=IMPORTTEST selfimport RM9n6rts1CBKX4oXziLp1WBBgEUjKKWHb3 100000 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "selfimport", "params": ["RM9n6rts1CBKX4oXziLp1WBBgEUjKKWHb3","100000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -To see the rest of the process of the `migrate_converttoexport` method, click the following button. - - - -## Notary API - -The following methods are available to the notary nodes for retrieving the blockchain "fingerprints" and notarization data. - -### calc_MoM - -**calc_MoM height MoMdepth** - -The `calc_MoM` method calculates the value of the merkle root of the blocks' merkle roots (MoM), starting from the block of the indicated height for the chosen depth. - -:::tip Note -This method should be run on a Smart Chain. -::: - -#### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | ------------------------------------------------------------ | -| "height" | (number, required) | the block height from which the `MoM` calculation must begin | -| "MoMdepth" | (number, required) | the number of blocks to include in the MoM calculation | - -#### Response - -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------------------ | -| "coin" | (string) | the chain's name | -| "height" | (string) | the starting block height | -| "MoMdepth" | (number) | the number of blocks included in the `MoM` calculation | -| "MoM" | (string) | the `MoM` value | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND calc_MoM 1000 100 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "calc_MoM", "params": ["1000","100"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### MoMoMdata - -**MoMoMdata symbol kmdheight ccid** - -The `MoMoMdata` method calculates the value of the merkle root of merkle roots of the blocks' merkle roots (MoMoM), starting from the block of the indicated height for the data of the indicated chain. - -:::tip Note - -Execute this method on the KMD chain. - -::: - -#### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | --------------------------------------------------------------- | -| "symbol" | (string, required) | the chain's name whose data's `MoMoM` value is to be calculated | -| "kmdheight" | (number, required) | the number of blocks to include in the `MoM` calculation | -| "ccid" | (number, required) | the chain's CCid | - -#### Response - -| Name | Type | Description | -| ------------------ | -------- | --------------------------------------------------------- | -| "coin" | (string) | the chain's name | -| "kmdheight" | (string) | the starting block's height | -| "ccid" | (number) | the chain's `CCid` | -| "MoMs" | (string) | the array of `MoM` values | -| "notarizationHash" | (string) | the first found notarization transaction id for the chain | -| "MoMoM" | (string) | the MoMoM value | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli MoMoMdata CFEKHOUND 1350074 533 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "MoMoMdata", "params": ["CFEKHOUND","1350074","533"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### assetchainproof - -**assetchainproof txid** - -The `assetchainproof` method scans the chain for the back `MoM` notarization for a transaction corresponding to the given transaction id and returns a proof object with MoM branch. Scanning is performed from the height up to the chain tip, with a limit of `1440` blocks. - -#### Arguments - -| Name | Type | Description | -| ------ | ------------------ | ------------------------------------------------------------ | -| "txid" | (string, required) | the transaction id for which a proof object must be returned | - -#### Response - -| Name | Type | Description | -| -------------- | -------- | ------------------------------------------------------- | -| "proof object" | (string) | the returned proof object with MoM branch in hex format | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND assetchainproof d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "assetchainproof", "params": ["d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### getNotarisationsForBlock - -**getNotarisationsForBlock height** - -The `getNotarisationsForBlock` method returns the notarization transactions within the block of the given block hash. - -#### Arguments - -| Name | Type | Description | -| -------- | ------------------ | -------------------------------------------- | -| "height" | (number, required) | the block number of the block to be searched | - -#### Response - -| Name | Type | Description | -| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------- | -| "Notary Cluster" | (string) | refers to the notary group which performed the notarizations; KMD for the main Komodo notaries, LABS for the LABS notaries | -| "txid" | (string) | the notarization transaction's id | -| "chain" | (string) | the chain that has been notarized | -| "height" | (number) | the notarization transaction's block height | -| "blockhash" | (string) | the hash of the notarization transaction's block | -| "notaries" | (array) | the [ids](https://github.com/jl777/komodo/blob/master/src/komodo_notary.h) of the notaries who performed the notarization | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getNotarisationsForBlock 1350074 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getNotarisationsForBlock", "params": [1350074] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### scanNotarisationsDB - -**scanNotarisationsDB blockHeight symbol [blocksLimit=1440]** - -The `scanNotarisationsDB` method scans the notarization database backwards from the given block height for a notarization of the chain with the given name (symbol). - -#### Arguments - -| Name | Type | Description | -| ------------- | ------------------ | --------------------------------------------------------------------- | -| "blockHeight" | (number, required) | the starting block height from which notarizations are to be searched | -| "symbol" | (string, required) | the chain's name whose notarizations are to be searched | -| "blocksLimit" | (number, optional) | an optional block depth to search for notarizations | - -#### Response - -| Name | Type | Description | -| ---------- | -------- | ----------------------------------------------------------------------- | -| "height" | (number) | the block height of the notarization transaction id that has been found | -| "hash" | (string) | the hash of the notarization transaction id that has been found | -| "opreturn" | (string) | the notarization data in hex format | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli scanNotarisationsDB 1350074 EMC2 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "scanNotarisationsDB", "params": ["1350074","EMC2"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## User API - -The following are utility methods available to user. These methods assist in retrieving information about burn and import transactions. - -### getimports - -**getimports hash|height** - -The `getimports` method lists import transactions in the indicated block of the chain. - -#### Arguments - -| Name | Type | Description | -| ---------------- | ---------------------------- | ----------------------------------------- | -| "hash or height" | (string or number, required) | the block's hash or height to be searched | - -#### Response - -| Name | Type | Description | -| --------------- | ----------------- | --------------------------------------------------- | -| "imports" | (array) | | -| "txid" | (string) | the import transaction id | -| "amount" | (number) | the import transaction's value in coins | -| "export" | (json) | the export or burn transaction's infomation | -| "txid" | (string) | the export transaction's id | -| "amount" | (number) | the export transaction's value | -| "txid" | (string) | the export transaction's id | -| "source" | (string) | the source chain's name | -| "tokenid" | (string,optional) | the source chain's token id, if tokens are imported | -| "TotalImported" | (number) | the total imported amount in coins | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKDRAGON getimports 027366fc75eb2adda37f54092f29130d3feafd5bf453b4005fbdc68a27391a8f -``` - -:::tip Note - -If the transaction id of an import is known, use the [gettransaction](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#gettransaction) method to retrieve its block hash. - -::: - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getimports", "params": ["027366fc75eb2adda37f54092f29130d3feafd5bf453b4005fbdc68a27391a8f"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -### getwalletburntransactions - -**getwalletburntransactions "count"** - -The `getwalletburntransactions` method lists all the burn transactions in the current wallet. - -#### Arguments - -| Name | Type | Description | -| ------- | ------------------ | -------------------------------------------------------------------------------------------- | -| "count" | (number, optional) | the number of burn transactions to be returned; if omitted, defaults to 10 burn transactions | - -#### Response - -| Name | Type | Description | -| -------------- | ------------------ | ---------------------------------- | -| "txid" | (string) | the burn transaction's id | -| "burnedAmount" | (number) | the burned value in coins | -| "tokenid" | (string, optional) | the token id, if tokens are burned | -| "targetSymbol" | (string) | the target chain's name | -| "targetCCid" | (number) | the target chain's `CCid` | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli -ac_name=CFEKHOUND getwalletburntransactions -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletburntransactions", "params": [""] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/disclosure.md b/docs/basic-docs/smart-chains/smart-chain-api/disclosure.md deleted file mode 100644 index a2b0f5508..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/disclosure.md +++ /dev/null @@ -1,114 +0,0 @@ -# Disclosure - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## z_getpaymentdisclosure - -::: warning -EXPERIMENTAL FEATURE: Payment disclosure is currently DISABLED. This call always fails. -::: - -**z_getpaymentdisclosure transaction js_index output_index ("message")** - -The `z_getpaymentdisclosure` method generates a payment disclosure for a given joinsplit output. - -### Arguments - -| Name | Type | Description | -| -------------- | ------------------ | -------------------------------------------------- | -| "txid" | (string, required) | (in development) | -| "js_index" | (string, required) | | -| "output_index" | (string, required) | | -| "message" | (string, optional) | | - -### Response - -| Name | Type | Description | -| ------------------- | -------- | --------------------------------------- | -| "paymentdisclosure" | (string) | a hex data string, with a "zpd:" prefix | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_getpaymentdisclosure 96f12882450429324d5f3b48630e3168220e49ab7b0f066e5c2935a6b88bb0f2 0 0 "refund" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in your coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getpaymentdisclosure", "params": ["96f12882450429324d5f3b48630e3168220e49ab7b0f066e5c2935a6b88bb0f2", 0, 0, "refund"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_validatepaymentdisclosure - -**z_validatepaymentdisclosure "paymentdisclosure"** - -The `z_validatepaymentdisclosure` method validates a payment disclosure. - -::: warning -EXPERIMENTAL FEATURE: Payment disclosure is currently DISABLED. This call always fails. -::: - -### Arguments - -| Name | Type | Description | -| ------------------- | ------------------ | ----------------------------------- | -| "paymentdisclosure" | (string, required) | hex data string, with "zpd:" prefix | - -### Response - -| Name | Type | Description | -| -------------------- | ---- | ----------- | -| (currently disabled) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_validatepaymentdisclosure "zpd:706462ff004c561a0447ba2ec51184e6c204..." -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_validatepaymentdisclosure", "params": ["zpd:706462ff004c561a0447ba2ec51184e6c204..."] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/generate.md b/docs/basic-docs/smart-chains/smart-chain-api/generate.md deleted file mode 100644 index f10d80d0a..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/generate.md +++ /dev/null @@ -1,294 +0,0 @@ -# Generating - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## generate - -**generate numblocks** - -::: tip -This function can only be used in the regtest mode (for testing purposes). -::: - -The `generate` method instructs the coin daemon to immediately mine the indicated number of blocks. - -### Arguments - -| Name | Type | Description | -| --------- | --------- | ---------------------------------------- | -| numblocks | (numeric) | the desired number of blocks to generate | - -### Response - -| Name | Type | Description | -| ----------- | ------- | -------------------------- | -| blockhashes | (array) | hashes of blocks generated | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli generate 2 -``` - - - -## getgenerate - -**getgenerate** - -The `getgenerate` method returns a boolean value indicating the server's mining status. - -The default value is false. - -::: tip -See also gen. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ------ | ----------- | -| (none) | (none) | - -### Response - -| Name | Type | Description | -| ---------- | --------- | ----------------------------------------------------- | -| true/false | (boolean) | indicates whether the server is set to generate coins | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getgenerate -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getgenerate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## setgenerate - -**setgenerate generate ( genproclimit )** - -The `setgenerate` method allows the user to set the `generate` property in the coin daemon to `true` or `false`, thus turning generation (mining/staking) on or off. - -Generation is limited to [genproclimit](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#genproclimit) processors. Set `genproclimit` to `-1` to use maximum available processors. - -::: tip -See also the [getgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#getgenerate) method to query the current setting, and [genproclimit](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#genproclimit) for setting the default number of processors the daemon uses through the `.conf` file. -::: - -### Arguments - -| Name | Type | Description | -| ------------ | ------------------- | ------------------------------------------------------------------------------- | -| generate | (boolean, required) | set to true to turn on generation; set to off to turn off generation | -| genproclimit | (numeric, optional) | set the processor limit for when generation is on; use value "-1" for unlimited | - -### Response - -| Name | Type | Description | -| ------ | ------ | ----------- | -| (none) | (none) | - -#### :pushpin: Examples - -##### Activate mining with maximum available processors - -Command: - -```bash -./komodo-cli setgenerate true -1 -``` - - - -##### Activate staking - -Command: - -```bash -./komodo-cli setgenerate true 0 -``` - - - -##### Activate mining with 4 threads - -Command: - -```bash -./komodo-cli setgenerate true 4 -``` - - - -##### Check the setting - -Command: - -```bash -./komodo-cli getgenerate -``` - - - -##### Turn off generation - -Command: - -```bash -./komodo-cli setgenerate false -``` - - - -##### Turning the setting on via json RPC - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setgenerate", "params": [true, 1] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/jumblr.md b/docs/basic-docs/smart-chains/smart-chain-api/jumblr.md deleted file mode 100644 index 0874e033a..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/jumblr.md +++ /dev/null @@ -1,211 +0,0 @@ -# Jumblr - -::: tip Note - -At this time, all zero-knowledge transaction and Jumblr functionality on the main KMD chain is disabled. - -Other Smart Chains in the Komodo ecosystem offer zero-knowledge transaction functionality. However, no Smart Chain currently offers Jumblr, and therefore this documentation is currently deprecated. - -Please check with the developers of your desired Smart Chain to learn more. - -::: - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## Basic Instructions - -- Install Komodo following the [installation guides](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#linux) and change into the `komodod` subdirectory using: - -```bash -cd ~/komodo/src -``` - -- Start the daemon: - -```bash -./komodod & -``` - -- Designate a KMD address with at least 10.024 KMD funds: - -```bash -./komodo-cli jumblr_deposit KMD_address -``` - -::: tip -The jumblr process continues until there are less than ~ 10.024 KMD in the deposit address. -::: - -- Designate a destination address for your funds. This should be a transparent address that you are keeping secret: - -```bash -komodo-cli jumblr_secret destination_KMD_address -``` - -- Leave your node running until the balance in your first address reaches below 10.024 KMD and the destination address receives the correct amount. - -::: warning -Jumblr is created to be resistant against time-based analysis. Because of this, Jumblr is purposefully designed not to be fast. You will need to leave your node running for several hours for the process to finish. -::: - -#### :pushpin: Examples - -Designate your deposit address. - -```bash -./komodo-cli jumblr_deposit RT4mSUjG35QeuGcedsfpHtP5MhDeEGTAqb -``` - -Designate your secret destination address. - -```bash -./komodo-cli jumblr_secret RS46GZ5iTkt2exdauQG3JJ8fdnZNJUvAc1 -``` - -## jumblr_deposit - -**jumblr_deposit "depositaddress"** - -The `jubmlr_deposit` method indicates the address from which Jumblr should withdraw funds. There should be at least 10.024 KMD in this address. Jumblr will withdraw funds in increments of 10, 100, or 7770 KMD. - -::: tip -While shielded z_address technology is available on all KMD-based Smart Chains, the Jumblr engine and methods are only available on the KMD mainnet. -::: - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------ | ------------------------------------------------- | -| "depositaddress" | (string, required) | the address from which Jumblr will withdraw funds | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli jumblr_deposit RT4mSUjG35QeuGcedsfpHtP5MhDeEGTAqb -``` - - - -## jumblr_pause - -**jumblr_pause** - -The `jumblr_pause` method instructs Jumblr to temporarily pause the privacy-shielding process. - -::: tip -See also jumblr_resume. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli jumblr_pause -``` - - - -## jumblr_resume - -**jumblr_resume** - -The `jumblr_resume` method instructs Jumblr to resume the privacy-shielding process. - -::: tip -See also jumblr_pause. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli jumblr_resume -``` - - - -## jumblr_secret - -**jumblr_secret "secretaddress"** - -The `jumblr_secret` method indicates to Jumblr the final t destination address. This should be a separate t address that has no connection to the `wallet.dat` file of your `jumblr_deposit` address. Ideally, you should only access the final `jumblr_secret` address via a separate node, and with other layers of privacy (VPN, Tor, etc.). - -### Arguments - -| Name | Type | Description | -| --------------- | ------------------ | ----------------------------------- | -| "secretaddress" | (string, required) | the destination transparent address | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli jumbr_secret "RCpMUZwxc3pWsgip5aj3Sy1cKkh86P3Tns" -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/mining.md b/docs/basic-docs/smart-chains/smart-chain-api/mining.md deleted file mode 100644 index b432dcd79..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/mining.md +++ /dev/null @@ -1,631 +0,0 @@ -# Mining - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## getblocksubsidy - -**getblocksubsidy height_number** - -The `getblocksubsidy` method returns the block-subsidy reward. The resulting calculation takes into account the mining slow start. This method can be used in conjunction with custom mining rewards designed by the developers of a KMD-based Smart Chain. - -### Arguments - -| Name | Type | Description | -| ------ | ------------------- | ------------------------------------------------------------------------------------------------------------- | -| height | (numeric, optional) | the block height; if the block height is not provided, the method defaults to the current height of the chain | - -### Response - -| Name | Type | Description | -| ------- | --------- | ------------------------ | -| "miner" | (numeric) | the mining reward amount | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblocksubsidy 100 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocksubsidy", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getblocktemplate - -**getblocktemplate ( "jsonrequestobject" )** - -::: tip -See the Bitcoin wiki for the full specification. -::: - -The `getblocktemplate` method returns data that is necessary to construct a block. - -If the request parameters include a `mode` key, it is used to explicitly select between the default 'template' request, a 'proposal' or 'disablecb'. - -#### A Note on Unique Mining Circumstances - -There are many features in the Komodo Ecosystem that can make a Smart Chain's daemon produce non-standard coinbase transactions. Examples include a Smart Chain parameter that creates new coins for a specific pubkey in every block or a CC module that adds outputs to the coinbase transaction. - -This can be dealt using a mode called `disablecb` - -Usage: - -```bash -./komodo-cli getblocktemplate '{"mode":"disablecb"}' -``` - -The block template produced using this mode doesn't have the `"coinbasetxn": { ... }` json object but adds the coinbase transaction to the `"transactions":[ ... ]` array, just like a regular transaction. - -Now the pool software can use the `"transactions":[ ... ]` array to create a block and take fees in the payment processor. -Team member, `Blackjok3r`, developed a coinbase-override method for this purpose. Please see [this repo](https://github.com/webworker01/knomp/#disable-coinbase-mode) for details. - -### Arguments - -| Name | Type | Description | -| ----------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | -| "jsonrequestobject" : { ... } | (string, optional) | a json object in the following spec | -| "mode" | (string, optional) | this must be set to "template" or omitted | -| "capabilities": [ ... ] | (array, optional) | a list of strings | -| "support" | (string) | client side supported features: "longpoll", "coinbasetxn", "coinbasevalue", "proposal", "serverlist", "workid" | - -### Response - -| Name | Type | Description | -| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| "version" | (numeric) | the block version | -| "previousblockhash" | (string) | the hash of current highest block | -| "finalsaplingroothash" | (string) | the hash of the final sapling root | -| "transactions":[ ... ] | (array) | the contents of non-coinbase transactions that should be included in the next block | -| "data" | (string) | transaction data encoded in hexadecimal (byte-for-byte) | -| "hash" | (string) | the hash/id encoded in little-endian hexadecimal | -| "depends" : [ ... ] | (array) | an array of numbers | -| number | (numeric) | the indexes of transactions that must be present in the final block if this transaction is present in the final block; the index of the array of transactions starts with "1" | -| "fee" | (numeric) | the difference in value between transaction inputs and outputs in satoshis; for coinbase transactions, this is the negative number of the total collected block fees, not including the block subsidy; if a key is not present, the fee is unknown and clients MUST NOT assume it is not present | -| "sigops" | (numeric) | the total number of sigops, as counted for the purposes of block limits; if a key is not present, the sigop count is unknown and clients MUST NOT assume they are not present. | -| "required" | (boolean) | if provided and true, this transaction must be in the final block | -| "coinbasetxn": { ... } | (json object) | information for the coinbase transaction | -| "longpollid" | (string) | the last seen longpollid when this response was sent by the server | -| "data" | (string) | transaction data encoded in hexadecimal (byte-for-byte) | -| "hash" | (string) | the hash/id encoded in little-endian hexadecimal | -| "depends" : [ ... ] | (array) | an array of numbers | -| "fee" | (numeric) | the difference in value between transaction inputs and outputs in satoshis; for coinbase transactions, this is the negative number of the total collected block fees, not including the block subsidy; if a key is not present, the fee is unknown and clients MUST NOT assume it is not present | -| "sigops" | (numeric) | the total number of sigops, as counted for the purposes of block limits; if a key is not present, the sigop count is unknown and clients MUST NOT assume they are not present. | -| "foundersreward" | (numeric) | the founder's reward that should be paid out in this block; this key is present only in the blocks that payout the founder's reward; present only in chains with [ac_founders](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-founders) enabled | -| "coinbasevalue" | (numeric) | the value of the coinbase transaction (in satoshis) | -| "required" | (boolean) | if provided and true, this transaction must be in the final block | -| "target" | (string) | the hash target | -| "mintime" | (numeric) | the minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT) | -| "mutable": [ ... ] | (array of strings) | a list of ways the block template may be changed | -| "value" | (string) | a way the block template may be changed, e.g. "time", "transactions", "prevblock" | -| "noncerange" | (string) | a range of valid nonces | -| "sigoplimit" | (numeric) | the limit of sigops in blocks | -| "sizelimit" | (numeric) | the limit of block size | -| "curtime" | (numeric) | current timestamp in seconds since epoch (Jan 1 1970 GMT) | -| "bits" | (string) | the compressed target of the next block | -| "height" | (numeric) | the height of the next block | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getblocktemplate '{"mode":"template","capabilities":["workid"]}' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocktemplate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getlocalsolps - -**getlocalsolps** - -The `getlocalsolps` method returns the average local solutions per second since this node was started. - -::: tip -This is the same information shown on the metrics screen (if enabled). -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | --------- | -------------------------------- | -| "data" | (numeric) | the solutions-per-second average | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getlocalsolps -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getlocalsolps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getmininginfo - -**getmininginfo** - -The `getmininginfo` method returns a json object containing mining-related information. - -### Arguments - -| Name | Type | Description | -| ------ | ------ | ----------- | -| (none) | (none) | - -### Response - -| Name | Type | Description | -| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| "blocks" | (numeric) | the current block | -| "currentblocksize" | (numeric) | the last block size | -| "currentblocktx" | (numeric) | the last block transaction | -| "difficulty" | (numeric) | the current difficulty | -| "errors": | | -| "generate" | (boolean) | if the generation is on or off (see [getgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#getgenerate) or [setgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#setgenerate) calls) | -| "genproclimit" | (numeric) | the processor limit for generation; `-1` if no generation (see [getgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#getgenerate) or [setgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#setgenerate) calls) | -| "localsolps" | (numeric) | the average local solution rate (solutions per second) since this node was started | -| "networksolps" | (numeric) | the estimated network solution rate (solutions per second) | -| "pooledtx": | | -| "testnet" | (boolean) | if using testnet or not | -| "chain" | (string) | the current network name as defined in BIP70 (main, test, regtest) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getmininginfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getnetworkhashps - -**getnetworkhashps ( blocks height )** - -::: warning -DEPRECATED: Use getnetworksolps instead. -::: - -The `getnetworkhashps` method returns the estimated network solutions per second based on the last `n` blocks. - -Pass in `blocks` value to override the default number of blocks. Passing in `-1` will return a value based on the average `hashps` of the relevant difficulty window. - -Pass in `height` to estimate the network speed at the time when a certain block was found. - -### Arguments - -| Name | Type | Description | -| ------ | -------------------------------- | ------------------------------------------------------------------------------------------ | -| blocks | (numeric, optional, default=120) | the number of blocks (use `-1` to calculate over the relevant difficulty averaging window) | -| height | (numeric, optional, default=-1) | the block height that corresponds to the requested data | - -### Response - -| Name | Type | Description | -| ---- | --------- | --------------------------------- | -| data | (numeric) | the solutions-per-second estimate | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getnetworkhashps -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhashps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getnetworksolps - -**getnetworksolps ( blocks height )** - -The `getnetworksolps` method returns the estimated network solutions per second based on the last `n` blocks. - -Pass in `blocks` to override the default number of blocks. Use -1 to calculate according to the relevant difficulty averaging window. -Pass in `height` to estimate the network speed at the time when a certain block was found. - -### Arguments - -| Name | Type | Description | -| ------ | -------------------------------- | ------------------------------------------------------------------------------------------------- | -| blocks | (numeric, optional, default=120) | the number of blocks; use `-1` to calculate according to the relevant difficulty averaging window | -| height | (numeric, optional, default=-1) | the block height that corresponds to the requested data | - -### Response - -| Name | Type | Description | -| ---- | --------- | ------------------------------- | -| data | (numeric) | solutions per second, estimated | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getnetworksolps -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworksolps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## prioritisetransaction - -**prioritisetransaction "transaction_id" priority_delta fee_delta** - -The `prioritisetransaction` method instructs the daemon to accept the indicated transaction into mined blocks at a higher (or lower) priority. The transaction selection algorithm considers the transaction as it would have a higher priority. - -::: tip -This method is inherited from the original Bitcoin protocol, of which KMD is a fork (via Zcash). For more examples regarding this method, please see the linked documentation. -::: - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "transaction_id" | (string, required) | the transaction id | -| priority_delta | (numeric, required) | the priority to add or subtract (if negative). The transaction selection algorithm assigns the tx a higher or lower priority. The transaction priority calculation: `coinage * value_in_satoshis / txsize` | -| fee_delta | (numeric, required) | the fee value in satoshis to add or subtract (if negative); the fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as if it paid a higher (or lower) fee. | - -### Response - -| Name | Type | Description | -| ---- | --------- | ------------ | -| true | (boolean) | returns true | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli prioritisetransaction "7dc902b280da27cf2dabe41ed6f4d04c828714f289435db193a49341005607eb" 0.0 10000 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "prioritisetransaction", "params": ["7dc902b280da27cf2dabe41ed6f4d04c828714f289435db193a49341005607eb", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## submitblock - -**submitblock "hexdata" ( "jsonparametersobject" )** - -The `submitblock` method instructs the daemon to propose a new block to the network. - -::: tip -The jsonparametersobject parameter is currently ignored. See the linked documentation for full specification details. -::: - -::: tip -Note: for more information on submitblock parameters and results, see the linked documentation. -::: - -### Arguments - -| Name | Type | Description | -| -------------------------------- | ---------------------------- | --------------------------------------------------------------------- | -| "hexdata" | (string, required) | the hex-encoded block data to submit | -| "jsonparametersobject" : { ... } | (string, optional) | object of optional parameters | -| "workid" | (string, sometimes optional) | if the server provides a workid, it MUST be included with submissions | - -### Response - -| Name | Type | Description | -| ------------------------ | ---- | ------------------------------------------------------------------------------------ | -| "duplicate" | | the node already has a valid copy of the block | -| "duplicate-invalid" | | the node already has the block, but it is invalid | -| "duplicate-inconclusive" | | the node already has the block but has not validated it | -| "inconclusive" | | the node has not validated the block, it may not be on the node's current best chain | -| "rejected" | | the block was rejected as invalid | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli submitblock "0400000029865a4962f43d6f95fdf9ccc89f82377a23d1fdc41eaf943c7881a5ca55c5018973d81f5ce7ab99f027b15c86ca88ec5e4b6f35ad4018bfc2058568bbe7f526000000000000000000000000000000000000000000000000000000000000000097954a5b9e830c1d1600ac305580abea34bda62eb503b02fc4b7872428cfa60bf5824a9b78fc0000fd400500c80d4a8c84cec781a5740d8d3fb18587a850b6380f073cd861c4ce7c4290460c533e0d4dd3b89fe0f0052ccdf9d450a1dfcd7263a39422000378da3eeb621078af689447a5ed0a7265a857463a36d72cdd35910d14de9816a25d631aeb0249ede829aca77f9cce1a2e4a84b75e4bd515845043d52f718638fb41e92d8b18bfe1f49e1c0d23223a285b2850e8469dfbb9782b20c8bebf2a61d7b7d8eea310c7c8d5bfa612bf94fd05562ec8876eacafa0c334a651ef70c941459161b60c20511087d63223878052d4fd1a92298789d7c57609fe3a247489674592e8e34a1728b28e2c2b3165f01d5fefa22e6384f7fe4e566de1741e264f057a0feb1b35d51694647ba52afd71c3bd375b924da95e2b413dbea256a2de9ccddcab88bd2e69cc3acc8a778b4d1db78b41df9fea6d69b071f570f628ad47537d081740a4f2c4fa6666dbb862a6d02ff07b5ae0a9fa24b003fa0355dbde0425d6c14452f0d357f2cfd97960c343ba73789a2d7ba580ea8834ef656a9e79c49fc0f61aa9452a644c8bc06afe31dce2a7ca5d6995adc8ce1f77165a075399e1d006e2bb57c09ffd6e21fcff440645faef599264a3b8c005cf60683371ba1af8847d1992c64e512f13d9d2d364969759233a27c65e1f2f1113cdb665e3e8f7baa2c398c4a2ee85a6ad1bdb095962fafaa01c3d85bc820653544b89b6e75a584d8d04bc77e5284a9ebbcd46c1a6732b841e46c876976805d932a90ac215bcc37801900d49cfb87fe5c809b30ebd8ece38669153c1f1a2438253a56a6507d556cc16b2990f0bd290fea59462d25eebdbfcb78eb403c8080e0c68e8e2ef8f67145121bce83b94dc8f9d0a742752323c5a4b42409ffcc37053c58596deff7981a20e3f412c07c839a341fdc177d5e28f7909696f90c90efff14048f440e7ea3181378f66d35b0697dc02c60154778f438cdd3dba5dc4c2763319498bbb3b8fae17508b073d07d83f5f1dc71bf2dc205f06245872620dfa341dbcdf9c574598c121120e91dd687dfd08451369ab29a11dc73f69d0722992a1c70cf1498ec9b9143fcb0abfd7b1e39189125e8567cb2cc3d71fcdb541a0776a5a665161f98385633153fc9702f079269a1dac0d2c708f5d94e346159858cfd50624ff5a0505358739b5f41adbe739bf75852eebb06eeccd79e030019a5227cd9a19e77b6821ba0794fe09cb074f40ce0b92c081c31cda2d4711d53889fc6f0579839fa74309768ef0a796fa1fa660e150d3ea5c0a369e1297d11177fc284524d6d5e40eb7ee4b400f6dfd6a10402904394e1694de300ddd565622e7ca7ed62970ff5add0b36a513b5d90d2194cf414ecc97e5dcc88698e06405dea09f49503c81cc61518f8aee882da6eeae09b4127a7fcc0c0829fca8fda3502ebf13ece0a90a8dfd05d8e514452247f79472c20683e2b1fde5ec14a2453bf00f9f1cd5a088d229a7fdfdfdc24f176fb9a8a409af70d894998957394d30a46668d71cd16907aa800ee9d96c2b9fc7fb5a7944a9b8d4f76609fc186e3c0a4d80fb9c8c236f76eb00bc24dd9abddef7d653740ece7141ac6175f7e9cab1cb0216e85adde43907b60c0581336b50ccd7682f28f00f7efd663df4d31701141657da989d236d16052c4b59fc46fb41657a26d7074fbc9dee602f7d03b86179e4c12bc0df253f815319dff12353a478d95febd5f902e363734e6e5ef4bf1865eb70750b9238be3382a51ded182569d112f37870d43465615ca9174d41f7f3b9eb780a28c7dba674075bbe04538ad669eef7716d1b7b252d49da3b00993f0c829860a1efafdcdc865d46f2f8aec9893b5bc607db33272e5b9f7cf134595e1ad5e8f34b1b7f93ca181c513afc4d8a531c36929e95cfbb4d268a9d94f80201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0603860f0e0101ffffffff0188b6e1110000000023210383d0b37f59f4ee5e3e98a47e461c861d49d0d90c80e9e16f7e63686a2dc071f3ac67954a5b01000000010b1561554a46ec535c4972a3a16652b270ee4af847ec3bbfcf6ba663ebcfefcb1a00000049483045022100b9cd7c1c56d69d9b05d695f9ac86c1233427ec26860774a0eb4e6052fe11ca8502207eca5a4eda1ccf92ccdb501ab7d61cf084d0f4431f059e27ee13ce11f9aa159b01ffffffff0188130000000000002321020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9ac00000000" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "submitblock", "params": ["0400000029865a4962f43d6f95fdf9ccc89f82377a23d1fdc41eaf943c7881a5ca55c5018973d81f5ce7ab99f027b15c86ca88ec5e4b6f35ad4018bfc2058568bbe7f526000000000000000000000000000000000000000000000000000000000000000097954a5b9e830c1d1600ac305580abea34bda62eb503b02fc4b7872428cfa60bf5824a9b78fc0000fd400500c80d4a8c84cec781a5740d8d3fb18587a850b6380f073cd861c4ce7c4290460c533e0d4dd3b89fe0f0052ccdf9d450a1dfcd7263a39422000378da3eeb621078af689447a5ed0a7265a857463a36d72cdd35910d14de9816a25d631aeb0249ede829aca77f9cce1a2e4a84b75e4bd515845043d52f718638fb41e92d8b18bfe1f49e1c0d23223a285b2850e8469dfbb9782b20c8bebf2a61d7b7d8eea310c7c8d5bfa612bf94fd05562ec8876eacafa0c334a651ef70c941459161b60c20511087d63223878052d4fd1a92298789d7c57609fe3a247489674592e8e34a1728b28e2c2b3165f01d5fefa22e6384f7fe4e566de1741e264f057a0feb1b35d51694647ba52afd71c3bd375b924da95e2b413dbea256a2de9ccddcab88bd2e69cc3acc8a778b4d1db78b41df9fea6d69b071f570f628ad47537d081740a4f2c4fa6666dbb862a6d02ff07b5ae0a9fa24b003fa0355dbde0425d6c14452f0d357f2cfd97960c343ba73789a2d7ba580ea8834ef656a9e79c49fc0f61aa9452a644c8bc06afe31dce2a7ca5d6995adc8ce1f77165a075399e1d006e2bb57c09ffd6e21fcff440645faef599264a3b8c005cf60683371ba1af8847d1992c64e512f13d9d2d364969759233a27c65e1f2f1113cdb665e3e8f7baa2c398c4a2ee85a6ad1bdb095962fafaa01c3d85bc820653544b89b6e75a584d8d04bc77e5284a9ebbcd46c1a6732b841e46c876976805d932a90ac215bcc37801900d49cfb87fe5c809b30ebd8ece38669153c1f1a2438253a56a6507d556cc16b2990f0bd290fea59462d25eebdbfcb78eb403c8080e0c68e8e2ef8f67145121bce83b94dc8f9d0a742752323c5a4b42409ffcc37053c58596deff7981a20e3f412c07c839a341fdc177d5e28f7909696f90c90efff14048f440e7ea3181378f66d35b0697dc02c60154778f438cdd3dba5dc4c2763319498bbb3b8fae17508b073d07d83f5f1dc71bf2dc205f06245872620dfa341dbcdf9c574598c121120e91dd687dfd08451369ab29a11dc73f69d0722992a1c70cf1498ec9b9143fcb0abfd7b1e39189125e8567cb2cc3d71fcdb541a0776a5a665161f98385633153fc9702f079269a1dac0d2c708f5d94e346159858cfd50624ff5a0505358739b5f41adbe739bf75852eebb06eeccd79e030019a5227cd9a19e77b6821ba0794fe09cb074f40ce0b92c081c31cda2d4711d53889fc6f0579839fa74309768ef0a796fa1fa660e150d3ea5c0a369e1297d11177fc284524d6d5e40eb7ee4b400f6dfd6a10402904394e1694de300ddd565622e7ca7ed62970ff5add0b36a513b5d90d2194cf414ecc97e5dcc88698e06405dea09f49503c81cc61518f8aee882da6eeae09b4127a7fcc0c0829fca8fda3502ebf13ece0a90a8dfd05d8e514452247f79472c20683e2b1fde5ec14a2453bf00f9f1cd5a088d229a7fdfdfdc24f176fb9a8a409af70d894998957394d30a46668d71cd16907aa800ee9d96c2b9fc7fb5a7944a9b8d4f76609fc186e3c0a4d80fb9c8c236f76eb00bc24dd9abddef7d653740ece7141ac6175f7e9cab1cb0216e85adde43907b60c0581336b50ccd7682f28f00f7efd663df4d31701141657da989d236d16052c4b59fc46fb41657a26d7074fbc9dee602f7d03b86179e4c12bc0df253f815319dff12353a478d95febd5f902e363734e6e5ef4bf1865eb70750b9238be3382a51ded182569d112f37870d43465615ca9174d41f7f3b9eb780a28c7dba674075bbe04538ad669eef7716d1b7b252d49da3b00993f0c829860a1efafdcdc865d46f2f8aec9893b5bc607db33272e5b9f7cf134595e1ad5e8f34b1b7f93ca181c513afc4d8a531c36929e95cfbb4d268a9d94f80201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0603860f0e0101ffffffff0188b6e1110000000023210383d0b37f59f4ee5e3e98a47e461c861d49d0d90c80e9e16f7e63686a2dc071f3ac67954a5b01000000010b1561554a46ec535c4972a3a16652b270ee4af847ec3bbfcf6ba663ebcfefcb1a00000049483045022100b9cd7c1c56d69d9b05d695f9ac86c1233427ec26860774a0eb4e6052fe11ca8502207eca5a4eda1ccf92ccdb501ab7d61cf084d0f4431f059e27ee13ce11f9aa159b01ffffffff0188130000000000002321020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/network.md b/docs/basic-docs/smart-chains/smart-chain-api/network.md deleted file mode 100644 index 5a4d3672d..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/network.md +++ /dev/null @@ -1,908 +0,0 @@ -# Network - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## addnode - -**addnode "node" "add|remove|onetry"** - -The `addnode` method attempts to add or remove a node from the addnode list, or to make a single attempt to connect to a node. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------- | -| "node" | (string, required) | the node (see [getpeerinfo](../../../basic-docs/smart-chains/smart-chain-api/network.html#getpeerinfo) for nodes) | -| "command" | (string, required) | 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli addnode "192.168.0.6:8233" "onetry" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8233", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## clearbanned - -**clearbanned** - -The `clearbanned` method clears all banned IPs. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli clearbanned -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## disconnectnode - -**disconnectnode "node"** - -The `disconnectnode` method instructs the daemon to immediately disconnect from the specified node. - -Use `getpeerinfo` to determine the result. - -### Arguments - -| Name | Type | Description | -| ------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------- | -| "node" | (string, required) | the node's address (see [getpeerinfo](../../../basic-docs/smart-chains/smart-chain-api/network.html#getpeerinfo) for nodes) | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli disconnectnode "192.168.0.6:8233" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8233"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaddednodeinfo - -**getaddednodeinfo dns ( "node" )** - -The `getaddednodeinfo` method returns information about the given added node, or all added nodes. - -If `dns` is set to `false`, only a list of added nodes is returned. Otherwise, connection information is also provided. - -::: tip -Nodes added via onetry are not listed here. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ------------------- | --------------------------------------------------------------------------------------------------------- | -| dns | (boolean, required) | if false, only a list of added nodes will be provided; otherwise, connection information is also provided | -| "node" | (string, optional) | if provided, the method returns information about this specific node; otherwise, all nodes are returned | - -### Response - -| Name | Type | Description | -| --------------------- | ---------------- | ---------------------------------------------------------------- | -| "addednode" | (string) | the node ip address | -| "connected" | (boolean) | if connected | -| "addresses" : [ ... ] | (array of jsons) | -| "address" | (string) | the server host and port | -| "connected" | (string) | "connected" accepts two possible values: "inbound" or "outbound" | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaddednodeinfo true -``` - - - -Command: - -```bash -./komodo-cli getaddednodeinfo true "78.47.205.239" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": [true, "78.47.205.239"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getconnectioncount - -**getconnectioncount** - -The `getconnectioncount` method returns the number of connections to other nodes. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ---- | --------- | -------------------- | -| n | (numeric) | the connection count | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getconnectioncount -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getdeprecationinfo - -**getdeprecationinfo** - -The `getdeprecationinfo` method returns an object containing current version and deprecation block height. - -::: tip -This method is applicable only to the KMD main net. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| "version" | (numeric) | the server version | -| "subversion" | (string) | the server sub-version string (i.e. "/MagicBean:x.y.z[-v]/") | -| "deprecationheight" | (numeric) | the block height at which this version will deprecate and shut down (unless [disabledeprecation](https://z.cash/blog/new-release-1-1-2/) is set) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getdeprecationinfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdeprecationinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getnettotals - -**getnettotals** - -The `getnettotals` method returns information about network traffic, including bytes in, bytes out, and current time. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ---------------- | --------- | -------------------- | -| "totalbytesrecv" | (numeric) | total bytes received | -| "totalbytessent" | (numeric) | total bytes sent | -| "timemillis" | (numeric) | total cpu time | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getnettotals -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getnetworkinfo - -**getnetworkinfo** - -The `getnetworkinfo` method returns an object containing various state info regarding p2p networking. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------------------------- | ---------------- | ------------------------------------------------------------------------------------ | -| "version" | (numeric) | the server version | -| "subversion" | (string) | the server subversion string (i.e. "/MagicBean:x.y.z[-v]/") | -| "protocolversion" | (numeric) | the protocol version | -| "localservices" | (string) | the services we offer to the network | -| "timeoffset" | (numeric) | the time offset | -| "connections" | (numeric) | the number of connections | -| "networks": [ ... ] | (array of jsons) | information per network | -| "name" | (string) | network (ipv4, ipv6 or onion) | -| "limited" | (boolean) | whether the network is limited using -onlynet | -| "reachable" | (boolean) | whether the network is reachable | -| "proxy" | (string) | (submitted as "host:port") the proxy that is used for this network, or empty if none | -| "relayfee" | (numeric) | minimum relay fee for non-free transactions in COIN/kB | -| "localaddresses": [ ... ] | (array of jsons) | list of local addresses | -| "address" | (string) | network address | -| "port" | (numeric) | network port | -| "score" | (numeric) | relative score | -| "warnings" | (string) | any network warnings (such as alert messages) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getnetworkinfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getpeerinfo - -**getpeerinfo** - -The `getpeerinfo` method returns data about each connected network node as a json array of objects. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------------------- | --------- | -------------------------------------------------------------------- | -| "id" | (numeric) | peer index | -| "addr":, | (string) | the ip address and port of the peer ("host:port") | -| "addrlocal" | (string) | local address ("ip:port") | -| "services" | (string) | the services offered | -| "lastsend" | (numeric) | the time in seconds since epoch (Jan 1 1970 GMT) of the last send | -| "lastrecv" | (numeric) | the time in seconds since epoch (Jan 1 1970 GMT) of the last receive | -| "bytessent" | (numeric) | the total bytes sent | -| "bytesrecv" | (numeric) | the total bytes received | -| "conntime" | (numeric) | the connection time in seconds since epoch (Jan 1 1970 GMT) | -| "timeoffset" | (numeric) | the time offset in seconds | -| "pingtime" | (numeric) | ping time | -| "pingwait" | (numeric) | ping wait | -| "version" | (numeric) | the peer version, such as 170002 | -| "subver" | (string) | the string version (i.e. "/MagicBean:x.y.z[-v]/") | -| "inbound" | (boolean) | inbound (true) or outbound (false) | -| "startingheight" | (numeric) | the starting height (block) of the peer | -| "banscore" | (numeric) | the ban score | -| "synced_headers" | (numeric) | the last header we have in common with this peer | -| "synced_blocks" | (numeric) | the last block we have in common with this peer | -| "inflight": [ ... ] | (array) | -| number | (numeric) | the block height requested from this peer | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getpeerinfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listbanned - -**listbanned** - -The `listbanned` method lists all banned IP addresses and subnets. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| -------------- | --------- | ----------------------------------------------------- | -| "address" | (string) | the address/subnet that is banned | -| "banned_until" | (numeric) | the timestamp, at which point the ban will be removed | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listbanned -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## ping - -**ping** - -The `ping` method requests that a ping be sent to all other nodes, to measure ping time. - -Results provided in `getpeerinfo`, `pingtime` and `pingwait` fields are decimal seconds. - -The `ping` command is handled in queue with all other commands, so it measures processing backlog, not just network ping. - -::: tip -Use getpeerinfo to see ping results. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli ping -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## setban - -**setban "ip(/netmask)" "add|remove" (bantime) (absolute)** - -The `setban` method attempts to add or remove an IP address (and subnet, if indicated) from the banned list. - -### Arguments - -| Name | Type | Description | -| -------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "ip(/netmask)" | (string, ip required) | the IP/subnet (see `getpeerinfo` for nodes ip) with an optional netmask (default is /32 = single ip) | -| "command" | (string, required) | use "add" to add an IP/subnet to the list, or "remove" to remove an IP/subnet from the list | -| bantime | (numeric, optional) | indicates how long (in seconds) the ip is banned (or until when, if [absolute] is set). 0 or empty means the ban is using the default time of 24h, which can also be overwritten using the -bantime runtime parameter. | -| absolute | (boolean, optional) | if set to true, the bantime must be an absolute timestamp (in seconds) since epoch (Jan 1 1970 GMT) | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -::: tip -Use listbanned to view results. -::: - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli setban "192.168.0.6" "add" 86400 -``` - - - -Command: - -```bash -./komodo-cli setban "192.168.0.0/24" "add" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["78.47.205.239", "add", 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/rawtransactions.md b/docs/basic-docs/smart-chains/smart-chain-api/rawtransactions.md deleted file mode 100644 index ae26096ab..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/rawtransactions.md +++ /dev/null @@ -1,806 +0,0 @@ -# Rawtransactions - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## createrawtransaction - -**createrawtransaction '[{ "txid": "id_string", "vout": number }, ... ]' '{ "address": amount, ... }'** - -The `createrawtransaction` method creates a transaction, spending the given inputs and sending to the given addresses. The method returns a hex-encoded raw transaction. - -::: tip -This is a raw transaction, and therefore the inputs are not signed and the transaction is not stored in the wallet nor transmitted to the network. -::: - -### Arguments - -| Name | Type | Description | -| -------------- | ------------------- | ---------------------------------------------------------- | -| "transactions" | (string, required) | a json array of json objects | -| "txid" | (string, required) | the transaction id | -| "vout" | (numeric, required) | the output number | -| "addresses" | (string, required) | a json object with addresses as keys and amounts as values | -| "address" | (numeric, required) | the key is the address, the value is the COIN amount | - -### Response - -| Name | Type | Description | -| ------------- | -------- | ------------------------------- | -| "transaction" | (string) | a hex string of the transaction | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli createrawtransaction '[{"txid":"9f44dc664882198b14e9a8c466d466efcdd070ccb6f57be8e2884aa11e7b2a30","vout":0}]' '{"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01}' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": [[{"txid":"9f44dc664882198b14e9a8c466d466efcdd070ccb6f57be8e2884aa11e7b2a30","vout":0}], {"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01} ]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## decoderawtransaction - -**decoderawtransaction "hexstring"** - -The `decoderawtransaction` method returns a json object representing the serialized, hex-encoded transaction. - -### Arguments - -| Name | Type | Description | -| ----- | ------------------ | -------------------------- | -| "hex" | (string, required) | the transaction hex string | - -### Response - -| Name | Type | Description | -| ----------------------- | ---------------------------------------------- | ----------------------------------------------------------------- | -| "txid" | (string) | the transaction id | -| "overwintered" | (boolean) | the overwintered flag | -| "version" | (numeric) | the version | -| "versiongroupid" | (string, optional) | the version group id (overwintered txs) | -| "locktime" | (numeric) | the lock time | -| "expiryheight" | (numeric, optional) | last valid block height for mining transaction (overwintered txs) | -| "vin" : [ ... ] | (array of json objects) | -| "txid" | (string) | the transaction id | -| "vout" : [ ... ] | (numeric) | the output number | -| "scriptSig" | (json object) | the script | -| "asm" | (string) | asm | -| "hex" | (string) | hex | -| "sequence" | (numeric) | the script sequence number | -| "vout" | (array of json objects) | -| "value" | (numeric) | the value | -| "number" | (numeric) | index | -| "scriptPubKey" | (json object) | -| "asm" | (string) | the asm | -| "hex" | (string) | the hex | -| "reqSigs" | (numeric) | the required sigs | -| "type" | (string) | the type, eg 'pubkeyhash' | -| "addresses" | | -| "address" | (string) | the address | -| "vjoinsplit" : [ ... ] | (array of json objects, only for version >= 2) | -| "vpub_old" | (numeric) | public input value | -| "vpub_new" | (numeric) | public output value | -| "anchor" | (string) | the anchor | -| "nullifiers" : [ ... ] | (array of strings) | -| "hex" | (string) | input note nullifier | -| "commitments" : [ ... ] | (array of strings) | -| "hex" | (string) | output note commitment | -| "onetimePubKey" | (string) | the onetime public key used to encrypt the ciphertexts | -| "randomSeed" | (string) | the random seed | -| "macs" : [ ... ] | (array of strings) | -| "hex" | (string) | input note MAC | -| "proof" | (string) | the zero-knowledge proof | -| "ciphertexts" : [ ... ] | (array of strings) | -| "hex" | (string) | output note ciphertext | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli decoderawtransaction "0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## decodescript - -**decodescript "hex"** - -The `decodescript` method decodes a hex-encoded script. - -### Arguments - -| Name | Type | Description | -| ----- | -------- | ---------------------- | -| "hex" | (string) | the hex encoded script | - -### Response - -| Name | Type | Description | -| -------------------- | ------------------ | -------------------------- | -| "asm" | (string) | the script public key | -| "hex" | (string) | the hex-encoded public key | -| "type" | (string) | the output type | -| "reqSigs" | (numeric) | the required signatures | -| "addresses": [ ... ] | (array of strings) | -| "address" | (string) | the address | -| "p2sh" | (string) | the script address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli decodescript "0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## fundrawtransaction - -**fundrawtransaction "hexstring"** - -The `fundrawtransaction` method adds inputs to a transaction until it has enough `in` value to meet its `out` value. This will not modify existing inputs, and will add one `change` output to the outputs. - -::: tip -Inputs which were signed may need to be resigned after completion since in/outputs have been added. To sign the inputs added, use signrawtransaction. -::: - -::: tip -This method comes from the BTC codebase, of which KMD is ultimately a fork (via Zcash). For full details, please see the linked documentation. -::: - -### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | ------------------------------------- | -| "hexstring" | (string, required) | the hex string of the raw transaction | - -### Response - -| Name | Type | Description | -| ----------- | --------- | -------------------------------------------------- | -| "hex" | (string) | the resulting raw transaction (hex-encoded string) | -| "fee" | (numeric) | the fee added to the transaction | -| "changepos" | (numeric) | the position of the added change output, or -1 | - -#### :pushpin: Examples - -Create a transaction with no inputs: - -Command: - -```bash -./komodo-cli createrawtransaction "[]" '{"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01}' -``` - - - -Add sufficient unsigned inputs to meet the output value: - -Command: - -```bash -./komodo-cli fundrawtransaction "rawtransactionhex" -``` - - - -Sign the transaction: - -Command: - -```bash -./komodo-cli signrawtransaction "01000000660aeb1fef3f0f6e8e9598a2f4b434466b5ccb95e49aa7c4286bc5392d43fa1f280000000000feffffff0d204965060600f1e79bfd183e7ee1b5b9b61c6379d6c95984cb7cdf79231c4c0000000000feffffff0d3eba8ce5b6b6ee7d2e804be57dbe4544d7b7169caf5afd6f207c1275e8977e0000000000feffffff04f8b24c1eb3aeb01cc483a5b6922eb341da17fd42c944b0bb18998c04fea67e0000000000feffffff0360b074597abb6e32c319078ea5f83cdfc85d5c892c0388893d8b66876c077b0000000000feffffff0e2ae757c446029f5dbea36926883744a2d3fe8ee05381c2b4311e7d58057fd40000000000feffffff149c5bbedff321a7810d5db264829ffa5529a4f29ca3a452b0543736339bf0260000000000feffffff1f9e6624bb5185f0b51d36a3a94982f0d8a325bdf81db90bf67945354a6f40c60000000000feffffff22e752f465434c0563a7e0b9d104b8633bdbd6073bbe61d17dee0d53ac8220430000000000feffffff2780816ab4fd0177dfff1a98b7783bbefe8d08f339c964d2438b7e73c8ce614c0000000000feffffff2da12ef31d8678120d4961c9090035ae9e8f48dcfe4e2f461fb10437473c2bc90000000000feffffff39a00efcf7f678ecf0252ee2b4998a43121aaad28abe518be06a830fd34ae24e0000000000feffffff3c5b78d98b3edf510b003cc5723270854313d51ad40859ba08a622f3a269a6690000000000feffffff3ca10423750150708e817fe0020a7fd0a687a0456158db659af112dfefefa2990000000000feffffff4005c2dd439c35e3f04384142b66871e15a72149218d66be2ca3b13f7e1604b00000000000feffffff408d53f3499c6db833b4a9b19aa8cf61c95182775a0539efef9c62a0456520c40000000000feffffff43671a7bd5f31ee1642842027378035d73b06d446fbb1666e95638eb0d55d1c90000000000feffffff45ee4a5c7a98f315d26c1020b26576500ecae4d6a6a78b3ad169788006e7c76c0000000000feffffff48244290df0dccc781e7d081c731081c2e7e022176cc7b4b31fd92c1e31d970e0000000000feffffff48c28c27f8303266e0547b8c453b9823baed7a9e06105c09ba4cf65cb2bd5d2b0000000000feffffff4b28d567f5933d5992559fb19f90115b145db32bd1b6e52d309021da8e6063cc0000000000feffffff4d45006be4acc1bf5c69722cb744b967e615d2d35014fc82cf61c2a4905717a50000000000feffffff4d8540fa9e580b140359e0a17aac6415ca80072f9ba26fc2b43914092f4702400000000000feffffff4ff26de89311f83d65a3936e06937f30a75dd50594246d910035bcbe19c0ea6a0000000000feffffff511e169a83c0c0f8ee7163c34fa0e3b024275892419f11a2bb96d4976d3f9b470000000000feffffff52325adf85f74f38f467bc3a99657f322988add8aebb371bd080088efb95836f0000000000feffffff532ff452f8423507348c542063deb6f257de711237ff8d718143358128e2c6470000000000feffffff5b0d6fe54dce0515e6947f5170478cabb06d1e855365a6b7dbb0118c4450ff0b0000000000feffffff5b7db5b32a8e8e8c6307a7d0afec7062637eec39670f1afb08f0b04a50fbc4740000000000feffffff5cbecf874fd1996cd4e49cd41c98a586c533eac1ebc37df92cf5a9545203f9350000000000feffffff5d015b907e23b9c5e00907013f66d258fab2f016842f0c8e69346d72b0221dd70000000000feffffff65c461a04f571b50ab4fe3e367952bfba755eec9b6ed23cb460ab3bdc873fff80000000000feffffff686da3cbb1a1af26c2c01793345a5fb8ee47829aa907ab95b8144fbeda1707920000000000feffffff6896423421d7e1193a7b88d2fbf1eef1c46f637e7a49217c171a18852d29e8d60000000000feffffff6a0f6f77ae1d42dc96c39c620f401f32c9774f18f1a039e97b4b405b8aaa757d0000000000feffffff6cfa0bcd2e2689498496dc4b15feb0fc535667a88005f2c88198265bb1f8f3d80000000000feffffff705456a54cb0b94ec15890bd957dd778581f606270a331ad5b15ef48684a5fc40000000000feffffff718076a7dd771121e817b98e98f46c7f52722d6cdfca9130203fe5965f0a3c000000000000feffffff780ed86aeead9747bc96bf7053b02ada6ac566481763e70c29d3d00162bc7b530000000000feffffff7b3ad2352be9169286629dcf064fa769c23a8aabd468c30eec35a0c79b61f1f80000000000feffffff7fc4676bc415a467bd10d303eacd54617acfb6876945e3bf1217dfd208c6d58d0000000000feffffff80fe96eb05e5fcf89fa7e19b1a653e0b8164cba383e2d2ff5934a61c42698cb10000000000feffffff875ea454109c4725766d372f0fe395dd4744737378b3a246094dc0db7fb6e95f0000000000feffffff87b7c1fd810834fdd892975a795b9e6c1b1aa398436ae3ecb19bce62ac11aa4e0000000000feffffff88b22fca9de29db1901e9c8accbf1caf8fd4d5a37802b3bf5142038809ee3c690000000000feffffff89e4b0f44e022cf53736520aef84a324100f19f4f0862c9d2150b686e951d3740000000000feffffff8e0611807aa639621ca6be13a2eda8d98c32867041f929dbbef7742c7c867db00000000000feffffff8e77d64182b666e50377b3c9a39395735a89d2c90f5ff62024143f2c25ea51d50000000000feffffff8fe0b55ad0e150fbfe8d263c44527b967c44fd79ebbe88a09a91a4318f1c17c40000000000feffffff91ad86b51f541d480383681c4faa26575f723154ed6e39cb76e03317c8984c610000000000feffffff927673288f7c95f452e035b65c8cd46a57e58451b93dcfecfae0c33f00b4e5350000000000feffffff9477cc8e7dddfa7d183bfe0771def3778e7b2641996a3ea52f42d085d4007d190000000000feffffff948a1e5af04f265b29fd23700d1ac9926b5bed71ed5b2968f29abaa15036848c0000000000feffffff98a1cd6c74d9d42f88032e74182cfe8e71f125eb7eb1b49e8334d5b17bf4d07e0000000000feffffff9a7fefd1b1409dfc23d6be09dab5692cd9f6c59c98b2d7b0231f40b396999c2b0000000000feffffff9b0ed42c0446f8ea3c19b47be97f42d1a546bbd6a5a311cded5c1dd16c3606d40000000000feffffff9ba78bb678f5b7a289ca37b49835bc6ad383e2089dd3711833383c0c6e6d40cb0000000000feffffff9d2bdc85ec46fb0457dd41f02f5f7b203ff8c844062f3376c7f86cf2144dc6a60000000000feffffff9dc64c498135ebd6c025d7d43ae71120d6477bcbcd9828aebe21911ea21655c80000000000feffffffa0c3203666c02ea6f958408c8f2241b4d6e3a8beb9ab54736fe73621feb57ce40000000000feffffffa14e8b18777a8710e58942b56d094243151299f033cc21bb3ad3dfce2b3e77ad0000000000feffffffa262a97a28944d41d47c7f8788528c797d322f7abc0390c20bf22e3b835e127a0000000000feffffffaa3c2496b8237d865f81ff0bb8eb01bf2b69ee806463816ec83b60cace7a58330000000000feffffffabfc5cf05834234e1ee8a3c87c8de5d6a07f9530a09f2b34d9303ef30d8646cf0000000000feffffffa2d1512943366ab64e6d1749b81f993e830e5b546a87b9bd68fe0c5c865da9530100000000feffffffad976a10bc9ebe391cee6b83191520a9d0fb62a24e969477a4cc6dd26b29e4da0000000000feffffffadd486a6d94629b19713d723301b135c11af92b5ed69e6f0b9ed07d417078b240000000000feffffffb04574d6517ca90a26e07a749ebcde23f67f7ef8a594b23e699fa084529d96e80000000000feffffffb2197245ddc53b189c18d05d167210fd6291c6b9116862144c3654da5bb55d060000000000feffffffb4b953583df750085d727027674f69c6ba63513915941e42924a462d5bc15c9b0000000000feffffffb7f5149ac38efb591ad8c3a46ec9e979d5647c964190a135342435b55484dd570000000000feffffffbfc02225e0c5351bbeb63adb8e3b7859752363a5b85f5b2a6da5240a449e80650000000000feffffffc0def09bb3cbf791c52764cceadd389199be9d7603cc3d6d213ba45ffc98518d0000000000feffffffc5c9957c3a3e03204e603c313368d3c01206320beddfd28b850fd17b09a61a410000000000feffffffc64396e634d716a5ae280d9fd821507239d7b25a812eea6751254e462c8a73a50000000000feffffffc69c9cdd6825a657be1a06008f73b78cf185a9d195ba771451ca1ec09ce54d4f0000000000feffffffca6112fdc1db1a441961f6eb62b492c1397732cc5519d40f6aa335612f42d39c0000000000feffffffcb15dbc245dec1ef8cb8e25ef11921ca804c023e6ad803ebcb2a7b98380b60b30000000000feffffffcfe47e6ce0780c4594a2d1b76a2906c0a9ea32d39a73c244aa9d5d8dea67248c0000000000feffffffd0a4d502c22cea7da0d1a3cf99aef598b74fad19a6de35f21c6fd0d1b8cf27560000000000feffffffd25452b8575cafca10255179f95c8c66e255329220b7ff645af522af7b8038320000000000feffffffd3922dfd1a65216bbcd4646d0cbcfa70cfe587775cf4c673043c57061f48d7630000000000feffffffd75c777645d534009bc8e7b2c0b58a78cd63f41f47f6cd30868aeaf9b55e47700000000000feffffffd8f837530faf0d9b50efe1d79aed453b11916d565a2b9c40a380a85f0be2af6b0000000000feffffffdbce76e284668c829366dafd00ae4884ea39b2aa597cc1b4d2a37991a9b2ea560000000000feffffffe481d9493d67997104c12972b7c8a73fb87b16e228665bb784436fc0f58d7e660000000000feffffffe7a22d3d87255e4adaab9a6fd8a72320299a6902426424aa8b2b89b7c3b0c0950000000000feffffffe80ac9635b6bd91c1935eca6df80876ac8cdc87a2b91e925cfdcc0f06059b2e50000000000feffffffedad3357a1a9aeeb8c2771cc6f284db92a2aa31f458e35bb270216015bb0edd40000000000feffffffee85afefc31a99a4616bfb228e1f48691976b900ecdfe838e1310bf5b33fadcf0000000000fefffffff13e4784de0564595f3b4cce57ec0d8a4b72a798feb65f5fbca5b26a3a91d0760000000000fefffffff205212771fd3ca5a68340fa307810e44315ae02464b5d8a235ba6bca691bd710000000000fefffffff31cea9351fddc36393fa996962e204c461a34ff1c6ad243b3a4902440f165da0000000000fefffffff3c67e78777cc42ae2834bcf5dce5493fbcfcc6e0aabd7608cf4f9c936a37f490000000000fefffffff3ddc14df664f6e4f59b1f1e25241a61fc69f13125ea5a67edbd03b37d332eb50000000000fefffffff614bd5d83278ad95d8c5bf6fefe59b3675e832cc1c2349d7952aa734fd202830000000000fefffffff67ef42d75fc5d36ff32ab40f5c9f88f279a1173ee1db227a4706aa0480d66ab0000000000fefffffff69f0798ab6de485dcfe72391f4cbb1e5f4d39ee8f852b80fd4bb730eabd8e930000000000fefffffff8dd75e7c674cf7bf15f42fcb1256ef4f16b96e0ff6a359bc24c07ba734f09a30000000000fefffffffa0c47583d4c6f18e12b93764ccf57d2430a52bdd0ceb611924a79c82daf48b90000000000fefffffffa5ca0440f302bcf118946714dba6e81036e48477ff3a315084fe682aea6d1d50000000000fefffffffef369694bf0493161762e49d7ca16f1ba600250d801a848d0ca8d3f2d677d4a0000000000feffffff02c5490f00000000001976a9146843838a0aa11686cd0c01fbf470c9c5f302249488ac40420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -Send the transaction: - -Command: - -```bash -./komodo-cli sendrawtransaction "01000000660aeb1fef3f0f6e8e9598a2f4b434466b5ccb95e49aa7c4286bc5392d43fa1f2800000000484730440220234b370cddf91b27e172cb5d6257a9807e63cf680a644229147b39d87e597875022047a58509a11b190107a9ff6e08143bd0d450db233518ed26f123bd739576e9c201feffffff0d204965060600f1e79bfd183e7ee1b5b9b61c6379d6c95984cb7cdf79231c4c000000004847304402202ffed5ef972b01ec4290343ab0bc4cff989d0047f2cbc9e8b69f0f3102824c0e02203c7e3214344e6ac430e4f996a8980e7d9172ea1e8c0c238ba32b8930f4d4119301feffffff0d3eba8ce5b6b6ee7d2e804be57dbe4544d7b7169caf5afd6f207c1275e8977e00000000484730440220096fdd062535f200897de2f2dfb7d782499dc5fc24d8e06805eebed6ec125c07022077e4379409bd7c9052608e8cd52cd83b0c9314c623d9b85012eab28e10f8c13601feffffff04f8b24c1eb3aeb01cc483a5b6922eb341da17fd42c944b0bb18998c04fea67e000000004847304402204a8f45abf51333ec7c4491cd5750e5d46785475ebdb0a13a6a946711f17483a9022075805ee9f2130c3938e273c280b6b14b27640349b537b55348c40ede1508938f01feffffff0360b074597abb6e32c319078ea5f83cdfc85d5c892c0388893d8b66876c077b000000004948304502210089c7919c6e7412a1569434f74caf7110bbb0341361384067265c142c8e033b2d02203d5eaa583d727fad487bbb689bf433bac32d907e707043e8f96f8c50fd3480d501feffffff0e2ae757c446029f5dbea36926883744a2d3fe8ee05381c2b4311e7d58057fd40000000049483045022100a0672d882511b01696192965175f3827e65ef8d45b3217b563d0f97f3cab512602205c568b5c1eda0c149976380b38d2f93ee384500bb5eecf6e9f3f2101d649eace01feffffff149c5bbedff321a7810d5db264829ffa5529a4f29ca3a452b0543736339bf0260000000049483045022100981f7f5210e17e1c73fe5083ca7b29a5b1a9dfbbf5474c109069a4b3eecbb5c5022065e21331260c718788b72902da250418b0091537a540e8f6152ae097632637da01feffffff1f9e6624bb5185f0b51d36a3a94982f0d8a325bdf81db90bf67945354a6f40c6000000004847304402204391d39a88d2f8427396bbbca508bcdb3b6897c25bee4c68d357b878419285a602205da8f54aec5bb9253aeaa9b4c4a1a8a2fe602e894422da0279f21f9799a3540201feffffff22e752f465434c0563a7e0b9d104b8633bdbd6073bbe61d17dee0d53ac8220430000000049483045022100d5a4b70ce4542e30a7cfb09ea259405ee202f99b556c88604b06a86419b2e72602202417376668f93e44b404ec2bfe6e797b699367604de296377dfc6944afce722901feffffff2780816ab4fd0177dfff1a98b7783bbefe8d08f339c964d2438b7e73c8ce614c00000000494830450221009d1878ce69f3a438748bcc73de00d531492cd36d2bf7a292bc5bbf67fcf6c774022066e1705510ed5a5177e78a71ba9891d69e11a7a3bc28599d5d18c29c2033a00e01feffffff2da12ef31d8678120d4961c9090035ae9e8f48dcfe4e2f461fb10437473c2bc90000000049483045022100fe0f6284ddb97b4595d77cf7ad5ef4f5caa67cb7c4b6e6ee9812bac076787377022032991f85e1962140673af04a85a442bca3df931ca52c365d3cf24e79b782b2d101feffffff39a00efcf7f678ecf0252ee2b4998a43121aaad28abe518be06a830fd34ae24e0000000048473044022038759690b62c95f80a54d3bde28abdf7dddae992ee4a18c511a4d442da67d758022016aa7dba3da26aa7531731222a0f66cec25c5026cc4903b51dd3fe5483af4cc401feffffff3c5b78d98b3edf510b003cc5723270854313d51ad40859ba08a622f3a269a66900000000484730440220141e545e4ea0c27a630972d474b7d95dd2c9da1a129a7e680016e4ad70c5579102207a3384d8c988bfa526bea0f7cebfb8a8d81ae4b7272d23e83268791fc8eba2bf01feffffff3ca10423750150708e817fe0020a7fd0a687a0456158db659af112dfefefa299000000004847304402205c4e4f8934cea71191f87208bbbaae36b2b3ac4f7282256cc05446cdd1ccc0980220038db0a46e2b06fd61acdf1b47a5de87b787a62a1b65db823c904efa6223129b01feffffff4005c2dd439c35e3f04384142b66871e15a72149218d66be2ca3b13f7e1604b0000000004847304402206b8854445fdb689929143c8daf33fa52ddee06c360073f6262ffea4db0b8b71102200b4d7a166bfa81e8f2570afcd9de338b9a0d7bc72a3962c775205933690f302901feffffff408d53f3499c6db833b4a9b19aa8cf61c95182775a0539efef9c62a0456520c40000000049483045022100c1f028354c1034e61d59999070a8ab554a97f81583d72f38c0f6b0b7a52fe8ab0220538d6fec3f35a595614602203b360730b2f13c3bd879fdadca06dd8a16b90b9d01feffffff43671a7bd5f31ee1642842027378035d73b06d446fbb1666e95638eb0d55d1c9000000004847304402203fc7529cc7a96726728a4aa6a1698fc31bad94d1eadda2a0f74ea8f22d752869022011983a3c457e5c7ffc87b576d877e6f02ab8e08dbda6a94dfbf245315a3365e201feffffff45ee4a5c7a98f315d26c1020b26576500ecae4d6a6a78b3ad169788006e7c76c000000004847304402207a60671e1d0cd3d5d7b8eb2a1b53a0014f30de45f0e379a30435a47e7f9861eb0220689af75a99876c1d1d206869dca223806c45ad64f32cc08cd624936ec6c0600f01feffffff48244290df0dccc781e7d081c731081c2e7e022176cc7b4b31fd92c1e31d970e000000004847304402201972bc346632bcd5166cecbd9d7ca29583c7ad938640d7db9f4bdc6629fff086022019135d7341ef96813a839c6cc14f47c7d2e42c262abbe8747e16c6869cf2b90a01feffffff48c28c27f8303266e0547b8c453b9823baed7a9e06105c09ba4cf65cb2bd5d2b000000004847304402205e40a09a37c939cfa6b5143a2ce596452ecbbd223400922b0001bda694f4c63602205aad66d989167c9bbca130aa489de6286390e55f9e9ef4c5c043c2f13377c7c701feffffff4b28d567f5933d5992559fb19f90115b145db32bd1b6e52d309021da8e6063cc0000000049483045022100ceb282925d7eac742085d5ac48443e9af8b72873fb7a2f96b4e196a58a4b29d7022074790a63adec4088a5d5c2bf1fa80597be0e17afc7490620163a873a2ef1855d01feffffff4d45006be4acc1bf5c69722cb744b967e615d2d35014fc82cf61c2a4905717a50000000049483045022100c6f42ccf0af44182e144aa925b631cab8d90959fa96eb0453335a970e74910d402205e99e1f1d23813e336a3c96efd6e75490f3b5d807f0f2bbc677499cc0b92f47a01feffffff4d8540fa9e580b140359e0a17aac6415ca80072f9ba26fc2b43914092f4702400000000049483045022100b42e72fdb23f4f50af0222d5e590bcc676d60858583dffc1ba8b35730e1c8eb102207cc50ecd38639100131b4c4950cedaac4c4ee37c7a6f87d3ed7fb7eb165559c101feffffff4ff26de89311f83d65a3936e06937f30a75dd50594246d910035bcbe19c0ea6a00000000484730440220425c41bc88fce16ba54f2611a54737d9b5197abc541c730711157b290486cdc6022003f967d0f98864249d80720c65e04c475cbc12c482104aa7e45a06bc9eb080b901feffffff511e169a83c0c0f8ee7163c34fa0e3b024275892419f11a2bb96d4976d3f9b4700000000484730440220136e776a7bfe3fdb5a5b8db2783452ed7cf1fe3c89ec001ed69455a082337e49022057e7dc0ace7ae100a2f2c26291cfe80352b34dfd9269d07468ee2dfba13fc02001feffffff52325adf85f74f38f467bc3a99657f322988add8aebb371bd080088efb95836f000000004847304402201fafc46f92d80a9b4f71a15113ae8e8182dcaa09cff63645db5b858044f329730220160082cc1a3bb262458a204040c3ecc23b276c4558ea095c1b66e20a4004e26b01feffffff532ff452f8423507348c542063deb6f257de711237ff8d718143358128e2c6470000000049483045022100d8dfe5557eae68e8b3da5cc787b14e85fb4d10d2c8a80eda12e69b807319ff9902200b104ae561f1d9c4f0c1646327686f890aed1ea8fb1c1b411f07059517737d0001feffffff5b0d6fe54dce0515e6947f5170478cabb06d1e855365a6b7dbb0118c4450ff0b000000004847304402207fad37e344180882f9cfa3e36d036282a91467ff15fca2f24278f5fa5283b99d0220325dda0a7c35a85cb617bcac369ec0033023c221771cf02f1f877f693f1059d901feffffff5b7db5b32a8e8e8c6307a7d0afec7062637eec39670f1afb08f0b04a50fbc47400000000484730440220752cc9659edbddc78293b1947f84d2bd69e32ef4d5425d4e55df4ca74a7a962402203a755152ab6d38a7ba91f26f476d611cd9c6b27167d6e20b511c4830038d102c01feffffff5cbecf874fd1996cd4e49cd41c98a586c533eac1ebc37df92cf5a9545203f935000000004847304402203af4f03cfed41a4d8387a0859324ce3c40c953582e8848867d06d3aef096deba0220104c18b2e243cf7f076d2833c4fac30e0f5e62b58bc039cba6ce7fe47ea394a101feffffff5d015b907e23b9c5e00907013f66d258fab2f016842f0c8e69346d72b0221dd70000000049483045022100bc3e1c873f25e1a661ef81c109de1758ab13df3fc591540658c5fc05bb1e8c150220309b87661ce039899d5be3b510fcdbb9464ff8cb47af06c016390d79daa7029c01feffffff65c461a04f571b50ab4fe3e367952bfba755eec9b6ed23cb460ab3bdc873fff80000000048473044022037b231fec860afbac51e3034e1308e1873d87dc586258ad8c7ede04cf0fab97e022012eceff07cf09a2c3d2f6884ee885ff9f8e7526de8c08b54e5e538ab223bb31b01feffffff686da3cbb1a1af26c2c01793345a5fb8ee47829aa907ab95b8144fbeda1707920000000049483045022100a0d89b8331105f34528f2c9687f53897a2a14f57cde1390513b4d0fda530a4200220573800bfa5cba98af2a08fa3e87fd0142fe1db6f391a4d160f70565b1078210d01feffffff6896423421d7e1193a7b88d2fbf1eef1c46f637e7a49217c171a18852d29e8d60000000049483045022100cde87af1eb614761149aef298153c541e24ff45345f99dbef18bf2379d27f347022063115fb6b37842eb7cc4d8910ccd047635a9674e72d9418894614014c19d583a01feffffff6a0f6f77ae1d42dc96c39c620f401f32c9774f18f1a039e97b4b405b8aaa757d0000000049483045022100a82d1afe573bfaf0668b3acbec55f68bcbb58bed7b806d59837c32f3560cd1d70220198904866e0bd9d19cc465cf09e256c439ad5309caffa347b8c416443ed07a0c01feffffff6cfa0bcd2e2689498496dc4b15feb0fc535667a88005f2c88198265bb1f8f3d8000000004847304402207917043acb4879438625ace42109cc1bee16054222473d2f975b3edf27286f3602207413e93cf5e696de7c0d210dfa70cd4dd9e62e78ed86a3d99682ef8ea5c064cd01feffffff705456a54cb0b94ec15890bd957dd778581f606270a331ad5b15ef48684a5fc4000000004847304402206668503174e874bc09d999d7bc47f82a5ac47c3f1bc1c43ffa1cca74c1cde4410220616df31f268371b61d83acdfd394a7bcd8da5817174faa29b51c648786c5405a01feffffff718076a7dd771121e817b98e98f46c7f52722d6cdfca9130203fe5965f0a3c00000000004847304402200f1c2ef04cf5fceacb53724360ce3af3794d14ef8a47d4d09c8e3b95b20e48770220659021ba00a68e5f2f4053ec904cc7e65b5bd5db76ff45a9be4ba35ad1a2d0a201feffffff780ed86aeead9747bc96bf7053b02ada6ac566481763e70c29d3d00162bc7b530000000048473044022027f04c7d149ed6c9c72ce3956917444cb5f943aa95adb694ec30ef53c930cfe202206dc14b5f1d59b6724fea484501e36fe7bf40849614921cf76130ec20665f35d401feffffff7b3ad2352be9169286629dcf064fa769c23a8aabd468c30eec35a0c79b61f1f80000000049483045022100c4a61d02e54b0c0b8a9749d394d6447326bf66f3524388b8854c5585ad71704702200b0e71e178082df01e66d0bb72aad0238b0063018cae190c2f21c0fbd78a462001feffffff7fc4676bc415a467bd10d303eacd54617acfb6876945e3bf1217dfd208c6d58d0000000048473044022064ab0c92b7cb2205f1d7af0a2faa441eac041cbb892b166b8f1f060019301546022066924807801b03876a0ac1830eb355ed26c7a67b9e28fcb0b3c6dc5d3c8ca1db01feffffff80fe96eb05e5fcf89fa7e19b1a653e0b8164cba383e2d2ff5934a61c42698cb100000000484730440220515b9c588036449b326ab8d74679cf65c7fe780a03b23ba8428cf829a070abd402204c71e343cfe18e166b7259509b47dcbec0b5b29a764e4dbd29a39479ef60d34601feffffff875ea454109c4725766d372f0fe395dd4744737378b3a246094dc0db7fb6e95f0000000048473044022039167229a3f6ece80aebdfb425608c855989a0e7934abe0c4fca1175f60d46b5022069f57fb057a537cd95e5ebd6a93709e0bffde3d05bd01322f08d0fecef7c061f01feffffff87b7c1fd810834fdd892975a795b9e6c1b1aa398436ae3ecb19bce62ac11aa4e0000000049483045022100ab701a93c793c182bd54f06f80de91c03e36fa9b33b220a91d028f2196d329b5022020e23cff44abe2510b50ce0a8cab286d3ae17c59d8aebd20b42613b764a128c801feffffff88b22fca9de29db1901e9c8accbf1caf8fd4d5a37802b3bf5142038809ee3c6900000000494830450221008ade6fbaec28bf02b3914ffc62c4e0dd7da3d50b41b1054653826a38573e6c13022032d2528595fad675d3f01aad532bdd5ca64960a9cdec35822bb0e69b57fb78ba01feffffff89e4b0f44e022cf53736520aef84a324100f19f4f0862c9d2150b686e951d3740000000049483045022100e69902cff246e6ae5ae8a502aaf2ecc0f8505b8546b17fef18a6e2dde8703bc60220121b6293f7c24aad7766900a746693b9e30ef4e8cc1ca01b2ed4537b47debd2f01feffffff8e0611807aa639621ca6be13a2eda8d98c32867041f929dbbef7742c7c867db000000000484730440220710257eb2b9f5e7b9517770f81c0999a7fcd5b798d8665e0674abec0909b5bad02207bcbcebecb36661cbc8793575f62524dac431fbee3f9c02fb0d854933357694001feffffff8e77d64182b666e50377b3c9a39395735a89d2c90f5ff62024143f2c25ea51d50000000049483045022100ec5f6927e57df66eefcd1275d4236f38841466cdb29aa9ed8c6f8b8f64e0cc4302200141c090ae22c294844bd0b5179f97fd4b98cee426dfb795c3288f37f67a70e401feffffff8fe0b55ad0e150fbfe8d263c44527b967c44fd79ebbe88a09a91a4318f1c17c40000000049483045022100bbaec071109be2005be905bc0b2877286f24cfdb4d8431a31c8f57d802db31270220345e56f174738a6a191ef0a91c4cdeb686dd552d8992ea6ce7517e0ff9cafad001feffffff91ad86b51f541d480383681c4faa26575f723154ed6e39cb76e03317c8984c610000000048473044022046628accc862ea34ab15232f97505cf673d8bfd23d6316677e524e3643e92a20022078414e64419c96474fe2559c30134ac4c08b5a0617a0dc9bd1ce09e85a8df89001feffffff927673288f7c95f452e035b65c8cd46a57e58451b93dcfecfae0c33f00b4e5350000000049483045022100b9e84841140ae7b9bf08f82e014247a8c270d4073b457fbee74743c413e0b4370220292fc63652cd2fae0d1baf9c705de61478b2ec8d4623b9ecaf2aca715c1e69d801feffffff9477cc8e7dddfa7d183bfe0771def3778e7b2641996a3ea52f42d085d4007d190000000048473044022073842db3431ea57cb4aa05435648817bacb36a623e2528817e399126068fbd8b02206744687cfc5587f07d6a507eeeb2aaff45731b3dd9222c40f2b62b60e4db59b301feffffff948a1e5af04f265b29fd23700d1ac9926b5bed71ed5b2968f29abaa15036848c000000004847304402207c5440b72bc608cdf4c7fad0bccdc19d43877e31b22fe3f5873f558a6068e28c022013e3a5b0b11eeec0bfd5cc8317c8a61ccf28ce19a1b50fd7759502a350b991e401feffffff98a1cd6c74d9d42f88032e74182cfe8e71f125eb7eb1b49e8334d5b17bf4d07e00000000484730440220393955bb76c236467d92d42091a290631cbcd9ef3c3f177ace6f1ce73abe319f0220153d5c0aef39f5cea8ef53822993e374dc6d66a758d599f25d2e934d8c97769601feffffff9a7fefd1b1409dfc23d6be09dab5692cd9f6c59c98b2d7b0231f40b396999c2b000000004847304402201f9d944711c3ee35c47b68ddac1a0e1f728884847d8df788b398157de22e9bbd022005d97ceca294e96f5484420189d7a99b9850ecb2c849223ddb934c6c772e32f401feffffff9b0ed42c0446f8ea3c19b47be97f42d1a546bbd6a5a311cded5c1dd16c3606d40000000049483045022100d42b4c9c6fbcbd65d69f0967cca562227f8fbab7ca2727822eb9eb4d0ce8e77a022049d752916ee19c285675786aa04c37d7025e2cef6907f70849f55cda414f3fb501feffffff9ba78bb678f5b7a289ca37b49835bc6ad383e2089dd3711833383c0c6e6d40cb000000004847304402205d3a652a05971d324947fb9d4d15e98393262498e09a6d8fdde7422af91d341a022070e017f2edf61310cb724401a451c1d2be59175e68b49e5c1f82f20084f0b2e501feffffff9d2bdc85ec46fb0457dd41f02f5f7b203ff8c844062f3376c7f86cf2144dc6a6000000004847304402202f93a774f96364ad8fdf46132f47dde1fac4b833d1cf7c20c6c69f03c605c09702207cf7ef42d8c97b96e349d023efd9e7e0b1fd74c50561290d16f3f122e1ead8fb01feffffff9dc64c498135ebd6c025d7d43ae71120d6477bcbcd9828aebe21911ea21655c80000000049483045022100f72cd391c5dd1bc77de0605a3cb35c246a5c1cc14e7b9b3fc1cdd90fd42cfa4b022069049bca8a2f5100ada2a407a2354d04efa94573a7cd1bfa4130cde66e481a1001feffffffa0c3203666c02ea6f958408c8f2241b4d6e3a8beb9ab54736fe73621feb57ce40000000049483045022100daa9b7a48975348b41dfdf8b5e4614721fd018b950d3cec1d7009386bffddb470220522220c5f3ad8f1f19cb0eafea1aae7a3489cdd3dcb3d64f2ce75bd2066a73dd01feffffffa14e8b18777a8710e58942b56d094243151299f033cc21bb3ad3dfce2b3e77ad0000000049483045022100a9e02b9ad05da478a1cf06a235743d202d1f9e8c2e969ea8b1b7d5fe6778fd9602203880f139bf40766d264c2d7f858eb36dc2257b4cacd116cacca400645f80680401feffffffa262a97a28944d41d47c7f8788528c797d322f7abc0390c20bf22e3b835e127a0000000048473044022059a9da8cb72d3d3967ad3adcfb400ee6043ee088707424728de63cba9361da2102206ca3e6681ff149bff11135315d431e24e05aa3c794b41ef0822b8969b0d1597401feffffffaa3c2496b8237d865f81ff0bb8eb01bf2b69ee806463816ec83b60cace7a5833000000004847304402205637e4e9538fa7489e017da763bce9182c5e78492fe23d5366c0638af15c7eef022034e9a552d342053c4184cea58684ffbd0881467cd0a40f009db155275deae1c001feffffffabfc5cf05834234e1ee8a3c87c8de5d6a07f9530a09f2b34d9303ef30d8646cf0000000049483045022100a68eff499320029204dd73f707d36d65583d21ebfa063d770f55139ed546ea8102206646e141b55f506ed457f24311eeec6e302833f69cd08c9ea3086c78f82dfd3801feffffffa2d1512943366ab64e6d1749b81f993e830e5b546a87b9bd68fe0c5c865da953010000006b483045022100c686f7a4b2e8af7deca60cb20b0c626609548f5426dda6bf33207f82923e0ea202200d9c36dc490f014d0d4970ce8c18621d39b6c0c134c7e43da0f62326725598ba01210360cfa32fd05b4c3bc270fc6e8c891af45a149d34664746ffc67f5cb49c6b5f5bfeffffffad976a10bc9ebe391cee6b83191520a9d0fb62a24e969477a4cc6dd26b29e4da000000004847304402203385b46d676be7f898b316fdcf56a8521bda2224ae891b48be05cd880ae7a0e502201f6de4117623336529e445e0943c519e80150cf0d4a5b1427766d06db2d7a26b01feffffffadd486a6d94629b19713d723301b135c11af92b5ed69e6f0b9ed07d417078b2400000000484730440220575a03c7a331f65defeab66ab1404503a700ece0780889266bd1866ff806096b022069348e446f67f551949267b49861e96904e0b47c75a220aa1cd7ffec3b8fa7d801feffffffb04574d6517ca90a26e07a749ebcde23f67f7ef8a594b23e699fa084529d96e80000000049483045022100948f7ec200d121bdea79b29bf1c608c6d5e007aec62acfb3a5cbcae84ce457490220431802ca646caacfeaf1827e1ceb70f07752413c65bb50db24957166603bab3f01feffffffb2197245ddc53b189c18d05d167210fd6291c6b9116862144c3654da5bb55d06000000004847304402204def3dfa143d5887b4075f45d92a91df9825f1e08bee1c29901c1f117ab30df302207eff300c5347d13f531ec36789a6f4f66c07149ff4c86f21107d0f21dc400d9e01feffffffb4b953583df750085d727027674f69c6ba63513915941e42924a462d5bc15c9b0000000049483045022100a267fdd914d9ce78ca819e08312fb2b3c0f9c395bd30d22b26ea8c6a8af3618f0220548b821abd8f1f1fec1db25fbc277cbfc5840e47185a830174a97b74645af60401feffffffb7f5149ac38efb591ad8c3a46ec9e979d5647c964190a135342435b55484dd570000000049483045022100d1d05a271a8516b9357b0e3e73d5413aa138ae9a10c1ccbe30ba7ef15994c24202203df3584a99260ff637db9515361b258e6cf7fbbfa15278b29173dd2c4f25264901feffffffbfc02225e0c5351bbeb63adb8e3b7859752363a5b85f5b2a6da5240a449e8065000000004948304502210082c85c2c7d8316e9e3cfba9f5bafcdbbeaf0509c3e896bd4121f19e4b82cbfe6022070d7650714cb1975215fe109b8f1da2eea866abbdf05e487eb1d75e12776e52d01feffffffc0def09bb3cbf791c52764cceadd389199be9d7603cc3d6d213ba45ffc98518d0000000049483045022100841df35265191f063a9ad2414ec9b36fe39ef9ae13c9fde0e82d67ec9bc654e302206dd8523cf58547ab425ea55a8d879e75d31558701d4f57d76b0f67736ca5e5ea01feffffffc5c9957c3a3e03204e603c313368d3c01206320beddfd28b850fd17b09a61a410000000049483045022100c3467add04b9e313238376a0d3867bc5b59fca8b2eb76bcc18fbc0b0805e63960220578a2cf379848771a9b13e12559cd130853c7f02d9ab497a74f3305aeaf7b00b01feffffffc64396e634d716a5ae280d9fd821507239d7b25a812eea6751254e462c8a73a50000000048473044022040e5e55b23846cbd5e0af588564e5501d58cf2a18eb485c562352fe2801230d002200c70fcf828a81c1cfb856a2d2cc9de21f2564e6080b2f84f44c65b679f49d09c01feffffffc69c9cdd6825a657be1a06008f73b78cf185a9d195ba771451ca1ec09ce54d4f0000000049483045022100e10488858800081f775278c5d844ba2c2cda71ebb4a822d028637191e13efb2602203f7e7f580dad9d7ed1d4cda38222095d8377917c7d4e90c8abb4b9bf3a40975c01feffffffca6112fdc1db1a441961f6eb62b492c1397732cc5519d40f6aa335612f42d39c000000004948304502210097ed9842254112825356823d7365ce8d0bbc973702be7f25951e21f48fcd6e5702203a0aab0ef62926936815e1d9490b335359f766d0ace9b858d59bbd8ba26cb1d901feffffffcb15dbc245dec1ef8cb8e25ef11921ca804c023e6ad803ebcb2a7b98380b60b30000000049483045022100bb9285cab4a68dcb68b46687b59ab1769a0b5aa1ea6f45488e189f58e698321f02205e6499101ee3b0f005e6d3ba151282c236a79d32488e16b1867c6e70c8f7f51001feffffffcfe47e6ce0780c4594a2d1b76a2906c0a9ea32d39a73c244aa9d5d8dea67248c0000000049483045022100a4681709fd0b79ceaddd9d695bd5c740391970a1feff2dd3a90674d20ca95a2a022076dbad3df0c4f8158eba4a087650feeeb1736b5a8b03aef15f698be4fc668abd01feffffffd0a4d502c22cea7da0d1a3cf99aef598b74fad19a6de35f21c6fd0d1b8cf275600000000494830450221009d8a22fe94f18d0a65e8f188b702b4023948e236ac2efd36bfb20d2054e1d55402201383ab2ed9465790eb9496483f10f54e40ae201fb98358cbdd71a0e650ad1b9701feffffffd25452b8575cafca10255179f95c8c66e255329220b7ff645af522af7b8038320000000048473044022013581d5e4794efb6df6dbe04339478ecf019493814d9d52390b6cc790c998762022006aef7acc10019a8cfd7ae99e11e5877a9cf1a5a6ef084549815435f7b681e1801feffffffd3922dfd1a65216bbcd4646d0cbcfa70cfe587775cf4c673043c57061f48d763000000004847304402200bc9095368e4409c7debdf0871f18af1d36e1a4851e4b948a1ce362926550611022034fb19afe76cf133e4bb561fcd3cfe7f3d49743fd75022c124b6e45bd9f503cd01feffffffd75c777645d534009bc8e7b2c0b58a78cd63f41f47f6cd30868aeaf9b55e477000000000494830450221008f4a11d94e97f02e3226c509c70a3582a280ea3bf33309ec392ceeda7a59567e022044bf0d858442058b7c5fd8c73e47287f9283e957fdb39fc005cef70e22b0c07001feffffffd8f837530faf0d9b50efe1d79aed453b11916d565a2b9c40a380a85f0be2af6b0000000048473044022065ac672cfaffe8f8d02fb8064cb54f4d335e7af222452ee71c9b249602cbfcac02202cdb7e8cc05c52db51b71a05258abaf0810d61199eff9ee0ea37d8c373a876ab01feffffffdbce76e284668c829366dafd00ae4884ea39b2aa597cc1b4d2a37991a9b2ea56000000004847304402204480dd6aac1167bb49f32fc04feaa3a7c19ad6cba48479cb72dc7d0bd71ca279022036e654a48cadceba49dbb097892ce5d90d8f082460fb18776d353e9d832ba83301feffffffe481d9493d67997104c12972b7c8a73fb87b16e228665bb784436fc0f58d7e66000000004847304402203645fe9770f3851392a85b8dc9dd405ab13fd8434122f6763de459129527fd0702204d240e91298a1487d496feb320dee028df7dbb5c9236e5d62a4964347f97279001feffffffe7a22d3d87255e4adaab9a6fd8a72320299a6902426424aa8b2b89b7c3b0c0950000000049483045022100b362e030a6739f020622f0f7e34c48fc4ff6147ed88a194a37a8a04c8e42822a0220755bcc63667eb4cbcd52108d27245765176c6c5b2e9a77013aea4d7474c0a1ec01feffffffe80ac9635b6bd91c1935eca6df80876ac8cdc87a2b91e925cfdcc0f06059b2e5000000004847304402204a2b8c311a11920eef4d64e786c5f26ed82d4c1562f2cc0e73fd5a5374c7061e02203693e77f88372a335d1463df4edd062b6dfe2bb895d56d58f3a404c27757378501feffffffedad3357a1a9aeeb8c2771cc6f284db92a2aa31f458e35bb270216015bb0edd40000000049483045022100abad2415b7c6ca9ccf3c52b4008c4d531360f2d6541d9025ec2caa4d764b46da022054f5d2833704686a860fcf978313a3c6c61f16e9a1cf84a3e4ac76c8950dabb701feffffffee85afefc31a99a4616bfb228e1f48691976b900ecdfe838e1310bf5b33fadcf000000004847304402200f7afc12d43432f5303b892b08417743d43a05bf938719428a88c85e255e5b0d02201a12cc706286a1c9329f9e37e62143866563b3773769def6912494a73c17a9f201fefffffff13e4784de0564595f3b4cce57ec0d8a4b72a798feb65f5fbca5b26a3a91d0760000000049483045022100fd3c9b2e02db889ae2bd43537a308a87a7d701bac19083e3a985a93674239e2802206dd36da12f3f2b222ce4387cb91e1098c5f93d25ce95fed0e5d21e6724af554401fefffffff205212771fd3ca5a68340fa307810e44315ae02464b5d8a235ba6bca691bd710000000048473044022062aa2571a91a7e06f0e96570bb3a348296ce7b756ceed48fe69be91f94a6c5c70220631885aa6fc967e40cd1820c83310143884e175227c5434e33b89245598d5e5c01fefffffff31cea9351fddc36393fa996962e204c461a34ff1c6ad243b3a4902440f165da000000004847304402203355527ee222e6bc756ef30c6ad687a21109a5175b1eb27592e9e1938b9e8f850220206ea10896e9e307ee73d33813048fece04bbeda702e11cae8bd61297b73590601fefffffff3c67e78777cc42ae2834bcf5dce5493fbcfcc6e0aabd7608cf4f9c936a37f49000000004847304402207cd40b7d6ca2b869d3f00c0babb484c7a2896c080c593767e0a293acd1505a9c02203a2f8c191b20fe4fb08958b3bb20411834d17f7fa075deb8b2272d22112ec8b001fefffffff3ddc14df664f6e4f59b1f1e25241a61fc69f13125ea5a67edbd03b37d332eb50000000049483045022100a40f81d4e1791d0253a2484656c27994d1e42aaaf77995e9fa6e0eb02480bde30220669c0bfbd0772ec1ad8ca9357eb3ca1100d7b40ed97bb34e23c8cecb42511c7001fefffffff614bd5d83278ad95d8c5bf6fefe59b3675e832cc1c2349d7952aa734fd20283000000004847304402207709f2089f820012e76eaa6221aa0b9776cbdcd0b0b458d400c7c1ca9ed7eedb02200de75bbdae8100b4b27e5deb164e13d596b6661248be45d817b573cdf8cb2c7c01fefffffff67ef42d75fc5d36ff32ab40f5c9f88f279a1173ee1db227a4706aa0480d66ab0000000049483045022100b09aa2cca247052451537f64801ea561506bff82794a8870c077c32c69d0bebc022013bceb4edd8f126af25c07a74d5c16935b0e916cdcc25d49ee335c430400eb2601fefffffff69f0798ab6de485dcfe72391f4cbb1e5f4d39ee8f852b80fd4bb730eabd8e9300000000494830450221009d91a34a7294250ac5b31bc86a2f7ceac8ce79e49d8ac7b3b02ad0cc278f16d102207b9ea41b03e72746a67e7bedfd1cad7f5055a915abdabc13f8e51815f29e983601fefffffff8dd75e7c674cf7bf15f42fcb1256ef4f16b96e0ff6a359bc24c07ba734f09a30000000049483045022100cf9283df82dc2c0d26c2fc9349d16faf2c961919066798705da4afe6fbf27af202207740172e195f5713eff2aeb39d12923625401dea6a0c4b4aa19be3b973c9077601fefffffffa0c47583d4c6f18e12b93764ccf57d2430a52bdd0ceb611924a79c82daf48b9000000004847304402207b46c5dfb4e65c5f91f9770acca2a1ad24a4cdd7e4f27ac9c5e55b14f8d7c00202203b17ab29bd9be1559d550cae9f79728a644682a8aab5db1a1cc3432bad159f4701fefffffffa5ca0440f302bcf118946714dba6e81036e48477ff3a315084fe682aea6d1d50000000049483045022100929668780086aa4c8945fc6d9aaa340ee8ae2807ff2f6a89623ffa102d2bdf6d0220318d3e075a82195af58a66b47c8d62849d69ed1da2e07402d89440a6a77b63ba01fefffffffef369694bf0493161762e49d7ca16f1ba600250d801a848d0ca8d3f2d677d4a0000000049483045022100f7dd5f966156c81a1d2aa694befa6b19e35aa8d7fa199c37a803cd382836fdbe0220669d85a44632a8ea6093b783693c4626ad8c71be4b82b027c4cdfa63682a9a1601feffffff02c5490f00000000001976a9146843838a0aa11686cd0c01fbf470c9c5f302249488ac40420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -## getrawtransaction - -**getrawtransaction "transaction_id" ( verbose )** - -The `getrawtransaction` method returns the raw transaction data. - -If `verbose=0`, the method returns a string that is serialized, hex-encoded data for `transaction_id`. If `verbose` is non-zero, the method returns an object with information about `transaction_id`. - -::: tip -This method relies on the txindex runtime parameter, which is enabled by default on all KMD-based chains. Disabling txindex will cause this method to malfunction. -::: - -### Arguments - -| Name | Type | Description | -| ------- | ------------------------------ | ----------------------------------------------------------------------------- | -| "txid" | (string, required) | the transaction id | -| verbose | (numeric, optional, default=0) | if 0, the method returns a string in hex; otherwise, it returns a json object | - -### Response (if `verbose` is not set, or set to `0`) - -| Name | Type | Description | -| ------ | -------- | ------------------------------------------- | -| "data" | (string) | the serialized, hex-encoded data for 'txid' | - -### Response (if `verbose` > `0`) - -| Name | Type | Description | -| ----------------------- | ---------------------------------------------- | --------------------------------------------------------------------------- | -| "hex" | (string) | the serialized, hex-encoded data for 'txid' | -| "txid" | (string) | the transaction id (same as provided) | -| "version" | (numeric) | the version | -| "locktime" | (numeric) | the lock time | -| "expiryheight" | (numeric, optional) | the block height after which the transaction expires | -| "vin" : [ ... ] | (array of json objects) | -| "txid" | (string) | the transaction id | -| "vout" | (numeric) | -| "scriptSig": { ... } | (array of json objects) | the script | -| "asm" | (string) | asm | -| "hex" | (string) | hex | -| "sequence" | (numeric) | the script sequence number | -| "vout" : [ ... ] | (array of json objects) | -| "value" | (numeric) | the value | -| "number" | (numeric) | index | -| "scriptPubKey" | | -| "asm" | (string) | the asm | -| "hex" | (string) | the hex | -| "reqSigs" | (numeric) | the required sigs | -| "type" | (string) | the type, e.g. 'pubkeyhash' | -| "addresses" : [ ... ] | (array of strings) | -| "address" | (string) | the address | -| "vjoinsplit" : [ ... ] | (array of json objects, only for version >= 2) | -| "vpub_old" | (numeric) | public input value | -| "vpub_new" | (numeric) | public output value | -| "anchor" | (string) | the anchor | -| "nullifiers" | | -| "hex" | (string) | input note nullifier | -| "commitments" : [ ... ] | (array of strings) | -| "hex" | (string) | output note commitment | -| "onetimePubKey" | (string) | the onetime public key used to encrypt the ciphertexts | -| "randomSeed" | (string) | the random seed | -| "macs": [ ... ] | (array of strings) | -| "hex" | (string) | input note MAC | -| "proof" | (string) | the zero-knowledge proof | -| "ciphertexts": [ ... ] | (array of strings) | -| "hex" | (string) | output note ciphertext | -| "blockhash" | (string) | the block hash | -| "height" | (numeric) | height of the block | -| "confirmations" | (numeric) | a confirmation number that is aware of dPoW security | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | -| "time" | (numeric) | the transaction time in seconds since epoch (Jan 1 1970 GMT) | -| "blocktime" | (numeric) | the block time in seconds since epoch (Jan 1 1970 GMT) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getrawtransaction "a44feb2e788d0332e283d8ca69c6a20999944dccac93246cbf9b36d841b08c95" -``` - - - -Command: - -```bash -./komodo-cli getrawtransaction "3ac97fdd33c713857c1aac8de58cee5d51c768619602b969db9c752e65b28d69" 1 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["3ac97fdd33c713857c1aac8de58cee5d51c768619602b969db9c752e65b28d69", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## sendrawtransaction - -**sendrawtransaction "hexstring" ( allowhighfees )** - -The `sendrawtransction` method submits raw transaction (serialized, hex-encoded) to local nodes and the network. - -Also see [createrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#createrawtransaction) and [signrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#signrawtransaction) calls. - -### Arguments - -| Name | Type | Description | -| ------------- | ---------------------------------- | ------------------------------------- | -| "hexstring" | (string, required) | the hex string of the raw transaction | -| allowhighfees | (boolean, optional, default=false) | whether to allow high fees | - -### Response - -| Name | Type | Description | -| ----- | -------- | --------------------------- | -| "hex" | (string) | the transaction hash in hex | - -#### :pushpin: Examples - -Create a transaction: - -Command: - -```bash -./komodo-cli createrawtransaction '[{"txid" : "a44feb2e788d0332e283d8ca69c6a20999944dccac93246cbf9b36d841b08c95","vout":0}]' '{"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01}' -``` - - - -Sign the transaction, and get back the hex: - -Command: - -```bash -./komodo-cli signrawtransaction "0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa40000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -Send the transaction (signed hex): - -Command: - -```bash -./komodo-cli sendrawtransaction "0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa4000000006a4730440220242c38740261799f9b6ccbde8f941e2567e86c84108c508d108d062ab9677b6e02206fea089b28c6d66d1c8f2343e1de7960dadafa3cf268c00f7dbe391cd8b9365f01210384c0db4f1eaa142a2745742b942f989375dbec32c55310a793225bb5c43cdc98ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa4000000006a4730440220242c38740261799f9b6ccbde8f941e2567e86c84108c508d108d062ab9677b6e02206fea089b28c6d66d1c8f2343e1de7960dadafa3cf268c00f7dbe391cd8b9365f01210384c0db4f1eaa142a2745742b942f989375dbec32c55310a793225bb5c43cdc98ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## signrawtransaction - -**signrawtransaction "hexstring" ( [{ "txid": "id", "vout": n, "scriptPubKey": "hex", "redeemScript": "hex" }, ... ][ "privatekey1", ... ] sighashtype )** - -The `signrawtransaction` method signs inputs for a raw transaction (serialized, hex-encoded). The second optional argument (may be `null`) is an array of previous transaction outputs that this transaction depends on, but may not yet be in the block chain. The third optional argument (may be `null`) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction. - -::: tip -For full details, please see the linked documentation. -::: - -### Arguments - -| Name | Type | Description | -| -------------- | ------------------------------- | ------------------------------------------------------------------- | -| "hexstring" | (string, required) | the transaction hex string | -| "prevtxs" | (string, optional) | a json array of previous dependent transaction outputs | -| "txid" | (string, required) | the transaction id | -| "vout" | (numeric, required) | the output number | -| "scriptPubKey" | (string, required) | the script key | -| "redeemScript" | (string, required for P2SH) | redeem script | -| "amount" | (numeric, required) | the amount spent | -| "privatekeys" | (string, optional) | a json array of base58-encoded private keys for signing | -| "privatekey" | (string) | the private key in base58-encoding | -| "sighashtype" | (string, optional, default=ALL) | the signature hash type; the following options are available: "ALL" | "NONE" | "SINGLE" | "ALL | ANYONECANPAY" | "NONE | ANYONECANPAY" | "SINGLE | ANYONECANPAY" | - -### Response - -| Name | Type | Description | -| ----------- | --------- | -------------------------------------------------------- | -| "hex" | (string) | the hex-encoded raw transaction with signature(s) | -| "complete" | (boolean) | whether the transaction has a complete set of signatures | -| "errors" | | -| "txid" | (string) | the hash of the referenced, previous transaction | -| "vout" | (numeric) | the index of the output to spend and used as input | -| "scriptSig" | (string) | the hex-encoded signature script | -| "sequence" | (numeric) | the script sequence number | -| "error" | (string) | verification or signing error related to the input | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli signrawtransaction "0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa40000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransaction", "params": ["0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa40000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/util.md b/docs/basic-docs/smart-chains/smart-chain-api/util.md deleted file mode 100644 index 4116a93c3..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/util.md +++ /dev/null @@ -1,504 +0,0 @@ -# Util - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## createmultisig - -**createmultisig nrequired [ "key", ... ]** - -The `createmultisig` method creates a multi-signature address with `n` signature(s) of `m` key(s) required. The method returns a json object with the address and redeemScript. - -### Arguments - -| Name | Type | Description | -| --------------- | ------------------- | ---------------------------------------------------------------------- | -| number_required | (numeric, required) | the number of required signatures out of the `n` key(s) or address(es) | -| "keys" | (string, required) | a json array of keys which are addresses or hex-encoded public keys | -| "key" | (string) | an address or hex-encoded public key | - -### Response - -| Name | Type | Description | -| -------------- | -------- | ----------------------------------------------------- | -| "address" | (string) | the value of the new multisig address | -| "redeemScript" | (string) | the string value of the hex-encoded redemption script | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli createmultisig 2 "[\"RJnVEQgucK1iwiRjfTZmreXkF49KgTErDn\",\"RCVyjn9MQ8Tw6YRJnDcsx67kfsmfUgLdfw\"]" -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, ["RJnVEQgucK1iwiRjfTZmreXkF49KgTErDn","RCVyjn9MQ8Tw6YRJnDcsx67kfsmfUgLdfw"]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## decodeccopret - -**decodeccopret scriptPubKey** - -The `decodeccopret` method decodes the OP RETURN data from a CC transaction to output the `EVALCODE` and `function id` of the method that produced the transaction. - -#### Finding the OP RETURN Data From a CC Transaction - -The OP RETURN data from a CC transaction can be found by following these steps: - -- Decode a transaction produced by a CC module using the method [getrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#getrawtransaction)'s verbose option. -- Look for the `vout` key; it is an array of jsons -- Find the json that contains the `scriptPubkey`, and which has the `type:nulldata` key pair -- Copy the `hex` value from that `scriptPubkey` json -- This is the hex-string that is expected as the argument for the above method. -- You can verify that the transaction was produced by a CC module by checking if one of the `vout` json's `scriptPubkey` json has the `type:cryptocondition` key pair - -### Arguments - -| Name | Type | Description | -| ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------- | -| scriptPubKey | (string) | the hex-string format `scriptPubKey` of the `type` : `nulldata` in the `vout` of a transaction produced by a CC module | - -### Response - -| Name | Type | Description | -| --------- | -------------------- | ------------------------------------------------------------- | -| result | (string) | whether the call succeeded | -| OpRets | (json) | a json containing the keys `EVALCODE` and `function id` | -| eval_code | (hexadecimal number) | the `EVALCODE` of the method that produced the transaction | -| function | (string) | the `function id` of the method that produced the transaction | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli decodeccopret 6a2412782103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodeccopret", "params": ["6a2412782103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## estimatefee - -**estimatefee nblocks** - -The `estimatefee` method estimates the approximate fee per kilobyte. The method is needed for a transaction to begin confirmation within `nblocks` blocks. - -The value `-1.0` is returned if not enough transactions and blocks have been observed to make an estimate. - -### Arguments - -| Name | Type | Description | -| ------- | --------- | ---------------------------------------------------------- | -| nblocks | (numeric) | the number of blocks within which the fee should be tested | - -### Response - -| Name | Type | Description | -| ---- | --------- | ----------------- | -| n | (numeric) | the estimated fee | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli estimatefee 6 -``` - - - -## estimatepriority - -**estimatepriority nblocks** - -The `estimatepriority` method estimates the approximate priority of a zero-fee transaction, when it needs to begin confirmation within `nblocks` blocks. - -The value `-1.0` is returned if not enough transactions and blocks have been observed to make an estimate. - -### Arguments - -| Name | Type | Description | -| ------- | --------- | --------------------------------------------------------------------------------- | -| nblocks | (numeric) | a statement indicating within how many blocks the transaction should be confirmed | - -### Response - -| Name | Type | Description | -| ---- | --------- | ---------------------- | -| n | (numeric) | the estimated priority | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli estimatepriority 6 -``` - - - -## invalidateblock - -**invalidateblock "hash"** - -The `invalidateblock` method permanently marks a block as invalid, as if it violated a consensus rule. - -### Arguments - -| Name | Type | Description | -| ---- | ------------------ | ---------------------------------------- | -| hash | (string, required) | the hash of the block to mark as invalid | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli invalidateblock "02f51fb2793b0728050c5e983ffed669594e0a2dda01dcb7a68d129fd87436e0" -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "invalidateblock", "params": ["02f51fb2793b0728050c5e983ffed669594e0a2dda01dcb7a68d129fd87436e0"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## reconsiderblock - -**reconsiderblock "hash"** - -The `reconsiderblock` method removes invalidity status of a block and its descendants, reconsidering them for activation. This can be used to undo the effects of the `invalidateblock` method. - -### Arguments - -| Name | Type | Description | -| ---- | ------------------ | ----------------------------------- | -| hash | (string, required) | the hash of the block to reconsider | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli reconsiderblock "02f51fb2793b0728050c5e983ffed669594e0a2dda01dcb7a68d129fd87436e0" -``` - - - -## txnotarizedconfirmed - -**txnotarizedconfirmed txid** - -The `txnotarizedconfirmed` method returns information about a transaction's state of confirmation. - -If the transaction is on a chain that has Komodo's dPoW security service, the method returns `true` if the transaction is notarized. - -If the chain does not have dPoW, the method returned `true` if the confirmation number is greater than `60`. - -### Arguments - -| Name | Type | Description | -| ------ | ------------------ | ------------------ | -| "txid" | (string, required) | the transaction id | - -### Response - -| Name | Type | Description | -| -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| "result" | (boolean) | whether the transaction is confirmed, for dPoW-based chains; for non-dPoW chains, the value indicates whether the transaction has `60` or more confirmations | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli txnotarizedconfirmed ce1e3df1fb24ab3301b4032c3a0af466ca03b9365f8c649511bdd72f5519fecb -``` - - - -## validateaddress - -**validateaddress "komodoaddress"** - -The `validateaddress` method returns information about the given address. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ----------------------- | -| "address" | (string, required) | the address to validate | - -### Response - -| Name | Type | Description | -| -------------- | --------- | ----------------------------------------------------------------------------------------- | -| "isvalid" | (boolean) | indicates whether the address is valid. If it is not, this is the only property returned. | -| "address" | (string) | the address validated | -| "scriptPubKey" | (string) | the hex encoded scriptPubKey generated by the address | -| "ismine" | (boolean) | indicates whether the address is yours | -| "isscript" | (boolean) | whether the key is a script | -| "pubkey" | (string) | the hex value of the raw public key | -| "iscompressed" | (boolean) | whether the address is compressed | -| "account" | (string) | DEPRECATED the account associated with the address; "" is the default account | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli validateaddress "RDNC9mLrN48pVGDQ5jSoPb2nRsUPJ5t2R7" -``` - - - -## verifymessage - -**verifymessage "address" "signature" "message"** - -The `verifymessage` method verifies a signed message. - -::: tip -See also signmessage. -::: - -### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | -------------------------------------------------------- | -| "address" | (string, required) | the address to use for the signature | -| "signature" | (string, required) | the signature provided by the signer in base 64 encoding | -| "message" | (string, required) | the message that was signed | - -### Response - -| Name | Type | Description | -| ---------- | --------- | ------------------------------------------- | -| true/false | (boolean) | indicates whether the signature is verified | - -#### :pushpin: Examples - -Create the signature: - -Command: - -```bash -./komodo-cli signmessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "my message" -``` - - - -Verify the signature: - -Command: - -```bash -./komodo-cli verifymessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "H1y0mn/wRv56r1bcfkbQtzjG6XeWSelAsyayBuCwEL9XGXs7ieU55dryt/cFWM9gnRFI7gS01AByuSqRs+o/AZs=" "my message" -``` - - - -## z_validateaddress - -**z_validateaddress "zaddr"** - -The `z_validateaddress` method returns information about the given z address. - -### Arguments - -| Name | Type | Description | -| ------- | ------------------ | ------------------------- | -| "zaddr" | (string, required) | the z address to validate | - -### Response - -| Name | Type | Description | -| ----------------- | --------- | ---------------------------------------------------------------------------------- | -| "isvalid" | (boolean) | indicates whether the address is valid; if not, this is the only property returned | -| "address" | (string) | the z address validated | -| "ismine" | (boolean) | indicates if the address is yours or not | -| "payingkey" | (string) | the hex value of the paying key, a_pk | -| "transmissionkey" | (string) | the hex value of the transmission key, pk_enc | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_validateaddress "zcWsmqT4X2V4jgxbgiCzyrAfRT1vi1F4sn7M5Pkh66izzw8Uk7LBGAH3DtcSMJeUb2pi3W4SQF8LMKkU2cUuVP68yAGcomL" -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-api/wallet.md b/docs/basic-docs/smart-chains/smart-chain-api/wallet.md deleted file mode 100644 index 5ade2e17b..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-api/wallet.md +++ /dev/null @@ -1,4832 +0,0 @@ -# Wallet - -The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. - -## addmultisigaddress - -**addmultisigaddress nrequired [ "key", ... ] \( "account" )** - -The `addmultisigaddress` method adds a multi-signature address to the wallet, where `nrequired` indicates the number of keys (out of the total provided) required to execute a transaction. - -The keys function as signatures, allowing multiple parties or entities to manage an account. Each key in the array can be an address or a hex-encoded public key. - -::: tip -DEPRECATED: If account is specified, the method assigns the multi-signature address to that account. -::: - -### Arguments - -| Name | Type | Description | -| ------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| nrequired | (numeric, required) | the number of required keys (out of the `n` submitted) | -| "keysobject" | (string, required) | a json array of addresses or hex-encoded public keys | -| "address" | (string) | the address or hex-encoded public key | -| "account" | (string, optional) | DEPRECATED: if provided, "account" MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | - -### Response - -| Name | Type | Description | -| --------- | -------- | ----------------------------------- | -| "address" | (string) | an address associated with the keys | - -#### :pushpin: Examples - -Add a multisig address from 2 addresses: - -Command: - -```bash -./komodo-cli addmultisigaddress 2 '["RSWwtqsNr9mW21UXRm6Lz4AzQnj4pVzzkp","RW8d8EChHTooVbwF3reqHYgkzWCnJFLXgh"]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, ["RL4CuA2MSAbBiqJKQEr2TKnKT2fSwK99mG","RBYVFCxpJdLgvUixhguxzuH1TJpoNLYCJ6"]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## backupwallet - -**backupwallet "destination"** - -The `backupwallet` method safely copies the `wallet.dat` file to the indicated destination. The `destination` input accepts only alphanumeric characters. - -::: tip -This method requires that the coin daemon have the exportdir runtime parameter enabled. -::: - -### Arguments - -| Name | Type | Description | -| ------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "destination" | (string, required) | the destination filename, saved in the directory set by the [exportdir](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#exportdir) runtime parameter | - -### Response - -| Name | Type | Description | -| ------ | -------- | ------------------------------------- | -| "path" | (string) | the full path of the destination file | - -#### :pushpin: Examples - -```bash -./komodo-cli backupwallet "mybackupdata" - -/home/myusername/myexportdir/mybackupdata -``` - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backupdata"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## dumpprivkey - -**dumpprivkey "address"** - -The `dumpprivkey` method reveals the private key corresponding to the indicated `address`. - -::: tip -See also importprivkey. -::: - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ------------------------------- | -| "address" | (string, required) | the address for the private key | - -### Response - -| Name | Type | Description | -| ------ | -------- | --------------- | -| "data" | (string) | the private key | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli dumpprivkey "RTcwYaQPDVN7V9SdfFHARWnoB7vcpSfdvs" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpprivkey", "params": ["RTcwYaQPDVN7V9SdfFHARWnoB7vcpSfdvs"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## dumpwallet - -**dumpwallet "filename"** - -The `dumpwallet` method dumps all transparent-address wallet keys into a file, using a human-readable format. - -Overwriting an existing file is not permitted. The `destination` parameter accepts only alphanumeric characters. - -::: tip -This method requires that the coin daemon have the [exportdir](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#exportdir) runtime parameter enabled. -::: - -### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "filename" | (string, required) | the filename, saved in the folder set by the [exportdir](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#exportdir) runtime parameter | - -### Response - -| Name | Type | Description | -| ------ | -------- | ------------------------------------- | -| "path" | (string) | the full path of the destination file | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli dumpwallet "test" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## encryptwallet - -**encryptwallet "passphrase"** - -::: warning -Using the `encryptwallet` method will shutdown the Komodo daemon (`komodod`). -::: - -:::tip -This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. -::: - -The `encryptwallet` method encrypts the wallet with the indicated `passphrase`. - -For more information, please see these instructions: [Encrypt Komodo's wallet.dat File](https://docs.komodoplatform.com/komodo/encrypt-wallet.html) - -This method is for first-time encryption only. After the first encryption, any calls that interact with private keys will require the passphrase via [walletpassphrase](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#walletpassphrase) prior to calling the corresponding method. This includes methods that create a transaction, dump a private key for an address, sign a transaction, etc. - -### Arguments - -| Name | Type | Description | -| ---------- | -------- | ----------------------------------------------------------------------------------------------------- | -| passphrase | (string) | the passphrase for wallet encryption; the passphrase must be at least 1 character, but should be many | - -### Response - -| Text Response | -| -------------------------------------------------------------------------------------------------------------------------------------------- | -| wallet encrypted; Komodo server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup. | - -#### :pushpin: Examples - -##### Encrypt your wallet - -Command: - -```bash -./komodo-cli encryptwallet "mypassphrase" -``` - - - -##### Unlock the wallet for 60 seconds - -Command: - -```bash -./komodo-cli walletpassphrase "mypassphrase" 60 -``` - - - -##### Lock the wallet again by removing the passphrase - -Command: - -```bash -./komodo-cli walletlock -``` - - - -As a json rpc call: - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["mypassphrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaccount - -**getaccount "address"** - -The `getaccount` method returns the account associated with the given address. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ----------- | -| "address" | (string, required) | the address | - -### Response - -| Name | Type | Description | -| ------------- | -------- | ------------------- | -| "accountname" | (string) | the account address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaccount "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccount", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaccountaddress - -**getaccountaddress "account"** - -::: tip -DEPRECATED -::: - -The `getaccountaddress` method returns the current address for receiving payments to this account. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- | -| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | - -### Response - -| Name | Type | Description | -| --------- | -------- | ------------------- | -| "address" | (string) | the account address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaccountaddress -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccountaddress", "params": ["myaccount"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getaddressesbyaccount - -**getaddressesbyaccount "account"** - -::: tip -DEPRECATED -::: - -The `getaddressesbyaccount` method returns the list of addresses for the given `account`. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- | -| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | - -### Response - -| Name | Type | Description | -| --------- | -------- | -------------------------------------------- | -| "address" | (string) | an address associated with the given account | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getaddressesbyaccount "tabby" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbyaccount", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getbalance - -**getbalance ( "account" minconf includeWatchonly )** - -The `getbalance` method returns the server's total available balance. - -::: tip -The account input is deprecated. -::: - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------------------- | -------------------------------------------------------------------------------------- | -| "account" | (string, optional) | DEPRECATED if provided, it MUST be set to the empty string `""` or to the string `"*"` | -| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | -| includeWatchonly | (bool, optional, default=false) | also include balance in watchonly addresses (see `importaddress`) | - -### Response - -| Name | Type | Description | -| ------ | --------- | ---------------- | -| amount | (numeric) | the total amount | - -#### :pushpin: Examples - -The total amount in the wallet: - -Command: - -```bash -./komodo-cli getbalance - -``` - - - -The total amount in the wallet where at least five blocks are confirmed: - -Command: - -```bash -./komodo-cli getbalance "*" 5 -``` - - - -As a json rpc call: - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getbalance64 - -**getbalance64** - -::: tip -This method is part of the new ac_staked functionality. -::: - -The `getbalance64` method is used only on Smart Chains that are utilizing the `ac_staked` functionality. On KMD-based Proof-of-Stake (PoS) Smart Chains, all staked coins are placed into one of 64 segments (`segid`'s'). The `getbalance64` method returns the balance of coins in each `segid`. For further information, please reach out to our support team. - -## getnewaddress - -**getnewaddress ( "account" )** - -The `getnewaddress` method returns a new address for receiving payments. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| "account" | (string, optional) | DEPRECATED: If provided, the account MUST be set to the empty string `""` to represent the default account; passing any other string will result in an error | - -### Response - -| Name | Type | Description | -| --------- | -------- | --------------- | -| "address" | (string) | the new address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getnewaddress -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getrawchangeaddress - -**getrawchangeaddress** - -The `getrawchangeaddress` returns a new address that can be used to receive change. - -::: tip -This is for use with raw transactions, NOT normal use. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| --------- | -------- | ----------- | -| "address" | (string) | the address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getrawchangeaddress -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawchangeaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getreceivedbyaccount - -**getreceivedbyaccount "account" ( minconf )** - -::: tip -DEPRECATED -::: - -The getreceivedbyaccount method returns the total amount received by account in transactions with at least minconf confirmations. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------- | -| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | -| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | - -### Response - -| Name | Type | Description | -| ------ | --------- | ------------------------------------------ | -| amount | (numeric) | the total amount received for this account | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getreceivedbyaccount "" -``` - - - -## getreceivedbyaddress - -**getreceivedbyaddress "address" ( minconf )** - -The `getreceivedbyaddress` method returns the total amount received by the given `address` in transactions with at least `minconf` confirmations. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------------------ | ------------------------------------------------------------ | -| "address" | (string, required) | the address for transactions | -| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | - -### Response - -| Name | Type | Description | -| ------ | --------- | -------------------------------------------------------------- | -| amount | (numeric) | the total amount of the relevant coin received at this address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getreceivedbyaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" -``` - - - -Command: - -```bash -./komodo-cli getreceivedbyaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" 0 -``` - - - -Command: - -```bash -./komodo-cli getreceivedbyaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" 6 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaddress", "params": ["RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## gettransaction - -**gettransaction "txid" ( includeWatchonly )** - -The `gettransaction` method queries detailed information about transaction `txid`. This command applies only to `txid`'s that are in the user's local wallet. - -### Arguments - -| Name | Type | Description | -| ------------------ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| "txid" | (string, required) | the transaction id | -| "includeWatchonly" | (bool, optional, default=false) | whether to include watchonly addresses in the returned balance calculation and in the `details[]` returned values | - -### Response - -| Name | Type | Description | -| ----------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------ | -| "amount" | (numeric) | the transaction amount | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | -| "blockhash" | (string) | the block hash | -| "blockindex" | (numeric) | the block index | -| "blocktime" | (numeric) | the time in seconds since epoch (1 Jan 1970 GMT) | -| "txid" | (string) | the transaction id | -| "time" | (numeric) | the transaction time in seconds since epoch (1 Jan 1970 GMT) | -| "timereceived" | (numeric) | the time received in seconds since epoch (1 Jan 1970 GMT) | -| "details" : [ ... ] | (array) | -| "account" | (string) | DEPRECATED the account name involved in the transaction; can be "" for the default account | -| "address" | (string) | the address involved in the transaction | -| "category" | (string) | the category - either `send` or `receive` | -| "amount" | (numeric) | the amount | -| "vout" | (numeric) | the vout value | -| "vjoinsplit" : [ ... ] | (array of json objects) | -| "anchor" | (string) | merkle root of note commitment tree | -| "nullifiers" : [ ... ] | (array of strings) | | -| "hex" | (string) | -| "commitments" : [ ... ] | (array of strings) | -| "hex" | (string) | -| "macs" : [ ... ] | (array of strings) | -| "hex" | (string) | -| "vpub_old" | (numeric) | the amount removed from the transparent value pool | -| "vpub_new" | (numeric) | the amount added to the transparent value pool | -| "hex" | (string) | transaction data translated into hex | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli gettransaction "34efdb82ec718dede04feccecdc44f119cb7263f11c56ec3d7bf6234c9d0e27a" -``` - - - -Command: - -```bash -./komodo-cli gettransaction "34efdb82ec718dede04feccecdc44f119cb7263f11c56ec3d7bf6234c9d0e27a" true -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["34efdb82ec718dede04feccecdc44f119cb7263f11c56ec3d7bf6234c9d0e27a"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getunconfirmedbalance - -**getunconfirmedbalance** - -The `getunconfirmedbalance` method returns the server's total unconfirmed balance. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getunconfirmedbalance -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getunconfirmedbalance", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## getwalletinfo - -**getwalletinfo** - -The `getwalletinfo` method returns an object containing various information about the wallet state. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| "walletversion" | (numeric) | the wallet version | -| "balance" | (numeric) | the total confirmed balance of the wallet | -| "unconfirmed_balance" | (numeric) | the total unconfirmed balance of the wallet | -| "immature_balance" | (numeric) | the total immature balance of the wallet | -| "txcount" | (numeric) | the total number of transactions in the wallet | -| "keypoololdest" | (numeric) | the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool | -| "keypoolsize" | (numeric) | how many new keys are pre-generated | -| "unlocked_until" | (numeric) | the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked | -| "paytxfee" | (numeric) | the transaction fee configuration, given as the relevant COIN per KB | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli getwalletinfo -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## importaddress - -**importaddress "address" ( "label" rescan )** - -The `importaddress` method adds an address or script (in hex) that can be watched as if it were in your wallet, although it cannot be used to spend. - -::: tip -This call can take an increased amount of time to complete if rescan is true. -::: - -### Arguments - -| Name | Type | Description | -| --------- | --------------------------------- | ---------------------------------- | -| "address" | (string, required) | the address to watch | -| "label" | (string, optional, default="") | an optional label | -| rescan | (boolean, optional, default=true) | rescan the wallet for transactions | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Import an address with rescan: - -Command: - -```bash -./komodo-cli importaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" -``` - - - -Command: - -```bash -./komodo-cli importaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" "testing" false -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["R9z796AehK5b6NCPeVkGUHSpJnawerf8oP", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## importprivkey - -**importkey "komodoprivkey" ( "label" rescan )** - -The `importprivkey` method adds a private key to your wallet. - -::: tip -This call can take minutes to complete if rescan is true. -::: - -::: tip -See also dumpprivkey. -::: - -### Arguments - -| Name | Type | Description | -| --------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| "privkey" | (string, required) | the private key (see [dumpprivkey](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#dumpprivkey)) | -| "label" | (string, optional, default="") | an optional label | -| rescan | (boolean, optional, default=true) | rescan the wallet for transactions | -| block | (integer, optional) | block height to rescan from | - -### Response - -| Name | Type | Description | -| --------- | -------- | ------------------ | -| addresses | (string) | the public address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli importprivkey "DONOTUSExxxxxxxxxxxxxxxxxxxxj4Xu9jjinhLpffhdtoKg5gar2" -``` - - - -Command: - -```bash -./komodo-cli importprivkey "DONOTUSExxxxxxxxxxxxxxxxxxxxj4Xu9jjinhLpffhdtoKg5gar2" "testing" false -``` - - - -Command: - -```bash -./komodo-cli importprivkey "DONOTUSExxxxxxxxxxxxxxxxxxxxj4Xu9jjinhLpffhdtoKg5gar2" "testing" true 1762762 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importprivkey", "params": ["UwibHKsYfiM19BXQmcUwAfw331GzGQK8aoPqqYEbyoPrzc2965nE", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## importwallet - -**importwallet "filename"** - -The `importwallet` method imports transparent-address keys from a wallet-dump file (see [dumpwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#dumpwallet)). - -### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | --------------- | -| "filename" | (string, required) | the wallet file | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli importwallet "path/to/exportdir/nameofbackup" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importwallet", "params": ["path/to/exportdir/nameofbackup"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## keypoolrefill - -**keypoolrefill ( newsize )** - -The `keypoolrefill` method refills the keypool. - -### Arguments - -| Name | Type | Description | -| ------- | -------------------------------- | -------------------- | -| newsize | (numeric, optional, default=100) | the new keypool size | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli keypoolrefill -``` - - - -Command: - -```bash -./komodo-cli keypoolrefill 100 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "keypoolrefill", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listaccounts - -**listaccounts ( minconf includeWatchonly )** - -::: tip -DEPRECATED -::: - -The listaccounts method returns an object that has account names as keys and account balances as values. - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------------------- | --------------------------------------------------------------- | -| minconf | (numeric, optional, default=1) | only include transactions with at least this many confirmations | -| includeWatchonly | (bool, optional, default=false) | include balances in watchonly addresses (see 'importaddress') | - -### Response - -| Name | Type | Description | -| ---------------- | --------- | ----------------------------------------------------------------------------------------- | -| "account_number" | (numeric) | the property name is the account name, and the value is the total balance for the account | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listaccounts 6 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaccounts", "params": [6] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listaddressgroupings - -**listaddressgroupings** - -The `listaddressgroupings` method lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ---------- | ------------------ | ------------------------ | -| "address", | (string) | the address | -| amount, | (numeric) | the amount | -| "account" | (string, optional) | (DEPRECATED) the account | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listaddressgroupings -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaddressgroupings", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listlockunspent - -**listlockunspent** - -The `listlockunspent` method returns a list of temporarily non-spendable outputs. - -::: tip -See the lockunspent call to lock and unlock transactions for spending. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | --------- | ------------------------- | -| "txid" | (string) | the transaction id locked | -| "vout" | (numeric) | the vout value | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listlockunspent -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listlockunspent", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listreceivedbyaccount - -**listreceivedbyaccount ( minconf includeempty includeWatchonly )** - -::: warning -DEPRECATED -::: - -The `listreceivedbyaccount` method lists balances by account. - -### Arguments - -| Name | Type | Description | -| ---------------- | ---------------------------------- | ---------------------------------------------------------------- | -| minconf | (numeric, optional, default=1) | the minimum number of confirmations before payments are included | -| includeempty | (boolean, optional, default=false) | whether to include accounts that haven't received any payments | -| includeWatchonly | (bool, optional, default=false) | whether to include watchonly addresses (see 'importaddress') | - -### Response - -| Name | Type | Description | -| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------- | -| "involvesWatchonly" | (bool) | only returned if the imported addresses were involved in the transaction | -| "account" | (string) | the account name of the receiving account | -| "amount" | (numeric) | the total amount received by addresses with this account | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations of the most recent transaction included (number of blocks on top of this transaction's block) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listreceivedbyaccount -``` - - - -Command: - -```bash -./komodo-cli listreceivedbyaccount 6 true -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaccount", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listreceivedbyaddress - -**listreceivedbyaddress ( minconf includeempty includeWatchonly)** - -The `listreceivedbyaddress` method lists balances by receiving address. - -### Arguments - -| Name | Type | Description | -| ---------------- | ---------------------------------- | ---------------------------------------------------------------- | -| minconf | (numeric, optional, default=1) | the minimum number of confirmations before payments are included | -| includeempty | (numeric, optional, default=false) | whether to include addresses that haven't received any payments | -| includeWatchonly | (bool, optional, default=false) | whether to include watchonly addresses (see 'importaddress') | - -### Response - -| Name | Type | Description | -| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------- | -| "involvesWatchonly" | (bool) | only returned if imported addresses were involved in transaction | -| "address" | (string) | the receiving address | -| "account" | (string) | DEPRECATED the account of the receiving address; the default account is "" | -| "amount" | (numeric) | the total amount received by the address | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations of the most recent transaction included (number of blocks on top of this transaction's block) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listreceivedbyaddress -``` - - - -Command: - -```bash -./komodo-cli listreceivedbyaddress 6 true -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listsinceblock - -**listsinceblock ( "blockhash" target-confirmations includeWatchonly )** - -The `listsinceblock` method queries all transactions in blocks since block `blockhash`, or all transactions if `blockhash` is omitted. - -### Arguments - -| Name | Type | Description | -| -------------------- | ------------------------------- | ---------------------------------------------------------------------- | -| "blockhash" | (string, optional) | the block hash from which to list transactions | -| target-confirmations | (numeric, optional) | the confirmations required (must be 1 or more) | -| includeWatchonly | (bool, optional, default=false) | include transactions to watchonly addresses (see also 'importaddress') | - -### Response - -| Name | Type | Description | -| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| "transactions": | | -| "account" | (string) | DEPRECATED the account name associated with the transaction; will be "" for the default account | -| "address" | (string) | the address of the transaction (not present for move transactions -- category = move) | -| "category" | (string) | the transaction category; `send` has negative amounts, `receive` has positive amounts | -| "amount" | (numeric) | the amount of the relevant currency -- negative for the `send` category, and for the `move` category for moves outbound. It is positive for the `receive` category, and for the `move` category for inbound funds. | -| "vout" | (numeric) | the vout value | -| "fee" | (numeric) | the amount of the fee; this value is negative and only available for the `send` category of transactions | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations of the transaction; available for `send` and `receive` category of transactions (number of blocks on top of this transaction's block) | -| "blockhash" | (string) | the block hash containing the transaction; available for the `send` and `receive` categories of transactions | -| "blockindex" | (numeric) | the block index containing the transaction; available for the `send` and `receive` categories of transactions | -| "blocktime" | (numeric) | the block time in seconds since epoch (1 Jan 1970 GMT) | -| "txid" | (string) | the transaction id; available for `send` and `receive` categories of transactions | -| "time" | (numeric) | the transaction time in seconds since epoch (Jan 1 1970 GMT) | -| "timereceived" | (numeric) | the time received in seconds since epoch (Jan 1 1970 GMT); available for `send` and `receive` category of transactions | -| "comment" | (string) | whether a comment is associated with the transaction | -| "to" | (string) | whether a 'to' comment is associated with the transaction | -| "lastblock" | (string) | the hash of the last block | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listsinceblock -``` - - - -Command: - -```bash -./komodo-cli listsinceblock "029f11d80ef9765602235e1bc9727e3eb6ba20839319f761fee920d63401e327" 6 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listsinceblock", "params": ["029f11d80ef9765602235e1bc9727e3eb6ba20839319f761fee920d63401e327", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listtransactions - -**listtransactions ( "account" count from includeWatchonly )** - -The `listtransactions` method returns up to `count` most recent transactions skipping the first `from` transactions for `account`. - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------------------- | ----------------------------------------------------------------- | -| "account" | (string, optional) | DEPRECATED the account name; should be `"*"` | -| count | (numeric, optional, default=10) | the number of transactions to return | -| from | (numeric, optional, default=0) | the number of transactions to skip | -| includeWatchonly | (bool, optional, default=false) | include transactions to watchonly addresses (see `importaddress`) | - -### Response - -| Name | Type | Description | -| ------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "account" | (string) | DEPRECATED the account name associated with the transaction; it will be "" for the default account | -| "address" | (string) | the address of the transaction; not present for move transactions (category = move) | -| "category" | (string) | The transaction category. This property can be `send` | `receive` | `move`. `move` is a local (off blockchain) transaction between accounts -- not associated with an address, transaction id, or block. `send` and `receive` transactions are associated with an address, transaction id, and block details. | -| "amount" | (numeric) | The amount. This value is negative for the `send` category, and for the `move` category for moves outbound. It is positive for the `receive` category and for the `move` category for inbound funds. | -| "vout" | (numeric) | the vout value | -| "fee" | (numeric) | the amount of the fee; this is negative and only available for the `send` category of transactions | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations of the transaction; available for `send` and `receive` category of transactions (number of blocks on top of this transaction's block) | -| "blockhash" | (string) | the block hash containing the transaction; available for the `send` and `receive` categories of transactions | -| "blockindex" | (numeric) | the block index containing the transaction; available for the `send` and `receive` categories of transactions | -| "txid" | (string) | the transaction id; available for the `send` and `receive` categories of transactions | -| "time" | (numeric) | the transaction time in seconds since epoch (midnight Jan 1 1970 GMT) | -| "timereceived" | (numeric) | the time received in seconds since epoch (midnight Jan 1 1970 GMT); available for the `send` and `receive` categories of transactions | -| "comment" | (string) | whether a comment is associated with the transaction | -| "otheraccount" | (string) | for the `move` category of transactions; indicates the account which sent the funds (for receiving funds, positive amounts), or went to (for sending funds, negative amounts) | -| "size" | (numeric) | transaction size in bytes | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listtransactions -``` - - - -Command: - -```bash -./komodo-cli listtransactions "*" 20 100 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listtransactions", "params": ["*", 20, 100] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## listunspent - -**listunspent ( minconf maxconf ["address", ... ] )** - -The `listunspent` method returns an array of unspent transaction outputs, with a range between `minconf` and `maxconf` (inclusive) confirmations. The method can, optionally, filter to only include `txouts` paid to specified addresses. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------------------------ | ----------------------------------- | -| minconf | (numeric, optional, default=1) | the minimum confirmations to filter | -| maxconf | (numeric, optional, default=9999999) | the maximum confirmations to filter | -| "address" | (string) | a series of addresses | - -### Response - -| Name | Type | Description | -| ------------------ | --------- | --------------------------------------------------------------------------- | -| "txid" | (string) | the transaction id | -| "vout" | (numeric) | the vout value | -| "generated" | (boolean) | true if txout is a coinbase transaction output | -| "address" | (string) | the address | -| "account" | (string) | DEPRECATED the associated account, or "" for the default account | -| "scriptPubKey" | (string) | the script key | -| "amount" | (numeric) | the transaction amount | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli listunspent -``` - - - -Command: - -```bash -./komodo-cli listunspent 6 9999999 '["RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu","RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ"]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listunspent", "params": [6, 9999999, ["RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu","RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ"]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## lockunspent - -**lockunspent unlock [{ "txid": "txid", "vout": n }, ... ]** - -The `lockunspent` method locks (unlock = `false`) or unlocks (unlock = `true`) specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection, when spending the relevant coin. The locks are stored in memory only; at runtime a node always starts with zero locked outputs, and the locked output list is always cleared when a node stops or fails. - -::: tip -See the listunspent and listlockunspent calls to determine local transaction state and info. -::: - -### Arguments - -| Name | Type | Description | -| ------ | ------------------- | ------------------------------------------------------------------- | -| unlock | (boolean, required) | whether to unlock (true) or lock (false) the specified transactions | -| "txid" | (string) | the transaction id | -| "vout" | (numeric) | the output number | - -### Response - -| Name | Type | Description | -| ---------- | --------- | ---------------------------------- | -| true/false | (boolean) | whether the command was successful | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli lockunspent false '[{"txid":"d7ba45296c66e16eb61f27a4eef8848c7f5579fe801f277c1b0e074a4f47d6fd","vout":0}]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "lockunspent", "params": [false, [{"txid":"d7ba45296c66e16eb61f27a4eef8848c7f5579fe801f277c1b0e074a4f47d6fd","vout":0}]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## move - -**move "fromaccount" "toaccount" amount ( minconf "comment" )** - -::: tip -DEPRECATED -::: - -The `move` method moves a specified amount from one account in your wallet to another. - -### Arguments - -| Name | Type | Description | -| ------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------- | -| "fromaccount" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | -| "toaccount" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | -| amount | (numeric) | the quantity to move between accounts | -| minconf | (numeric, optional, default=1) | only use funds with at least this many confirmations | -| "comment" | (string, optional) | an optional comment, stored in the wallet only | - -### Response - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| true/false | (boolean) | true if successful | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli move "" "tabby" 0.01 -``` - - - -Command: - -```bash -./komodo-cli move "timotei" "akiko" 0.01 6 "happy birthday!" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko", 0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - - - -## resendwallettransactions - -**resendwallettransactions** - -The `resendwallettransactions` method immediately re-broadcasts unconfirmed wallet transactions to all peers. This method is intended only for testing; the wallet code periodically re-broadcasts automatically. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ---------------- | -------- | ---------------------------------------------- | -| "transaction_id" | (string) | an array of the rebroadcasted transaction id's | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli resendwallettransactions -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "resendwallettransactions", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## sendfrom - -**sendfrom "account" "address" amount ( minconf "comment" "comment-to" )** - -::: tip -DEPRECATED: Use sendtoaddress instead. -::: - -The `sendfrom` method sends an amount from `account` to `address`. - -### Arguments - -| Name | Type | Description | -| ------------ | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | -| "address" | (string, required) | the address to receive funds | -| amount | (numeric, required) | the amount (transaction fee not included) | -| minconf | (numeric, optional, default=1) | only use funds with at least this many confirmations | -| "comment" | (string, optional) | a comment used to store what the transaction is for; this is not part of the transaction, just kept in your wallet | -| "comment-to" | (string, optional) | an optional comment to store the name of the person or organization to which you're sending the transaction; this is not part of the transaction, it is only kept in your wallet | - -### Response - -| Name | Type | Description | -| ---------------- | -------- | ------------------ | -| "transaction_id" | (string) | the transaction id | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli sendfrom "" "RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu" 0.01 -``` - - - -Command: - -```bash -./komodo-cli sendfrom "tabby" "RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu" 0.01 6 "donation" "seans outpost" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendfrom", "params": ["tabby", "RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu", 0.01, 6, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## sendmany - -**sendmany "account" { "address": amount, ... } ( minconf "comment" [ "address", ... ] )** - -The `sendmany` method can send multiple transactions at once. Amounts are double-precision floating point numbers. - -### Arguments - -| Name | Type | Description | -| ----------------------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | -| "amounts" { "address":amount, ... } | ("string":numeric) | the address (string) and the value (double-precision floating numeric) | -| minconf | (numeric, optional, default=1) | only use the balance confirmed at least this many times | -| "comment" | (string, optional) | a comment | -| subtractfeefromamount | (string, optional) | a json array with addresses. The fee will be equally deducted from the amount of each selected address; the recipients will receive less than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. | -| "address" | (string) | subtract fee from this address | - -### Response - -| Name | Type | Description | -| ---------------- | -------- | ---------------------------------------------------------------------------------------------------- | -| "transaction_id" | (string) | the transaction id for the send; only 1 transaction is created regardless of the number of addresses | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli sendmany "" '{"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}' -``` - - - -Command: - -```bash -./komodo-cli sendmany "" '{"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}' 6 "testing" -``` - - - -Command: - -```bash -./komodo-cli sendmany "" '{"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}' 1 "" '["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ","RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu"]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendmany", "params": ["", {"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}, 6, "testing"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## sendtoaddress - -**sendtoaddress "address" amount ( "comment" "comment-to" subtractfeefromamount)** - -The `sendtoaddress` method sends an amount to a given address. The amount is real and is rounded to the nearest 0.00000001. - -### Arguments - -| Name | Type | Description | -| --------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| "komodoaddress" | (string, required) | the receiving address | -| "amount" | (numeric, required) | the amount to send (json requires all decimals values less than 1 begin with the characters '0.') | -| "comment" | (string, optional) | a comment used to store what the transaction is for; this is not part of the transaction, just kept in your wallet | -| "comment-to" | (string, optional) | a comment to store the name of the person or organization to which you're sending the transaction; this is stored in your local wallet file only | -| subtractfeefromamount | (boolean, optional, default=false) | when `true`, the fee will be deducted from the amount being sent | - - - -### Response - -| Name | Type | Description | -| ---------------- | -------- | ------------------ | -| "transaction_id" | (string) | the transaction id | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 -``` - - - -Command: - -```bash -./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 "donation" "seans outpost" -``` - - - -Command: - -```bash -./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 "" "" true -``` - - - -Command: - -```bash -./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 "" "" false "c5727cafd7d6dfc888d4a0596dc58bfafb24859e29f827e1bf1443037d8461fc" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## setaccount - -**setaccount "address" "account"** - -::: tip Notice -DEPRECATED -::: - -The `setaccount` method sets the account associated with the given address. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- | -| "address" | (string, required) | the address to be associated with an account | -| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli setaccount "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "tabby" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setaccount", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ", "tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## setpubkey - -**setpubkey pubkey** - -The `setpubkey` method sets the indicated `pubkey`. This method can be used in place of the [pubkey](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#pubkey) launch parameter, when necessary. - -Visit the section [pubkey](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#pubkey) to understand when it is essential to set a pubkey and the consequences of setting it. - -::: warning -This method works only once per daemon start. It can't be used to change the pubkey that has already been set. -::: - -### Arguments - -| Name | Type | Description | -| ------ | -------- | ------------------ | -| pubkey | (string) | the desired pubkey | - -### Response - -| Name | Type | Description | -| --------- | --------- | ------------------------------------------------- | -| pubkey | (string) | the pubkey | -| ismine | (boolean) | indicates whether the address belongs to the user | -| R-address | (string) | the public address associated with the pubkey | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli setpubkey 0260801166cebdc9be1e3460ba9e4959fb29feee7725f565ffc296fa4636aa706f -``` - - - -You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user myrpuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setpubkey", "params": ["02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## settxfee - -**settxfee amount** - -The `settxfee` method sets the transaction fee per kB. - -### Arguments - -| Name | Type | Description | -| ------ | ------------------- | ---------------------------------------------------------------- | -| amount | (numeric, required) | the transaction fee in COIN/kB rounded to the nearest 0.00000001 | - -### Response - -| Name | Type | Description | -| ---------- | --------- | -------------------------- | -| true/false | (boolean) | returns true if successful | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli settxfee 0.00001 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "settxfee", "params": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## signmessage - -**signmessage "address" "message"** - -The `signmessage` method signs a message via the private key of an address. - -### Arguments - -| Name | Type | Description | -| --------- | ------------------ | -------------------------------------- | -| "address" | (string, required) | the address to use for the private key | -| "message" | (string, required) | the message | - -### Response - -| Name | Type | Description | -| ----------- | -------- | ----------------------------------------------- | -| "signature" | (string) | the signature of the message encoded in base 64 | - -#### :pushpin: Examples - -Create the signature: - -Command: - -```bash -./komodo-cli signmessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "my message" -``` - - - -Verify the signature: - -Command: - -```bash -./komodo-cli verifymessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "H1y0mn/wRv56r1bcfkbQtzjG6XeWSelAsyayBuCwEL9XGXs7ieU55dryt/cFWM9gnRFI7gS01AByuSqRs+o/AZs=" "my message" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signmessage", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## walletlock - -**walletlock** - -::: tip -The `walletlock` method is neither active nor visible in the `help` method until the [encryptwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#encryptwallet) passphrase is set. -::: - -:::tip -This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. -::: - -The `walletlock` method re-locks a wallet that has a passphrase enabled via [encryptwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#encryptwallet). - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli walletlock -``` - - - -## walletpassphrase - -**walletpassphrase "passphrase" (timeout)** - -::: tip -The `walletpassphrase` method is neither active nor visible in the `help` method until the [encryptwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#encryptwallet) passphrase is set. -::: - -:::tip -This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. -::: - -The `walletpassphrase` method unlocks the wallet using the passphrase that was set by the [encryptwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#encryptwallet) method. - -The `timeout` argument can be included to limit the length of time (in seconds) the wallet will remain unlocked. - -### Arguments - -| Name | Type | Description | -| ------------ | ----------------------------- | ---------------------------------------------------------------------- | -| "passphrase" | (string) | the passphrase that was set by the `encryptwallet` method | -| timeout | (number in seconds, optional) | the amount of time for which the wallet should remember the passphrase | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli walletpassphrase -``` - - - -## walletpassphrasechange - -**walletpassphrasechange "oldpassphrase" "newpassphrase"** - -::: tip -The `walletpassphrasechange` method is neither active nor visible in the `help` method until the [encryptwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#encryptwallet) passphrase is set. -::: - -:::tip -This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. -::: - -The `walletpassphrasechange` method changes `"oldpassphrase"` to `"newpassphrase"`. - -### Arguments - -| Name | Type | Description | -| --------------- | -------- | ------------------ | -| "oldpassphrase" | (string) | the old passphrase | -| "newpassphrase" | (string) | the new passphrase | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli walletpassphrasechange "oldpassphrase" "newpassphrase" -``` - - - -## z_exportkey - -**z_exportkey "z_address"** - -The `z_exportkey` method reveals the private z_key corresponding to `z_address`. - -::: tip -See also z_importkey. -::: - -### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | --------------------------------- | -| "z_address" | (string, required) | the z_address for the private key | - -### Response - -| Name | Type | Description | -| ----- | -------- | --------------- | -| "key" | (string) | the private key | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_exportkey "ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_exportkey", "params": ["ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_exportviewingkey - -**z_exportviewingkey "z_address"** - -The `z_exportviewingkey` method reveals the viewing key corresponding to `z_address`. - -::: tip -See also z_importviewingkey. -::: - -### Arguments - -| Name | Type | Description | -| ----------- | ------------------ | --------------------------------- | -| "z_address" | (string, required) | the z_address for the viewing key | - -### Response - -| Name | Type | Description | -| ------ | -------- | --------------- | -| "vkey" | (string) | the viewing key | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_exportviewingkey "ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_exportviewingkey", "params": ["ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_exportwallet - -**z_exportwallet "filename"** - -The `z_exportwallet` method exports all wallet keys, including both t address and z address types, in a human-readable format. Overwriting an existing file is not permitted. - -### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "filename" | (string, required) | the filename, saved to the directory indicated by the [exportdir](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#exportdir) parameter at daemon runtime (required) | - -### Response - -| Name | Type | Description | -| ------ | -------- | ------------------------------------- | -| "path" | (string) | the full path of the destination file | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_exportwallet "test" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_exportwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_getbalance - -**z_getbalance "address" ( minconf )** - -The `z_getbalance` method returns the balance of a t address or z address belonging to the node’s wallet. - -::: warning -CAUTION: If address is a watch-only z address, the returned balance may be larger than the actual balance, -as spends cannot be detected with incoming viewing keys. -::: - -### Arguments - -| Name | Type | Description | -| --------- | ------------------------------ | ------------------------------------------------------------ | -| "address" | (string) | the selected z or t address | -| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | - -### Response - -| Name | Type | Description | -| ------ | --------- | ---------------------------------------------------------------------- | -| amount | (numeric) | the total amount received at this address (in the relevant COIN value) | - -#### :pushpin: Examples - -The total amount received by address "myaddress" at least 5 blocks confirmed - -Command: - -```bash -./komodo-cli z_getbalance "ztfF6SFBfq2qha73dAgsXnL86F8air32CXKxJg8aYtEPJFdLcw4y3zWzBasocnx1V9GLnnFeKnkPvkScjNkQBfWn2kBDmkn" -``` - - - -Command: - -```bash -./komodo-cli z_getbalance "ztfF6SFBfq2qha73dAgsXnL86F8air32CXKxJg8aYtEPJFdLcw4y3zWzBasocnx1V9GLnnFeKnkPvkScjNkQBfWn2kBDmkn" 5 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getbalance", "params": ["ztfF6SFBfq2qha73dAgsXnL86F8air32CXKxJg8aYtEPJFdLcw4y3zWzBasocnx1V9GLnnFeKnkPvkScjNkQBfWn2kBDmkn", 5] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_getnewaddress - -**z_getnewaddress** - -The `z_getnewaddress` method returns a new z_address for receiving payments. - -### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -### Response - -| Name | Type | Description | -| ----------- | -------- | ----------------- | -| "z_address" | (string) | the new z_address | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_getnewaddress -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_getoperationresult - -**z_getoperationresult ([ "operationid", ... ])** - -The `z_getoperationresult` method retrieves the result and status of an operation which has finished, and then removes the operation from memory. - -::: tip -See also z_getoperationstatus. -::: - -### Arguments - -| Name | Type | Description | -| ------------- | ------------------ | ------------------------------------------------------------------------------------------------------- | -| "operationid" | (string, optional) | a list of operation ids to query; if not provided, the method examines all operations known to the node | - -### Response - -| Name | Type | Description | -| ------------------ | ----------------------- | ---------------------------------------------------------- | -| "id" | (string) | the operation id | -| "status" | (string) | the result of the operation; can be `success` | `failed` | `executing` | -| "creation_time" | (numeric) | the creation time, in seconds since epoch (Jan 1 1970 GMT) | -| "result": { ... } | (array of json objects) | -| "txid": | (string) | the transaction id | -| "execution_secs" | (numeric) | the length of time to calculate the transaction | -| "method" | (string) | the name of the method used in the operation | -| "params": { ... } | (json) | -| "fromaddress" | (string) | the address from which funds are drawn | -| "amounts": [ ... ] | (array of json objects) | -| "address" | (string) | the receiving address | -| "amount" | (numeric) | the amount to receive | -| "minconf" | (numeric) | the minimum number of confirmations required | -| "fee" | (numeric) | the transaction fee | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_getoperationresult '["opid-6e581ee5-4e90-4e70-8961-f95d8d28748c"]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getoperationresult", "params": [["opid-6a9da0dd-a950-4d95-848c-d3c18e44be03"]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_getoperationstatus - -**z_getoperationstatus ([ "operationid", ... ])** - -The `z_getoperationstatus` message queries the operation status and any associated result or error data of any `operationid` stored in local memory. The operation will remain in memory (unlike `z_getoperationresult`, which removes the data from the local memory). - -### Arguments - -| Name | Type | Description | -| ------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| "operationid" | (array, optional) | a list of operation ids we are interested in; if an array is not provided, the method examines all operations known to the node | - -### Response - -| Name | Type | Description | -| ------------------ | ----------------------- | ----------------------------------------------------------------------------- | -| "id" | (string) | the operation id | -| "status" | (string) | the status of the operation; can be `success` | `executing` | `failed` | -| "creation_time" | (numeric) | the creation time, in seconds since epoch (Jan 1 1970 GMT) | -| "error" : { ... } | (array of json objects) | -| "code" | (numeric) | the associated error code | -| "message" | (string) | a message to indicate the nature of the error, if such a message is available | -| "method" | (string) | the name of the method used in the operation | -| "params" : { ... } | (array of json objects) | -| "fromaddress" | (string) | the address from which funds are drawn | -| "amounts": [ ... ] | (array of json objects) | -| "address" | (string) | the receiving address | -| "amount" | (numeric) | the amount to receive | -| "minconf" | (numeric) | indicates the required number of mining confirmations | -| "fee" | (numeric) | the fee | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_getoperationstatus -``` - - - -Command: - -```bash -./komodo-cli z_getoperationstatus '["opid-47e12224-8477-4cd4-852d-d8c3ddbc6375"]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getoperationstatus", "params": [["opid-47e12224-8477-4cd4-852d-d8c3ddbc6375"]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_gettotalbalance - -**z_gettotalbalance ( minconf includeWatchonly )** - -The `z_gettotalbalance` method returns the total value of funds, including both transparent and private, stored in the node’s wallet. - -::: warning -CAUTION: If the wallet contains watch-only z addresses the returned private balance may be larger than the actual balance, as spends cannot be detected with incoming viewing keys. -::: - -::: tip -While the interest property is returned for all KMD-based coin daemons, only the main KMD chain utilizes the interest feature. KMD-based Smart Chains will always return a 0.00 interest value. -::: - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------------------- | ------------------------------------------------------------------------------------------ | -| minconf | (numeric, optional, default=1) | only include private and transparent transactions confirmed at least this many times | -| includeWatchonly | (bool, optional, default=false) | also include balance in watchonly addresses (see 'importaddress' and 'z_importviewingkey') | - -### Response - -| Name | Type | Description | -| ------------- | --------- | ------------------------------------------------------- | -| "transparent" | (numeric) | the total balance of transparent funds | -| "interest" | (numeric) | the total balance of unclaimed interest earned | -| "private" | (numeric) | the total balance of private funds | -| "total" | (numeric) | the total balance of both transparent and private funds | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_gettotalbalance -``` - - - -Command: - -```bash -./komodo-cli z_gettotalbalance 5 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_gettotalbalance", "params": [5] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_importkey - -**z_importkey "z_privatekey" ( rescan startHeight )** - -The `z_importkey` method imports `z_privatekey` to your wallet. - -::: tip -This call can take minutes to complete if rescan is true. -::: - -::: tip -The optional parameters are currently not functional with KMD-based blockchains. -::: - -::: tip -See also z_exportkey. -::: - -### Arguments - -| Name | Type | Description | -| -------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| "z_privatekey" | (string, required) | the z_privatekey (see [z_exportkey](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-exportkey)) | -| rescan | (string, optional, default=`"whenkeyisnew"`) | rescan the wallet for transactions; can be `yes` | `no` | `whenkeyisnew` | -| startHeight | (numeric, optional, default=0) | the block height at which to begin the rescan | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_importkey DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK -``` - - - -Command: - -```bash -./komodo-cli z_importkey DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK whenkeyisnew 30000 -``` - - - -Command: - -```bash -./komodo-cli z_importkey DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK yes 20000 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importkey", "params": ["DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK", "no"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_importviewingkey - -**z_importviewingkey "viewing_key" ( rescan startHeight )** - -The `z_importviewingkey` adds a viewing key to your wallet. This method allows you to view the balance in a z address that otherwise does not belong to your wallet. - -::: tip -See also z_exportviewingkey. -::: - -::: tip -This call can take minutes to complete if rescan is true. -::: - -::: tip -The optional parameters are currently not functional for KMD-based blockchains. -::: - -### Arguments - -| Name | Type | Description | -| ------------- | ------------------------------------------ | ------------------------------------------------------------- | -| "viewing_key" | (string, required) | the viewing key | -| rescan | (string, optional, default="whenkeyisnew") | whether to rescan the wallet for transactions; can be `"yes"` | `"no"` | `"whenkeyisnew"` | -| startHeight | (numeric, optional, default=0) | block height to start rescan | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" -``` - - - -Command: - -```bash -./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" no -``` - - - -Command: - -```bash -./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" whenkeyisnew 30000 -``` - - - -Command: - -```bash -./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" yes 20000 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importviewingkey", "params": ["ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja", "no"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_importwallet - -**z_importwallet "filename"** - -The `z_importwallet` method imports t address and z address keys from a wallet export file. - -::: tip -See also z_exportwallet. -::: - -### Arguments - -| Name | Type | Description | -| ---------- | ------------------ | --------------- | -| "filename" | (string, required) | the wallet file | - -### Response - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_importwallet "/mydirectory/nameofbackup" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importwallet", "params": ["/mydirectory/nameofbackup"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_listaddresses - -**z_listaddresses ( includeWatchonly )** - -The `z_listaddresses` method returns the list of z addresses belonging to the wallet. - -::: tip -See also z_importviewingkey. -::: - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------------------- | -------------------------------- | -| includeWatchonly | (bool, optional, default=false) | also include watchonly addresses | - -### Response - -| Name | Type | Description | -| ----------- | -------- | ----------------------------------- | -| "z_address" | (string) | a z address belonging to the wallet | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_listaddresses -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listaddresses", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_listoperationids - -**z_listoperationids** - -The `z_listoperationids` method returns the list of operation ids currently known to the wallet. - -### Arguments - -| Name | Type | Description | -| -------- | ------------------ | ----------------------------------------------------- | -| "status" | (string, optional) | filter result by the operation's state e.g. "success" | - -### Response - -| Name | Type | Description | -| ------------- | -------- | --------------------------------------- | -| "operationid" | (string) | an operation id belonging to the wallet | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_listoperationids -``` - - - -Command: - -```bash -./komodo-cli z_listoperationids "success" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listoperationids", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_listreceivedbyaddress - -**z_listreceivedbyaddress "address" ( minconf )** - -The `z_listreceivedbyaddress` method returns a list of amounts received by a z address belonging to the node’s wallet. - -### Arguments - -| Name | Type | Description | -| ------- | ------------------------------ | ------------------------------------------------------------ | -| address | (string) | the private address. | -| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | - -### Result - -An array of json objects, each having the properties below. - -| Name | Type | Description | -| ------------------ | -------------------------------------------- | ------------------------------------------------------------------------------- | -| txid | (string) | the transaction id | -| amount | (numeric) | the amount of value in the note | -| memo | (string) | hexadecimal string representation of memo field | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | -| jsindex | (sprout) | (numeric, received only by sprout addresses) the joinsplit index | -| jsoutindex | (numeric, received only by sprout addresses) | the output index of the joinsplit | -| outindex | (numeric, sapling) | the output index | -| change | (boolean) | true if the address that received the note is also one of the sending addresses | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_listreceivedbyaddress "zs1wqykmk74mv2ezjscpxsgzrn4fasqwh50tgk0ym64m45c5yw5fjtpkps64gle963veqzuj04872z" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user rpcuser:rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listreceivedbyaddress", "params": ["zs1umhaattx6lna933m9zwfqlmkm2qj49hpa9lnymtj5h5c7cwtd3evfpu29hppprax9cs45fzeyqg"] }' -H 'content-type: text/plain;' http://127.0.0.1:rpcport/ -``` - - - -## z_listunspent - -**z_listunspent ( minconf maxconf includeWatchonly ["zaddr", ...] )** - -The `z_listunspent` method returns an array of unspent shielded notes. - -The method can also filter to only include results that have between `minconf` and `maxconf` (inclusive) confirmations, and also for specified z_addresses (`["zaddr", ...])`. - -When `minconf` is `0` unspent notes with zero confirmations are returned, even though they are not immediately spendable. - -Results are an array of Objects, each of which has: -{txid, jsindex, jsoutindex, confirmations, address, amount, memo} (Sprout) -{txid, outindex, confirmations, address, amount, memo} (Sapling) - -### Arguments - -| Name | Type | Description | -| ---------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -| minconf | (numeric, optional, default=1) | the minimum confirmations to filter | -| maxconf | (numeric, optional, default=9999999) | the maximum confirmations to filter | -| includeWatchonly | (bool, optional, default=false) | whether to also include watchonly addresses (see [z_importviewingkey](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-importviewingkey)) | -| addresses | (array) | a json array of z addresses (both Sprout and Sapling) to act as a filter; duplicate addresses are not allowed | -| address | (string) | a z address | - -### Results - -An array of json objects, each having the properties below. - -| Name | Type | Description | -| ------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| txid | (string) | the transaction id | -| jsindex | (numeric) | the joinsplit index | -| jsoutindex | (numeric, only returned on sprout addresses) | the output index of the joinsplit | -| outindex | (numeric, only returned on sapling addresses) | the output index | -| "confirmations" | (numeric) | a confirmation number that is aware of the dPoW security service | -| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | -| spendable | (boolean) | true if note can be spent by wallet, false if note has zero confirmations, false if address is watchonly | -| address | (string) | the shielded address | -| amount | (numeric) | the amount of value in the note | -| memo | (string) | hexadecimal string representation of memo field | -| change | (boolean) | true if the address that received the note is also one of the sending addresses | - -#### :pushpin: Examples - -Command: - -``` -./komodo-cli z_listunspent -``` - - - -Command: - -```bash -./komodo-cli -ac_name=BEER z_listunspent 1 100 false "[\"zs1wqykmk74mv2ezjscpxsgzrn4fasqwh50tgk0ym64m45c5yw5fjtpkps64gle963veqzuj04872z\"]" -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user rpcuser:rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listunspent", "params": [1, 9999999, false, ["zs1umhaattx6lna933m9zwfqlmkm2qj49hpa9lnymtj5h5c7cwtd3evfpu29hppprax9cs45fzeyqg"] ] }' -H 'content-type: text/plain;' http://127.0.0.1:rpcport/ -``` - - - -## z_mergetoaddress - -**z_mergetoaddress [ "fromaddress", ... ] "toaddress" ( fee ) ( transparent_limit ) ( shielded_limit ) ( memo )** - -::: warning -CAUTION: z_mergetoaddress is DISABLED but can be enabled as an experimental feature. -::: - -The `z_mergetoaddress` method merges multiple utxos and notes into a single utxo or note. The method works for both t addresses and z addresses, both separately and in combination. Coinbase utxos are ignored; use `z_shieldcoinbase` to combine those into a single note. - -This is an asynchronous operation, and utxos selected for merging will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos. - -The number of utxos and notes selected for merging can be limited by the caller. If the transparent limit parameter is set to `0`, the `mempooltxinputlimit` option will determine the number of utxos. Any limit is constrained by the consensus rule defining a maximum transaction size of 100000 bytes. - -### The fromaddresses array - -The following special strings are accepted inside the `fromaddresses` array: - -- `"*"`: Merge both utxos and notes from all addresses belonging to the wallet - -- `"ANY_TADDR"`: Merge utxos from all t addresses belonging to the wallet - -- `"ANY_ZADDR"`: Merge notes from all z addresses belonging to the wallet - -If a special string is given, any given addresses of that type will be ignored - -### Arguments - -| Name | Type | Description | -| ----------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| fromaddresses | (string, required) | -| "address" | (string) | can be a t address or a z address | -| "toaddress" | (string, required) | the t address or z address to receive the combined utxo | -| fee | (numeric, optional, default=0.0001) | the fee amount to attach to this transaction | -| transparent_limit | (numeric, optional, default=50) | limit on the maximum number of transparent utxos to merge; you may set this value to 0 to use the node option [mempooltxinputlimit](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#mempooltxinputlimit) | -| shielded_limit | (numeric, optional, default=10) | limit on the maximum number of hidden notes to merge; you may set this value to 0 to merge as many as will fit in the transaction | -| "memo" | (string, optional) | encoded as hex; when `toaddress` is a z address, this value will be stored in the memo field of the new note | - -### Response - -| Name | Type | Description | -| --------------------------- | --------- | ----------------------------------------------------------------------------------- | -| "remainingUTXOs" | (numeric) | the number of utxos still available for merging | -| "remainingTransparentValue" | (numeric) | the value of utxos still available for merging | -| "remainingNotes" | (numeric) | the number of notes still available for merging | -| "remainingShieldedValue" | (numeric) | the value of notes still available for merging | -| "mergingUTXOs" | (numeric) | the number of utxos being merged | -| "mergingTransparentValue" | (numeric) | the value of utxos being merged | -| "mergingNotes" | (numeric) | the number of notes being merged | -| "mergingShieldedValue" | (numeric) | the value of notes being merged | -| "opid" | (string) | an operationid to pass to `z_getoperationstatus` to get the result of the operation | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_mergetoaddress '["R1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"]' ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_mergetoaddress", "params": [["R1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"], "ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_sendmany - -**z_sendmany "fromaddress" [ { "address": ..., "amount": ... }, ... ] \( minconf ) ( fee )** - -The `z_sendmany` method sends one or more transactions at once, and allows for sending transactions of types `t --> t`, `t --> z`, `z --> z`, `z --> t`. It is the principle method for dealing with shielded `z` transactions in the Komodo ecosystem. - -The `amount` values are double-precision floating point numbers. Change from a t address flows to a new t address address, while change from z address returns to itself. When sending coinbase utxos to a z address, change is not allowed. The entire value of the utxo(s) must be consumed. Currently, the maximum number of z address outputs is 54 due to transaction-size limits. - -### Arguments - -| Name | Type | Description | -| ------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ | -| "fromaddress" | (string, required) | the sending t address or z address | -| "amounts" | (array of json objects) | -| "address" | (string, required) | the receiving address; can be a t address or z address | -| "amount" | (numeric, required) | the numeric amount | -| "memo" | (string, optional) | if the address is a z address, this property accepts raw data represented in hexadecimal string format | -| minconf | (numeric, optional, default=1) | only use funds confirmed at least this many times | -| fee | (numeric, optional, default=0.0001) | the fee amount to attach to this transaction | - -### Response - -| Name | Type | Description | -| ------------- | -------- | --------------------------------------------------------------------------------- | -| "operationid" | (string) | an operationid to pass to z_getoperationstatus to get the result of the operation | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_sendmany "RUX5vGkxJCKBPGm8b97VUumt2aHkuCjp8e" '[{"address":"RVEsww91UBdUNGyCC1GjDVuvJShEei2kj4","amount":0.01}]' -``` - - - -Command: - -```bash -./komodo-cli z_sendmany "RCpMUZwxc3pWsgip5aj3Sy1cKkh86P3Tns" '[{"address":"ztci8RzNSo2pdiDpAeHpz9Rp91hq12Mn7zcFfBR8Jjs2ydZUCTw8rLZzkVP888M4vGezpZVfsTR8orgxYK3N8gdgbBzakx3","amount":0.01}]' -``` - - - -Command: - -```bash -./komodo-cli z_sendmany "ztci8RzNSo2pdiDpAeHpz9Rp91hq12Mn7zcFfBR8Jjs2ydZUCTw8rLZzkVP888M4vGezpZVfsTR8orgxYK3N8gdgbBzakx3" '[{"address":"ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP","amount":0.0099}]' -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_sendmany", "params": ["RCpMUZwxc3pWsgip5aj3Sy1cKkh86P3Tns", [{"address": "ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf" ,"amount": 0.01}]] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## z_shieldcoinbase - -**z_shieldcoinbase "fromaddress" "tozaddress" ( fee ) ( limit )** - -The `z_shieldcoinbase` method shields transparent coinbase funds by sending the funds to a shielded z address. This is an asynchronous operation and utxos selected for shielding will be locked. If there is an error, they are unlocked. - -The RPC call `listlockunspent` can be used to return a list of locked utxos. The number of coinbase utxos selected for shielding can be limited by the caller. If the limit parameter is set to zero, the [mempooltxinputlimit](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#mempooltxinputlimit) option will determine the number of uxtos. Any limit is constrained by the consensus rule defining a maximum transaction size of 100000 bytes. - -### Arguments - -| Name | Type | Description | -| ------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------- | -| "fromaddress" | (string, required) | the address is a t address or `"*"` for all t address belonging to the wallet | -| "toaddress" | (string, required) | the address is a z address | -| fee | (numeric, optional, default=0.0001) | the fee amount to attach to this transaction | -| limit | (numeric, optional, default=50) | limit on the maximum number of utxos to shield; set to `0` to use node option `mempooltxinputlimit` | - -### Response - -| Name | Type | Description | -| ---------------- | --------- | --------------------------------------------------------------------------------- | -| "remainingUTXOs" | (numeric) | the number of coinbase utxos still available for shielding | -| "remainingValue" | (numeric) | the value of coinbase utxos still available for shielding | -| "shieldingUTXOs" | (numeric) | the number of coinbase utxos being shielded | -| "shieldingValue" | (numeric) | the value of coinbase utxos being shielded | -| "opid" | (string) | an operationid to pass to z_getoperationstatus to get the result of the operation | - -#### :pushpin: Examples - -Command: - -```bash -./komodo-cli z_shieldcoinbase "RXN2rxidK4cwzRL44UTnWvQjjvLdoMmCpU" "ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP" -``` - - - -Command: - -```bash -./komodo-cli z_shieldcoinbase "REyaj53EB2nwUnsmVyn8JHCcquKf1zYkEP" "ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP" 0.0001 50 -``` - - - -You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. - -Command: - -```bash -curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_shieldcoinbase", "params": ["RWRSfEYcfLv3yy9mhAuKHQTMCs9fArpPiH", "ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - - - -## zcbenchmark - -**zcbenchmark benchmarktype samplecount** - -The `zcbenchmark` method runs a benchmark of the selected `benchmarktype`. This benchmark is calculated `samplecount` times. - -When finished, the method returns the running times of each sample. - -### Arguments - -| Name | Type | Description | -| --------------- | ------------------ | ----------------------------- | -| "benchmarktype" | (string, required) | the type of the benchmark | -| "samplecount" | (numeric) | the number of samples to take | - -### Response - -| Name | Type | Description | -| ------------- | --------- | ---------------------------------------------------- | -| "runningtime" | (numeric) | the time it took to run the selected `benchmarktype` | - -Output: - -```json -[ - { - "runningtime": runningtime - }, - { - "runningtime": runningtime - } - ... -] -``` - -## zcrawjoinsplit - -**zcrawjoinsplit rawtx inputs outputs vpub_old vpub_new** - -::: warning -DEPRECATED. -::: - -- inputs: a JSON object mapping {note: zcsecretkey, ...} -- outputs: a JSON object mapping {zcaddr: value, ...} - -Splices a joinsplit into a raw transaction. Inputs are unilaterally confidential. -Outputs are confidential between sender/receiver. The vpub_old and -vpub_new values are globally public and move transparent value into -or out of the confidential value store, respectively. - -Note: The caller is responsible for delivering the output enc1 and -enc2 to the appropriate recipients, as well as signing rawtxout and -ensuring it is mined. (A future RPC call will deliver the confidential -payments in-band on the blockchain.) - -Output: - -```json -{ - "encryptednote1": enc1, - "encryptednote2": enc2, - "rawtxn": rawtxout -} -``` - -## zcrawkeygen - -**zcrawkeygen** - -::: warning -DEPRECATED. -::: - -the `zcrawkeygen` method generates a zcaddr which can send and receive confidential values. - -Output: - -```json -{ - "zcaddress": zcaddr, - "zcsecretkey": zcsecretkey, - "zcviewingkey": zcviewingkey -} -``` - -## zcrawreceive zcsecretkey encryptednote - -**zcrawreceive zcsecretkey encryptednote** - -::: warning -DEPRECATED. -::: - -Decrypts `encryptednote` and checks if the coin commitments -are in the blockchain as indicated by the "exists" result. - -Output: - -```json -{ - "amount": value, - "note": noteplaintext, - "exists": exists -} -``` - -## zcsamplejoinsplit - -Perform a joinsplit and return the JSDescription. diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/README.md b/docs/basic-docs/smart-chains/smart-chain-setup/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.md b/docs/basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.md deleted file mode 100644 index 52e5b210b..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.md +++ /dev/null @@ -1,630 +0,0 @@ -# Common Runtime Parameters - -## Introduction - -The following is an abbreviated list of runtime parameters and settings that can be initiated in a [Smart Chain's .conf file.](../../../basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.html#location-of-conf-file) - -These commands largely derive from the upstream Bitcoin software, `bitcoind`. - -Komodo is a fork of Zcash, and Zcash is a privacy-centric fork of Bitcoin. Therefore, essentially all runtime parameters and API commands available in both Bitcoin and Zcash are available in Komodo. - -To see additional Bitcoin-based runtime parameters not included here, please visit [the relevant Bitcoin wiki page](https://en.bitcoin.it/wiki/Running_Bitcoin). - -## addnode - -`addnode` tells the daemon which nodes are trusted to act as seed nodes. After connecting to a node via `addnode`, the trusted node will send your node the list of all nodes that it is connected to, and your node will then connect to these additional nodes until [the max limit](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#maxconnections) is reached. - -This contrasts from the [connect](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#connect) runtime parameter, as the latter does not attempt to connect your node to additional nodes. - -If you are behind a firewall or are having issues connecting to the network, `addnode` is a stronger option. - -On the other hand, if you want to connect only to designated and trusted nodes, `connect` is a stronger option. - -If you run multiple nodes that are connected via a LAN, it is not necessary for each node to open multiple connections. Instead, use `connect` to connect all to one primary node, and then use `addnode` on the primary node to connect to the network. - -The p2p port must not be blocked by a firewall. If the computers do not have public IP addresses, you will need to port-forward the p2p port on both computers and append the forwarded port to the IP. - -#### :pushpin: Examples: - -`./komodod -ac_name=EXAMPLECHAIN -ac_supply=1000000 -addnode=:8096` - -Using addnode as a default value in the Smart Chain's `.conf` file: - -```bash -addnode=69.164.218.197 -``` - -## addressindex - -`addressindex` instructs a Smart Chain to maintain an index of all addresses and balances. - -We recommend that the user [manually delete the blockchain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) before initiating this parameter. - -`addressindex` is enabled by default on any Smart Chain that utilizes Antara. - -::: tip -The reindex parameter is not a viable alternative method for re-syncing the Smart Chain in this circumstance. -::: - -#### :pushpin: Examples: - -Using `addressindex` as a runtime parameter: - -```bash -komodod -addressindex=1 -``` - -Using `addressindex` as a default value in the Smart Chain's `.conf` file: - -```bash -addressindex=1 -``` - -## bantime - -`bantime` sets the default number of seconds for a ban initiated during the daemon's session. The default is 86400. - -#### :pushpin: Examples: - -Using bantime as a runtime parameter: - -```bash -komodod -bantime=100000 -``` - -Using bantime as a default value in the Smart Chain's `.conf` file: - -```bash -bantime=100000 -``` - -## bind - -`bind` instructs the Smart Chain daemon to bind to a given address and always listen on it. - -Use `[host]:port` notation for IPv6. - -#### :pushpin: Examples: - -Using bind as a runtime parameter: - -```bash -komodod -bind=127.0.0.1:9050 -``` - -Using bind as a default value in the Smart Chain's `.conf` file: - -```bash -bind=127.0.0.1:9050 -``` - -## connect - -`connect` connects the `komodod` server to a trusted peer node, but not to request or add any additional nodes. - -Please refer to the [addnode](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addnode) parameter entry for more information. - -#### :pushpin: Examples: - -Using connect as a default value in the Smart Chain's `.conf` file: - -```bash -connect=69.164.218.197 -``` - -## conf - -`conf` allows the user to indicate an alternative configuration file for the Smart Chain daemon. The `conf` runtime parameter requires an absolute path. For example, `/home/user/mydirectory/MYCOIN/MYCOIN.conf`. Once the `conf` parameter is activated, the default configuration file is otherwise ignored. - -#### :pushpin: Examples: - -Using `conf` as a runtime parameter: - -```bash -komodod -conf=/home/username/coinConfs/DEX.conf -``` - -## datadir - -`datadir` allows the user to indicate an alternative blockchain-data directory for the Smart Chain daemon. The `datadir` parameter requires an absolute path. For example, `home/user/mydirectory/MYCOIN/MYCOINDATA`. Once this parameter is activated, the daemon will ignore the default data directory. - -The name of the alternative directory must match the value provided to the [ac_name](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-name) parameter. - -#### :pushpin: Examples: - -Using `datadir` as a runtime parameter: - -```bash -komodod -datadir=/home/username/coinData/DEX -``` - -## donation - -`donation` donates all user rewards to a specific address. This value must be set to a 33 byte pubkey. - -#### :pushpin: Examples: - -Using donation as a default value in the Smart Chain's `.conf` file: - -```bash -donation=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 -``` - -## exchange - -`exchange` forfeits all user rewards to miners. Set this to explicitly not claim user rewards. - -#### :pushpin: Examples: - -Using exchange as a default value in the Smart Chain's `.conf` file: - -```bash -exchange=1 -``` - -## exportdir - -`exportdir` tells the Smart Chain daemon where to store the wallet backup files created through the [backupwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#backupwallet) and [dumpwallet](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#dumpwallet) calls. - -#### :pushpin: Examples: - -Using exportdir as a default value in the Smart Chain's `.conf` file: - -```bash -exportdir=/home/myusername/mydirectory -``` - -## gen - -`gen` instructs the daemon to attempt to generate new blocks, and thereby mine new coins. - -See also [setgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#setgenerate). - -::: warning -This parameter should be avoided. Instead, start the daemon without the `-gen` parameter. Once the Smart Chain is launched, wait until the blockchain is synced to the current block and then execute the [setgenerate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#setgenerate) method. The sync status of the blockchain can be found by executing the [getinfo](../../../basic-docs/smart-chains/smart-chain-api/control.html#getinfo) method and comparing the `blocks` and `longestchain` properties. -::: - -::: tip - -- If the `genproclimit` property is not specified after the `gen` option, the daemon mines using 1 thread. -- To mine using all available threads, use: `-genproclimit=-1` - ::: - -::: tip -`gen=0` in the .conf file on an Smart Chain where [ac_staked](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-staked) is enabled sets the daemon to stake using all available coins -::: - -#### :pushpin: Examples: - -Using gen as a runtime parameter to mine using 4 threads: - -```bash -./komodod -gen -genproclimit=4 -``` - -## genproclimit - -`genproclimit` sets the number of threads to be used for mining. To use all the available processors, use the value `-1`. - -::: tip -Setting `genproclimit=0` instructs the daemon to stake (if possible) using all available coins. -::: - -#### :pushpin: Examples: - -Using genproclimit as a default value in the Smart Chain's `.conf` file, to mine using 2 threads: - -```bash -genproclimit=2 -``` - -## keypool - -`keypool` instructs the daemon to pre-generate a certain number of public/private key pairs. This can facilitate `wallet.dat` backups being valid for both prior transactions and several dozen future transactions. - -#### :pushpin: Examples: - -Using keypool as a default value in the Smart Chain's `.conf` file: - -```bash -keypool=100 -``` - -## listen - -`listen` instructs the daemon to listen for RPC calls on the network. It is enabled by default, except when `connect` is used. - -#### :pushpin: Examples: - -Using listen as a runtime parameter: - -```bash -komodod -listen=1 -``` - -Using listen as a default value in the Smart Chain's `.conf` file: - -```bash -listen=1 -``` - -## maxconnections - -`maxconnections` sets the maximum number of inbound and outbound connections. - -#### :pushpin: Examples: - -Using maxconnections as a runtime parameter: - -```bash -komodod -maxconnections=NUMBER -``` - -Using maxconnections as a default value in the Smart Chain's `.conf` file: - -```bash -maxconnections=NUMBER -``` - -## mempooltxinputlimit - -::: tip -DEPRECATED -::: - -`mempooltxinputlimit` is a runtime parameter inherited from Zcash. The functionality it facilitates is now enabled by default, and therefore the parameter is deprecated. Please see [the Zcash documentation for more information](https://blog.z.cash/new-release-1-1-0/). - -## port - -`port` tells the daemon to listen for p2p connections on the indicated TCP port, overwriting the default. The default p2pport for the Komodo(KMD) blockchain is 7770. The default p2p port of a Smart Chain is solely dependant on the `-ac_` [Antara customization parameters](../../antara/antara-setup/antara-customizations.html) and values used to launch it. - -#### :pushpin: Examples: - -Using port as a default value in the Smart Chain's `.conf` file: - -```bash -port=8231 -``` - -## proxy - -`proxy` allows the user to connect via a `SOCKS5` proxy. - -#### :pushpin: Examples: - -Using proxy as a runtime parameter: - -```bash -komodod -proxy=127.0.0.1:9050 -``` - -Using proxy as a default value in the Smart Chain's `.conf` file: - -```bash -proxy=127.0.0.1:9050 -``` - -## pubkey - -`pubkey` sets an address to use as a change address for all transactions. This value must be set to a 33 byte pubkey. All mined/staked coins will also be sent to this address. We recommend that the user ensure they own the corresponding `privkey` of their chosen `pubkey`, lest their funds be sent to a `pubkey` they do not own or control. - -The `pubkey` parameter is required for all Antara-enabled chains. All Antara transactions will utilize the `pubkey` as an integral property. - -#### :pushpin: Examples: - -Using pubkey as a default value in the Smart Chain's `.conf` file: - -```bash -pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 -``` - -Using pubkey as a startup parameter: - -```bash --pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 -``` - -## regtest - -`regtest` instructs the Smart Chain daemon to run a regression test network. Typically, the user will create a disposable Smart Chain for these purposes. The [ac_supply](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-supply) parameter is not required in this instance. - -(A regression-test network is a useful tool for rapid trial and testing. [Please reach out to us](https://komodoplatform.com/discord) if you are curious to implement this tool in your workflow and are unfamiliar with the process.) - -#### :pushpin: Examples: - -Using regtest as a runtime parameter: - -```bash -komodod -ac_name=TEST -regtest -``` - -Using regtest as a default value in the Smart Chain's `.conf` file: - -```bash -regtest=0 -``` - -## reindex - -`reindex` instructs the daemon to re-index the currently synced blockchain data. - -::: tip -Depending on the size and state of the chain you are re-indexing, this parameter may prolong the daemon launch time. -::: - -#### :pushpin: Examples: - -Using reindex as a runtime parameter: - -```bash -komodod -reindex -``` - -## rewind - -`rewind` rewinds the chain to a specific block height. This is useful for creating snapshots at a given block height. - -#### :pushpin: Examples: - -Using rewind as a runtime parameter: - -```bash -komodod -rewind=777777 -``` - -## rpcallowip - -`rpcallowip` tells the daemon which ip addresses are acceptable for receiving rpc commands. - -By default, only rpc connections from localhost are allowed. - -Specify as many `rpcallowip=` settings as you like to allow connections from other hosts, either as a single IPv4/IPv6 or with a subnet specification. - -::: warning - -Opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED. The rpcpassword is transmitted over the network unencrypted. Also note that anyone that can authenticate on the RPC port can steal your keys and take over the server. [For more information click here](https://github.com/zcash/zcash/issues/1497). - -::: - -#### :pushpin: Examples: - -Using rpcallowip as a default value in the Smart Chain's `.conf` file: - -```bash - rpcallowip=10.1.1.34/255.255.255.0 - rpcallowip=1.2.3.4/24 - rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96 -``` - -## rpcbind - -`rpcbind` instructs the daemon to listen for json-rpc connections. - -Use `[host]:port` notation for IPv6. - -This option can be specified multiple times. - -The default setting is to bind to all interfaces. - -#### :pushpin: Examples: - -Using rpcbind as a runtime parameter: - -```bash -komodod -rpcbind=127.0.0.1:9704 -``` - -Using rpcbind as a default value in the Smart Chain's `.conf` file: - -```bash -rpcbind=127.0.0.1:9704 -``` - -## rpcclienttimeout - -`rpcclienttimeout` indicates the number of seconds to wait for an rpc command to complete before killing the process. - -#### :pushpin: Examples: - -Using rpcclienttimeout as a runtime parameter: - -```bash -komodod -rpcclienttimeout=SECONDS -``` - -Using rpcclienttimeout as a default value in the Smart Chain's `.conf` file: - -```bash -rpcclientttimeout=SECONDS -``` - -## rpcconnect - -`rpcconnect` allows the user to connect to `komodod` and send RPC commands from a host. By default, it is set to localhost. - -::: warning -We DO NOT RECOMMEND that the average user set this value to anything other than the localhost, as it can grant access to a foreign party, who are then able to take control over komodod and all funds in your wallet.dat file. -::: - -#### :pushpin: Examples: - -Using rpcconnect as a default value in the Smart Chain's `.conf` file: - -```bash -rpcconnect=127.0.0.1 -``` - -## rpcport - -`rpcport` tells the daemon to listen for RPC connections on the indicated TCP port overwriting the default. The default rpcport for the Komodo(KMD) blockchain is 7771. The default rpcport of a Smart Chain is solely dependant on the `-ac_` [Antara customization parameters](../../antara/antara-setup/antara-customizations.html) and values used to launch it. - -#### :pushpin: Examples: - -Using rpcport as a default value in the Smart Chain's `.conf` file: - -```bash -rpcport=8232 -``` - -## sendfreetransactions - -`sendfreetransactions` instructs the daemon to send transactions as zero-fee transactions if possible. The default value is 0. - -#### :pushpin: Examples: - -Using sendfreetransactions as a default value in the Smart Chain's `.conf` file: - -```bash -sendfreetransactions=0 -``` - -## server - -`server` instructs the daemon to accept json-rpc commands. It is enabled by default. - -#### :pushpin: Examples: - -Using server as a runtime parameter: - -```bash -komodod -server=1 -``` - -Using server as a default value in the Smart Chain's `.conf` file: - -```bash -server=1 -``` - -## spentindex - -`spentindex` instructs a Smart Chain to maintain a full index of all spent transactions (txids). - -We recommend that the user [manually delete the blockchain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) before initiating this parameter. - -`spentindex` is enabled by default on any Smart Chain that utilizes Antara. - -::: tip -The reindex parameter is not a viable alternative method for re-syncing the blockchain in this circumstance. -::: - -#### :pushpin: Examples: - -Using spentindex as a runtime parameter: - -```bash -komodod -spentindex=1 -``` - -Using spentindex as a default value in the Smart Chain's `.conf` file: - -```bash -spentindex=1 -``` - -## stopat - -`stopat` stops the chain at a specific block height. This is useful for creating snapshots at a given block height. - -#### :pushpin: Examples: - -Using stopat as a runtime parameter: - -```bash -komodod -stopat=1000000 -``` - - - -## testnode - -The `testnode` parameter allows the daemon to mine without being connected to any other peers. This is useful for debugging and testing. - -If this parameter is not set, the daemon will not attempt to mine blocks unless it has at least one other peer. - -#### :pushpin: Examples: - -Using testnode as a runtime parameter: - -```bash -./komodod -testnode=1 -``` - -Using testnode as a default value in the Smart Chain's `.conf` file: - -```bash -testnode=1 -``` - -## timestampindex - -`timestampindex` instructs a Smart Chain to maintain a timestamp index for all block hashes. - -We recommend that the user [manually delete the blockchain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) before initiating this parameter. - -::: tip -The reindex parameter is not a viable alternative method for re-syncing the Smart Chain in this circumstance. -::: - -#### :pushpin: Examples: - -Using timestampindex as a runtime parameter: - -```bash -./komodod -timestampindex=1 -``` - -Using timestampindex as a default value in the Smart Chain's `.conf` file: - -```bash -timestampindex=1 -``` - -## txindex - -`txindex` instructs a Smart Chain to track every transaction made on the relevant blockchain. - -`txindex` is enabled by default on all Smart Chains, and is utilized in delayed Proof of Work (dPoW), privacy modules, and Antara. - -::: danger Warning! -Disabling `txindex` will cause the default Smart Chain daemon to malfunction. -::: - -## whitebind - -`whitelist` binds the daemon to a given address and whitelists peers connecting to it. - -Use `[host]:port` notation for IPv6 - -#### :pushpin: Examples: - -Using whitebind as a runtime parameter: - -```bash -komodod -whitebind=127.0.0.1:9050 -``` - -Using whitebind as a default value in the Smart Chain's `.conf` file: - -```bash -whitebind=127.0.0.1:9050 -``` diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/ecosystem-launch-parameters.md b/docs/basic-docs/smart-chains/smart-chain-setup/ecosystem-launch-parameters.md deleted file mode 100644 index 3d1ce952e..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/ecosystem-launch-parameters.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ecosystem Launch Parameters - -A list of launch parameters for all the Smart Chains in the Komodo ecosystem that receive the dPoW security service can be found at this link: [https://github.com/KomodoPlatform/dPoW/blob/master/iguana/assetchains.old](https://github.com/KomodoPlatform/dPoW/blob/master/iguana/assetchains.old) diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/installing-from-source.md b/docs/basic-docs/smart-chains/smart-chain-setup/installing-from-source.md deleted file mode 100644 index 01e12bf2c..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/installing-from-source.md +++ /dev/null @@ -1,525 +0,0 @@ -# Installing Smart Chain Software From Source Code - -The basic Komodo software package includes two applications. - -##### komodod - -The `komodod` software application is the Smart Chain daemon that powers all Komodo blockchains. - -##### komodo-cli - -The `komodo-cli` software application allows a developer to execute API calls to `komodod` via the command line. - -##### Both are Installed Automatically - -Both of these software applications are installed in the `~/komodo/src/` directory as a part of any of the following installation procedures. - -### The Two Methods to Install Smart Chain Software - -There are two methods available to install Smart Chain software. - -##### Pre-compiled Binaries - -You can download and unzip our pre-compiled binaries. This is the simplest method and requires no installation procedure. - -For more information on this method, please see the link below. - -[Link to simple installations section for pre-compiled executables](../../../basic-docs/start-here/about-komodo-platform/simple-installations.html) - -##### Building Smart Chain Software From Source - -You may also build Smart Chain software from source. - -This is not required, but building from source is considered the best practice in a production environment, as this allows you to instantly update to the latest patches and upgrades. - -- [Linux](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#linux) -- [MacOS](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#macos) -- [Windows](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#windows) - -## Linux - -#### Requirements - -- Linux (easiest with a Debian-based distribution, such as Ubuntu) - - - For Ubuntu, we recommend using only the 16.04 or 18.04 releases - -- 64-bit Processor - -- Minimum 32GB HDD or SDD storage space - -- Minimum 4GB of free RAM (8GB+ recommended) - -#### Get Started - -Verify that your system is up to date. - -```bash -sudo apt-get update -sudo apt-get upgrade -y -``` - -#### Install the dependency packages - -```bash -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git zlib1g-dev wget curl bsdmainutils automake cmake clang ntp ntpdate nano -y -``` - -This action takes some time, depending on your Internet connection. Let the process run in the background. - -Once completed, follow the steps below to install Komodo. - -::: tip Note -At some point during the installation process, you may see a warning, "libgmp headers missing". This can safely be ignored. -::: - -#### Clone the Komodo Repository - -```bash -cd ~ -git clone https://github.com/KomodoPlatform/komodo -cd komodo -``` - -#### Fetch the Zcash Parameters - -```bash -./zcutil/fetch-params.sh -``` - -#### Build the Komodo Daemon - -In the command below, the `-j$(nproc)` parameter instructs the script to utilize all available processors in your hardware. - -Alternatively, you may instruct the script to use only a set number of processors. For example, `-j8` instructs the script to use `8` processors, `-j4` instructs the script to use `4` processors, etc. - -```bash -./zcutil/build.sh -j$(nproc) -``` - -This script can take some time. - -#### Create the komodo.conf File - -```bash -cd ~ -mkdir .komodo -cd .komodo -nano komodo.conf -``` - -With the `komodo.conf` file open in the Nano text editor, add the following lines. - -(Create your own `rpcuser` username and `rpcpassword` password.) - -```bash -rpcuser=usernameChangeItToSomethingSecure -rpcpassword=passwordChangeItToSomethingSecure -txindex=1 -bind=127.0.0.1 -rpcbind=127.0.0.1 -addnode=78.47.196.146 -addnode=5.9.102.210 -addnode=178.63.69.164 -addnode=88.198.65.74 -addnode=5.9.122.241 -addnode=144.76.94.38 -addnode=148.251.44.16 -``` - -Press `CTRL+O` to save the changes. - -Press `CTRL+X` to exit the Nano editor. - -Start the `komodod` daemon. It will automatically begin syncing with the network. - -```bash -cd ~ -cd komodo/src -./komodod & -``` - -The `&` parameter in the last instruction above instructs the terminal to continue allowing you to enter commands within this terminal shell. - -#### (Optional) Tail the komodod Daemon - -Enter the following command to "tail" the `komodod` daemon. The `tail` command allows you to view the `debug.log` file updates in real time. - -```bash -tail -f ~/.komodo/debug.log -``` - -#### Test Your Daemon with komodo-cli - -Ensure that your current working directory is in the default `src` directory. - -```bash -cd ~/komodo/src/ -``` - -You may now use the `komodo-cli` software to send API (RPC) calls to the `komodod` daemon. - -For example: - -```bash -./komodo-cli getinfo -``` - -This command returns the latest state information about the KMD blockchain and your `wallet.dat` file. - -```json -{ - "version": 1000550, - "protocolversion": 170002, - "KMDversion": "0.1.0", - "notarized": 186670, - "notarizedhash": "000000308845da840ab9af6c1e09dc02f3118683df065b5ec00b05c9bd58cdae", - "notarizedtxid": "6723a10ef4fceab230d4245305d1ed2a916e435abb83269c20daad9bbefd3f0e", - "notarizedtxid_height": "mempool", - "notarized_confirms": 0, - "walletversion": 60000, - "balance": 0, - "interest": 0, - "blocks": 186773, - "longestchain": 308867, - "timeoffset": 0, - "tiptime": 1486411069, - "connections": 8, - "proxy": "", - "difficulty": 1624278.6287953, - "testnet": false, - "keypoololdest": 1482746526, - "keypoolsize": 101, - "paytxfee": 0.0, - "relayfee": 0.00001, - "errors": "" -} -``` - -When the `blocks` and `longestchain` values are equal to each other, your machine is in sync with the network. - -#### Backup your wallet - -We can not stress enough the importance of backing up your `wallet.dat` file. - -On Linux, the file is located here: `~/.komodo/wallet.dat` - -One method to backup this file is to archive a copy of the file. - -```bash -# Copy the file -cp -av ~/.komodo/wallet.dat ~/wallet.dat - -# Rename file -mv ~/wallet.dat ~/2019-05-17-wallet_backup.dat - -# To make archive -tar -czvf ~/2019-05-17-wallet_backup.dat.tgz ~/2019-05-17-wallet_backup.dat - -# Move the final file to a secure location -``` - -## MacOS - -### Requirements - -- OSX (version > 10.11) -- Minimum 4GB of free RAM (8GB+ recommended) - -##### Ensure Command Line Tools are Installed. - -Issue the following command in a terminal. - -```bash -xcode-select --install -``` - -##### Ensure brew is Installed - -We use the software `brew` to install dependencies. If you have the latest version of `brew` installed already, you may skip this step. - -```bash -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -``` - -##### Use brew to Install Dependencies - -Execute each command separately - -```bash -brew update -brew upgrade -brew tap discoteq/discoteq; brew install flock -brew install autoconf autogen automake -brew install gcc@8 -brew install binutils -brew install protobuf -brew install coreutils -brew install wget -``` - -#### Clone the Komodo repository - -```bash -git clone https://github.com/KomodoPlatform/komodo -``` - -#### Fetch the Zcash Parameters: - -```bash -cd komodo -./zcutil/fetch-params.sh -``` - -#### Compile Komodo - -```bash -git checkout dev -./zcutil/build-mac.sh -j8 -``` - -This can take some time. - -While this process proceeds, open a new terminal for the next step. - -#### Create Configuration File - -Create the configuration file in the following directory: - -```bash -~/Library/Application\ Support/Komodo -``` - -If the directory does not yet exist, create the directory. - -```bash -mkdir ~/Library/Application\ Support/Komodo -``` - -Create the configuration file by entering the following commands in the terminal. Execute each line separately. - -```bash -echo "rpcuser=komodouser" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "txindex=1" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "bind=127.0.0.1" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "rpcbind=127.0.0.1" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=5.9.102.210" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=78.47.196.146" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=178.63.69.164" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=88.198.65.74" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=5.9.122.241" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=144.76.94.38" >> ~/Library/Application\ Support/Komodo/komodo.conf -echo "addnode=148.251.44.16" >> ~/Library/Application\ Support/Komodo/komodo.conf -``` - -#### Run Komodo - -Once all processes are complete, run the `komodod` daemon. - -```bash -cd ~/komodo/src -./komodod & -``` - -#### Track the Syncing Progress - -##### Using the tail Command - -```bash -tail -f ~/Library/Application\ Support/Komodo/debug.log -``` - -##### Using komodo-cli and getinfo - -```bash -cd ~/komodo/src -./komodo-cli getinfo -``` - -When the returned properties of `blocks` and `longestchain` are equal to each other, the daemon is finished syncing with the network. - -#### Backup Your Wallet - -We can not stress enough the importance of backing up your `wallet.dat` file. - -On MacOS, the file is located here: `~/Library/Application\ Support/Komodo/wallet.dat` - -One method to backup this file is to archive a copy of the file. - -```bash -# Copy the file -cp -av ~/Library/Application\ Support/Komodo/wallet.dat ~/wallet.dat - -# Rename file -mv ~/wallet.dat ~/2019-05-17-wallet_backup.dat - -# To make archive -tar -czvf ~/2019-05-17-wallet_backup.dat.tgz ~/2019-05-17-wallet_backup.dat - -# Move the final file to a secure location -``` - -## Windows - -The Windows software for `komodod` and `komodo-cli` files are slightly different than their MacOS and Linux counterparts in two ways. - -- The Windows software cannot be directly compiled on a Windows machine. Rather, the software must be compiled on a Linux machine (Ubuntu recommended), and then transferred to the Windows machine - - You can use a Virtual Machine-based installation of Ubuntu Linux, running on a Windows machine, as a solution -- The names of the software are `komodod.exe` and `komodo-cli.exe` - -Once you have access to an Ubuntu machine and have access to a terminal [with sudo privileges](https://help.ubuntu.com/community/RootSudo), you are prepared to continue the installation process. - -#### Install dependencies - -```bash -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl libsodium-dev cmake mingw-w64 -``` - -#### Install Rust - -```bash -curl https://sh.rustup.rs -sSf | sh -source $HOME/.cargo/env -rustup target add x86_64-pc-windows-gnu -``` - -#### Configure the compiler to use POSIX thread model - -Execute: - -```bash -sudo update-alternatives --config x86_64-w64-mingw32-gcc -``` - -After executing the above command, select the POSIX option. - -``` - Selection Path Priority Status ------------------------------------------------------------- - 0 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 auto mode - 1 /usr/bin/x86_64-w64-mingw32-gcc-posix 30 manual mode -* 2 /usr/bin/x86_64-w64-mingw32-gcc-win32 60 manual mode - -Press to keep the current choice[*], or type selection number: 1 -``` - -Execute: - -```bash -sudo update-alternatives --config x86_64-w64-mingw32-g++ -``` - -After executing the above command, select the POSIX option. - -``` -There are 2 choices for the alternative x86_64-w64-mingw32-g++ (providing /usr/bin/x86_64-w64-mingw32-g++). - - Selection Path Priority Status ------------------------------------------------------------- - 0 /usr/bin/x86_64-w64-mingw32-g++-win32 60 auto mode - 1 /usr/bin/x86_64-w64-mingw32-g++-posix 30 manual mode -* 2 /usr/bin/x86_64-w64-mingw32-g++-win32 60 manual mode - -Press to keep the current choice[*], or type selection number: 1 -``` - -#### Clone the Komodo Repository - -```bash -git clone https://github.com/KomodoPlatform/komodo -cd komodo -``` - -#### Fetch the Zcash Parameters - -```bash -./zcutil/fetch-params.sh -``` - -#### Build the Komodo Daemon - -In the command below, you may instruct the script to use only a set number of processors. For example, `-j8` instructs the script to use `8` processors, `-j4` instructs the script to use `4` processors, etc. - -```bash -./zcutil/build-win.sh -j8 -``` - -This script can take some time. Once completed, you will find `komodod.exe` & `komodo-cli.exe` files inside the `src` directory. - -Transfer these 2 executable files to your Windows computer and place the files in a new folder on the Desktop called kmd or any other location you prefer (remember the location and use that). For this guide we are using `kmd` directory on Desktop. - -Open a command prompt for the following steps. - -#### Create the Komodo Directory - -```bash -mkdir "%HOMEPATH%\AppData\Roaming\komodo" -``` - -#### Create the Configuration File - -```bash -notepad "%HOMEPATH%\AppData\Roaming\Komodo\komodo.conf" -``` - -When the software dialogue box opens, click `Yes` to create the `komodo.conf` file. - -Copy the information below and paste it into Notepad. - -```bash -rpcuser=usernameChangeItToSomethingSecure -rpcpassword=passwordChangeItToSomethingSecure -daemon=1 -rpcallowip=127.0.0.1 -rpcbind=127.0.0.1 -server=1 -txindex=1 -addnode=5.9.102.210 -addnode=78.47.196.146 -addnode=178.63.69.164 -addnode=88.198.65.74 -addnode=5.9.122.241 -addnode=144.76.94.38 -addnode=148.251.44.16 -``` - -After pasting, save and exit Notepad. - -#### Create the Directory for the Zcash Parameters - -```bash -mkdir “%HOMEPATH%\AppData\Roaming\ZcashParams” -``` - -Download following files and move them into the new directory. - -- [sprout-proving.key](https://z.cash/downloads/sprout-proving.key) - -- [sprout-verifying.key](https://z.cash/downloads/sprout-verifying.key) - -- [sapling-spend.params](https://z.cash/downloads/sapling-spend.params) - -- [sapling-output.params](https://z.cash/downloads/sapling-output.params) - -- [sprout-groth16.params](https://z.cash/downloads/sprout-groth16.params) - -#### Run Smart Chain Software - -```bash -"%HOMEPATH%\Desktop\kmd\komodod.exe" -``` - -#### Verify Syncing Progress - -```bash -"%HOMEPATH%\Desktop\kmd\komodo-cli.exe" getinfo -``` - -#### Backup Your Wallet - -We can not stress enough the importance of backing up your `wallet.dat` file. - -On Windows, the file is located here: `%HOMEPATH%\AppData\Roaming\Komodo\wallet.dat` - -One method to backup this file is to create a copy and archive it. diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.md b/docs/basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.md deleted file mode 100644 index 357e367d8..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.md +++ /dev/null @@ -1,84 +0,0 @@ -# Interacting with Komodo Chains - -## Using komodo-cli -Initiate the `komodod` daemon by calling it from the command line and including any desired runtime parameters. - -When initiating any Smart Chain other than the main KMD chain, the user should always include all parameters that were used to create the Smart Chain. - -::: tip - Note to Windows Users: Replace ./komodod and ./komodo-cli with komodod.exe and komodo-cli.exe for each step. -::: - -To launch the main KMD chain, execute the following command in the directory where `komodod` is installed. - -```bash -./komodod & -``` - -After the daemon launches, you may interact with it using the `komodo-cli` software. - -```bash -./komodo-cli API_COMMAND -``` - -To launch another Smart Chain, include the necessary parameters. - -::: tip IMPORTANT -Always execute the launch command EXACTLY as indicated, and as the Smart Chain's developers instruct. If you make a mistake, you must [delete the Smart Chain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) and re-launch to regain access to the Smart Chain's network. -::: - -For example, to launch the DEX Smart Chain, execute: - -```bash -./komodod -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 & -``` - -To interact with the DEX daemon, use `komodo-cli` like so: - -```bash -./komodo-cli -ac_name=DEX API_COMMAND -``` - -In the terminal you can call the Komodo documentation by executing: - -```bash -./komodo-cli help -``` - -To learn more via the terminal about a specific API command, execute: - -```bash -./komodo-cli help API_COMMAND -``` -## Using curl - -To access a coin daemon remotely -- for example, via a `curl` command in the shell -- the user will need to obtain the `rpcuser`, `rpcpassword`, and `rpcport` from the `.conf` file of the relevant coin daemon. - -#### Location of .conf File - -Assuming the default installation location, the `.conf` file can be found by exploring the following directories: - -| Operating System | Directory | -| ---------------- | --------- | -| MacOS | `~/Library/Application Support/Komodo` | -| Windows | `C:\Users\myusername\AppData\Roaming\Komodo\` | -| GNU/Linux | `~/.komodo` | - - -Within this directory there are also subdirectories containing all KMD-compatible `.conf` files used on this node. - -Contents of a KMD `.conf` file: - -```bash -rpcuser=myusername -rpcpassword=myrpcpassword -server=1 -rpcport=7771 -addnode=78.47.196.146 -addnode=5.9.102.210 -addnode=178.63.69.164 -addnode=88.198.65.74 -addnode=5.9.122.241 -addnode=144.76.94.3 -addnode=148.251.44.16 -``` diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/nspv.md b/docs/basic-docs/smart-chains/smart-chain-setup/nspv.md deleted file mode 100644 index 89fabf339..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/nspv.md +++ /dev/null @@ -1,1455 +0,0 @@ -# nSPV - -## Introduction - -nSPV enhances the normal "Simple Payment Verification" (SPV) technology available for a Smart Chain. To learn more about regular SPV technology, [read this entry on the Bitcoin wiki.](https://en.bitcoinwiki.org/wiki/Simplified_Payment_Verification) - -nSPV leverages the dPoW security mechanism of the Komodo Platform to enable secure and scalable super-lite "SPV" clients. An nSPV client network utilizes a smaller amount of computation and storage resources compared to a normal SPV network. For all Smart Chains, all the full nodes on the Smart Chain's network can serve the necessary data to nSPV clients for the latter to have full wallet functionality. - -All Komodo-compatible Smart Chains, including the KMD main chain, can utilize this technology. - -More details are available in the blog posts [here](https://medium.com/@jameslee777/nspv-a-simple-approach-to-superlight-clients-leveraging-notarizations-75d7ef5a37a9) and [here.](https://medium.com/@jameslee777/nspv-reference-cli-client-cf1ffdc03631) - -## Installation - -Follow the instructions below to set up an nSPV client. - -```bash -sudo apt-get update -sudo apt-get upgrade -y -sudo apt-get install build-essential pkg-config libc6-dev m4 libsodium-dev curl libevent-dev git cmake nano wget ntp ntpdate automake unzip autoconf libtool -y -git clone https://github.com/jl777/libnspv -cd libnspv -./autogen.sh -./configure -./onetime # compiles cc support -make -``` - - - -## Enabling the nSPV Client - -Copy the following code to the file named `coins` (located at the root level of the source directory). - -(Change each value as appropriate for the desired Smart Chain.) - -```json -{ - "coin": "COIN", - "asset": "COIN", - "fname": "Coin", - "rpcport": 12345, - "mm2": 1, - "p2p": 12346, - "magic": "feb4cb23", - "nSPV": "5.9.102.210, 5.9.253.195, 5.9.253.196, 5.9.253.197, 5.9.253.198, 5.9.253.199, 5.9.253.200, 5.9.253.201, 5.9.253.202, 5.9.253.203" -} -``` - -#### Property Descriptions - -| Name | Type | Description | -| ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| coin | (string) | the ticker of the coin | -| asset | (string) | the `-ac_name` parameter used to start the Smart Chain | -| fname | (string) | the full name of the Smart Chain | -| rpcport | (number) | the RPC port the Smart Chain's daemon uses to receive RPC commands | -| mm2 | (number) | set this value to `1` if this coin has been tested and proves capable of functioning on MarketMaker 2.0 software | -| p2p | (number) | the p2p port the Smart Chain's daemon uses to communicate with other nodes | -| magic | (string) | the netmagic number for this Smart Chain. The decimal value of `magic` can be obtained by executing the `getinfo` RPC on a full node on the Smart Chain network. Convert the decimal value to hex and serialize it into 4 hexbytes; | -| nSPV | (string) | the ip addresses of the full nodes on the Smart Chain network | - -::: tip - -To start the nSPV client for a specific Smart Chain after its data has been added to the coins file, execute the following. - -```bash -./nspv COIN -``` - -::: - -#### Tips and Suggestions for Working with the Magic Number - -The magic number is a unique number that the daemon uses for identification purposes. - -If the direction of the `magic` number appears to be incorrect, try reversing the order of the numbers. - -The `magic` number can also be found from the terminal as a `stdout` printout when launching the daemon. Look for the line that starts with `>>>>>>>>>>` , extract the hex portion of the string (`magic.xxxxxxxx`), and reverse its byte order. - -###### Example - -```bash ->>>>>>>>>> COIN: p2p.40264 rpc.40265 magic.fe1c3450 4263261264 350689 coins -``` - -The hex extracted is `fe1c3450`. - -Therefore the magic value for the coins file is `50341cfe` - -## Interacting with the nSPV Client - -The port in each of these examples is the port on which the nSPV client listens for RPC commands. - -For KMD, the port is `7771`. For any other Smart Chain, the port is the `rpcport` specified in the `coins` file. - -This behaviour can be bypassed by setting the [-p](../../../basic-docs/smart-chains/smart-chain-setup/nspv.html#p) parameter. - -#### curl Commands Using Named Parameters - -Use the example below as a template for creating new `curl` commands for any RPCs available in the nSPV API. - -```bash -curl --url "http://127.0.0.1:$port" --data "{\"userpass\":\"$userpass\",\"method\":\"spentinfo\",\"vout\":1,\"txid\":\"e07709088fa2690fdc71b43b5d7760689e42ca90f7dfb74b18bf47a1ad94c855\"}" -``` - -#### curl Command Using the json2.0 Interface - -When using this format for any RPC that requires parameters (also called "arguments"), provide the parameters in the order they are given in this documentation. - -For example, the [spentinfo](../../../basic-docs/smart-chains/smart-chain-setup/nspv.html#spentinfo) RPC lists `txid` as the first parameter and `vout` as the second. Observe in the following example how the values in the `"params"` key match this order. - -Use quotation marks `""` for all strings. - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "spentinfo", "params": ["e07709088fa2690fdc71b43b5d7760689e42ca90f7dfb74b18bf47a1ad94c855",1 ] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - -#### Accessing localhost in the Browser - -To access an nSPV client using a browser, create a url that uses `http://127.0.0.1:/api/` as the base url, and add the `rpc_name/` and any relevant additional `parameters/` as additional url directions. See the example below. - -##### Example - -``` -http://127.0.0.1:/api/method/spentinfo/txid/e07709088fa2690fdc71b43b5d7760689e42ca90f7dfb74b18bf47a1ad94c855/vout/1 -``` - -## -p - -Use this parameter at nSPV runtime to set the port on which the nSPV client should listen for RPC commands. - -##### Example - -The following command starts the nSPV client for the KMD main chain and listens on port `3000` for RPC commands. - -```bash -./nspv KMD -p 3000 -``` - -## broadcast - -**broadcast hex** - -Use this method to broadcast the hex value returned by the [spend](#spend) method. - -#### Arguments - -| Name | Type | Description | -| ---- | -------- | ----------------------------- | -| hex | (string) | the transaction in hex format | - -#### Response - -| Name | Type | Description | -| --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | -| result | (string) | whether the command was successful | -| expected | (string) | the expected transaction id | -| broadcast | (string) | the broadcasted transaction id | -| retcode | (number) | the return code

0: no error

-1,-2,-3: failure

-200x: mostly OK, some of the inputs may not be notarized | -| type | (string) | the type of the broadcast | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "broadcast", "params": ["0400008085202f890155c894ada147bf184bb7dff790ca429e6860775d3bb471dc0f69a28f080977e0010000006a47304402206774ff903a8a4b73bcd5a79fe5c744f34d2263160cd8877c198c2228c66a8a42022063e1d2d6403c395e3472a6a509f01cbff0b90e3413bc6f7bc492649302a4a64001210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06ffffffff0200e1f505000000001976a9144726f2838fc4d6ac66615e10604e18926e9b556e88ac48f804060000000023210217a6aa6c0fe017f9e469c3c00de5b3aa164ca410e632d1c04169fd7040e20e06ace77e395d000000000000000000000000000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## getinfo - -**getinfo [hdrheight]** - -Use this method to get the general information on the state of the blockchain at the moment. - -#### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ---------------------------------------------------------------------- | -| hdrheight | (number, optional) | supplies the height of the block for which the header data is required | - -#### Response - -| Name | Type | Description | -| ----------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| result | (string) | whether the command was successful | -| nSPV | (string) | the mode of nSPV | -| address | (string) | the address corresponding to the wifkey | -| pubkey | (string) | the pubkey corresponding to the wifkey | -| wifexpires | (string) | the time in seconds till the login expires | -| height | (number) | the current height of the blockchain | -| chaintip | (string) | the blockhash of the last block | -| notarization | (json) | a json object containing the notarization details | -| notarized_height | (number) | the height of the latest block that has been notarized | -| notarized_blockhash | (string) | the blockhash of the latest block that has been notarized | -| notarization_txid | (string) | the id of the transaction in which the notarization data is included in the chain being dPoW'ed | -| notarization_txidheight | (number) | the height of the block in which the notarization transaction is included | -| notarization_desttxid | (string) | the id of the transaction in which the notarization data is included in the chain acting as the data store | -| header | (string) | a json object containing the details of the header (of the current block by default / block of height specified by `hdrheight` if it is specified) | -| height | (number) | the height of the block that has been queried | -| blockhash | (string) | the blockhash of the block that has been queried | -| hashPrevBlock | (string) | the blockhash of the block before the block that has been queried | -| hashMerkleRoot | (string) | the merkleroot of the block that has been queried | -| nTime | (number) | a timestamp recording when this block was created | -| nBits | (number) | the calculated difficulty target being used for this block | -| protocolversion | (string) | the version of the client; helps the nspv client disconnect from nodes that are out of date | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## getnewaddress - -**getnewaddress [lang]** - -Use this method to create a new address. - -#### Arguments - -| Name | Type | Description | -| ---- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| lang | (string,optional) | the language in which the seed words are to be generated; can be one of: "english", "french", "italian", "japanese", "korean", "russian", "spanish", "chinese_simplified", "chinese_traditional" | - -#### Response - -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| seed | (string) | seed phrase of the generated address; currently generates a phrase with `23` seed words compatible with the other wallets in the Komodo Ecosystem | -| wif | (string) | wifkey of the generated address | -| address | (string) | the generated address | -| pubkey | (string) | pubkey of the generated address | -| wifprefix | (number) | prefix of the generated wifkey; depends on the network | -| compressed | (number) | whether the wifkey generated is compressed | - -#### :pushpin: Examples - -##### Command (Without arguments) - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -##### Command (To get the seed words in italian) - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "getnewaddress", "params": ["italian"] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## getpeerinfo - -**getpeerinfo** - -Use this method to get the information of all peers on the network. - -#### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### Response - -| Name | Type | Description | -| ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| nodeid | (number) | the number given to a node by our instance of the nSPV client | -| ipaddress | (string) | the ipaddress of the node | -| port | (number) | the p2p port used to connect to this node | -| lastping | (number) | the unix time at which this node was last pinged | -| time_started_con | (number) | the unix time at which a connection to this node was established | -| time_last_request | (number) | the unix time at which a connection was last requested | -| services | (number) | this value encodes the available services from this node in decimal format; converted to HEX, `70000005` : nSPV support with both addressindex and spent index , `40000005` : nSPV support but neither addressindex nor spent index, `00000005` is the services value for a normal node | -| missbehavescore | (number) | the score given to this node if the node was misbehaving | -| bestknownheight | (number) | the height of the blockchain as best known by this node | -| in_sync | (string) | the sync status of the node; `synced` indicates that the client has verified that the chain tip's block header from the node links back to the last notarization; after the client been running a while, all honest nodes should be synced to the same block | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## hdrsproof - -**hdrsproof prevheight nextheight** - -This method scans backwards from the `prevheight` until the process encounters a notarization transaction, then forward from `nextheight` until the process encounters another notarization transaction. - -Then the process finds the notarized blocks corresponding to these two notarization transactions. - -Then the process returns all the block headers between these two notarized blocks. - -Now that both ends of this segment of blocks are notarized blocks, all block headers in this segment can be validated to see if they link back to each other. - -#### Arguments - -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------------ | -| prevheight | (number) | the block number from which headers are required | -| nextheight | (number) | the block number to which headers are required | - -#### Response - -| Name | Type | Description | -| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| result | (string) | whether the command was successful | -| prevht | (string) | the height of the first notarized block below the height `prevheight` | -| nextht | (string) | the height of the first notarized block above the height `nextheight` | -| prevtxid | (string) | the id of the transaction that contains the notarization data of the block of height `prevht` | -| prevtxidht | (string) | the height of the block in which the transaction with id `prevtxid` is present | -| prevtxlen | (string) | the length of the transaction with id `prevtxid` | -| nexttxid | (string) | the id of the transaction that contains the notarization data of the block of height `nextht` | -| nexttxidht | (string) | the height of the block in which the transaction with id `nexttxid` is present | -| nexttxlen | (string) | the length of the transaction with id `nexttxid` | -| numhdrs | (string) | the number of headers being returned | -| headers | (string) | a json object containing the details of the header (of the current block by default / block of height specified by `hdrheight` if it is specified) | -| height | (number) | the height of the block that has been queried | -| blockhash | (string) | the blockhash of the block that has been queried | -| hashPrevBlock | (string) | the blockhash of the block before the block that has been queried | -| hashMerkleRoot | (string) | the merkleroot of the block that has been queried | -| nTime | (number) | a timestamp recording when this block was created | -| nBits | (number) | the calculated difficulty target being used for this block | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "hdrsproof", "params": [1456692, 1456694 ] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## help - -**help** - -This method returns the help output of all available methods. - -#### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### Response - -| Name | Type | Description | -| ------- | ---------------- | ----------------------------------------------------------- | -| result | (string) | whether the command was successful | -| methods | (array of jsons) | an array containing a json object for each method | -| method | (string) | name of a method | -| fields | (array) | an array conataining the description of parameters expected | -| num | (number) | the number of methods available | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "help", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## listtransactions - -**listtransactions [address [isCC [skipcount [filter]]]]** - -This method returns a list of transactions for an address. - -#### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ---------------------------------------------------------------------------------------------------------- | -| address | (string, optional) | the address for which transactions are to be listed; if not specified, the current active address is used | -| isCC | (number, optional) | only return transactions that are related to Antara modules | -| skipcount | (number, optional) | skips the specified number of transactions starting from the oldest; always returns the latest transaction | -| filter | (number, optional) | (in development) | - -#### Response - -| Name | Type | Description | -| --------- | ---------------- | --------------------------------------------------------------------------------------- | -| result | (string) | whether the command was successful | -| txids | (array of jsons) | an array containing jsons that describe the transactions | -| height | (number) | the height of the block in which the transaction was included | -| txid | (string) | the id of the transaction | -| value | (number) | the amount of coins in the vin/vout (inputs and outputs) | -| vin/vout | (number) | the index of vin/vout in the transaction | -| address | (string) | the address for which the transactions are being returned | -| isCC | (number) | whether the address belongs to an Antara module | -| height | (number) | the height of the blockchain when this response was returned | -| numtxids | (number) | number of vouts/vins being returned | -| skipcount | (number) | the number of transactions that have been skipped, starting from the oldest transaction | -| filter | (number) | (in development) | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "listtransactions", "params": ["RFmQiF4Zbzxchv9AG6dw6ZaX8PbrA8FXAb"] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## listunspent - -**listunspent [address [isCC [skipcount [filter]]]]** - -Use this method to retrieve all unspent outputs belonging to an address. - -#### Arguments - -| Name | Type | Description | -| --------- | ------------------ | ---------------------------------------------------------------------------------------------------------- | -| address | (string, optional) | the address for which transactions are to be listed; if not specified, the current active address is used | -| isCC | (number, optional) | only return transactions that are related to Antara modules | -| skipcount | (number, optional) | skips the specified number of transactions starting from the oldest; always returns the latest transaction | -| filter | (number, optional) | (in development) | - -#### Response - -| Name | Type | Description | -| --------- | ---------------- | ------------------------------------------------------------ | -| result | (string) | whether the command was successful | -| utxos | (array of jsons) | an array containing jsons that describe the outputs | -| height | (number) | the height of the block in which the output was created | -| txid | (string) | the id of the transaction in which the output is present | -| vout | (number) | the index of the vout (output) in the transaction | -| value | (number) | the amount of coins in the vout (output) | -| rewards | (number) | the amount of active user rewards claimable by the output | -| address | (string) | the address for which the transactions are being returned | -| isCC | (number) | whether the address belongs to an Antara module | -| height | (number) | the height of the blockchain when this response was returned | -| numutxos | (number) | number of vouts(outputs) being returned | -| balance | (number) | the total balance available for the address | -| rewards | (number) | the total rewards claimable by the address | -| skipcount | (number) | the number of utoxs that have been skipped; from the oldest | -| filter | (number) | (in development) | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "listunspent", "params": ["RFmQiF4Zbzxchv9AG6dw6ZaX8PbrA8FXAb"] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## login - -**login wif** - -Use this method to log in to an address using its wifkey. - -#### Arguments - -| Name | Type | Description | -| ---- | -------- | --------------------------------------------------- | -| wif | (string) | the wifkey (wallet import format of the privatekey) | - -#### Response - -| Name | Type | Description | -| ---------- | --------- | ------------------------------------------------------------------------ | -| result | (string) | whether the command was successful | -| status | (string) | the time till the expiry of the login | -| address | (string) | the address corresponding to the wifkey | -| pubkey | (string) | the pubkey corresponding to the wifkey | -| wifprefix | (number) | the prefix of the wifkey (indicates the intended network for the wifkey) | -| compressed | (boolean) | indicates whether the wifkey is compressed | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "login", "params": ["Uxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## logout - -**logout** - -Use this method to log out of the current active address. - -#### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### Response - -| Name | Type | Description | -| ------ | -------- | ----------------------------- | -| result | (string) | whether the command succeeded | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "logout", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## mempool - -**mempool address isCC memfunc [txid vout evalcode ccfunc]** - -This method returns the current transactions in the mempool. The various parameters can be used to filter the transactions. - - - -#### Arguments - -| Name | Type | Description | -| -------- | ------------------ | ------------------------------------------------------ | -| address | (string, optional) | if the transactions should belong to the address | -| isCC | (number, optional) | if the transactions should belong to any Antara module | -| memfunc | (number, optional) | (in development) | -| txid | (string, optional) | (in development) | -| vout | (number, optional) | (in development) | -| evalcode | (number, optional) | (in development) | -| ccfunc | (number, optional) | (in development) | - -#### Response - -| Name | Type | Description | -| -------- | ------------------ | ------------------------------------------------------------ | -| result | (string) | whether the command was successful | -| txids | (array of strings) | the ids of the transactions in the mempool | -| address | (string) | the address that was used to filter the mempool | -| isCC | (number) | if the transactions returned belong to an Antara Module | -| height | (number) | the height of the blockchain when this response was returned | -| numtxids | (number) | the number of transaction ids that are being returned | -| txid | (string) | (in development) | -| vout | (number) | (in development) | -| memfunc | (number) | (in development) | -| type | (string) | the type of the filter apploed to the mempool | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "mempool", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## notarizations - -**notarizations height** - -This method returns the notarization data for a given height. - -#### Arguments - -| Name | Type | Description | -| ------ | -------- | ------------------------------------------------- | -| height | (number) | the height at which notarization data is required | - -#### Response - -| Name | Type | Description | -| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------- | -| result | (string) | whether the command was successful | -| prev | (json) | the details of the previous notarization | -| notarized_height | (number) | the height of the latest block that has been notarized | -| notarized_blockhash | (string) | the blockhash of the latest block that has been notarized | -| notarization_txid | (string) | the id of the transaction in which the notarization data is included in the chain being dPoW'ed | -| notarization_txidheight | (number) | the height of the block in which the notarization transaction is included | -| notarization_desttxid | (string) | the id of the transaction in which the notarization data is included in the chain acting as the data store | -| next | (json) | the details of the next notarization | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "notarizations", "params": [145677] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## spend - -**spend address amount** - - - -This method can be used to spend coins from the current active address to any other address. - -#### Arguments - -| Name | Type | Description | -| ------- | -------- | ---------------------------- | -| address | (string) | the address of the recipient | -| amount | (number) | the amount to be sent | - -#### Response - -| Name | Type | Description | -| ------------- | ---------------- | --------------------------------------------------------------------------------------------------------------- | -| rewards | (string) | the rewards being claimed by this spend transaction | -| validated | (string) | (in development) | -| tx | (json) | a json object containing details of the transaction | -| nVersion | (number) | version of the komodo daemon | -| vin | (array of jsons) | the inputs being consumed by the transaction | -| txid | (string) | the id of the transaction whose input is being spent | -| vout | (number) | the output number in the above transaction | -| scriptSig | (string) | the redeem script that satisfies the scriptPubkey of the above output | -| sequenceid | (number) | the sequence number that has been set | -| vout | (array of jsons) | the outputs being created by the transaction | -| value | (string) | the value in the output | -| scriptPubKey | (string) | the locking script placed on the above value | -| nLockTime | (number) | the locktime that has been set | -| nExpiryHeight | (number) | the block height after which the transaction will be removed from the mempool if it has not been mined | -| valueBalance | (number) | (in development) | -| result | (string) | whether the command succeeded | -| hex | (string) | the transaction in hex format; this should be broadcast to the network using the [broadcast](#broadcast) method | -| retcodes | (number) | the return codes; an indication of the success or failure of the creation of the transaction | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "spend", "params": ["RFmQiF4Zbzxchv9AG6dw6ZaX8PbrA8FXAb",1 ] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## spentinfo - -**spentinfo txid vout** - -This method returns the spent info of the output specified by the arguments. - -#### Arguments - -| Name | Type | Description | -| ---- | -------- | --------------------------------------------------------------------- | -| txid | (string) | the id of the transaction whose spent info is required | -| vout | (number) | the vout number in the above transaction whose spent info is required | - -#### Response - -| Name | Type | Description | -| --------------- | -------- | --------------------------------------------------------------------- | -| result | (string) | whether the command succeeded | -| txid | (string) | the id of the transaction whose spent info is returned | -| vout | (string) | the vout number in the above transaction whose spent info is required | -| spentheight | (string) | the block height at which the output has been spent | -| spenttxid | (string) | the id of the transaction that spent this output | -| spentvini | (string) | the input number of this output in the transaction that spent it | -| spenttxlen | (string) | the length of the transaction that spent this output | -| spenttxprooflen | (string) | the length of proof of the transaction that spent this output | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "spentinfo", "params": ["e07709088fa2690fdc71b43b5d7760689e42ca90f7dfb74b18bf47a1ad94c855",1 ] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## stop - -**stop** - -Stops the nSPV instance associated with the port specified in the curl command. - -#### Arguments - -| Name | Type | Description | -| ------ | ---- | ----------- | -| (none) | | | - -#### Response - -| Name | Type | Description | -| ------ | -------- | ---------------------------------- | -| result | (string) | whether the command was successful | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "stop", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - - -## txproof - -**txproof txid vout [height]** - -This method is an internal function used by the [gettransaction](#gettransaction) method. - -#### Arguments - -| Name | Type | Description | -| ------ | ------------------ | -------------------------------------------------- | -| txid | (string) | the id of the transaction whose proof is requested | -| vout | (number) | the number of the output in the above transaction | -| height | (number, optional) | | - -#### Response - -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------------------------ | -| txid | (string) | the id of the transaction whose proof is returned | -| height | (string) | the height at which the proof of the transaction is returned | -| txlen | (string) | the length of the transaction | -| txprooflen | (string) | the length of the proof for the transaction | -| lastpeer | (string) | the last known peer | - -#### :pushpin: Examples - -##### Command - -```bash -curl --data-binary '{"jsonrpc": "2.0", "id":"curltest", "method": "txproof", "params": ["e07709088fa2690fdc71b43b5d7760689e42ca90f7dfb74b18bf47a1ad94c855",0,1453881 ] }' -H 'content-type: text/plain;' http://127.0.0.1:$port/ -``` - - diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.md b/docs/basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.md deleted file mode 100644 index ec9ecfe75..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.md +++ /dev/null @@ -1,27 +0,0 @@ -# Smart Chain Maintenance - -## Manually Deleting Blockchain Data - -Sometimes it is necessary to manually delete all blockchain data. This should automatically trigger a full re-sync of the Smart Chain. - -Users should exercise caution not to delete the `wallet.dat` file during this procedure. We recommend that the user make frequent backups of the `wallet.dat` file, especially before deleting files from the data directory. - -To erase all synced blockchain data, the following files should be deleted from the `.komodo` folder: - -#### Files to Delete - -- `blocks` -- `chainstate` -- `notarisations` -- `komodostate` -- `komodostate.ind` -- `peers.dat` - -#### Default Location for Files - -| Operating System | Directory | -| ---------------- | --------- | -| MacOS | `~/Library/Application Support/Komodo` | -| Windows | `C:\Users\myusername\AppData\Roaming\Komodo\` | -| GNU/Linux | `~/.komodo` | - diff --git a/docs/basic-docs/smart-chains/smart-chain-setup/updating-from-source.md b/docs/basic-docs/smart-chains/smart-chain-setup/updating-from-source.md deleted file mode 100644 index 47219a11c..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-setup/updating-from-source.md +++ /dev/null @@ -1,147 +0,0 @@ -# Updating Smart Chain Software From Source - -## Linux - -To update your compiled `komodod` daemon, follow the steps below carefully. For each step, do not proceed to the next step until the current step is fully complete. - -You may leave the `komodod` daemon running, if necessary, and if your machine has sufficient resources. - -Alternatively, you may stop the daemon by executing `~/komodo/src/komodo-cli stop`. - -#### Navigate to your komodo directory - -```bash -cd ~/komodo -``` - -#### Reset Your Local Repository - -```bash -git reset --hard -``` - -#### Clean the Source Directory - -```bash -make clean -``` - -#### Update Your Local Source Code - -```bash -git pull -``` - -#### Compile the Latest Komodo Binary - -```bash -./zcutil/build.sh -j$(nproc) -``` - -#### Restart the komodod Daemon - -Start your services as usual. - -(If you did not stop the daemon before compiling, stop the daemon using `~/komodo/src/komodo-cli stop` and start the daemon again.) - -```bash -~/komodo/src/komodod & -``` - -#### Rapid Update Method - -The steps below can often be used to update the daemon. - -These steps take a lesser amount of time, but they may occasionally produce an error during compilation. If the steps below do not succeed, the compiler will cease and return an error. When this happens, simply switch to the update steps listed above. - -```bash -cd ~/komodo -git checkout dev -git pull -make -j$(nproc) -``` - -## MacOS - -To update your compiled `komodod` daemon, follow the steps below carefully. For each step, do not proceed to the next step until the current step is fully complete. - -You may leave the `komodod` daemon running, if necessary, and if your machine has sufficient resources. - -Alternatively, you may stop the daemon by executing `~/komodo/src/komodo-cli stop`. - -#### Navigate to your komodo directory - -```bash -cd ~/komodo -``` - -#### Reset Your Local Repository - -```bash -git reset --hard -``` - -#### Clean the Source Directory - -```bash -make clean -``` - -#### Update Your Local Source Code - -```bash -git pull -``` - -#### Compile the Latest Komodo Binary - -```bash -./zcutil/build.sh -j8 -``` - -#### Restart the komodod Daemon - -Start your services as usual. - -(If you did not stop the daemon before compiling, stop the daemon using `~/komodo/src/komodo-cli stop` and start the daemon again.) - -```bash -~/komodo/src/komodod & -``` - -#### Rapid Update Method - -The steps below can often be used to update the daemon. - -These steps take a lesser amount of time, but they may occasionally produce an error during compilation. If the steps below do not succeed, the compiler will cease and return an error. When this happens, simply switch to the update steps listed above. - -```bash -cd ~/komodo -git checkout dev -git pull -make -j8 -``` - -## Windows - -To update the Windows software, you will again need access to your available installation of Linux where you originally compiled the software. - -#### Build the New Executables - -Execute the following commands on your Linux machine to build the new executable files. - -```bash -cd ~/komodo -git pull -./zcutil/build-win.sh -j8 -``` - -This can take some time. - -#### Move Executables to Windows OS - -Once the process completes, find the `komodod.exe` and `komodo-cli.exe` files and move them to your Windows OS machine. - -You may drop these executable files into the same `kmd` folder to overwrite the old executables files. - -Once complete, run the `komodod.exe` and `komodo-cli.exe` files to verify that they work properly. diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/README.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/basic-environment-setup-for-linux-vps.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/basic-environment-setup-for-linux-vps.md deleted file mode 100644 index 84dd0dca1..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/basic-environment-setup-for-linux-vps.md +++ /dev/null @@ -1,83 +0,0 @@ -# Basic Environment Setup for Linux VPS - -## Introduction - -This tutorial provides guidance in creating a simple environment for development in the Komodo ecosystem. - -The content herein is not comprehensive. Rather, this content provides a starting point, from which an enthusiastic learner should be capable of customizing and developing their own approach. - -## Rent a VPS - -A common environment choice among developers is to use a Virtual Private Server (VPS). A VPS allows a developer to use the Internet to access high quality hardware with corporate-level high speed Internet access. - -Popular VPS choices include [Amazon Web Services (AWS)](https://aws.amazon.com) and [DigitalOcean](https://digitalocean.com). - -One reason a VPS is popular is that a developer can quickly create new instances of a virtual machine. This facilitates the developer in having a clean environment that is targeted for a specific purpose. - -VPS's are also relatively cheap. Both AWS and DigitalOcean provide the basic necessities for ~$20/month, depending on your desired specifications. - -::: warning - -When using an AWS instance, do not use the free tier's micro t2 instance. This tier does not include enough RAM for blockchain software to function properly. Instead, select a size of at least medium or greater. This will ensure at least 4GB RAM. - -::: - -::: tip - -Alternatively, you can use your own personal computer, or a bare-metal server. However, troubleshooting on a personal setup can prove to be more time consuming than on a VPS. - -::: - -### Recommended Minimum Server Specifications: - -- CPU with 4 cores -- 8 GB RAM -- ~100GB SSD - - Note that using an HDD instead of a SSD will dramatically increase synchronization time, and thus slow down your workflow -- Ubuntu version 18.04 (for beginners) - - Ubuntu is the most popular Linux distribution - - The majority of Komodo's documentation is tested and written on Ubuntu - - To learn more about Linux, [read this linked article](https://www.linux.com/what-is-linux) - -## Connect to Your VPS - -Once you have chosen your VPS provider, you will need to connect to your VPS. - -New developers often find this process confusing. - -Your VPS provider should have several tutorials available to help you through this process. - -Look for tutorials on the following topics. - -* How to launch a terminal shell on your laptop or desktop machine -* How to set up SSH keys for secure login access -* How to execute a `ssh` command on your local machine to connect to your VPS -* How to enter `sudo` commands on your VPS - -For example, AWS has the following documentation to assist new developers in accessing VPS's that use the AWS EC2 service. Choose between MacOS & Linux, or Windows, both of which have different tutorial paths. - -[Link to AWS tutorial starting point](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html) - -## Initial VPS Setup - -Once you can access your VPS via the terminal, it is time to consider security in your environment. You are accessing a machine over the Internet, and there are myriad ways by which an attack can compromise your connection. - -To ensure your own safety, consider the following security measures. - -- Never log into your VPS as the root user -- Consider disabling the option to log in as root -- Use SSH keys to log in, instead of a password -- Enable a firewall to limit all unwanted traffic - -The following tutorials provide many useful tips on creating a secure server. - -- [Initial Server Setup with Ubuntu 18.04 | Digital Ocean](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04) -- [Using SSH to connect to a remove server](https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server-in-ubuntu) - -For experience learning the Linux environment, consider the following tutorials. - -- [How to use the Unix command line (interactive course)](https://www.codecademy.com/learn/learn-the-command-line) -- [An Introduction to Linux (Especially "A Culture of Learning")](https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics) -- [How To Download Software and Content onto your Linux VPS](https://www.digitalocean.com/community/tutorials/how-to-download-software-and-content-onto-your-linux-vps) -- [How To Use cd, pwd, and ls to Explore the File System on a Linux Server](https://www.digitalocean.com/community/tutorials/how-to-use-cd-pwd-and-ls-to-explore-the-file-system-on-a-linux-server) -- [How to Add and Delete Users on Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04) diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md deleted file mode 100644 index e18f3b860..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.md +++ /dev/null @@ -1,242 +0,0 @@ -# Creating Komodo Smart Chains - -## Introduction - -#### Requirements for Creating a New Chain - -- 2 nodes with the ability to open ports (a node can be either a computer or a VPS) -- At least 4GB RAM each -- At least 2 CPU cores each -- 64-bit Operating System (Ubuntu 18.04 recommended) -- Komodo Smart Chain software installed on each - - (when the goal is only to build a new Smart Chain, there is no need to sync the KMD main chain) - -::: tip -When you are building and testing a Komodo Smart Chain, please do not hesitate to reach out to us when you are stuck. We wish to make this as easy as possible. Our support agents are available in our #support channel in Discord for many hours each day. -::: - -### Basic Info for Connecting At Least Two Nodes - -Basic knowledge about how to connect two nodes is recommended for the initial setup. - -As per the original blockchain designs of Satoshi Nakamoto, a Komodo Smart Chain does not exist on a single node. Rather, it exists via a connection between two or more nodes. This is the nature of decentralization: it is on the network we rely, rather than a single authority. Therefore, the design of the technology encourages the developer to have two separate nodes which are able to connect over a network. - -In the most ideal circumstance, the new Komodo developer will already have two virtual private servers (VPS's) available for testing. VPS's can be cheap and easy to manage. A typical VPS will either have a static external IP or can be assigned one. - -If the new developer does not have two VPS's available, setting up a test Smart Chain on two local machines in a home or office-type setting is still achievable, but it may require more troubleshooting. - -When using a home or office-type setup, the challenge lies in the way the network is created, and there are myriad network setups. - -For example, if the developers are operating on a local router, where the two machines are connected via wifi, the local ip addresses of the machines are harder to find. This is because the router assigns new local ip addresses to the machines each time they re-connect to the router. It is not possible to see the ip addresses from the Internet. In this situation, the developer must log into the router's software interface and search for the currently assigned local ip addresses. - -A home or office-type setup can suffice, if you're just looking to test an Smart Chain quickly and don't want to spend money on a VPS. However, don't be surprised if you need to ask for help. Please reach out to us, and we'll help the best we can. - -To test the creation of a Smart Chain using only a single node, [see these linked instructions.](../../../basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.html#introduction) - -To prepare for the next step, execute the following command in the terminal on both machines: - -```bash -curl ifconfig.me -``` - -From the response, record the `ip address` value for additional use. - -With the ip addresses available, we are now prepared to test the connection between the machines. - -```bash -ping -``` - -This command will generate a response every second, indicating the `ping` speed with which your machines are able to connect. - -```bash -$ ping 192.168.1.101 - -PING 192.168.1.101 (192.168.1.101) 56(84) bytes of data - -64 bytes from 192.168.1.101: icmp_seq=1 ttl=64 time=131 ms - -64 bytes from 192.168.1.101: icmp_seq=2 ttl=64 time=2.40 ms - -``` - -If you do not see a similar response in the shell, your machines are not able to connect. Please reach out to our team and we will do our best to assist you. - -## Part I: Creating a New Komodo Smart Chain - -With your machines successfully able to `ping` each other, you are ready to create your first Smart Chain. - -The following instructions use the simplest possible set of parameters in creating a new Smart Chain: a coin with the ticker symbol `HELLOWORLD`, `777777` pre-mined coins, and a block reward of `.0001`. - -On your first node, change into the directory where Komodo's `komodod` and `komodo-cli` are installed and execute the following commands in the terminal: - -#### Mac & GNU/Linux - -```bash -./komodod -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & -``` - -#### Windows - -```bash -./komodod.exe -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & -``` - -::: tip -If you want the Smart Chain to have Antara Modules enabled, please include the [-ac_cc](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-cc) parameter with the required value in your launch parameters on both the nodes. -::: - -### Verify the Response - -After issuing this command in the terminal on both machines, you will find the p2p port in the terminal window. - -```bash ->>>>>>>>>> HELLOWORLD: p2p.8096 rpc.8097 magic.c89a5b16 3365559062 777777 coins -``` - -In the above string, take note of the p2p and RPC ports, as well as the magic number. These values must match on both nodes for the chains to be identical. If they are not the same, verify that the launch command is the same on both the nodes. - -In the example above, the p2p port is `8096`. Make sure that the p2p port is open to the internet or any other network from which the second node connects. - -This completes the first half of the Smart Chain creation process. Scroll down to [Part II](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html#part-ii-connecting-the-second-node). - -::: tip -Please refer to [Antara Customization parameters](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-algo) for a full list of parameters to customize the characteristics of your blockchain. -::: - -::: tip -Please note the requirements for [ac_supply](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-supply), and instructions for using [addnode](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addnode) under various network conditions, including firewalls and LANs. -::: - -## Part II: Connecting the Second Node - -On the second node you issue the same command, but with a key difference. This time, use the first node's IP address. - -```bash -./komodod -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & -``` - -Once the daemon loads, compare the string that starts with `>>>>>>>>>>` in the second node to the one from the first node to make sure they are identical. - -Mining can be started on a node using the following command: - -```bash -./komodo-cli -ac_name=HELLOWORLD setgenerate true $(nproc) -``` - -`$(nproc)` in the above command makes the daemon mine using all the available CPU threads, which might be necessary in a low end VPS. - -On a Komodo-based blockchain, all of the pre-mined coins are mined in the first block. Therefore, whichever machine executes the mining command will receive the entirety of the blockchain's pre-mined coin supply, as set in the [ac_supply](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-supply) parameter. Upon mining the first block, these coins are available in the default `wallet.dat` file. - -To collect all the mining rewards from the node to a single address, execute the following commands before issuing the `setgenerate` command: - -```bash -# Get a new address -newaddress=$(./komodo-cli -ac_name=HELLOWORLD getnewaddress) - -# Get the corresponding pubkey -pubkey=$(./komodo-cli -ac_name=HELLOWORLD validateaddress $newaddress | jq -r '.pubkey' ) - -# Indicate the pubkey to the daemon -./komodo-cli -ac_name=HELLOWORLD setpubkey $pubkey -``` - -After issuing the mining command is issued, can check that the two nodes are connected by using the following command: - -```bash -./komodo-cli -ac_name=HELLOWORLD getinfo | grep connections -``` - -If the nodes are properly connected, both nodes will respond with: `"connections": 1` - -These are the coins you will later distribute to your community, using either our native DEX, [AtomicDEX](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html#why-is-atomicdex-special), or our decentralized-ICO software (coming soon), or on any other third-party exchange. - -You can check the contents of the wallet by executing the following command in the terminal: - -```bash -./komodo-cli -ac_name=HELLOWORLD getwalletinfo -``` - -To verify that everything is properly initiated, send a few coins from the second node to the first node: - - - -More info can be found in the debug.log of the chain found at: - -- **MacOS:** `~/.komodo/HELLOWORLD/debug.log` -- **Windows:** `%appdata%\komodo\HELLOWORLD\debug.log` -- **GNU/Linux:** `~/.komodo/HELLOWORLD/debug.log` - -## Querying the Smart Chain - -Using the `komodo-cli` software, which is included in any default installation of `komodod`, you can now execute many commands on your new Smart Chain. This enables you to perform transactions, create and execute smart contracts, store data in KV storage, etc. - -Since the Komodo software began as a fork of Zcash and BTC, essentially all commands that are available on these two upstream blockchains are also available on your new Smart Chain. - -Furthermore, a key purpose of the Komodo blockchain is to create features and functions that facilitate and enhance your development experience. Information regarding these enhancements is available throughout this documentation. - -In addition, since you are building on a Komodo-based blockchain, you have easy access to our multi-coin wallet and atomic-swap powered decentralized exchange, [AtomicDEX](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html#why-is-atomicdex-special), the Antara development framework and modules, our decentralized-ICO software, and our future upgrades. - -## Example commands - -To see general information about your new Smart Chain, execute this command: - -`./komodo-cli -ac_name=HELLOWORLD getinfo` - -The following command returns information about all available RPC and API commands: - -`./komodo-cli -ac_name=HELLOWORLD help` - -## Secure this Smart Chain with Delayed Proof of Work - -Your new Smart Chain can receive the same security of the Bitcoin hash rate through our security mechanism, called "delayed Proof of Work" (dPoW). - -There are two aspects to the cost for dPoW services. The first comes from the cost of making records in your Smart Chain's database, and in the records of the KMD main chain. These records are called "notarizations." - -Notarizations are performed as transactions on your blockchain and on the main KMD blockchain. The transactions have messages included inside that indicate the most recent and secure state of your Smart Chain. Your Komodo Smart Chain will know how to recognize and rely on notarizations automatically. - -Every ten to twenty minutes, our notary nodes will hash the history of your Smart Chain and insert it as a record into the KMD main chain. This provides an initial layer of security, but it is not the final layer. - -In another ten to twenty minutes, all of the information in the KMD chain (including your Smart Chain's hashed data) is hashed and inserted into the BTC blockchain. Once your information is pushed into BTC, your Smart Chain will consider all notarized information effectively settled and immutable; only the recent, un-notarized transactions are still relying on your Smart Chain's raw consensus mechanism. [Click here to learn more about the types of consensus mechanisms you can choose on a KMD Smart Chain](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-staked). - -Thus, your Smart Chain will have all the power of Bitcoin securing your blockchain's history, with the zero-knowledge privacy of the Zcash parameters pre-installed, and all of the interoperability, scalability, and more that Komodo adds to your development experience. - -As the notarizations are transactions, they naturally have a cost, and this cost is covered by you, the Smart Chain developer. Over the course of a year, assuming consistent activity, the cost for performing these transactions is 365 KMD, and also 365 of your Smart Chain's coins. - -There are extra costs involved that are aimed to compensate the Notary Nodes for the setup and maintainance of the dPOW service. You may reach out to our third-party service providers to receive a quote. They can provide various services related to Smart Chain creation, electrum-server (SPV) setup and maintenance, explorer setup, and other blockchain services. - -[Click Here for the List of Third-Party Service Providers](../../../basic-docs/start-here/about-komodo-platform/orientation.html#production-smart-chains-typically-require-komodo-s-security-services) - -Several teams have already signed up for our services and are developing on our platform. From our experience with them we can confidently say that our pricing is competitive compared to other blockchain services. Furthermore, when considering that a Komodo-based Smart Chain does not require KMD for gas and transaction fees, the cost to your end-users can be exponentially cheaper. All things considered, creating a fully independent blockchain on Komodo can cost but a small fraction of what it would cost to deploy a single smart contract on the platforms of some of our competitors. - -### A Note About Low-Activity Blockchains - -Blockchain technology relies on a network of users using the blockchain and sharing data to function. - -Smart Chains that are built for low-activity networks require extra steps from the developer to ensure proper syncing between nodes. - -If you are building a Smart Chain and would like more information on maintaining constant syncing across nodes, our [third-party service providers](../../../basic-docs/start-here/about-komodo-platform/orientation.html#production-smart-chains-typically-require-komodo-s-security-services) can provide dedicated support for this topic. Please also reach out to our support team and community on [Discord.](https://komodoplatform.com/discord) diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md deleted file mode 100644 index 6122dc406..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.md +++ /dev/null @@ -1,156 +0,0 @@ -# Creating a Smart Chain on a Single Node - -## Introduction - -Under most circumstances, a developer should [use two separate nodes to set up and create a Smart Chain.](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html#introduction) - -However, occasionally a developer may need to create a Smart Chain on a single node. This can be achieved using the [testnode](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#testnode) runtime parameter. The following tutorial is only neccesary if the developer desires to run two instances of the daemon on the same server. - -In this situation, the developer may create a Smart Chain by running two daemons with slightly different configurations on the same node. - -#### Tutorial Prerequisites - -- Komodo Smart Chain software installed on a compatible machine - - [Install instructions here](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html) - -## Launch the First daemon - -Select the desired Antara customization parameters. - -[Link to Antara Customization Parameters](../../../basic-docs/antara/antara-setup/antara-customizations.html) - -For this example, we use simple configurations. - -##### Command - -```bash -./komodod -ac_name=HELLOWORLD -ac_supply=777777 -``` - -::: tip -If you want the Smart Chain to have Antara Modules enabled, please include the [-ac_cc](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-cc) parameter with the required value in your launch parameters on both the daemons. -::: - -##### Response (truncated) - -Search for the part of the response that begins with this string: `>>>>>>>>>` - -```bash ->>>>>>>>>> HELLOWORLD: p2p.14165 rpc.14166 magic.01362c2a 20327466 777777 coins -``` - -The default [p2p](../smart-chain-setup/common-runtime-parameters.html#port) and [rpc](../smart-chain-setup/common-runtime-parameters.html#rpcport) ports of our chain are `14165` and `14166` respectively. - -#### Test komodo-cli - -To interact with this first daemon, use a `komodo-cli` command as follows. - -```bash -./komodo-cli -ac_name=HELLOWORLD getinfo -``` - -## Create a Data Directory for the Second Daemon - -Create a directory on your machine for the second daemon. - -In this guide, we use a directory named `coinData` in the Home directory: - -```bash -mkdir ~/coinData -``` - -Create the data directory for the second daemon. - -```bash -mkdir ~/coinData/HELLOWORLD -``` - -Copy the `.conf` file created for the first daemon to this new data directory. - -```bash -cp ~/.komodo/HELLOWORLD/HELLOWORLD.conf ~/coinData/HELLOWORLD/ -``` - -Change the values of `rpcuser`, `rpcpassword`, and `rpcport` in the file `~/coinData/HELLOWORLD/HELLOWORLD.conf`. - -##### The HELLOWORLD.CONF File - -``` -rpcuser=changethis -rpcpassword=changethis -... (ommitted) ... -rpcport=12345 -``` - -(Change all values shown above on the right side of the `=` side. In all values above, the chosen values must be different from the values in the first daemon's .conf file.) - -Add a new line `port=` to the file. This value indicates the [p2pport](../smart-chain-setup/common-runtime-parameters.html#port) used by the second daemon. - -``` -... (file continued) ... -port=22020 -``` - -The value of port should be different from the value of the p2p port for the first daemon. - -## Launch the Second daemon - -When launching the second daemon, use the same Antara customization parameters as the first daemon. - -However, now we specify the data directory for the daemon, as well as the `p2p` connection. - -To accomplish this, we use the datadir and addnode common launch parameters. - -```bash -./komodod -ac_name=HELLOWORLD -ac_supply=777777 -datadir=/home//coinData/HELLOWORLD -addnode=localhost -``` - -::: tip - -Replace `` with the USERNAME for your local node. You can find this value by using the `echo $USER` command in the terminal. - -::: - -To interact with the second daemon, add the datadir parameter to the `komodo-cli` command: - -```bash -./komodo-cli -ac_name=HELLOWORLD -datadir=/home//coinData/HELLOWORLD getinfo -``` - -After launching the second daemon, calling `getinfo` to either of the daemons should report `"connections":1`. - -## Using curl - -To issue a `getinfo` call using curl, observe the following example. - -Replace ``, ``, `` with the values from the `.conf` file in the data directory corresponding to the daemon that needs to be queried. - -```bash -curl -s --user : --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:/ -``` - -Alternatively, source the `.conf` file before using the curl command. Each time you desire to switch daemons, source the `.conf` file of your target daemon. - -##### Source the First Daemon's .conf File - -```bash -# Source the .conf file - -source ~/.komodo/HELLOWORLD/HELLOWORLD.conf - -# Execute the curl command - -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - -##### Source the Second Daemon's .conf File - -```bash -# Source the .conf file - -source ~/coinData/HELLOWORLD/HELLOWORLD.conf - -# Execute the curl command - -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/introduction-to-smart-chain-tutorials.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/introduction-to-smart-chain-tutorials.md deleted file mode 100644 index 195a38f61..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/introduction-to-smart-chain-tutorials.md +++ /dev/null @@ -1,11 +0,0 @@ -# Introduction to Smart Chain Tutorials - -Welcome to the Komodo Smart Chain tutorial documentation. - -This section contains tutorials that are specifically designed only for the essential aspects of Smart Chain software. These tutorials often focus on technology that is available to Komodo via upstream technologies, such as Bitcoin or Zcash. - -For tutorials regarding other Komodo software, such as Antara, which focuses on Komodo enhancement technologies, or AtomicDEX, which offers cross-chain atomic-swap compatibility, please see their respective documentation centers. - -For a targeted learning approach to Komodo's Smart Chain software, please see the Learning Launchpad. - -[Link to Learning Launchpad](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html) diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/multisignature-transaction-creation-and-walkthrough.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/multisignature-transaction-creation-and-walkthrough.md deleted file mode 100644 index ccd69751a..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/multisignature-transaction-creation-and-walkthrough.md +++ /dev/null @@ -1,281 +0,0 @@ -# Multisignature Transaction Creation and Walkthrough - -## Introduction - -Multisignature (multisig) is a technology used to increase the number of signatures required for a transaction from an address. This provides an additional layer of security to cryptocurrency transactions. - -In this guide we demonstrate the creation and usage of a `2of2` multisignature wallet. We use two nodes with the KMD main chain. - -To accomplish the same task on another Komodo Smart Chain, add `-ac_name=NAMEOFCHAIN` to each command. - -## Get a New Address, Public Key, and Private Key - -Create addresses on two nodes. We will combine these two addresses into a single multisig address. - -## Node One - -#### Generate a New Address - -##### Command - -``` -./komodo-cli getnewaddress -``` - -##### Response - -``` -RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 -``` - -#### Get the Public Key Using validateaddress - -##### Command - -```shell -./komodo-cli validateaddress RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 -``` - -##### Response - -```JSON -{ - "isvalid": true, - "address": "RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5", - "scriptPubKey": "76a91431a8cbc716e21238079729d46cb655ae7fadc9e388ac", - "segid": 37, - "ismine": true, - "iswatchonly": false, - "isscript": false, - "pubkey": "02dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a26", - "iscompressed": true, - "account": "" -} -``` - -#### Get the Private Key - -##### Command - -```shell -./komodo-cli dumpprivkey RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 -``` - -##### Response - -``` -DO_NOT_USEBnFx9R6iaPmWaBX8iqHzRpFRjNp8kBEQYKNt -``` - -#### A Summarization of Data from Node One - -``` -# address: RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 -# pubkey: 02dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a26 -# privkey: UrunDGyFJu5UFZG7BnFx9R6iaPmWaBX8iqHzRpFRjNp8kBEQYKNt -``` - -## Node Two - -Follow the same steps. - -#### Generate a New Address - -##### Command - -```shell -./komodo-cli getnewaddress -``` - -##### Response - -``` -RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s -``` - -#### Get the Pubkey Value Using validateaddress - -##### Command - -```shell -./komodo-cli validateaddress RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s -``` - -##### Response - -```JSON -{ - "isvalid": true, - "address": "RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s", - "scriptPubKey": "76a9141c0f1c482d38c43bb847506a527521d2204afe6588ac", - "segid": 38, - "ismine": true, - "iswatchonly": false, - "isscript": false, - "pubkey": "032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a2816", - "iscompressed": true, - "account": "" -} -``` - -#### Get the Private Key - -##### Command - -```shell -./komodo-cli dumpprivkey RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s -``` - -##### Response - -``` -UsuE7jG8BD1CV2xuCoBCwgzzbs4HqZ2P2im5fdyJmP2tSd3arAv7 -``` - -#### Summarization of Data From Node Two - -``` -address: RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s -pubkey: 032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a2816 -privkey: UsuE7jG8BD1CV2xuCoBCwgzzbs4HqZ2P2im5fdyJmP2tSd3arAv7 -``` - -## Create a Multisig Address - -Combine the pubkeys to create a `2of2` multisig address. - -A `2of2` address requires that both addresses sign for every transaction. - -::: tip - -You can customize the signature requirements for essentially any combination. For example, you can make a 3of5 multisig address that requires 3 of 5 available addresses for each transaction. - -::: - -Execute the following command on either node. The command returns the `redeemScript` json object, which is required to spend funds. - -##### Command - -```shell -./komodo-cli createmultisig 2 '["02dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a26","032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a2816"]' -``` - -##### Response - -```JSON -{ - "address": "bEP3HK73CboW8tGN8obyHUQteBzYjFzgNm", - "redeemScript": "522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae" -} -``` - -## Fund the multisig Address - -Fund the multisig address. - -(You may use either node.) - -##### Command - -```shell -./komodo-cli sendtoaddress bEP3HK73CboW8tGN8obyHUQteBzYjFzgNm 7.77 -``` - -##### Response - -``` -194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c -``` - -## Create the Raw Transaction - -As input we use the unspent vout of the transaction used to create the multisig address. We also place our desired target destination address in the transaction. - -In this example, we send the full `7.77` sum to the destination address. - -If you do not want to send the full amount, you must manually specify the "change" address and state how much of the change you desire to keep. - -Recall that any amount taken from the initial utxo and not included in either the destination address, or in the change address, will automatically be given to the miners as a mining fee. - -##### Command - -```shell -./komodo-cli createrawtransaction '[{"txid":"194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c","vout":1}]' '{"RP81MSVu39QgXhGDHfnk9d9KMnp4vhEVBu":7.77}' -``` -##### Response - -``` -0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f190100000000ffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000 -``` - -## Sign the Raw Transaction - -Sign the raw transaction using both nodes. - -## Sign Using Node One - -##### Command - -```shell -./komodo-cli signrawtransaction "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f190100000000ffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000" '[{"txid":"194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c","vout":1,"scriptPubKey":"a914121cbc7a828772bd4612bc7b9765cbbf13d0b3cc87","redeemScript":"522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae","amount":7.77}]' '["UrunDGyFJu5UFZG7BnFx9R6iaPmWaBX8iqHzRpFRjNp8kBEQYKNt"]' -``` - -##### Response - -```JSON -{ - "hex": "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f19010000009200483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000", - "complete": false, - "errors": [ - { - "txid": "194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c", - "vout": 1, - "scriptSig": "00483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae", - "sequence": 4294967295, - "error": "Operation not valid with the current stack size" - } - ] -} -``` - -## Sign Using Node Two - -Use the hex value from node one, but change the privkey to the privkey of node two's address. - -##### Command - -```shell -./komodo-cli signrawtransaction "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f19010000009200483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000" '[{"txid":"194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c","vout":1,"scriptPubKey":"a914121cbc7a828772bd4612bc7b9765cbbf13d0b3cc87","redeemScript":"522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae","amount":7.77}]' '["UsuE7jG8BD1CV2xuCoBCwgzzbs4HqZ2P2im5fdyJmP2tSd3arAv7"]' -``` - -##### Response - -```JSON -{ - "hex": "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f1901000000da00483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147304402200abc8c1e1e26090a7012df8859a3986229da34b0edd82c42a64efc8b89390e6702202582cbdce3de13fe59196228d4d0a6a80916e23ccb343f1cf32515688a938ebb0147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000", - "complete": true -} -``` - -## Broadcast the transaction - -Broadcast the raw hex to finish send the transaction. - -##### Command - -```shell -./komodo-cli sendrawtransaction 0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f1901000000da00483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147304402200abc8c1e1e26090a7012df8859a3986229da34b0edd82c42a64efc8b89390e6702202582cbdce3de13fe59196228d4d0a6a80916e23ccb343f1cf32515688a938ebb0147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000 -``` - -##### Response - -``` -23c2aaaf458ada3f171ee5d274e8dcfc91b62099ec15e4b2d02da2b2d1172cb1 -``` - -The above is the output txid which can be used in an online KMD block explorer to verify the transaction. - -## Useful Links -- [Detailed Article in the Russian Language](https://medium.com/@decker.komodo/%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D0%B8%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D0%B5%D0%B9-multisig-%D0%B2-komodo-9d8f8c48da52) -- [Multisig Web Tool](https://deckersu.github.io/coinbin/#newMultiSig) - diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/running-komodo-software-in-debug-mode.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/running-komodo-software-in-debug-mode.md deleted file mode 100644 index b03a2147c..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/running-komodo-software-in-debug-mode.md +++ /dev/null @@ -1,54 +0,0 @@ -# Running Komodo Software in Debug Mode - -## Introduction - -To run Komodo software in debug mode, follow these steps. - -## Install gdb - -```bash -sudo apt-get install gdb -``` - -## Run Komodo Daemon With `gdb` Tool - -Initiate your daemon using with `gdb -args` as a prefix. - -For example, the below command would initiate the Komodod daemon with mining active and a designated pubkey. - -```bash -gdb -args ./src/komodod -gen -genproclimit=2 -pubkey="03af2412ebf9517a43d192193490476fd0a44312c70755e07eb03b6d71338ebc9d" -``` -::: tip - -If you are having trouble initiating komodod in the shell, try use the absolute path to komodod. For example, /home/$USERNAME/komodo/src/komodod - -::: - -The shell should return the following prompt. - -```bash -gdb> -``` - -Execute `run` in the shell to start Komodo in debug mode. - -```bash -gdb> run -``` - -## Retrieving Backtrace Data - -Whenever komodod crashes, you will again see `gdb>` as a prompt. - -To recall the last stages of komodod before the crash, execute the following command. - -##### Command - -```bash -gdb> backtrace -``` - -The returned data can be shared with any Komodo developer to assist in troubleshooting Komodo development. - -Select and highlight all relevant data using the cursor, and then use `CTRL + SHIFT + C` to copy to the clipboard. diff --git a/docs/basic-docs/smart-chains/smart-chain-tutorials/smart-chain-api-basics.md b/docs/basic-docs/smart-chains/smart-chain-tutorials/smart-chain-api-basics.md deleted file mode 100644 index 03f41180a..000000000 --- a/docs/basic-docs/smart-chains/smart-chain-tutorials/smart-chain-api-basics.md +++ /dev/null @@ -1,1100 +0,0 @@ -# Smart Chain API Basics - -## API Tutorials: Introduction - -The following tutorial can assist in gaining hands-on experience with the essential Smart Chain API. - -In this tutorial, we create two new blockchains, called RT1 & RT2. - -The first blockchain, RT1, demonstrates the fundamental API concepts, such as how to create and utilize a simple test blockchain, how to query a blockchain for data, etc. - - - -For simplicity's sake, we use the blockchain [regtest](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#regtest) feature, which allows us to run a blockchain on a single node without having to connect to a network. - -After the tutorial, the developer should be able to repeat the same concepts on live and fully functional Komodo Smart Chains, assuming the Smart Chain in question has the proper CC features enabled. - -#### Tutorial Topics Outline - -Topics covered in this tutorial include: - -- How to create a simple Smart Chain for testing purposes -- How to execute a komodo-cli command to query the blockchain for existing data -- How to execute a curl command for the same purpose -- Understanding common API methods ("RPC's") -- Understanding common technology concepts in the Komodo ecosystem - - -### Tutorial Prerequisites - -#### komodod and komodo-cli - -The following tutorials assume that you have already [compiled the Komodo daemon](../.././basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#linux), and that you have used the default `~/komodo/src` directory as the root Komodo software directory. - -As with all software related to `komodod`, at the command line we use the terminal-based `komodo-cli` software, and the `curl` command, to access the daemon. - -## Komodo API Fundamentals Tutorial - -### Create a Regtest Blockchain - -The quickest way to establish your own development environment is to use the [regtest](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#regtest) feature. - -In regtest mode, the daemon creates a blockchain that is almost fully functional, save for a few exceptions. Two of the exceptions are that the chain runs on a single host, and the user instructs the daemon on when and how to perform new blocks (as opposed to receiving new blocks from a decentralized network of miners). - -The command to create our `RT1` regtest chain is as follows: - -```bash -./komodod -regtest -ac_name=RT1 -ac_supply=1000 & -``` - -##### ac_supply - -Note the `-ac_supply=1000` argument. This is the total number of coins we desire when the blockchain spawns. - -For more information, refer to the [ac_supply](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-supply) launch parameter. - -##### ac_name - -Also note the `-ac_name=RT1` argument. This is the blockchain ticker name we desire. For more information, refer to the [ac_name](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-name) launch parameter. - -There are many additional parameters that you can explore later in the [Antara Customizations](../../../basic-docs/antara/antara-setup/antara-customizations.html#antara-customizations) documentation. - -##### Observe the Response - -The daemon will return a response similar to the following: - -``` -[1] 22892 -ASSETCHAINS_SUPPLY 1000 -MAX_MONEY 106320417438 1063.20417438 -Created (/home/mylo/.komodo/RT1/RT1.conf) -call komodo_args.(./komodod) NOTARY_PUBKEY.() ->>>>>>>>>> RT1: p2p.13100 rpc.13101 magic.fd772ab9 4252445369 1000 coins -initialized RT1 at 1555581638 -finished loading blocks RT1 -fAddressIndex.0/0 fSpentIndex.0/0 -height.0 slowflag.1 possible.1 cmp.0 -``` - -From the response, note the following information: - -##### Smart Chain Supply - -``` -ASSETCHAINS_SUPPLY 1000 -``` - -We see the 1000 coin initial supply. - -##### Configuration File Location - -``` -Created (/home/mylo/.komodo/RT1/RT1.conf) -``` - -This is the location of the configuration file. - -Placing the configuration data here follows the Komodo convention of placing all relevant data for a Smart Chain in a subdirectory contained in the `~/.komodo/` directory. The new subdirectory for our regtest chain is named after the `RT1` value we gave to the `ac_name` parameter. - -##### Relevant RPC Data - -``` ->>>>>>>>>> RT1: p2p.13100 rpc.13101 magic.fd772ab9 4252445369 1000 coins -``` - -This information is the blockchain name, its network ports used for p2p (13100), and RPC control (13101). The magic number is a number the Komodo daemon uses for network purposes, and the number of coins is informational. - -##### Explanation of All Initial Daemon Output - -Here is an explanation of all of the output, as it appears in the above response. Many of the actual values will be different on your machine, although the underlying purpose of the value is the same. - -| Value | Description | -| ----- | ----------- | -| [1] 22892 | the process number; the value is dependent on your machine and will be different | -| ASSETCHAINS_SUPPLY 1000 | the number of coins when the blockchain initiates for its first time | -| MAX_MONEY 106320417438 1063.20417438 | this value is not important at this time; it states that 100 billion coins is the maximum possible amount the blockchain can mathematically support | -| Created (/home/mylo/.komodo/RT1/RT1.conf) | the location of the configuration file | -| call komodo_args.(./komodod) NOTARY_PUBKEY.() | this value specifies where the new coins from block rewards are sent; by default, the coins will be sent to your node's local wallet | -| >>>>>>>>>> RT1: p2p.13100 rpc.13101 magic.fd772ab9 4252445369 1000 coins | the blockchain name, its network ports and RPC controls; the magic number is used in Komodo networking and the number of coins derives from the ac_supply parameter included at runtime | -| initialized RT1 at 1555581638 | the time in seconds, past epoch, when the blockchain was initialized | -| finished loading blocks RT1 | informational | -| fAddressIndex.0/0 fSpentIndex.0/0 | informational and can be ignored for now | -| height.0 slowflag.1 possible.1 cmp.0 | informational and can be ignored for now | - -### Querying the Blockchain Using komodo-cli - -With the regtest Smart Chain operational we are prepared to execute our first API call. - -#### Access a Daemon via komodo-cli on a Smart Chain - -When using `komodo-cli` to access the daemon of a Smart Chain, we must add an additional argument to each terminal input. - -This required argument is the name of the Smart Chain for which the user desires `komodo-cli` to connect. The name is provided in the same format used to launch the chain. - -In our tutorial, the argument is: `-ac_name=RT1` - -Furthermore, as we are using the regtest feature, we must also include the `-regtest` argument with each terminal input. - -Therefore, each `komodo-cli` terminal input will begin with the following: - -```bash -./komodo-cli -regtest -ac_name=RT1 INSERT_API_CALL_HERE INSERT_ARGUMENTS_HERE -``` - -#### Using the getinfo API Method - -The [getinfo](../../../basic-docs/smart-chains/smart-chain-api/control.html#getinfo) API method does not require any additional parameters when called and provides useful information about our chain. - -To execute the method in the terminal we can use the `komodo-cli` software. - -#### Command - -```bash -./komodo-cli -regtest -ac_name=RT1 getinfo -``` - -#### Response - -```json -{ - "version": 2001526, - "protocolversion": 170007, - "KMDversion": "0.3.3b", - "notarized": 0, - "prevMoMheight": 0, - "notarizedhash": "0000000000000000000000000000000000000000000000000000000000000000", - "notarizedtxid": "0000000000000000000000000000000000000000000000000000000000000000", - "notarizedtxid_height": "mempool", - "KMDnotarized_height": 0, - "notarized_confirms": 0, - "walletversion": 60000, - "balance": 0.00000000, - "blocks": 0, - "longestchain": 0, - "timeoffset": 0, - "tiptime": 1296688602, - "connections": 0, - "proxy": "", - "difficulty": 1, - "testnet": false, - "keypoololdest": 1555581641, - "keypoolsize": 101, - "paytxfee": 0.00000000, - "relayfee": 0.00000100, - "errors": "", - "name": "RT1", - "sapling": -1, - "p2pport": 13100, - "rpcport": 13101, - "magic": -42521927, - "premine": 1000 -} -``` - -Note the `blocks` count of zero `0` and the `balance` sum of `0`. While our regtest chain's daemon is operational, we have yet to mine the genesis block and collect the initial coin value. - -### Querying the Blockchain Using curl - -Alternatively, we can execute the [getinfo](../../../basic-docs/smart-chains/smart-chain-api/control.html#getinfo) method using the Unix `curl` command. - -##### Sourcing the Configuration File - -The `curl` command will also need information about which Smart Chain daemon the user desires to connect. However, the `curl` command will receive these instructions in a different manner. - -The user must provide the `myrpcuser`, `myrpcpassword`, and `myrpcport` values from the Smart Chain's configuration file. - -The configuration file is automatically generated on Smart Chain creation, and is formatted for use with the Unix `source` command. - -To import all values into our terminal process environment, execute the following: - -```bash -source ~/.komodo/RT1/RT1.conf -``` - -We can test that the variables were loaded correctly with the following commands: - -```bash -echo $rpcuser $rpcpassword $rpcport -``` - -The terminal should return the values from the configuration file. - -##### Executing the curl Command - -With these variables set we can now easily use the `curl` command to execute the `getinfo` API method: - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ -``` - -We execute the `curl` command with `-s` silent option; this mutes irrelevant response data. - -The `$rpcuser:$rpcpassword` and the `...$rpcport` arguments utilize our sourced environment variables. - -The HTTP header `-H`, `--data-binary`, and `content-type: text/plain;` arguments instruct `curl` to reply with a json object. - -Without further intervention, the returned json response will be unformatted and difficult to read. - -To improve readability, the developer may optionally install and utilize the `jq` terminal software. - -[Link to download and install jq](https://stedolan.github.io/jq/download/) - -Once installed, add a `|` pipe and a ` jq '.'` reference at the end of the curl command: - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - -This should return a well formatted json object. - -## Preparing Your Local Wallet - -The wallet is not part of the blockchain. Rather, it is a separate application that tracks your private keys and grants access to them upon user request. This separate application is built into the Komodo daemon and can be accessed using the API. - -Common API commands include the following: - -| Command | Description | -| ------- | ----------- | -|[getnewaddress](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#getnewaddress) | get a new address | -| [validateaddress](../../../basic-docs/smart-chains/smart-chain-api/util.html#validateaddress) | get the public key of the new address; used often when developing a custom application-specific blockchain | -| [dumpprivkey](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#dumpprivkey) | get the private key of an address | - -We save details from each response, so that we may avoid continually obtaining new wallet keys. - -The next two sections demonstrate how to obtain a new private key. The first section uses `komodo-cli` software, and the second section repeats the same API steps using the `curl` command. - -### Preparing Your Wallet Using komodo-cli - -#### getnewaddress - -To obtain a new address, we use the `getnewaddress` API method: - -```bash -./komodo-cli -regtest -ac_name=RT1 getnewaddress -``` - -Response: - -```json -RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs -``` - -Your response will be a different address of the same format. - -#### validateaddress - -To obtain the public key, also called the "pubkey", we use the `validateaddress` API method. - -``` -./komodo-cli -regtest -ac_name=RT1 validateaddress RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs -``` - -Response: - -``` -{ - "isvalid": true, - "address": "RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs", - "scriptPubKey": "76a91457afccfe042ee068257f95873e1fd3cd4aa210ad88ac", - "segid": 28, - "ismine": true, - "iswatchonly": false, - "isscript": false, - "pubkey": "0350dd9b828e92600166dd74e521ac8510eb39064dfb30111c990396864542ce56", - "iscompressed": true, - "account": "" -} -``` - -Make a note of the `pubkey` value. We will use it towards the end of the tutorial. - -#### dumpprivkey - -Use the response from `getnewaddress` as an argument for the `dumpprivkey` API method. - -```bash -./komodo-cli -regtest -ac_name=RT1 dumpprivkey RWbzxx8tKncvcVBzBCetMsPRrcB3YFsXhw -``` - -```json -REDACTED_FOR_TUTORIAL -``` -The response is the private key for this address. - -The private key should never be shared under any circumstances. We have redacted the response for this tutorial. - -### Preparing Your Wallet Using curl - -#### getnewaddress - -A `curl` command to obtain a new address using the `getnewaddress` API method. - -##### Command - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnewaddress", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - -##### Response - -```json -{ - "result": "RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B", - "error": null, - "id": "curltest" -} -``` - -#### validateaddress - -A `curl` command to obtain the `pubkey` using the `validateaddress` API method. - -##### Command - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "validateaddress", "params": ["RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - -##### Response - -```json -{ - "result": { - "isvalid": true, - "address": "RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B", - "scriptPubKey": "76a914fd3ca56e0dc10a080c1d351b42c75bd82fc76d2288ac", - "segid": 56, - "ismine": true, - "iswatchonly": false, - "isscript": false, - "pubkey": "03cb108cdb893a4a6c72c2fe23768929ada335103c6fa2bea428f5204bd051dacc", - "iscompressed": true, - "account": "" - }, - "error": null, - "id": "curltest" -} -``` - -#### dumpprivkey - -A `curl` command to obtain the `pubkey` using the `validateaddress` API method. - -##### Command - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "dumpprivkey", "params": ["RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - -##### Response - -```json -{ - "result": "REDACTED_FOR_TUTORIAL", - "error": null, - "id": "curltest" -} -``` - -## Generating Blocks and Getting the New Coins - -When connecting to an existing blockchain that already has a populated network of miners or stakers, the user does not need to be concerned about how blocks are generated. - -However, in this tutorial we are running a regtest chain, and therefore we must instruct the daemon to generate new blocks. - -This also provides us with a useful opportunity to discuss the nature of simple mining in the Komodo ecosystem. The methods we discuss here reflect mining on a proof-of-work based Smart Chain. - -The reader should be aware that Komodo also offers proof-of-stake mining, and hybrid models that blend proof-of-work with proof-of-stake. For more information, the reader may turn to the [ac_staked](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-staked) feature. - -Here are several common API methods for mining: - -| Command | Description | -| ------- | ----------- | -| [generate](../../../basic-docs/smart-chains/smart-chain-api/generate.html#generate) | the number of blocks to generate | -| [getblock](../../../basic-docs/smart-chains/smart-chain-api/blockchain.html#getblock) | query information about a block | -| [gettransaction](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#gettransaction) | query a transaction | - -In a moment, we will use these commands to generate new blocks on our regtest chain, and in the process of generating, the blockchain will create new coins. - -#### Understanding the Coinbase Transaction - -The reader should be aware of the manner in which a blockchain creates new coins. - -When a blockchain initiates for the first time, and before it has mined the first block, the total sum of coins on the blockchain is always `0`. - -To add coins into the total coin supply, the blockchain must mint new coins. This minting process occurs in a special transaction that is included as the first transaction in each block of the blockchain. - -This transaction is called the `coinbase` transaction. - -While every other transaction on the blockchain can only take coins from the existing supply, the `coinbase` transaction may create new coins from nothing. - -These new coins can be sent to any number of locations. The rules of the blockchain, as set by the blockchain's developer, determine how many coins are minted, and who receives the coins. - -For more information about how to customize your `coinbase` transactions on a Komodo Smart Chain, observe the many different customization parameters in the [Antara Customizations](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-algo) documentation. - -For example, read about [ac_reward](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-reward), [ac_eras](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-eras), [ac_founders](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-founders), and many others. - -In our tutorial, when we mine our first block, all of the `1000` new coins we indicated will be mined in the first block's `coinbase` transaction. By default, these coins are distributed immediately into our own local wallet. - -### Generating Blocks Using komodo-cli - -#### generate - -We now generate a few blocks using the `generate` API method. - -##### Command - -```bash -./komodo-cli -regtest -ac_name=RT1 generate 2 -``` - -##### Response - -```json -[ - "0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab", - "0de2bb48b3a3ef47d5ece90b1ffeccc81b9609879ab86cc03a77cf248adea25d" -] -``` - -The response contains an array of blockhashes. These are the hashes of the blocks generated. - -#### getblock - -To inspect the particular information about any given block, we use the `getblock` API method and include our desired blockhash as an argument. - -```bash -./komodo-cli -regtest -ac_name=RT1 getblock 0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab -``` - -Alternatively, with `getblock` we can instead include the desired block `height` of the block we wish to inspect. - -In our case, we desire to inspect the genesis block, which is the first block ever mined on our Smart Chain. Therefore, the block `height` will be `1`. - -##### Command - -```bash -./komodo-cli -regtest -ac_name=RT1 getblock 1 -``` - -##### Response - -```json -{ - "hash": "0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab", - "confirmations": 2, - "rawconfirmations": 2, - "size": 276, - "height": 1, - "version": 4, - "merkleroot": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", - "segid": -1, - "finalsaplingroot": "3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb", - "tx": [ - "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006" - ], - "time": 1555589136, - "nonce": "0000d66a538f8cc7de721633f23e5d52649e5031a3f0a90e9821189e5b530056", - "solution": "01de6014269f75bae931362838b75c5fc3e318c620d2a203d65b9d52691b3d056ae753fc", - "bits": "200f0f0f", - "difficulty": 1, - "chainwork": "0000000000000000000000000000000000000000000000000000000000000022", - "anchor": "59d2cde5e65c1414c32ba54f0fe4bdb3d67618125286e6a191317917c812c6d7", - "blocktype": "mined", - "valuePools": [ - { - "id": "sprout", - "monitored": true, - "chainValue": 0.00000000, - "chainValueZat": 0, - "valueDelta": 0.00000000, - "valueDeltaZat": 0 - }, - { - "id": "sapling", - "monitored": true, - "chainValue": 0.00000000, - "chainValueZat": 0, - "valueDelta": 0.00000000, - "valueDeltaZat": 0 - } - ], - "previousblockhash": "029f11d80ef9765602235e1bc9727e3eb6ba20839319f761fee920d63401e327", - "nextblockhash": "0de2bb48b3a3ef47d5ece90b1ffeccc81b9609879ab86cc03a77cf248adea25d" -} -``` - -Note in the response the `tx` value. - -```json - - ... - - "tx": [ - "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006" - ], - - ... - -``` - -This value is an array containing all transactions performed within this block. Because it is the genesis block, and because we did not send any transactions on our blockchain, the only transaction is our `coinbase` transaction, wherein the `1000` coins were minted and sent to our local wallet. - -#### gettransaction - -To observe this transaction, we use the [gettransaction](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#addmultisigaddress) API method. - -##### Command - -```bash -./komodo-cli -regtest -ac_name=RT1 gettransaction 4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006 -``` - -##### Response - -```json -{ - "amount": 1000.07809721, - "rawconfirmations": 2, - "generated": true, - "confirmations": 2, - "blockhash": "0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab", - "blockindex": 0, - "blocktime": 1555589136, - "expiryheight": 0, - "txid": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", - "walletconflicts": [ - ], - "time": 1555589136, - "timereceived": 1555589136, - "vjoinsplit": [ - ], - "details": [ - { - "account": "", - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "category": "generate", - "amount": 1000.07809721, - "vout": 0, - "size": 98 - } - ], - "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff01b912ee4817000000232103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac1068b85c" -} -``` - -Note that the `amount` value is slightly higher than `1000`. This is normal. It is due to the internal mathematical complexities of a blockchain. - -### Generating Blocks Using curl - -#### generate - -We have already generated the genesis block. The following is a sample of using `curl` with the `generate` API method to generate 5 blocks. - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "generate", "params": [5]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - - - -#### getblock - -Here is a sample of using `curl` with the `getblock` API method on the blockhash of the genesis block. - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - -To use the block `height` instead, the `curl` command is formatted as follows. - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["1"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - - - -#### gettransaction - -Here is the `curl` command to retrieve the first block's `coinbase` transaction. - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettransaction", "params": ["4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - - - - -## Inspecting the wallet - -We have generated blocks and received the value from the `coinbase` transactions. Now, we would like to inspect the contents of our wallet. We will execute the [listunspent](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#listunspent) method for this purpose. - -However, before we execute this command, the reader should familiarize themselves with the way a blockchain stores value in a wallet. The title of the technical concept to understand is, "utxo." This stands for "unspent transaction." - -The way a utxo works is often difficult to understand for newcomers to blockchain technology. We have provided an article that explains this concept in more detail here, and we recommend the reader study it before proceeding. - -The reader may turn to [the Core Technology Discussion regarding utxos for more information.](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-utxo-an-elusive-yet-fundamental-concept) - -In blockchain technology, all value is contained within utxos. Every transaction consumes a utxo and creates new utxos. - -Once you are comfortably familiar with the concept, you are prepared to continue with the tutorial. - -### Listing Unspent Transactions Using komodo-cli - -A developer should be able to easily validate ownership of a utxo, as only the owner of a utxo is able to spend it. - -#### listunspent - -For this purpose, we turn to the [listunspent](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#listunspent) API method: - -```bash -./komodo-cli -regtest -ac_name=RT1 listunspent -``` - -The response is an array of transactions ids, called `txid` for brevity's sake. - -```json -[ - { - "txid": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 1000.07809721, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 7, - "confirmations": 7, - "spendable": true - }, - { - "txid": "148d8970e3c7e113bd3b4038c1efdd273a6d975f45b194b4257fda6acec4b14a", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 5, - "confirmations": 5, - "spendable": true - }, - { - "txid": "a0e13cad677b4fede6211c78069aed9345880147ea79edb647383787eb15fe51", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 6, - "confirmations": 6, - "spendable": true - }, - { - "txid": "01be6fa42a897009477f7a7248c538896ad39a24e132e9bcba00138c781fd57b", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 1, - "confirmations": 1, - "spendable": true - }, - { - "txid": "73ba44853735808e0b07c45bb1e1acd7c0323bc72e872d4bae92428ad03899be", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 3, - "confirmations": 3, - "spendable": true - }, - { - "txid": "78a401c6bb7765d73fedf1e2c033935db281a94a58d35f33e6986bda36e57bd5", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 2, - "confirmations": 2, - "spendable": true - }, - { - "txid": "d81523ef05f9d19abca61982f8c0d5374eb61ecb88c923226277bc0d3e7120e6", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 4, - "confirmations": 4, - "spendable": true - } -] -``` - -### Listing Unspent Transactions Using curl - -With `curl`, the terminal command for `listunspent` is as follows: - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listunspent", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - - - -## Setting the pubkey Parameter - -Observe this first `txid` returned from the `listunspent` transaction: - -```json - ... - - { - "txid": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", - "vout": 0, - "generated": true, - "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", - "segid": 47, - "amount": 1000.07809721, - "interest": 0.00000000, - "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", - "rawconfirmations": 7, - "confirmations": 7, - "spendable": true - }, - - ... -``` - -Notice that the address to which these `1000` coins were sent is not the address we generated earlier. Rather, it is an entirely new address. At the moment we may not mind, because the coins were sent to an address that the wallet automatically generated and which we own. - -However, what if we want to control the address to which coins are sent when mining? When this is the case, we turn to the [pubkey](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#pubkey) launch parameter. - -The `pubkey` we input into this parameter can be the same `pubkey` we generated earlier in the tutorial. - -#### Stopping the Daemon Using komodo-cli - -To place this pubkey at startup, we must first stop the Smart Chain. - -For this we use the [stop](../../../basic-docs/smart-chains/smart-chain-api/control.html#stop) API method. - -##### Command - -```bash -./komodo-cli -regtest -ac_name=RT1 stop -``` - -##### Response - -``` -RT1 server stopping -``` - -#### Stopping the Daemon Using curl - -Using `curl` to stop the daemon. - -##### Command - -```bash -curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "stop", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' -``` - -##### Response - -```json -{ - "result": "RT1 server stopping", - "error": null, - "id": "curltest" -} -``` - -#### Restarting the Smart Chain With the pubkey Parameter - -Execute the following to relaunch `komodod` with the `pubkey` we saved at the beginning of the tutorial. - -##### Command - -```bash -./komodod -regtest -ac_name=RT1 -ac_supply=1000 -pubkey=0350dd9b828e92600166dd74e521ac8510eb39064dfb30111c990396864542ce56 & -``` - -Now, when we generate new blocks, the `coinbase` transaction sends new coins to the new address associated with our `pubkey`. - -First, we generate a new block using komodo-cli. - -```bash -./komodo-cli -regtest -ac_name=RT1 generate 1 -``` - -Response: - -```json -[ - "06a639d7821f6ee803c6c53fe53a6b1dfe65063240ebc3a2907f7658cad8301e" -] -``` - -We can repeat the `getblock` method on the blockhash returned above to see the `coinbase` transaction. - -With that `coinbase` transaction, we can the execute `gettransaction` to see the address to which the new coins were sent. - -After executing these previously explained methods, here is a snippet of the final result: - - -```json -... - { - "txid": "2411800f0e9c15f5233453ffc17ff301f43043c70887c256a041945d341796f0", - "vout": 0, - "generated": true, - "address": "RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs", - "segid": 28, - "account": "", - "amount": 0.00010000, - "interest": 0.00000000, - "scriptPubKey": "210350dd9b828e92600166dd74e521ac8510eb39064dfb30111c990396864542ce56ac", - "rawconfirmations": 1, - "confirmations": 1, - "spendable": true - } -...snipped -``` - -Note that the `address` in this output is the one associated with our desired `pubkey`. - -## Closing - -Some of the fundamental blockchain and API skills we have learned include the following: - -- How to create a new Komodo Smart Chain -- How to make a single-node regtest chain, for development purposes -- How to launch with the pubkey set -- How to generate new blocks -- How to obtain information about blocks and transactions -- The nature of a utxo -- The nature of a coinbase transaction - -Having completed this tutorial, the developer should be able to explore the many API methods in the Komodo documentation. - diff --git a/docs/basic-docs/start-here/README.md b/docs/basic-docs/start-here/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/start-here/about-komodo-platform/README.md b/docs/basic-docs/start-here/about-komodo-platform/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/start-here/about-komodo-platform/about-komodo-platform.md b/docs/basic-docs/start-here/about-komodo-platform/about-komodo-platform.md deleted file mode 100644 index 6f299e8ac..000000000 --- a/docs/basic-docs/start-here/about-komodo-platform/about-komodo-platform.md +++ /dev/null @@ -1,133 +0,0 @@ -### Komodo Platform Overview - -After years of innovation and development, Komodo's multi-chain architecture overcomes the challenges faced by other smart-contract platforms. - -The philosophy behind Komodo's multi-chain architecture relies on four pillars. - -- Security -- Scalability -- Interoperability -- Adaptability - -With these four pillars in place, users of all types will find powerful, customizable solutions that will set your blockchain creativity free. - -
- - - -
- -
- -### Security - -#### Enjoy the Protection of the Bitcoin Hash Rate - -Secure your project with the power of the Bitcoin network via Komodo’s delayed proof of work security mechanism. Don’t waste time worrying about attackers. - -
- -
- -- Approximately every half hour, a hash of the developers blockchain is notarized to Bitcoin -- All transactions included in the hash are considered to have achieved finality -- For the consensus mechanism, arbitrarily choose between a mixture of Proof-of-Work and Proof-of-Stake - -
- -
- - - -
- -
- -### Scalability - -#### Have a Blockchain All To Yourself. Want More Than One? No Problem. - -Developers and their users have a full Smart Chain all to themselves, and can combine any number of Smart Chains together into one cluster. - -
- -
- -- Developers and their users can securely own a full Smart Chain -- Each Smart Chain is completely autonomous -- If your project grows beyond the capacity of a single chain, simply add more -- Scale your maximum transaction-per-second throughput into the millions, if desired -- No gas fees. All transaction fees are paid in your Smart Chain’s coin - -
- -
- - - -
- -
- -### Interoperability - -#### Link Your Smart Chain to Other Chains - -Your project is interoperable with all others in the Komodo ecosystem, plus connected with over 99% of coins and tokens through Komodo’s industry-leading atomic-swap technology. - -
- -
- -- Komodo’s Multi-Chain Syncing feature allows you to scale out linearly on demand -- Smart Chains can verify and update local state based on the activity of compatible Smart Chains -- Transfer assets and tokens between compatible Smart Chains -- Use Komodo's atomic-swap DEX software to trade your Smart Chain assets with Non-Smart assets. - -
- -
- - - -
- -
- -### Adaptability - -#### Develop Your Smart Chain at Will - -Adapt your blockchain to create a purpose-built solution that fits your individual needs. Receive all new features developed by Komodo to ensure your project is future-proofed. - -
- -
- -- Twenty-four different launch parameters are available to customize the functionality of your Smart Chain -- Rely on the Antara framework to fully customize your Smart Chain with unique and arbitrary code within the consensus mechanism -- Share and adopt code in Komodo's open-source community -- Dispose of Smart Chains that become data-weight heavy, or transfer them to fresh Smart Chains for ease of use -- No need for a virtual machine (VM) nor a VM-based programming language - -
- -#### Together, the Komodo Platform is Unlike Anything Else - -With the Komodo architecture at your command, you are prepared to lift your Smart Chain software to levels never before seen in the blockchain industry. - -### Komodo's White-Label Software Brings Your Innovation to Market Faster - -The Komodo Platform offers many free white-label applications that can help you bring your innovation to market faster. - -- Atomic-Swap Decentralized Exchange & Multi-Asset Wallet -- Decentralized-Crowdfunding App -- Custom Block Explorers -- SPV Electrum Server Integration -- Core Antara Modules - -### Installing, Using, and Testing Komodo Software is Free - -The best way to learn about Komodo is to use it for yourself. - - diff --git a/docs/basic-docs/start-here/about-komodo-platform/orientation.md b/docs/basic-docs/start-here/about-komodo-platform/orientation.md deleted file mode 100644 index 5613e5adc..000000000 --- a/docs/basic-docs/start-here/about-komodo-platform/orientation.md +++ /dev/null @@ -1,88 +0,0 @@ -# Documentation Orientation - -The following section answers common questions a newcomer may have, and prepares the new reader for the installation procedure. - -### Intended Audience of this Technical Documentation Website - -This website is targeted for developers in the Komodo ecosystem. - -Users who are not interested in developing Komodo-based software, but only in using existing software, should instead turn to the Komodo Support website for questions and answers. - -[Link to Komodo Support Website](https://support.komodoplatform.com) - -### Assumptions for this Documentation - -To limit the scope of what we cover on the technical-documentation website, we list the following prerequisite knowledge. - -#### Familiarity with the Concept of Blockchain Technology - -The reader should be generally familiar with the basic concept of blockchain technology and why it matters. If you're not yet familiar, we recommend that you first read our Core Technology Discussion regarding our Delayed Proof of Work consensus mechanism. - -[Link to Core Technology Discussion: Delayed Proof of Work](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html) - -#### Simple Programming Skills - -Much of the content on this site will be more understandable for the reader who has a rudimentary understanding of a mainstream programming language. - -Beginner-level knowledge should be sufficient for the majority of the site. For example, the reader should be able to: - -- Execute commands on the command line -- Utilize an Application Programming Interface (API) -- Write and execute a rudimentary script in any mainstream language - -If you do not have these prerequisite experiences, we encourage you to reach out to our community on [Discord.](https://komodoplatform.com/discord) There are thousands of free tutorials online that can help you quickly cover these topics. We will be happy to help you in your search. - -### A Note Regarding Komodo Language Compatibility - -Komodo is a highly capable blockchain technology, and it is designed for compatibility with essentially all mainstream programming languages. However, not all developers will need to use its most advanced aspects. - -#### A Normal Developer in the Komodo Ecosystem - -A typical developer in the Komodo ecosystem will build all their application logic in a separate application that runs outside of their Smart Chain daemon. - -The developer's software will send API requests to their Smart Chain's daemon to update the blockchain state and take advantage of Komodo's default Antara Modules. (Antara Modules provide functionality similar to the "smart contracts" that are common on other platforms. However, we argue that Antara Modules are dramatically more powerful.) - -For this developer, any programming language that is capable of sending API requests to the software daemon is compatible. - -#### An Advanced Antara Developer - -A highly advanced developer may be interested to take advantage of the full potential of Komodo technology. - -This developer can utilize Komodo's Antara Framework to add arbitrary code to the consensus mechanism of their autonomous Smart Chain. - -Although the Antara Framework can be compatible with essentially all mainstream programming languages, at this time we encourage developers to stay close to the C/C++ languages. - -### The Cost of a Smart Chain - -#### Installation and Testing is Free - -Creating and experimenting with Komodo Smart Chains is completely free. Even for Production Smart Chains, hardware needed to run the Smart Chains and the other essential associated infrastructure like Electrum servers, Explorers is the only expense if you are doing everything by yourself. - -#### Production Smart Chains Typically Require Komodo's Security Services - -If your Smart Chain is pure PoW based and doesn't include greater than 50% [PoS](../../../../antara/antara-setup/antara-customizations.html#ac-staked) based block generation, it is only truly secure once it receives the Komodo dPoW Security Service. - -Please reach out to our bizdev team for a cost quote on our [Discord](https://komodoplatform.com/discord) live-chat server. Their usernames are: - -- `ptyx#6840` -- `polycryptoblog#1173` - -### The Cost of Using AtomicDEX Software - -Currently, there are no additional costs for AtomicDEX beyond the fees listed for each trade. - -### Differences between KMD and a Smart Chain - -The main KMD blockchain runs on the same underlying framework as all Smart Chains in the ecosystem, but not all features are active on the KMD blockchain. - -The KMD chain's active features include Bitcoin-hash rate supported security and the ability to execute Antara Modules. Other features, such as zero-knowledge privacy, are disabled. - -This limitation is intentional. The KMD chain holds all the meta data of the ecosystem. By keeping the functionality limited, Komodo discourages rapid data growth on this central blockchain. - -All other Smart Chains in the ecosystem are fully customizable. - -### Licensing Information - -All technical-documentation content on this website can be considered to be available under the MIT standard license. Some of the content, including many of the remote procedure call (RPC) documentation that relates to upstream software, such as Bitcoin and Zcash, is derived from upstream documentation that is also freely available. - -For questions and inquiries about licensing information, please reach out to the Komodo team. diff --git a/docs/basic-docs/start-here/about-komodo-platform/product-introductions.md b/docs/basic-docs/start-here/about-komodo-platform/product-introductions.md deleted file mode 100644 index dee1b4fdf..000000000 --- a/docs/basic-docs/start-here/about-komodo-platform/product-introductions.md +++ /dev/null @@ -1,202 +0,0 @@ -# Product Introductions - -## Smart Chains & Antara - -Komodo's Smart Chain technology allows you to create secure and fully autonomous blockchains that are designed for a specific purpose. - - - -#### Smart Chains Rely on the Next Step in Blockchain Evolution: The Antara Framework - -The Antara framework allows you to customize your Smart Chain and add arbitrary code to the consensus mechanism. - -This blockchain evolution allows innovators to better meet the demands of your customers. - -#### Comparing a Smart Chain to a Smart-Contract Platform - -| Layer | Branded Terminology | Universally Defined As: | Smart-Contract Comparison | -| ----- | ------------------- | ----------------------- | ------------------------- | -| Application Layer | Antara Apps | Smart-Chain Apps | dApps | -| API Layer | Antara API | Smart-Chain API | - | -| Service Layer | Antara Module | Smart-Chain Module | Smart Contract | -| Blockchain Layer | Antara Smart Chains | Smart Chains | (Shared Chain) | -| Platform Layer | Komodo Platform | Smart-Chain Platform | Smart-Contract Platform | - -### Smart Chains and Antara Create a Convenient Development Workflow - -For developers, the unique combination of Smart Chain technology and Antara simplifies the adoption of blockchain technology. - -- Start by creating a new Smart Chain that will serve your specific application -- Use the library of existing Antara modules to craft application-specific functionality -- Optionally, use Antara to add arbitrary code to your consensus mechanism -- When your Smart Chain becomes popular, scale into a cluster of Smart Chains -- Link your Smart Chain to other Smart Chains using Antara and Komodo technology -- Trade your assets with essentially any blockchain token using Komodo's AtomicDEX -- Stay up-to-date with the latest industry innovations through no-cost updates - -[Read an in-depth discussion on the advantages of the Antara Framework here.](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.html) - -### The Architecture of Antara-Powered Smart Chains - -
- - - -
- --------------------------------------- -
- - - -
- -
- -#### Antara API - -Produced by Antara Modules - -- Open API -- Permissionless Innovation -- Language Agnostic - -
- --------------------------------------- -
- - - -
- -
- -#### Antara Modules - -Attached to the chain daemon. - -- Pluggable Modules -- Growing Module Library -- Build Your Own - -
- --------------------------------------- -
- - - -
- -
- -#### Antara Smart Chains - -Purpose-built blockchains - -- Autonomous & Sovereign -- Customizable Parameters -- Atomic Swap Compatible - -
- --------------------------------------- -
- - - -
- -
- -#### Komodo Platform - -Composable & Open - -- Connect to the Bitcoin Hash Rate -- Composable Architecture -- Open-Source Innovation - -
- --------------------------------------- - -### Advantages of the Antara Framework - -#### Programmable Daemon - -Arbitrary code is added directly into the blockchain daemon. This stands apart from the traditional smart-contract platforms, which abstract a smart contract on top of a virtual machine. - -#### Modular Design - -Smart Chains are composed of independent and autonomous modules that are decoupled from the underlying blockchain consensus mechanism. - -#### Autonomous & Sovereign - -Smart Chains are not child chains, nor are they dependent on other blockchains. - -#### Turing-Complete - -The Antara framework supports C/C++, and in the future it will also support other languages. Therefore, Antara allows for Turing-complete code. With Antara, any program or software can be coded to run within your blockchain daemon. - -#### No Gas Fees - -There are no gas fees with Antara. Regardless of how many processes an Antara module requires, running an instance of the module will only need a single transaction fee, paid in your blockchain’s coin. - -#### Antara Module Library - -The Antara framework already hosts a library of plug-and-play modules. Each module can add special conditions that affect the nature of transaction consensus on your Smart Chain. - -#### Create Your Own Modules - -Experienced developers can write custom modules, creating the building blocks and RPC calls they need to build more advanced blockchain-based software. - -[Learn more about Smart Chains here.](../../../basic-docs/start-here/core-technology-discussions/antara.html#antara-smart-chains-2) - -## AtomicDEX - -Komodo provides open-source atomic-swap software for trading seamlessly between essentially any blockchain asset in existence. - -
- - - -
- -#### Enjoy All the Benefits of the Old System, and of the New - -Everything that was possible in the old centralized-exchange system is also possible in the new atomic-swap system. - -High-speed trading is easy, the DEX API allows you to create atomic-swap powered apps and trading bots, and you can even trade on your mobile phone. - -Our DEX software is not bound to Komodo-based blockchain assets. If a blockchain asset can trade on a centralized exchange, odds are you can atomically swap this asset on our DEX software. - -#### Skip the Centralized Middleman and Trade Directly with Your Trading Partner - -In an atomic swap, there is no need to lend your money to a third party for temporary holding. This keeps security in the hands of the user, reduces the cost of fees, and prevents the users from coalescing their funds into a large target for hackers. - -#### Keep Your Private Keys Private, At All Times - -Unlike a centralized exchange, users maintain ownership over their blockchain assets at all times, right up until the moment when their assets are atomically swapped. - -#### Join the Crowd, or Start a New One - -Users create their own liquidity pools for trading between assets. You can use a pool that is already established, or start your own pool. - -#### No Off-Chain Settlements Required - -The Komodo software uses atomic-swap technology, pioneered by Tier Nolan and our very own JL777, to ensure that a trade either happens, or it doesn't. If a trade stalls or fails halfway through the process, blockchain software ensures that these funds automatically reappear in the users' wallets. - -#### Integrate Your Smart-Chain Asset with Our Software - -Integration requires only a few simple steps, and once up and running, you are free to trade your new blockchain-based asset with whomever you decide. - -You are free to discover your own audience. - -[Read an in-depth discussion about AtomicDEX here.](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html#why-is-atomicdex-special) - diff --git a/docs/basic-docs/start-here/about-komodo-platform/simple-installations.md b/docs/basic-docs/start-here/about-komodo-platform/simple-installations.md deleted file mode 100644 index 93f00637d..000000000 --- a/docs/basic-docs/start-here/about-komodo-platform/simple-installations.md +++ /dev/null @@ -1,55 +0,0 @@ -# Simple Installations - -## Smart Chain Installation - -To install the Komodo daemon, `komodod`, and its necessary counterpart, `komodo-cli`, the simplest method is to download pre-compiled binaries. - -Downloadable packages are available for Linux, MacOS, and Windows. - -#### Link to Download Software - -[Download and unzip the software files for your operating system..](https://github.com/KomodoPlatform/komodo/releases) - -#### Installing the Simple Downloadable Files - -Once unzipped, the executables do not require installation. Simply find `komodod` and `komodo-cli` in the directory where you unzipped the files. - -You may also build `komodod` and `komodo-cli` from source. This is not required, but it is considered the best practice. Building from source enables you to receive the latest patches and security upgrades the moment they are pushed to the `komodod` source. - -#### Using the official Docker image - -Komodo offers a Docker image that has pre-built versions of the Komodo software. The image is based on the Ubuntu operating system and offers different versions of the software that are built from different Komodo Github repositories, such as the `dev`, `beta`, and `research` branches. - -The Docker image can be found here: [https://hub.docker.com/r/komodoofficial/komodo](https://hub.docker.com/r/komodoofficial/komodo). - -An example of how the image can be used is available in this [github repository](https://github.com/tonymorony/komodo_docker_tests). - -#### See the Smart Chains Documentation for Further Details - -Please see the full [Smart Chains](../../../basic-docs/smart-chains/introduction-to-smart-chain-documentation.html) technical documentation for full software explanations. - -You will find [a walkthrough on building from source here.](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html) - -## AtomicDEX Installation - -#### Installing AtomicDEX Software - -The following links contain downloadable AtomicDEX software. Simply download the files appropriate for your operating system, extract them to your desired location, and double click the application to begin. - -[Link to AtomicDEX Software - Simple Installations](https://github.com/KomodoPlatform/atomicDEX-API/releases) - -#### Using the official Docker image - -Komodo offers a Docker image that features the AtomicDEX software. This Docker image is based on the Ubuntu (Linux) operating system. - -The image can be found here: [https://hub.docker.com/r/komodoofficial/atomicdexapi](https://hub.docker.com/r/komodoofficial/atomicdexapi). - -An explanation of how the image can be used is available in the "Overview" section of the above linked webpage. - -#### Additional AtomicDEX Documentation - -Please see the following links for further details regarding AtomicDEX software. - -[Link to Source Code Installation Methods](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) - -[Link to AtomicDEX API](../../../basic-docs/atomicdex/atomicdex-api.html) diff --git a/docs/basic-docs/start-here/core-technology-discussions/antara.md b/docs/basic-docs/start-here/core-technology-discussions/antara.md deleted file mode 100644 index f0e5e458c..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/antara.md +++ /dev/null @@ -1,116 +0,0 @@ -# The Antara Framework - -## Introduction - -Antara is an adaptable framework for end-to-end blockchain development. This framework allows developers to build blockchain-based applications in a more simple, quick, and less resource intensive manner than ever before. The framework reduces the barriers to adopting blockchain technology and opens up a universe of possibilities. - -#### The Three Layers of the Antara Framework - -There are three layers to Komodo’s Antara Framework. - -##### Generating Customizable Smart Chains - -The first layer allows for the generation of a customized, independent chain called a Smart Chain. - -##### Core-Level Antara Modules - -Modules are inserted into the consensus mechanism of a Smart Chain that allow the developer to change the nature of the chain. - -##### Antara Application Programmable Interface - -The third layer is the technology that integrates a Komodo Smart chain with other software. This includes an open API for language-agnostic, blockchain-based application development, an atomic-swap powered DEX, and more. - -### Antara Smart Chains - -Chains launched with Antara are not ordinary blockchains. They’re “Smart Chains.” They’re smart because they’re customizable, completely independent, scalable, and modular. - -Smart Chains are customizable along 18 different parameters, allowing for customization of block time, block rewards, consensus rules, algorithms, privacy settings, and much more. - -Smart Chains are also infinitely scalable, as multiple Smart Chains can be clustered together to function as one. Moreover, each Smart Chain comes with built-in modules that accelerate development. This leads us to the second layer of the Antara Framework. - -### Antara Modules - -Each Smart Chain comes with a library of powerful modules built-in. These modules include features like tokens, oracles, stablecoins, quantum security, lightning payments, and more. - -Antara Modules are activated prior to launch to meet the unique needs of every project that builds with Komodo’s Antara Framework. They provide an enormous boost in performance and drastically reduce the workload for a new project, ultimately leading to a faster product launch. - -Advanced developers can optionally program new modules, giving the developer complete freedom over their Smart Chain's behavior. - -### Antara Integration Layer - -The third layer of the Antara Framework is the Integration Layer. The Integration Layer offers a series of white-label products, including a multi-coin wallet, a fully decentralized exchange, a decentralized crowdfunding application, custom block explorers, and SPV server integration. - -The Antara Integration Layer also provides an open API that can be used to write blockchain-based applications and software in any programming language. All custom-built apps and software run natively and at the consensus level of each individual Smart Chain. - -## Antara Smart Chains - -Antara Smart Chains are completely independent and sovereign. - -Each Smart Chain has its own consensus rules, decentralized network, and currency. The consensus rules are decided prior to launch and the network validates transactions and blocks according to those rules. Transaction fees are always paid in each Smart Chain’s coin, not in the Komodo Platform’s native currency. Smart Chains never pay any gas fees to the platform. - -While multi-chain platforms are on the rise, many of Komodo’s competitors do not offer true sovereignty. The chains offered on other prominent multi-chain platforms are “child chains” or “side chains." Those types of chains are almost always forced to rely upon the platform’s parent chain in some way. - -Antara Smart Chains never depend on the Komodo Platform, the Komodo blockchain, or the KMD coin. Komodo believes that this open model is the only way to create an ecosystem in which blockchain startups can thrive. Further, a forced dependence on the Komodo blockchain or the KMD coin may provide short-term demand but is sure to be self-defeating in the long run. - -In addition, Smart Chains can also choose to participate in delayed Proof of Work (dPoW) security and Platform Synchronizations to enable interoperability and scalability features. - -Antara Smart Chains are customizable along 18 different parameters, offering hundreds of billions of different configurations to all projects that build with Komodo’s Antara Framework. - -| Customization | Description | -| ------------- | ----------- | -| Name | the name of the Smart Chain and the ticker symbol for the chain’s coin | -| Block Time | the number of seconds that elapse between block generation | -| Consensus Rules | Proof of Work (PoW) or Proof of Stake (PoS) or a combination | -| PoS Implementation | VerusPoS rules or PoS64 rules | -| PoW Hashing Algorithm | Equihash or VerusHash | -| Privacy Settings | mandatory privacy, optional privacy, or complete transparency | -| Interoperability Settings | choose which chains your Smart Chain will communicate with | -| Pre-Mine Supply | the number of coins mined in the first block of the Smart Chain | -| Block Rewards | the number of coins awarded to a miner or staker for finding a block | -| Reward Reductions | the number of blocks between reductions in block rewards | -| Block Reward Decay | percentage by which block rewards decline at each reduction -| Reward Eras | an optional feature to fully customize a chain’s coin emission schedule | -| Time Locking | the option to make block rewards frozen for a set number of blocks | -| Taxation | an optional, inflationary feature that generates a small tax for all transactions | -| Founder’s Bonus | optional feature that makes periodic payouts to the chain’s founder | -| Pubkey | designate the address to which pre-mine supply, tax, and bonuses are paid | -| Multi-Signature | the option to designate a multi-sig address to receive pub key payouts | -| Antara Modules | choose which Antara Modules that you would like to activate | - -## Antara Modules - -Antara Modules act as the foundation upon which advanced blockchain-based applications and software can be built. They offer an enormous level of functionality and cut down on the amount of time a new blockchain project needs to spend on development before going to market. - -As they run natively on every individual Smart Chain, Antara Modules are faster and more secure than traditional smart contracts. They also run at the consensus level, meaning every module is verified by every node in the network upon each use. - -In addition, Antara Modules are written in the C and C++ programming languages so they are Turing complete and can be coded to perform any functions that any existing software performs. - -Significantly, Antara Modules do not require any gas fees. Instead, a single use of a module requires just one ordinary transaction fee, which is always paid in each respective Smart Chain’s coin. This makes it far more practical and profitable to build and run a complex blockchain-based applications on Komodo than on any other multi-chain platform in existence. - -All Smart Chains come with a library of powerful, built-in modules to choose from. - -| Module | Description | -| ------ | ----------- | -| Tokens | create tokens (fungible or non-fungible) on your own Smart Chain | -| Oracles | use an aggregated data oracles solution to bring off-chain data on chain | -| Proxy Token DEX | trade tokenized representations of foreign blockchain assets | -| Instant Micropayments | a channel for secure and instant micropayments | -| Funds Recovery | allow users to designate a backup address to safeguard funds | -| Stablecoins | an algorithmic stablecoin solution with optional digital asset backing | -| Trustless Price Feeds | bring price data on-chain in a trustless, decentralized manner | -| Rewards | give users the option to earn rewards by locking coins for a set time | -| Quantum Security | make all transactions on your Smart Chain quantum secure | -| MuSig Payments | enable private, fast, low-data multi-signature payments | -| Faucet | an automated crypto faucet feature with built-in spam prevention | - -The option to code custom modules is also available to all Smart Chain projects. While coding custom modules is an advanced development task, it offers an unparalleled degree of flexibility and customization. Any processes imaginable can be coded into an Antara Module, which will then run natively and at the consensus level of a project’s Smart Chain. - - -## Antara Integration Layer - -The third and final layer of Komodo’s Antara Framework is the Integration Layer, which consists of an open API and a selection of white-label applications to accelerate development. - -Each Antara Module activated on a Smart Chain provides a number of remote procedure calls (RPC). Each individual call executes a different process and offers a unique functionality. Together, these RPCs from all of the the Antara Modules make up the open API. - -The Antara open API is language agnostic so developers can use it to code blockchain-based applications in the programming language of their choosing. This makes Komodo’s Antara Framework the fastest, easiest, and most cost effective way to adopt blockchain technology. - diff --git a/docs/basic-docs/start-here/core-technology-discussions/atomicdex.md b/docs/basic-docs/start-here/core-technology-discussions/atomicdex.md deleted file mode 100644 index 640370d69..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/atomicdex.md +++ /dev/null @@ -1,249 +0,0 @@ -# AtomicDEX and Atomic Swaps - -## Introduction - -Komodo’s decentralized exchange, AtomicDEX, allows people to trade cryptocurrency coins without a counterparty risk. The protocol is open source and trading is available for any coin that any developers choose to connect to AtomicDEX. - -Our service fully realizes decentralized order matching and trade clearing. The order-matching aspect relies on a peer-to-peer network to build public orderbooks, and trade clearing is executed through an atomic cross-chain protocol, also called an "atomic swap." - -## Current Problems in Cryptocurrency Exchange - -#### Centralized Exchanges are Popular, but Limited - -The current, most practical method for cryptocurrency exchange requires the use of centralized exchange services. - -These centralized solutions require vouchers to perform the exchange, wherein the user sends their funds into the care of a corporate entity and receives "I Owe You" (IOU) statements in return. The user then trades these IOUs within a controlled environment and, when finished, returns their IOUs to the corporate entity for reimbursement. - -Centralized exchanges carry great risk. Among many dangers present in this system, users are under the constant risk of their assets being stolen either by an inside theft or an outside hack. Furthermore, the operators of centralized exchanges are under intense legal and social pressure, as the operators are responsible both for the safety of thousands of users' funds and for the users' behaviors on their platforms. - -To eliminate such dangers and limitations requires the creation of a decentralized alternative, wherein either the entity holding the funds during the trading process is not centralized, or the users are allowed to trade directly without middleman involvement. - -#### The Concept and Shortcomings of a Normal Decentralized Exchange - -A decentralized exchange (DEX) allows users to trade funds within an environment that is at least partially decentralized. - -Decentralization of an exchange can take many forms. For example, in 2014 Komodo developers began one of the earliest instances of a decentralized exchange, called "InstantDEX." - -In this DEX, users sent their blockchain coins not to a centralized entity, but rather to a decentralized "gateway." The gateway was owned and controlled by several cooperating entities who were chosen from the online community. The gateway automatically distributed IOUs (called "proxy tokens") to the users, who then traded within the partially decentralized environment. - -When finished, users sent their proxy tokens back to the gateway, and the gateway managers collectively signed for the release of the users' blockchain funds. The underlying technology of this solution is still in use by many blockchain platforms, and is sometimes referred to as a proxy-token protocol. - -This form of a DEX is too limited to compete with centralized exchanges. Among many drawbacks, a proxy-token decentralized exchange must still have a storage center to hold the external cryptocurrencies represented by the proxy tokens. At best, this storage center is only distributed across several authority figures, and therefore users must still surrender control over their assets for the duration of the trading process. - -As of today, no decentralized exchange has successfully replaced any of their centralized counterparts. - -## AtomicDEX — A Complete Solution - -We now present a fully functional, new decentralized technology that makes a competitive decentralized exchange possible. We call our technology AtomicDEX, and it allows people to freely and safely exchange cryptocurrency coins from one person to another. - -The AtomicDEX decentralized exchange creates a competitive method for bartering cryptocurrencies, combining the key components of order matching and trade clearing. - -These components are combined into a single integrated system that allows users to make a request to trade their coins, find a suitable trading partner, and complete the trade using an "atomic swap." - -Unlike previous DEXs, AtomicDEX does not require users to send funds to either a centralized or decentralized party during the trading process. Rather, users maintain full control over the private keys of their funds at all times. - -## The Decentralized Orderbook - -The first component of AtomicDEX is Order Matching. This is the process of pairing a user’s offer to buy with another user’s offer to sell. The data of these offers form an orderbook. - -The process of matching orders is not the actual trade itself, but is only a digitally created promise between users stating that they will perform their parts of the trade. - -AtomicDEX features several technologies to facilitate order matching, including a peer-to-peer network, a decentralized orderbook, and a multicoin passphrase. - -##### Order Matching with Full-Relay and Non-Relay Nodes - -To create a decentralized orderbook, AtomicDEX creates a custom peer-to-peer (P2P) network. - -In this network, when a node places an order, other nodes on the network collaborate to distribute the data until all nodes are informed. Each node utilizes the data to build the orderbook locally. No centralized server is required. - -To manage this P2P network, AtomicDEX utilizes two separate types of nodes: a full-relay node and a non-relay node. - -The difference between a full-relay node and a non-relay node is that the former is typically a high-volume trader who provides liquidity to the network in exchange for being a trading hub on the network. This puts the trader in the position of being able to complete trades more quickly than their competitors. - -The latter type of node (non-relay) is the more common user, and these nodes rely on the full-relay nodes. A non-relay node has all the same available trading options. We expect that most nodes joining the network will be non-relay nodes. - - -There are no requirements or payments necessary to become either type of node, and so anyone desiring to become a high-volume full-relay node will find no restrictions. - -##### One Passphrase, Many Addresses - -As a part of order matching, AtomicDEX features a specialty wallet that can manage and trade among a multiplicity of different blockchain coins. In this technology, the user creates a single passphrase and uses this to unlock all public addresses associated with their desired coins. - -The complexities of this process are managed by Komodo's Iguana Core technology. - -## Atomic Swaps - -For trade clearing, AtomicDEX implements our own unique variation of atomic swaps. - -An atomic swap is a technology that allows two users to trade cryptocurrencies across two separate blockchains without requiring an intermediary third party. - -The original concept of an atomic swap was created in 2013 by Tier Nolan and many other Bitcoin enthusiasts on the Bitcointalk.org chat forum. In 2014, this conversation inspired members of the Komodo development team to experiment with atomic swaps, and they have remained a key technology in our strategy ever since. - -#### The Value of the Atomic Swap - -To understand why the atomic-swap protocol is necessary, one must first recall that computer code is executed in linear fashion. Even if we were to assume that both parties in a trade may be honest, on a computer the process of taking money from each digital wallet and pulling the money into the open must happen one wallet at a time. - -Therefore, one person must release control over their money first. The atomic-swap protocol protects that person from vulnerability. Without the atomic swap, any malicious party involved would be able to destroy the fairness of the trade. - -A key aspect of a proper atomic swap is that at each stage of the trade-clearing process, each user has incentives to proceed to the next step in the proper manner and disincentives to avoid abandoning the procedure. With this structure in place, regardless of a failure by either user to complete the protocol, each user receives a proper reward. - -#### AtomicDEX Manages a Public Trading Profile for Maker and Taker - -In addition to the atomic-swap protocol, AtomicDEX also allows users to track the behavior of trading partners on the network via a Trust API. - -The Trust API is not based on personal identity, but rather on behavior as associated with public addresses. - -As a user practices good behavior on the network while maintaining a consistent public address, their network trust can increase, thus improving their odds of a willing trading partner. - -Use of the Trust API is optional for all users. - -#### Introducing Taker and Maker - -There are two parties in an atomic swap: the liquidity provider and the liquidity receiver. We call the provider "Maker" and the receiver "Taker." - -##### Taker Makes a Request - -The process of an atomic swap begins with the person who makes the initial request. - -Taker will need two transactions to perform her swap. One transaction will cover the protocol fee, which is roughly 1/777th the size of the desired order. We call this fee the ``, and its primary purpose is to serve as a disincentive to Taker from spamming the network with rapid requests. - -::: tip - -The `dexfee` is actually calculated as "the greater of either `0.0001 TAKER COIN` or `1/777th` the size of the desired order" - -::: - -The second transaction required of Taker sends the actual amount she intends to swap. AtomicDEX first verifies that she has these funds, but for the moment she retains these funds in the safety of her own digital wallet. - -##### Maker Answers Taker - -On the other side of the atomic swap, we have the liquidity provider — Maker. Maker sees the request on the network for Taker’s atomic swap and decides to accept the trade. Now his part of the process begins. - -To complete the trade, he must send one transaction. It will be worth 100% of what he and Taker intend to actually trade. - -#### Taker and Maker Are Committed - -Assuming Taker and Maker are successfully connected, the process from this point forward becomes quite simple: - -A summary of the procedure, starting from the beginning. - -1. Taker requests a swap and sends the `` transaction data to Maker. - -2. Maker receives the ``, verifies it, and sends `` - - - Maker generates a "secret", creates a hash of the secret, and shares this hash with Taker - - - Maker does not send the payment to Taker directly, but rather into a temporary holding address - - On [utxo-based](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-utxo-an-elusive-yet-fundamental-concept) blockchains, this holding address is a P2SH hash/time locked output - - On ETH/ERC20 based blockchains, this address is an etomic-swap smart contract - - - `` enters a state of limbo on the Maker's coin network, held safely by encryption, awaiting either for Taker to spend the payment, or for the swap to time out - - - If the latter occurs, `` is automatically refunded to Maker via the AtomicDEX protocol - -3. Taker now sends `` - - - Taker does not send the payment to Maker directly, but rather into a temporary holding address - - On [utxo-based](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-utxo-an-elusive-yet-fundamental-concept) blockchains, this holding address is a P2SH hash/time locked output - - On ETH/ERC20 based blockchains, this address is an etomic-swap smart contract - - - - `` enters a state of limbo on the Taker's coin network, held safely by encryption, awaiting either for Maker to spend the payment, or for the swap to time out - - - If the latter occurs, `` is automatically refunded to Taker via the AtomicDEX protocol - -4. Maker now spends the `` - - - To spend the payment Maker reveals the secret - -5. Taker now "spends" the `` - - - Taker finds that `` is spent and extracts the secret from the spending transaction. The secret can be used to unlock the `` and send the coins to Taker's address - -While it may seem inefficient to have five transactions for a swap that could be done with two, the complexity of this process provides us with the requisite "trustless-ness" to maintain user safety. - -### Incentives and Disincentives to Maintain Good Behavior - -As we will now explain, at every step along the way there are incentives for each side to proceed, and there are various financial protections in place should one side fail. - -Also, because payments are sent to these "temporary holding addresses" that exist within the AtomicDEX protocol, the protocol itself can assist in the process of moving money at the appropriate steps. - -Let us now examine what is happening after each step. - -#### 1 - Taker Sends `` - -If Maker accepts the offer to trade, but does not send ``, Taker only stands to lose the ``. This is only 1/777th of the entire transaction amount, so she loses very little. - -Maker, on the other hand, stands to lose more. Since Maker did not follow through with his end of the bargain, the AtomicDEX network indicates on his public AtomicDEX trading profile that he failed in a commitment, thus decreasing his profile’s reputation. If Maker continues this behavior as a habit, he may find it difficult to discover trading partners. - -So long as the frequency of Makers failing is low, the occasional extra `` paid by a Taker is a minor issue. However, if there is a sudden spike in misbehavior, the AtomicDEX code has built-in contingency plans which can provide refunds to Takers. - -#### 2 - Maker Successfully Sends `` - -If Taker does not follow with her next step, the ``, then Taker loses not only the ``, but she also receives a mark on her public AtomicDEX profile. She gains nothing, and Maker has no reason to fear as `` will automatically return to him via the AtomicDEX protocol. - -#### 3 - Taker Successfully Sends `` - -If Maker does not proceed with his next step (spending the payment), then after lock time expires Taker can simply activate an AtomicDEX protocol that will refund the payment. - -#### 4 - Maker Spends `` - -If Taker does not follow by also "spending" the ``, it is of no concern to Maker because he has already received his funds. If Taker is simply sleeping and forgets to spend the ``, she can only hurt herself. - -Naturally, for Taker this is slightly dangerous. Taker’s best course of action is to remain alert and spend the `` once the `` is spent and the secret is revealed. - -#### 5 - Taker Spends `` - -The process is complete. Taker received the ``. Maker received the ``. The entire process only cost Taker the original ``. - - -At each step along the way, the side that needs to take the next step is motivated to do so, with greater and greater urgency until the process is complete. - -## Additional Details - -#### Always Manage Risk Appropriately - -Naturally, users must understand that outside forces can disable the process and thereby damage one of the users. For instance, an Internet outage for Taker could be particularly dangerous. Therefore, users are advised only to trade manageable sums that they are willing to put at risk, and only with nodes that have reliable reputations. - -#### The Connection is the True Challenge of an Atomic Swap - -Performing a successful connection between Maker and Taker, and verifying their funds, is the most complex and difficult aspect of creating the AtomicDEX network. - -Myriad factors are involved in a successful attempt for Maker and Taker to connect: human motivation; the experience level of the users; economics; connection technology; user hardware setups; normal variations within Internet connections; etc. - -We emphasize to users here that the process of performing these actions over a peer-to-peer network has almost an artistic element to it. An attempt to successfully connect Maker and Taker can be thought of more like fishing, where we must simply cast and recast our line until we successfully connect with our target. - -If a user attempts a trade and no response returns from the network, the user should slightly adjust the parameters of their offer and try again. As AtomicDEX continues to iterate and improve, and as the number of users increases, we expect any required effort to lessen for users, the network, and the AtomicDEX GUI apps. - -#### The DEX Fee - -People will notice that there is a small `` required as part of the AtomicDEX protocol. This is 1/777 of the transaction amount and it is calibrated to make spam attacks impractical. The 1/777 fee is about equal to 0.1287% of the ``. - -By forcing a would-be attacker to spend real money, attacking the network becomes costly. Without this spam prevention, AtomicDEX could otherwise be attacked at the protocol level by any person performing a plethora of trade requests. - -Naturally, some atomic swaps can initiate and then fail to complete, which raises questions about what happens to the `` in this scenario. The `` is the first charge in the protocol; in this sense, there is a `` charged for these failed atomic swaps. - -However, this failure should not be looked upon in isolation. The AtomicDEX protocol is based on statistics. Statistically speaking, there will be some percentage of atomic swaps that start and will not complete. - -Let us suppose a 15% failure rate at this stage of the atomic swap (15% is three times higher than the rate of failure we currently observe in our testing). Even in this scenario, the effective `` cost is still only 0.15% to all Taker-side requests across the entire network. - -If you experience the loss of a `` transaction for an atomic swap that fails to complete, know that this is all part of the statistical process. If you find yourself paying more than 0.15% of your completed trades in fees, please let us know. - -As an organization, when speaking generally to our audience online, we state that the `` is just 0.15%. In this manner, we hope to create the expectation that 0.15% is normal; if the network performs perfectly, on the other hand, users will get a blessing in the form of a lower fee, 0.1287%. - -#### Dealing with Confirmations - -Since AtomicDEX is trading permanently on blockchains — as opposed to updating an internal database of vouchers — both sides of the trading pair need to wait and watch as miners on the respective blockchains calculate transaction confirmations. - -Because the payments that occur on one blockchain will proceed regardless of the actions on the other blockchain — a confirmation failure on one chain will not stop with the other blockchain performing its duties as normal — the AtomicDEX protocol must automatically observe and adjust as necessary. - -#### AtomicDEX is Entirely Experimental, and Should Be Treated As Such - -We warn our readers, nevertheless. Every element of the Komodo ecosystem is still considered to be highly experimental. We provide no investment advice, nor any guarantees of any funds utilized on our network. Use our products only at your own risk. - -#### The AtomicDEX API - -We created an API model that is generally the same for all coins. - -For more information, [please turn to the AtomicDEX documentation.](../../../basic-docs/atomicdex/introduction-to-atomicdex.html) - diff --git a/docs/basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.md b/docs/basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.md deleted file mode 100644 index e7658fdd3..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.md +++ /dev/null @@ -1,692 +0,0 @@ -# Delayed Proof of Work - -## A Foundational Discussion of Blockchain Security - -Komodo’s form of providing security is called Delayed Proof of Work (dPoW). This security method builds on the most advanced form of blockchain security in existence, Proof of Work (PoW). The latter form of security is the method utilized by most of the secure PoW networks out there like the Bitcoin/Litecoin networks. - -To understand the value of Komodo’s dPoW security, we must first explain how PoW works and why it is the most secure method of maintaining a decentralized blockchain. We must also examine PoW’s shortcomings, so that we may understand the need for Komodo’s dPoW method and the advantages it provides to the blockchain community. - -To understand how PoW technology functions, we begin by explaining the roots that make the Bitcoin/Litecoin protocol a viable means of securely transferring value. - -## What Is A Consensus Mechanism? - -#### The "Double Spend" Problem - -The creation of blockchain technology stems from the early mathematical studies of encryption using computer technology. - -One such example is related to the information-encoding device, "Enigma," invented by the Germans at the end of World War I. Alan Turing, a British Intelligence agent, famously beat the Enigma device by inventing the world’s first "digital computer." This provided enough computing power to break [Enigma’s](https://en.wikipedia.org/wiki/Enigma_machine) encryption and discover German secret communications. - -This early affair with encryption set off a race throughout the world to develop myriad forms of securely transferring information from one party to another via computer technology. While each new form of computer encryption provided more advantages, there remained one problem that prevented encryption from being useful as a means of transferring not just information, but also financial value. - -This challenge is known as the "Double Spend" problem. The issue lies in the ability of computers to endlessly duplicate information. In the case of financial value, there are three important things to record: who owns a specific value; the time at which the person owns this value; the wallet address in which the value resides. When transferring financial value from one person to another, it is essential that if Person A sends money to Person B, Person A should not be able to duplicate the same money and send it again to Person C. - -The [Bitcoin protocol](https://en.wikipedia.org/wiki/Bitcoin_network), invented by an anonymous person (or persons) claiming the name of Satoshi Nakamoto, solved the Double Spend problem. The underlying math and computer code is both highly complex and innovative. For the purposes of this paper we need only focus on the one aspect of the Bitcoin protocol that solves the Double Spend problem: the consensus mechanism. - -#### The Consensus Mechanism Provides Security Against a "Double Spend" - -The consensus mechanism created by Nakamoto is perhaps one of the most powerful innovations of the twenty-first century. His invention allows individual devices to work together, using high levels of encryption, to securely and accurately track ownership of digital value (be it financial resources, digital real estate, etc.). The mechanism performs this in a manner that does not allow anyone on the same network (i.e. the Internet) to spend the same value twice. - -Let us suppose a user, Alice, indicates in her digital wallet that she wants to send cryptocurrency money to a friend. Alice’s computer now gathers several pieces of information, including any necessary permissions and passwords, the amount that Alice wants to spend, and the receiving address of her friend’s wallet. All this information is gathered into a packet of data, called a "transaction," and Alice’s device sends the transaction to the Internet. - -There are several types of devices that will interact with Alice’s transaction. These devices will share the transaction information with other devices supporting the cryptocurrency network. For this discussion, we need only focus on one type of device: a cryptocurrency miner. - -::: tip Note - -The following descriptions are simplified explanations of a truly complex process. There are many other strategies cryptocurrency miners devise to out-mine their competition, and those strategies can vary widely. - -::: - -#### A Miner Competes to Add Blocks to the Network’s History, in Exchange for a Reward - -##### Step One: Preparing the Preliminary Information - -This device is performing an activity called cryptocurrency "mining." Let us focus now on a mining device that captures Alice’s raw transaction data. This device is owned by a tech-savvy miner, named Bob, who wants to add Alice’s transaction to the permanent history of the Bitcoin network. - -If Bob is the first person to properly process Alice’s transaction he will receive a financial reward. One key part of this reward is a percentage-based fee, taken from Alice’s total transaction amount. - -##### The Mempool is the Collection of All Raw Transactions Waiting to be Processed - -Furthermore, Bob does not have just one transaction alone to mine. Rather, he has an entire pool of raw transactions, created by many people across the Internet. The raw data for each of these transactions sits in the local memory bank of each miner’s mining device, awaiting the miner’s commands. Miners call this pool of transactions, the "mempool." Most miners have automated systems to determine the transaction-selection process, based on estimated profit. - -##### Creating Transaction Hashes - -After Bob makes his choices about which transactions he will attempt to mine (and we assume that he includes Alice’s transaction), Bob’s mining device then begins a series of calculations. - -His device will first take each individual transaction’s raw data and use mathematical formulas to compress the transaction into a smaller, more manageable form. This new form is called a "transaction hash." For instance, Alice’s transaction hash could look like this: - -```bash -b1fea52486ce0c62bb442b530a3f0132b826c74e473d1f2c220bfa78111c5082 -``` - -Bob will prepare potentially hundreds of transaction hashes before proceeding to the next step. One important thing to understand about the compression of data in the Bitcoin protocol, including the transaction hash above, is that calculations herein obey a principle called, The Cascade Effect. - -##### The Cascade Effect: Changing One Bit of Data Changes the Entire Result - -The Cascade Effect simply means that were Bob to attempt to change even the smallest bit in the raw data—whether from a desire to cheat, or by mistake, or for any other reason—the entire transaction hash would dramatically change. In this way, the mathematical formulas in the Bitcoin protocol ensure that Bob cannot create an improper history. - -Were Bob to attempt to create an incorrect transaction hash, other miners would discover the falseness of the hash during their automated mining process. The miners would use the same raw transaction data from Alice, perform the proper mathematical formulas in the Bitcoin protocol, and immediately discover that Bob's attempted hash was incorrect. All the devices on the network would reject Bob’s attempt and this would prevent Bob from claiming rewards. - -##### Step One Continued: Finishing the Preliminary Calculations - -Now, using more mathematical formulas, Bob takes the transaction hashes he is attempting to process and compresses them into a new manageable piece of data. - -This is called, "the merkle root." This represents all the transactions that Bob hopes to process, and from which he hopes to gain a reward. Bob’s merkle root could look like this: - -```bash -7dac2c5666815c17a3b36427de37bb9d2e2c5ccec3f8633eb91a4205cb4c10ff -``` - -Finally, Bob will gather information provided from the last miner that successfully added to the permanent blockchain history. This information is called, "the block header." It contains a large amount of complex data, and we won’t go into all the details. The one important element to note is that the block header gives Bob clues about how to properly add the next piece of information to the permanent Bitcoin history. One of these hints could look like this: - -```bash -"difficulty" : 1.00000000 -``` - -We will return to this clue further on. - -Having all this information, Bob is nearly prepared. His next step is where the real challenge begins. - -##### Step Two: The Race to Finish First - -Bob’s computer is going to gather all the above information and collect it into a set of data called a "block." Mining this block and adding it to the list of blocks that came before is the process of creating a "chain" of blocks—hence the industry title, "blockchain." - -However, adding blocks to the blockchain is not so easy. While Bob may have everything up to this point correctly prepared, the Bitcoin protocol does not yet give Bob the right to add his proposed block to the chain. - -The consensus mechanism is designed to force the miners to compete for this right. By requiring the miners to work for the right to mine a new valid block, competition spreads across the network. This provides many benefits, including time for the transactions of users (like Alice) to disseminate around the world, thus providing a level of decentralization to the network. - -Therefore, although Bob would prefer to immediately create a new valid block and collect his reward, he cannot. He must win the competition by performing the proper work first. This is the source of the title of the Bitcoin-protocol consensus mechanism, "Proof of Work" (PoW). - -The competition that Bob must win is to be the first person to find an answer to a simple mathematical puzzle, designed by Satoshi Nakamoto. To solve the puzzle, Bob guesses at random numbers until he discovers a correct number. The correct number is determined by the internal complex formulas of the consensus mechanism and cannot be discovered by any means other than guessing. Bitcoin miners call this number a "nonce," which is short for "a ‘number’ you use ‘once.’" - -Bob’s mining device will make random guesses at the nonce, one after another, until a correct nonce is found. With each attempt, Bob will first insert the proposed nonce into the rest of his block. To find out if his guess is correct, he will next use mathematical formulas (like those he used earlier) to compress his attempt into a "block hash." A block hash is a small and manageable form of data that represents the entire history of the Bitcoin blockchain and all the information in Bob’s proposed block. A block hash can look like this: - -```bash -000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f -``` - -Recall now The Cascade Effect, and how it states that changing one small number in the data before performing the mathematical computations creates a vastly different outcome. Since Bob is continually including new guesses at the nonce with each computation of a block hash, each block-hash attempt will produce a widely different sequence of numbers. Miners on the Bitcoin network know when a miner, such as Bob, solves the puzzle; by observing the clues that were provided earlier. Recall that the last time a miner successfully added data to the blockchain, they provided these clues in their block header. One of the clues can look like this: - -```bash -"difficulty" : 1.00000000 -``` - -This detail, "difficulty," simply tells miners how many zeros should be at the front of the next valid block hash. When the difficulty setting is the level displayed above, it tells miners that there should be exactly ten zeros. Observe Bob’s attempted block hash once again, which he created after making a guess at a nonce, adding this proposed nonce into his block, and performing the mathematical formulas: - -```bash -000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f -``` - -The block hash above has ten zeros at the beginning, which matches the number of zeros in the difficulty level. Therefore, the hash that Bob proposed is correct. This must mean that he guessed a correct nonce. All the miners on the network can prove for themselves that Bob was correct by taking all the same information from their mempools, adding Bob’s nonce, and performing the mathematical calculations. They will receive the same result, and therefore Bob is the winner of this round. - -On the other hand, due to the Cascade Effect, if Bob’s attempted nonce had produced a block hash with the incorrect number of zeros at the front, his block hash would be invalid. The network would not afford him the right to add an incorrect block hash to the network, and all the miners would continue searching. - -##### Step Three: Bob Finds the Nonce - -Once a miner discovers a nonce that produces a valid block hash, the miner has "found a new block," and can send the signal across the Internet. The consensus mechanism running on every other mining device can verify for themselves the calculations. Once verified, the consensus mechanism grants the miner the right both to add the proposed block to the blockchain, and to receive the reward. - -Let us return to Bob’s machine, having just guessed a correct nonce, and thus holding a valid block hash. Bob’s machine instantly sends out the winning information across the Internet, and Bob collects his reward from the Bitcoin network. All the other miners must readjust. Earlier, they were searching for the correct nonce based off the information from the previous block header. However, Bob’s new valid block includes a new block header. All the other miners on the network abandon their current work, adopt Bob’s new block header, make many recalculations in their underlying data, and begin their search for the next nonce. - -There is no sympathy in the Bitcoin protocol for any miner’s wasted efforts. Suppose another machine on the network was also trying to mine Alice’s transaction, and lost to Bob in the race. Only Bob earns the reward from Alice’s transaction, and the other miner receives nothing in return for their costs and time. - -For Alice, this process seems simple. She first indicated the wallet address of her friend and sent cryptocurrency. After a certain amount of time, her friend received the money. Alice can ignore the byzantine process of the miners that occurred between these two events. Alice may not realize it, but the PoW consensus mechanism provides the foundation of security upon which she relies. - -## The Dominance of the Proof-of-Work Consensus Mechanism - -#### Proof of Work (PoW) Fosters Ever Increasing Security - -There are several reasons why PoW networks, especially Bitcoin, continue to dominate in terms of security and blockchain success. - -A simple, preliminary reason is that PoW networks foster ever-increasing speed and computer power. Miners must constantly update and innovate above their competitors to continue earning rewards. - -##### Speed and Power are of the Essence - -Among miners, having a faster and more powerful computer can mean earning rewards more frequently. For miners seeking to maximize profit, competition requires constant upgrades to machinery and to a miner’s customized underlying code. - -The frequency at which a device can create proposed block hashes is called "hash power." The more hash power a collective PoW network has across all miners mining the blockchain, the more secure the network. This competitive pressure provides one important advantage in security to PoW networks, when compared to alternate consensus mechanisms. - -##### The Network Effect: Bitcoin’s Ability to Dominate Begins - -A high level of security fosters a sense of trust among users, and this can grow a PoW network’s audience. As the audience grows, both the number of transactions and the price of the coin increase. This attracts more miners. The rising level of miners provides greater overall hash rate to the network, which in turn fosters a stronger sense of trust. This increased sense of security can raise the number of users on the network, which can increase the number of miners, and the cycle repeats. - -In economics, this is classified as a "Network Effect," where a cycle of behavior encourages more of the same behavior, with compounding interest. Due to the Network Effect, and the fact that Bitcoin is the oldest PoW network, Bitcoin is increasing its security at a rate faster than the rate of other PoW networks. - -Furthermore, consider the effect caused when the price of a PoW-blockchain coin rises. Before the rise, assume the blockchain coin is worth one dollar. A miner is justified in spending the necessary money (on equipment, upgrades, and electrical costs, etc.) to justify one dollar’s worth of hash rate. If the price shifts upwards to two dollars, the miner must upgrade their entire business to justify two dollars’ worth of a matching hash rate. If the miner does not upgrade, their competitor will, and then the miner will no longer be able to compete for rewards. - -#### The Longest Chain Rule: The True "Secret Sauce" of PoW Domination - -There are many more reasons why PoW networks continue to dominate in security. Yet, for our discussion, there is one element that rises above all others. It is called, "The Longest Chain Rule," and some blockchain developers may argue that it is "the secret sauce" that fuels PoW’s strength. - -The Longest Chain Rule is the determining factor whenever two competing versions of the blockchain history arise on the network. The rule simply states that whichever of the two versions grows longer first, wins. The other version is overwritten, and therefore all transactions and rewards on that version are erased. The simplicity of this rule is a key to understanding why PoW consensus mechanisms continue to outperform their competition. - -##### The Simple Effects of The Longest Chain Rule - -On a surface level, this rule prevents a double spend by a network user. For instance, consider a husband and wife accidentally attempting to spend the same money at the exact same time, while each person is traveling in a different part of the world. - -::: tip Note - -For the sake of the discussion, we are oversimplifying the following actions so that they take place within only a few milliseconds. We also oversimplify the technical details, for clarity. The full explanation of this process is provided in the [Bitcoin wiki](https://en.bitcoin.it/wiki/Main_Page), for those who would like to gain a deeper understanding. - -::: - -##### A Tale of Two Blockchains - -Let us suppose that the husband is in Asia and the wife is in the Americas. Both are purchasing a car. The husband uses all the funds from the family Bitcoin wallet to purchase a car at precisely 8:00 PM (UTC). The wife makes her purchase at the exact same moment, for a similar amount. - -After making his purchase, the husband’s transaction hash is immediately sent to a mining device in China, where it is held in the miner’s local mempool. (Recall that a mempool is a collection of all raw transaction data across the network.) - -Let us suppose that the husband’s transaction arrives in the Chinese miner’s mempool at the exact moment that the Chinese mining equipment finds a correct nonce and a valid block hash. The Chinese miner declares the winning information, mines a new block, and collects a reward. All the miners in his local (Asian) vicinity (who receive the winning information faster than in the Americas, due to proximity) complete the block verification process, increase the length of the blockchain, and begin searching for the next valid block hash. - -On the opposite side of the world, essentially the exact same actions happen. The wife’s transaction is sent to the nearest miner, this time located in Washington state of the United States. Just as the transaction enters the Washington state miner’s mempool, the miner discovers a valid block hash. He sends out the signal, mines a new block, and also collects the reward (this is the same reward that the Chinese miner is attempting to claim). All the miners in the local (US) vicinity verify the information immediately and begin searching for a new valid block hash based on the Washington state miner’s recent block. - -##### An Internal Conflict of Interest Arises Within the Bitcoin Network - -Note the paradox here. There are now two versions of the Bitcoin history that are valid, yet different. - -These two versions make their way across the Internet, around the world, each to the other side. When the competing messages arrive, the Bitcoin protocol sees that there is a conflict: the same money was spent twice. - -Consider how on each side of the world the miners are spending their financial and temporal resources to further their own interests. There is no economic incentive for either side to submit to the other, by nature. Therefore, there is a conflict of interest within the Bitcoin network itself. The Bitcoin network would swiftly fail, were it not for The Longest Chain Rule. - -##### The Longest Chain Rule: The History Which is Longer First, Wins - -The Longest Chain Rule simply declares that whichever of the two competing blockchains grows longer first, wins. The consensus mechanism erases the other version. - -Let us suppose that the Chinese mining equipment is superior in this instance, and the Chinese miner manages to discover the next valid block hash and send out the signal before the Washington state miner can do likewise. Across the world, the moment the information arrives that the Chinese miner completed yet another valid block, the Bitcoin protocol erases the Washington state miner’s version of the Bitcoin history. - -There is no sympathy for any wasted efforts, nor for any misunderstandings between the wife and her car dealer. The Bitcoin protocol’s consensus mechanism simply presses forward. The Washington state miner’s rewards disappear, as though they never occurred. The wife’s purchase of a car likewise evaporates. - -_(Typically, a normal and prepared car dealer utilizing cryptocurrency would not consider a customer’s transactions acceptable until several new blocks were added to the blockchain. In this manner, cryptocurrency users can ensure that a transaction is beyond contestation before the customer can, for example, drive a new car off the lot.)_ - -The Washington state miner gets a raw deal in this scenario, but the network benefits as a whole. The Longest Chain Rule provides the necessary security to prevent a Double Spend. The network accurately recorded one family member’s purchase of a car, prevented the mistaken double spend, and ensured that the most competitive miner received a just reward. - -This example illuminates the importance of The Longest Chain Rule. However, there is a dark side to this rule for the unsuspecting and unprepared blockchain developer. - -## The 51% Attack - -Here’s where intrigue enters the picture. The "easiest" way to steal money on a PoW blockchain (such as Bitcoin) is to perform a 51% Attack. - -In this attack, the malicious actor first spends cryptocurrency in exchange for something of value, which they take from their victim. Next, the malicious actor creates an alternate version of the PoW network’s history wherein those transactions never took place. Using advanced mining equipment, the malicious actor then "attacks" the PoW network by mining blocks to this "false" history faster than the rate at which other miners on the PoW network can mine blocks to the "true" history. - -Assuming the malicious actor has a sufficient hash rate, as this "false" history grows longer than the "true" history, the Longest Chain Rule will cause the consensus mechanism to overwrite the "true" version. The earlier transactions the malicious actor made would be as though they never occurred. Therefore, the malicious actor would keep both their original funds and whatever item of value they exacted from their victim. - -This is known as the 51% Attack. The number 51% derives from the fact that to successfully perform this attack, the attacker must add enough hashing power to the overall PoW network to form a majority of the hash rate. - -##### Size is Yet Another Reason Behind Bitcoin’s Current Success Among PoW Networks - -Today, Bitcoin’s overall hash rate is enormous. The collective of computers around the world mining Bitcoin is effectively the largest supercomputer ever created by man. As of the writing of this paper, some estimate that [the Bitcoin network consumes more electricity than the entire country of Denmark](https://arstechnica.com/tech-policy/2017/12/bitcoins-insane-energy-consumption-explained/), and the number of miners continues to grow. - -Therefore, to attempt a 51% Attack against the Bitcoin network could cost millions, if not billions of dollars in computer hardware. This attack would also require a sustained consumption of electricity that is likely unfeasible for a single geographical location, and would be expensive even for a decentralized-hardware network. So long as the miners of Bitcoin remain interested in the Bitcoin network, therefore, Bitcoin has a level of security that is nigh impenetrable. - -_We will return to the proposition of the miners’ ability to choose a different network to mine later in our discussion._ - -## The Genesis Attack - -##### A Genesis Attack on the Bitcoin Network - -Recall that according to the original version of the Bitcoin protocol, sometimes called the ["vanilla" version,](https://www.worldcryptoindex.com/bitcoin-scaling-problem-explained/) the Longest Chain Rule only requires that the blocks in the longest chain all be properly mined. Furthermore, recall that computers can endlessly duplicate code. - -Finally, note that during our explanation, when describing a malicious actor’s attempt to create an empty, meaningless blockchain history, we use quotation marks when employing the word, "false." Likewise, when describing the blockchain history trusted by the people on the network, we include the word "true" in quotations. - -We do this because at the core level, the consensus mechanism is purposefully blind regarding any human user’s preference between "truth" and "false." The code only sees "truth" in terms of properly mined blocks, and overall blockchain length. Nothing more. - -Now suppose the existence of a supercomputer a thousand times more powerful than the entirety of the Bitcoin-miner network. This supercomputer could, in theory, stealthily re-create and execute the initial code that spawned the very first block of the Bitcoin blockchain—the "Genesis Block." The supercomputer could then grind out block hashes, one-by-one, mining meaningless blocks and adding them to this empty, "false" version of the Bitcoin history. - -Once this meaningless blockchain’s length sufficiently exceed the so-called "true" blockchain used today, the supercomputer could then release its "false" version to the Internet. - -Throughout the world, (assuming the vanilla protocol) the Bitcoin network would automatically recognize the "false" blockchain as the correct blockchain! This would all be according to the code. The so-called "false" blocks would be properly mined, and the length would be longer than the chain that users currently trust. The vanilla protocol would, in theory, replace the so-called "true" history with the empty variant. - -Such an event might seem to users like a virus being uploaded to the Internet. The event could destroy all human trust in the current version of the Bitcoin protocol, wreaking financial havoc throughout the cryptocurrency realm. While users of the Bitcoin protocol would naturally protest, the entire operation would be entirely in agreement with the underlying code. - -When observing Bitcoin’s current hash power, the creation of such an anti-Bitcoin supercomputer is clearly not feasible in the immediate future. Assuming Bitcoin miners remain interested in the Bitcoin network, the risk of a Genesis Attack on Bitcoin is essentially non-existent. - -However, consider the implications of the Genesis Attack on unsuspecting or underprepared smaller PoW blockchain projects. - -##### The More Realistic Dangers of The Genesis Attack - -Let us assume a naïve blockchain entrepreneur building a new product. They are generally aware that malicious actors throughout the world are likely to attack their blockchain, stealing funds and otherwise causing trouble. Therefore, the naïve entrepreneur decides to implement what they believe is the most secure method of a blockchain consensus mechanism, PoW, and they offer ample financial rewards to miners to incentivize a secure network. - -The entrepreneur and their entire audience may not realize it, but so long as their network’s overall hash rate remains below the threshold of an attack by even an average supercomputer, their entire blockchain history is vulnerable to complete annihilation. A technically astute competitor, seeing the vulnerability, and possessing ownership of the requisite computer hardware, would be able to create an empty and longer version of the same blockchain code and vaporize their competitor’s financial records. - -The cryptocurrency industry is young, and few but the most advanced of developers understand the many ways in which blockchain competition can be technically eliminated. Therefore, we have seen but a few serious cases of the Genesis Attack. - -One notable instance occurred when an original Bitcoin developer, Luke-jr, used a variation of the attack to destroy a blockchain project called Coiledcoin. Luke-jr performed this attack out of a belief that Coiledcoin was a [disingenuous project.](https://bitcointalk.org/index.php?topic=56675.msg678006#msg678006) Setting aside any human sentiment on either side of the event, the fact stands that Luke-jr’s variation of the Genesis Attack was the end of the Coiledcoin network. - -The complexity in establishing a secure PoW blockchain remains a challenge for would-be entrepreneurs. Furthermore, there are existing PoW developers that are not fully aware of their vulnerability. Likewise, there are would-be malicious actors that have yet to realize the many methods available to cause frustration. The potential danger surrounding the issue of the Genesis Attack shows the relative youthfulness of the cryptocurrency industry. - -For a PoW blockchain network to maintain Bitcoin-level security, therefore, it must maintain a hash rate that is high enough to constantly mine blocks faster than a potential competitor could either perform the 51% Attack (destroying the most recent of transactions), or the deadly Genesis Attack (complete annihilation). - -## The Financial and Eco-Unfriendly Problems With All PoW Networks - -The problems with young PoW networks do not stop there, and furthermore, even Bitcoin’s PoW network has issues: the security of a PoW network comes at a high cost to the environment, and miners have no obligation to mine any particular network. - -#### PoW Networks Are Expensive - -Some estimate that by 2020, the Bitcoin network alone will consume more electricity than the entire world currently consumes (as of [2017](https://arstechnica.com/tech-policy/2017/12/bitcoins-insane-energy-consumption-explained/)). Having just one PoW network in existence, therefore, is already strain enough on our environment. The network is also a burden on our infrastructure and our worldwide economy. - -On the one hand, adding additional PoW blockchains to the world can serve the purpose of forcing free-market competition on the Bitcoin developers, encouraging ethical and innovative behavior. Therefore, some competition among PoW networks is likely useful. - -However, as a human species, we can consider that there are more financially sound and eco-friendly methods of innovating with blockchain technology without always directly competing with Bitcoin PoW security. Our innovation, delayed Proof of Work, is one response to this fact, as we will soon discuss. - -#### Miners are Free to Mine Other Networks - -Another inherent weakness of the PoW consensus mechanism to discuss is the ability of miners to choose alternate networks. - -In November of 2017, for a few hours the majority of Bitcoin network miners switched their hash power to a competitor’s PoW network, the ["Bitcoin Cash"](https://www.coinwarz.com/network-hashrate-charts/bitcoincash-network-hashrate-chart) network. This switch was the result of clever software engineering on the part of the Bitcoin Cash team. - -The team recognized that most miners are mining Bitcoin only because this network is the most profitable. Therefore, the team conducted a calculated change in the underlying protocol of Bitcoin Cash that caused its mining profitability to dramatically increase. The majority of the world’s Bitcoin miners recognized the higher profitability and switched to the Bitcoin Cash network instantly. - -While Bitcoin Cash’s play for a majority hash rate proved effective only for a matter of hours, their accomplishment raised awareness to a tacit principle in the network: Bitcoin’s hash rate is not bound to Bitcoin. The hardware is free to serve any compatible network the miners choose. - -At the time of the writing of this paper, between Bitcoin and Bitcoin Cash, ~80% of the available hash rate is aligned with the former, and ~20% with the latter. There is speculation in the industry that if the Bitcoin Cash network creates a more favorable position, the balance of hashing power could change on a long-term basis. Furthermore, there are many other blockchain competitors who may gain the attention of Bitcoin’s miners in the future. - -Were a shift in the balance of hash rate to occur, Bitcoin would no longer be the leader of security in the cryptocurrency realm. The price of Bitcoin would likely drop as users realized the resulting lack of security leadership. This might cause more miners to switch to a more profitable network to cover the cost of operating their expensive hardware. As miners abandon Bitcoin, and as users continue to leave, the situation becomes a reversal of the Network Effect. The Bitcoin network would come crashing downwards at an ever-compounding rate. - -This is all theoretical, but it raises yet another concern that we need to illuminate: the security of a blockchain depends on many things, including the potentially fickle support of human blockchain miners. Our innovation, delayed Proof of Work (dPoW), takes this fact into account as we empower members of the Komodo ecosystem with Bitcoin-level security. Before we finally turn to our own solution, we must discuss the primary competitor to the PoW consensus mechanism, Proof of Stake (PoS). - -#### The Primary Alternative: Proof of Stake - -Perhaps the most popular alternative consensus mechanism is Proof of Stake (PoS). In this mechanism, blocks are mined not by miners performing work, but rather by any user "staking" their coins on the open network for the right to mine blocks. - -The meaning of "staking" has different variations depending on the specific rules set forth by the developers of the unique variant of the PoS consensus mechanism. In general, staking one’s coins means placing them as collateral on the open network in exchange for the right to mine new blocks. - -Users who stake their coins, thereby, can periodically extract a portion of the mempool, mine new blocks, and earn rewards. There is no need to perform any hardware-expensive proof-of-work calculations, as the user’s incentive to be honest is encouraged by the fact that their own wealth hangs in the balance. - -#### The Security Risks and Shortcomings of PoS - -The downside to PoS is that a user who simply leaves a large portion of wealth staked (and therefore continually claims rewards) gradually becomes a centralized point of wealth through the power of compound interest. On PoS networks, monopolies are a constant danger. The owner of a monopoly has power over the well-being of the network. - -Once a majority of the supply is obtained, the owner gains a position known as "Nothing at Stake." The owner can mine "false" blocks to the PoS blockchain and use their own majority supply over the network to declare these "false" blocks valid. All other stakeholders on the network must adopt these "false" blocks, lest the majority holder use their strength to declare competing blockchain versions as invalid. - -If a non-majority holder attempts to challenge the monopoly holder’s version, the non-majority holder can achieve little more than the loss of coins they placed at stake. Compare this with a non-majority holder in a PoW system: the question over the "truth" of the blockchain history depends not upon ownership of wealth, but upon the miner’s innovation and performance. PoW-based systems do not suffer from the risk of monopolies, therefore, as majority stakeholders gain no unique control over the mining of new blocks. - -Variations of PoS, including the popular Delegated Proof of Stake (DPoS) and Delegated Byzantine Fault Tolerance (DBFT) systems, do not resolve the underlying issue of monopoly ownership and centralized manipulation. In a vanilla PoS system, the malicious actor needs only to purchase a majority supply of the coin to mine "false" blocks. Alternatively, as the PoS network grows to maturity, the collective of majority stakeholders will identify their financial equals, and they may find that they share a mutual interest in disadvantaging less financially established members of the network. - -In a DPoS/DBFT type system, wherein the ecosystem stakeholders elect and endow delegates with the responsibility to mine new blocks, the malicious actor has only to compromise the integrity of most of the delegates. Thereafter, the compromised delegates can mine "false" blocks, and the users of the ecosystem have no direct means to retaliate, beyond abandoning the network. - -This is not to say that PoS and its variants have no use cases. Indeed, there are scenarios in which PoS can be useful for entrepreneurs. In the Komodo ecosystem, our dPoW consensus mechanism can provide security to networks that use either type of consensus mechanism. - -After the following section summary, we finally turn our attention to dPoW. - -## A Summary of the PoW Consensus Mechanism - -In short, the PoW consensus mechanism, as designed by Satoshi Nakamoto, is currently the soundest method of blockchain security. The mechanism solves the Double Spend problem and creates a secure network, capable of transferring financial value. Furthermore, competition among miners and the Longest Chain Rule create fairness on the blockchain. The combination of features provides a high level of defense against two of the most dangerous methods of blockchain destruction—the 51% Attack and the Genesis Attack—assuming a strong overall hash rate on the network. - -New PoW blockchains can opt to compete directly with Bitcoin’s hash rate, and some level of competition is good for the ethical values and innovative power of the cryptocurrency industry. However, it is not necessary, cost-effective, nor eco-friendly that every new blockchain innovation requiring security should attempt to compete directly with Bitcoin. Not only is this unsustainable, but it is also unreliable, as it depends on the arbitrary choices of the decentralized network of miners around the world. - -## The Komodo Solution: Delayed Proof Of Work (dPOW) - -Komodo presents a technology, the delayed Proof of Work consensus mechanism, that solves the problems described above. Komodo’s unique consensus mechanism provides the same level of security as the strongest PoW network, without attempting direct competition. Instead, Komodo’s consensus mechanism uses the chosen PoW network as a storage space for "backups" of Komodo transactions. By this method, in the event of an attempted attack on Komodo’s blockchain history, even a single surviving copy of the Komodo main chain will allow the entire ecosystem to overwrite and overrule any of the attacker’s attempted changes. - -In a key difference separating Komodo from regular PoW networks, our dPoW consensus mechanism does not recognize the Longest Chain Rule for any transactions that are older than the most recent "backup" of the Komodo blockchain. For conflicts that may arise which refer to transactions that are older than the most recent "backup," our consensus mechanism looks to the backups in the chosen PoW blockchain (Bitcoin) to find the accurate record. - -Furthermore, entrepreneurs who build independent blockchains (Smart Chains) in the Komodo ecosystem can likewise elect to have backups of their own records inserted into the Komodo main chain. In this manner, the records of the entrepreneur’s chain are then included in the backup that is pushed into the protective hash rate of the main PoW blockchain (Bitcoin). Thus, entrepreneurs and developers in the Komodo ecosystem can have their independent blockchains protected by the hash rate of the chosen PoW blockchain (Bitcoin). - -Therefore, to destroy even the smallest Smart Chain that is employing Komodo’s dPoW security, the attacker would have to destroy: a) all existing copies of the Smart Chain; b) all copies of the Komodo main chain; c) the accompanying PoW security network into which the dPoW backups are inserted (Bitcoin). This endows the Komodo ecosystem with higher than Bitcoin-level security, while avoiding the excessive financial and eco-unfriendly costs. - -In addition, the dPoW security provided by Komodo is not only greater than Bitcoin, but is also more flexible. The Komodo security services are performed by notary nodes, chosen through a stake-weighted vote. Notary nodes have the freedom to switch notarization to another PoW network. Reasons the notary nodes might elect to switch networks could include an event where worldwide miners’ hashing power changes to another PoW network, or the cost of notarization to the current PoW network becomes more than necessary. Through this flexibility, the Komodo ecosystem maintains both a superior level of security and a more flexible and adaptive nature than Bitcoin itself. - -#### A Note About Komodo’s Iguana Core Technology - -All the following processes are supported by a deeper Komodo technology called Iguana Core. Readers of the entire Core Technology Discussion sections will note that Iguana Core is featured in each section. This is because Iguana Core is the heart of the underlying technology that enables the vast Komodo ecosystem to work together. The Iguana Core code itself is complex and to fully explain would require a separate whitepaper. - -In short, Iguana Core is a collection of code that serves many purposes. One function of Iguana Core is to empower the blockchain technologies Komodo either builds or adopts to act in coordination with each other. Often, Iguana Core can advance their initial capabilities beyond original expectations. In the case of dPoW, the code that underlies notary-node functionality spawned from Iguana Core technology. - -Iguana Core is coded in the C programming language—the language of choice of our lead developer, JL777. The C language is designed to enable computers to process high volumes of information in a secure manner at high speed. This aligns with Komodo’s directives to provide security and scalability to our users. - -#### An Overview of Notary Nodes - -The Komodo ecosystem uses a stake-weighted vote to elect parties who will run sixty-four separate "notary nodes." These notary nodes are the key to transferring the history of transactions performed in the Komodo ecosystem into the protection of the Litecoin hash rate. - -##### Notary Nodes Are Elected IT Professionals - -There are no requirements to run in the yearly election, and candidates may form groups of individuals to work together in competing for each of the notary-node positions. - -Although the positions are open, voters in the ecosystem are encouraged to favor candidates that exhibit strong professional skill sets in the computer sciences. Notary nodes' primary responsibility is to maintain and adapt the Komodo ecosystem's security as needed. - -##### Notary Nodes Hash and Notarize the Komodo Ecosystem History - -The elected notary nodes perform a type of "backup" process, using Komodo software. These backups are called "notarizations." - -Each notarization acts as a marker of the "true" history for the Komodo ecosystem at the time the notarization was created. - -Notary nodes write each notarization into the history of the Litecoin blockchain as a permanent indicator of the history of the Komodo ecosystem. This allows any person to observe the notarization in Litecoin and thereby verify data and transaction history anywhere in the Komodo ecosystem. - -The notary nodes work together in a decentralized and trustless manner to achieve each notarization. The frequency of notarizations varies between two to six notarizations per hour. - -With the notarizations recorded into the Litecoin history, each confirmation on the Litecoin network is also a confirmation of the history of the entire Komodo ecosystem. - -The primary sacrifice that is made is the time between the creation of a transaction and the confirmation on the Litecoin (LTC) network that confirms the most recent notarization. For this reason, we name our consensus mechanism, "delayed Proof of Work" (dPoW). - -:::tip Note - -- The dPoW service used the Bitcoin(BTC) network for security till Mid 2021. But, switched to the Litecoin (LTC) network at the beginning of Notary Node Season 5. -- The Bitcoin protocol has a proven track record of excellent security and is becoming more secure by the day with more miners joining the network and hash rates climbing. -- That being said, the Bitcoin network is also becoming costlier and more congested to make transactions due to increased demand and limited on-chain scalability. Read [this blog post](https://komodoplatform.com/en/blog/dpow-litecoin-notarizations/) for more info regarding this change. - -::: - -##### Notary Node Power is Restricted to History Transfer and Nothing More - -Our dPoW consensus mechanism is designed to keep the advantages provided by the PoW system, circumvent the excessive financial and eco-unfriendly overhead costs, and avoid the security risks found in a PoS system. We use several methods to this effect. - -Most importantly, all actions a notary node takes are publicly verifiable, and Komodo software running on each full user's machine automatically verifies notary nodes’ actions. - -Notary nodes are not arbiters of "truth." - -They only transfer a history of activity in the Komodo ecosystem into the protective custody of the Litecoin hash rate – nothing more. - -The only type of power notary nodes hold over the ecosystem is the ability to grant or withhold notarization. - -There are sixty-four notary nodes, and the minimum number of notary nodes required to maintain activity in the Komodo ecosystem is thirteen. Thus, for any activity in the Komodo ecosystem to be excluded entirely would require that at least fifty-one of the notary nodes withhold notarization. - -Such an action would be uneconomic, as this would destroy the access to the financial rewards a notary node receives for performing their duties. - -By this design, notary nodes' primary economic incentive is to properly transfer the records of the Komodo ecosystem into a secure location and to increase the value of the KMD rewards they receive for this service. - -##### Users Need Only Wait Until They Are Satisfied With a Transaction's Number of Notarizations and Other Security Features - -For the average user, when performing a trade of goods and services where security is desired, the user simply needs to wait until the notary nodes complete the notarization process. Once a transaction's history is included in a notarization in the Litecoin blockchain, the only way to break the security protecting their transaction history requires breaking the security of the Litecoin. - -Komodo software automates the verification process, and developers can tailor their individual communities around the needs of their audience. - -Through these measures, Komodo’s dPoW consensus mechanism maintains the security innovated by Satoshi Nakamoto, and because dPoW enables the Bitcoin/Litecoin hash rate to serve more independent blockchains than just the single Bitcoin blockchain, dPoW even expands on Nakamoto’s original design. - -## The Notarization Process - -#### Step One: Gathering the Appropriate Data - -The process of notarization is simple. Roughly every ten to twenty-five minutes, notary nodes perform a special block hash mined on the Komodo blockchain and take note of the overall Komodo blockchain "height" (i.e. the number of total blocks in the Komodo blockchain since inception). The notary nodes process this specific block in such a manner that their signatures are cryptographically included within the content of the notarized data. - -[All examples herein are estimated based off an actual historical KMD notarization to the BTC network, linked here.](https://www.blocktrail.com/BTC/tx/313031a1ed2dbe12a20706dff48d3dffb0e39d15e3e4ff936d01f091fb3b8556#tx_messages) - -The pieces going into the notarization process could look like this: - -##### Block Hash - -```bash -0a88371cc63969d29492110592189f839557e606db6f2b418ecfe8af24451c07 -``` - -This is the "block hash" from the KMD blockchain—mined and cryptographically signed by the notary nodes - -##### Block Height - -```bash -607240 -``` - -This is the blockchain "height" of the Komodo blockchain at the time of notarization (i.e. the total number of KMD blocks ever created) - -##### Name of Komodo Smart Chain - -```bash -KMD -``` - -The letters "KMD" are added into the notarization mixture to indicate the name of the blockchain to which this notarization belongs - -#### Creating a Notarization - -The notary nodes will take these three pieces of information and compress them into a format that is more computer-friendly. The result will look like this: - -```bash -6a28071c4524afe8cf8e412b6fdb06e65795839f189205119294d26939c61c37880a084409004b4d4400 -``` - -The above number can be said to be a cryptographic representation of all that has happened on the Komodo blockchain up to this point in time. According to the Cascade Effect, were an attacker to attempt to go back in the history of the Komodo blockchain and change even a single character of data, and then perform the same hashing formulas in the Komodo code, the number above would dramatically change. - -This makes the notary nodes’ notarization a useful backup, assuming this number is in a safe location where anyone on the Internet can view and verify it. The notarization enables a single surviving copy of the "true" Komodo main chain to identify itself to the rest of the Komodo network, as only the "true" data can produce the same result. - -On the other hand, an incorrect history of the Komodo network will not be able to produce the same notarization. Through the automation in the Iguana Core software that underlies the Komodo ecosystem, all users will align with the "true" blockchain history and ignore any malicious actors’ "false" attempts. - -#### Step Two: Notarizing the Data to a Secure Location - -Naturally, for security purposes this number cannot simply be saved to one person’s local computer, or be written down on a piece of paper. Were the number to be in such a centralized location, a would-be attacker could simply destroy the backup, or replace it with a "false" version. - -For the number to be useful, it must be placed in a secure and decentralized location. Here is where Komodo adopts security from another network: Komodo will perform a simple transaction in which it writes the above number into the data history of one of the strongest PoW blockchains (currently Litecoin). This location is as secure as the miners’ hash rate makes it, and the location is decentralized, by nature. - -To place this information in the accompanying PoW network, the notary nodes will use a feature that exists at the core of the Bitcoin/Litecoin protocol when making a transaction. The feature is called "OP_RETURN," and it allows for a message to be added to the blockchain, permanently, as a part of performing a transaction. - -A notable use of the ability to write messages to a PoW blockchain is found in the first actions of Satoshi Nakamoto himself (themselves). In the first Bitcoin block ever mined, Satoshi used a feature like OP_RETURN to include this [message](https://en.bitcoin.it/wiki/Genesis_block): - -```bash -03-Jan-2009 Chancellor on brink of second bailout for banks -``` - -::: tip - -Nakamoto used a feature called "coinbase," which is similar to OP_RETURN. A primary difference between coinbase and OP_RETURN is that coinbase is used by miners when mining a block, whereas OP_RETURN can be used by any user when performing transactions. - -::: - -Readers who have downloaded the Bitcoin blockchain to their local computer, and who possess the knowledge necessary to inspect the raw Bitcoin data, can discover these very words written to their own hard drive. The important thing to understand for our discussion is that any message written to a secure and decentralized PoW blockchain is viewable and verifiable to all. - -The permanence and security of OP_RETURN messages are a core aspect of dPoW’s security. In the event of a powerful attack on the Komodo network, there need be no argument over the correct notarized marker upon which the ecosystem members should rely. The Iguana Core code running at the heart of each user’s Komodo software can continue securing, decentralizing, and distributing the accurate version of the Komodo history as though the attack never occurred. - -#### Step Three: Notarizing the PoW Network Information Back to the KMD Main Chain - -One final step remains to complete the loop of security between the KMD main chain and the chosen PoW network. The KMD blockchain must record within its own records the specific location where it placed this backup into the PoW blockchain. This enables the Iguana Core software to identify the location of the most recent notarization. - -To create this reminder, the notary nodes will now gather one more piece of information, this time drawn from the accompanying PoW network: the transaction hash identifying the location of the first notarization. This information could look like this: - -```bash -313031a1ed2dbe12a20706dff48d3dffb0e39d15e3e4ff936d01f091fb3b8556 -``` - -The notary nodes will combine it with all the information that has come before. The result will be transformed, again, into a computer-friendly version: - -```bash -6a28071c4524afe8cf8e412b6fdb06e65795839f189205119294d26939c61c37880a0844090056853bfb91f0016d93ffe4e3159de3b0ff3d8df4df0607a212be2deda13130314b4d4400 -``` - -This number is a compressed cryptographic representation of everything that has happened in the Komodo ecosystem up to this point in time. The notarization is placed as a transaction message directly into the KMD main chain itself, and thus the notarization enables the Komodo ecosystem to know how to find a reference of its own history. - -## Extending Notarization to Komodo Smart Chains - -dPoW notarization allows Komodo to secure not just one chain, but many chains. Komodo is capable of using this notarization process to "recycle" the Bitcoin hash rate onto potentially thousands of other blockchains. - -A blockchain that uses Komodo technology to take advantage of this protective service is called a Smart Chain. Komodo provides Smart Chains to interested entrepreneurs and developers in the Komodo ecosystem. - -Each Smart Chain comes with many features, which are discussed in greater detail throughout the Core Technology Discussions section. - -##### Notarization Extends to Each Participating Smart Chain - -This same security process extends to any Smart Chain that is under the protection of the notary nodes. The primary difference between a Smart Chain and the KMD main chain is that the main chain notarizes to an external PoW network (Litecoin), whereas the Smart Chain notarizes to the KMD main chain. - -###### Notarization Flow - -
- - Smart Chain —> Komodo Main Chain (KMD) —> Litecoin (LTC) - -
- -To summarize, the notarization process of a transaction on a default PoW-based Smart Chain is as follows. - -- A transaction is performed on a Smart Chain -- Miners on the Smart Chain create a block for the transaction -- Notary nodes create a notarization for the current period of blocks -- Notary nodes write this notarization to the KMD main chain - - Notary nodes here also perform a quick special transaction on the Smart Chain to alert this chain's network that the notarization process is starting - - Once this special transaction enters the Smart Chain's mempool, the default Komodo software considers all included transactions to be final. Users and developers can decide for themselves whether to trust this first KMD notarization, or to wait for the LTC notarization to come -- A few minutes later, notary nodes create a notarization to represent the KMD main chain's history and write this into the LTC chain -- Notary nodes then perform a special transaction on the KMD main chain to alert all KMD nodes of the notarization -- Notary nodes also perform a special transaction on all Smart Chains to alert all nodes of the LTC notarization -- At this point, users often consider all transactions on their Smart Chains to have achieved finality - -##### Only the Most Recent Notarization Matters - -As each notarization is built upon all the notarizations that came before, Iguana Core does not need to monitor every notarization ever created. Rather, the software only needs to observe the most recent iteration. - -This is favorable for Komodo security, as there is always a possibility that the chosen PoW network (Litecoin) could fail. In this event, the notary nodes would place their next notarization in a competing PoW network (such as Bitcoin/Bitcoin Cash) and the entire Komodo ecosystem would remain secure. The notarizations in the failing PoW network would no longer be required to verify ecosystem accuracy. - -## Understanding Security and Economic Incentives - -The nature of mining in the Komodo ecosystem serves as an incentive to motivate the notary nodes to perform their job well. This setup is also a principle method by which the Komodo ecosystem dramatically reduces the overhead costs necessary to function. Portions of the mining rewards are available not just to the notary nodes, but also to all members of the Komodo ecosystem, through various means. - -The Komodo network on a surface-level is a minable network, like other PoW networks. Any technically savvy user can activate a device capable of mining the Komodo network, and thereby process users’ transactions, mine blocks, and receive rewards. For these miners, the Komodo protocol functions in almost the exact same manner as the Bitcoin blockchain. - -Understanding the similarities will explain to the reader the motivations for the notary nodes and other Komodo miners to secure the Komodo network. The differences, on the other hand, are explained [in another section of the Core Technology Discussions.](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#details-regarding-kmd-main-chain) - -(See the section regarding the 5.1% rewards allocated to all users who hold at least 10 KMD in their wallet address. This 5.1% reward is given to users out of the funds that would normally be given to a Bitcoin miner as a method of minting new Bitcoin coins.) - -#### "Easy Difficulty" in dPoW: The Key to Notary Nodes’ Financial Incentives - -The foundational similarity to understand is that with each block header, clues are provided for miners to find the next valid block hash. The specific clue, "difficulty," changes with each block header. - -Under normal circumstances on a PoW blockchain, with each block header the difficulty level can change. The Bitcoin/Litecoin protocol itself decides what the difficulty for the next valid block should be. - -The difficulty is decided based on the amount of overall hash power mining the network. If many miners are active, then the hash rate is high, and the Bitcoin /Litecoin protocol sets the difficulty to a higher number. On the other hand, if the hash rate is low, then the protocol sets the difficulty to a lower number. - -Recall that the "difficulty" level determines the number of zeros at the beginning of the next valid block hash. The more zeros at the beginning of a valid block hash, the more unlikely each attempt at finding a valid block hash will be. - -When the Bitcoin protocol was in its infancy, the difficulty setting was easy. In fact, the block hash we used earlier as an example is, in truth, the very first block hash ever created—by Satoshi Nakamoto himself (themselves). - -```bash -000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f -``` - -He (they) designed the difficulty setting to encourage the network to find new block hashes once every ten minutes, on average. - -For a computer, to guess within ten minutes a nonce that will produce a block hash beginning with ten zeros is relatively easy. This is so simple, in fact, no special computer is required. Early Bitcoin miners could use nothing more than the average desktop machine, having the CPU—the small heart of the computer—performing the calculations. - -As more miners joined the network, however, the Bitcoin protocol automatically increased the difficulty. This maintained the speed at which the pool of all miners discovered new blocks, despite the increased size of the pool. Stabilizing the speed created several benefits, including an amount of economic predictability upon which users can rely. - -Today, at Bitcoin’s current level of overall hash power, a valid block hash requires a much higher level of difficulty. Here is a recent successful block hash: - -```bash -0000000000000000002d08398d6f21f038019600266b419bad5ab88add5b638d -``` - -There are seventeen zeros, and to find a valid block hash at this level requires a prodigious effort. - -In the race to win blockchain rewards, miners all over the world have built entire farms of specialized equipment for mining. The small CPU of a desktop is no longer useful, and the time of "easy difficulty" on Bitcoin has passed. - -#### Notary Nodes are Special Miners on the KMD Blockchain - -Here is where our dPoW consensus mechanism diverges from the Bitcoin/Litecoin protocol’s limitations. In addition to performing the notarizations of the Komodo ecosystem, notary nodes are also a special type of blockchain miner. They have a certain feature in their underlying code that both enables them to maintain an effective and cost-efficient blockchain ecosystem and provides the notary nodes with a financial incentive. The combination of benefits prevents the Komodo ecosystem from falling into the trap of directly competing with other PoW networks for hash-rate security status. - -#### Each Notary Node Gets One Chance Per Every Sixty-Five Blocks to Mine on Easy - -Each individual node periodically receives the privilege to mine a block on "easy difficulty." In other words, while the rest of the miners in the Komodo ecosystem are mining at a calculated difficulty level, the notary nodes occasionally receive the chance to mine as though they are alone on the network. - -The notary nodes’ "easy difficulty" setting operates in a cyclical manner, with each notary node on its own cycle. At the start of the cycle the notary node holds the "easy difficulty" ability until it mines one "easy" block. Then the Iguana Core code removes the ability for the next sixty-four blocks. After the sixty-four block period passes, the notary node can once again attempt to capture a block on "easy difficulty." - -Therefore, while everyone else on the network mines at an adjustable level of difficulty according to the normal PoW consensus mechanism (which keeps the overall speed of the Komodo network stable) the notary nodes have a chance to step outside the normal rules. For every sixty-five block period on the Komodo blockchain, the odds that a block will be mined by a notary node, as opposed to a normal miner, are essentially 3:1. - -Since the rest of the miners have an adjustable difficulty ratio, it does not matter how many more miners attempt to mine Komodo. Most of the valid blocks will always be found by the sixty-four elected notary nodes, even were the equivalent of entire hash power of the Bitcoin network to switch all its attention to mining Komodo. - -The mining rewards that a notary node receives through this feature are ~50 KMD per day. This reward occurs regardless of KMD’s popularity, market value, or even of the competition from normal KMD miners. The reward notary nodes receive creates an economic incentive for each party controlling a notary node to support and protect the Komodo ecosystem, and to increase the relative value of this daily ~50 KMD reward. - -## Komodo’s Protective Measures in Action - -There are myriad ways that an attacker can assail a blockchain project, and the Komodo ecosystem is well prepared. In this foundational paper, we only discuss two of the most crucial attacks—the 51% Attack and the Genesis Attack. - -#### Notarizations Provide a Defense Against Both the 51% Attack and the Genesis Attack - -By relying on the notarizations in the chosen PoW network’s hash rate (Litecoin), users in the Komodo ecosystem are well protected from both the 51% Attack and the Genesis Attack. - -Recall that in a 51% Attack, the attacker first makes a transaction and then erases it by providing 51% of the total hash rate to a "false" blockchain where the transaction never occurred. In the Genesis Attack, the attacker recreates the genesis block of a blockchain and mines an entirely false history. - -For either of these attacks to play any part in the Komodo ecosystem, the successful attack would have to destroy every transaction at every level it is recorded. - -##### Defense Against the Genesis Attack - -First, let us consider the implications of the notarization process provided against the Genesis Attack. - -Once an independent blockchain has even just a single transaction pushed through the notarization process into the chosen PoW network, that notarization protects against the Genesis Attack. - -To successfully complete a Genesis Attack against a Komodo Smart Chain, the attacker would have to destroy the chosen PoW network’s records from that moment going forward. The attacker would also have to destroy the KMD main chain from that moment forward, and the entire independent Smart Chain. - -The likelihood of achieving this task is effectively as probable as performing a Genesis Attack on the chosen PoW network itself. - -#### Defense Against the 51% Attack - -The Komodo ecosystem is also well protected against the 51% Attack. Consider an attacker attempting to create a malicious transaction on a default PoW-based Smart Chain in the Komodo ecosystem. The attacker creates their transaction and sends it to the Smart Chain's PoW network for processing. - -##### Before Notarization - -During the waiting period for notarization, on a default PoW-based Smart Chain, this transaction is vulnerable to the attacker's 51% Attack. The attacker would simply wait until the opportune moment to attack their victim by providing 51% of the total hash rate to a "false" version of the independent Smart Chain wherein the transaction never occurred. This "false" version would erase the transaction before the notary nodes create the next notarization, and therefore the unfortunate recipient of the transaction would no longer have the funds from the vanished transaction. - -On a default PoW-based Smart Chain, therefore, the recipient of any transaction should always wait until the notarization process is underway before exchanging their valuables. - -::: tip Note - -An important aside here is that Komodo Smart Chains have additional settings beyond the default PoW-based setup that reduce the time required to wait for notarizations. In some instances, the waiting time can be eliminated. The [Channels Antara Module](../../../basic-docs/antara/antara-api/channels.html#introduction) is an effective example, as this module allows instantaneous secure transactions. - -::: - -##### Notarization to the KMD Main Chain - -However, if the attacker fails to perform their 51% Attack before the notary nodes notarize to the KMD main chain, the difficulty of successfully attacking their victim increases. Now, the attacker must successfully perform the 51% Attack against both the KMD main chain and the independent Smart Chain. - -Attacking the KMD main chain is difficult to achieve, as it is not a normal PoW blockchain. Rather, this chain is designed to withstand attacks. The attacker would have to compromise many of the notary-node machines while simultaneously performing a 51% Attack against both the KMD main chain and the independent Smart Chain. - -While the KMD main chain provides a certain level of protection, this chain is not the ultimate goal. The KMD chain is merely a transfer point before moving the notarization data to the LTC main chain, as LTC is dramatically more secure. Therefore, while entrepreneurs, developers, and users await notarization to LTC, they should decide for themselves how much trust they wish to place in the system at this point of the process. - -::: tip Note - -A frequent concern that many newcomers have here can be described as a fear that the notary nodes could potentially falsify information about a transaction on a Smart Chain. - -This concern sometimes mistakenly leads some observers to believe that notary nodes are a centralized group who are providing financial governance to the ecosystem. - -This is neither true nor possible. - -Notary nodes are not arbiters of truth. - -As stated before, all information that goes into a notarization is generated by the Smart Chain network and is publicly verified by all nodes on the network. This includes the notarization itself. - -Notary nodes' sole additional power is the ability to sign a transaction that records this notarization to the network. Either notary nodes perform this service, or they do not. There are no other options available to them. - -Any attempt by the notary nodes to falsify information in a notarization would be automatically rejected by all users of the Smart Chain network. - -::: - -##### Notarization to LTC - -After another ten to twenty minutes, the notary nodes will perform the notarization process for the KMD main chain. Here, they gather all the information for the entire ecosystem, create a hash, and record this hash to the LTC main chain. Once this is completed, they inform the entire ecosystem through a special transaction on the KMD main chain, and on each individual Smart Chain. - -At this point, one can argue that the attacker's job is nigh impossible. To 51% Attack the Smart Chain, the attacker must compromise LTC, KMD, and the Smart Chain. This would require an incredible amount of equipment and expertise, and therefore most users in the Komodo ecosystem may now feel safe to consider all transactions to have achieved permanent finality. - -Therefore, any record that has at least one full notarization has a fortress of security at its guard. So long as users and developers are mindful to wait for the desired number of notarizations to secure their payments, both the 51% Attack and the Genesis Attack are highly unlikely either to be successful, or to provide economic value to the would-be malicious actor. - -Nevertheless, we remind all users of our ecosystem to consider their own vigilance and mindfulness as the most effective protection against the would-be attacker. Users, entrepreneurs, and developers utilize all aspects of the Komodo network at their own risk. - -#### Considering an Attack on the Notarization Process - -To create a notarization for the KMD main chain, the minimum number of notary nodes required is 13. If the notary nodes themselves come under attack and must work to maintain access to the Internet, just 13 of the full 64 are required for the Komodo ecosystem to continue its operations. - -In the possible event of a disconnect from the minimum number of notary nodes, chains in the Komodo ecosystem should simply be on the alert. Users, developers, and entrepreneurs would simply need to wait for the notary nodes to regain access to the Internet and resume the notarization process before considering any transaction final. - -For this reason, the position of a notary node is held with high importance, and the parties which gain these positions are measured foremost by their Information Technology experience and capabilities. Komodo stakeholders are responsible to vote for candidates that are the most qualified to perform in the notary-node duties. - -## The dPOW Consensus Mechanism is Inherent in all Komodo Smart Chains - -The notarization for the Smart Chain is performed by the notary nodes as a service to the independent developer and entrepreneur. - -Notary nodes create a notarization of the Smart Chain and write it into the KMD main chain. Then they write their actions into the Smart Chain itself. This allows Iguana Core (running at the heart of the Smart Chain) to identify where its most recent notarization can be found. - -The notarization process cycles every ten minutes, assuming the Smart Chain’s network is consistently active. If the network has periods of inactivity, the notary nodes halt the process (to save against unnecessary notarization costs) and reactivate as soon as new transaction activity appears on the Smart Chain’s network. - -We invite the reader to consider that as each Smart Chain can support thousands of transactions per minute, this makes the combined ecosystem capable of supporting millions of transactions per minute. This includes cross-blockchain interoperability and Smart Chain clustering, via our atomic-swap powered technology and our Antara Framework. This makes Komodo among the most scalable of financial-technology solutions in existence, and capable of competing with the transaction volumes of fiat networks. - -Naturally, as each level of notarization takes time to perform, there is an additional delay for Smart Chains as compared to the KMD main chain. A Smart Chain’s history is notarized into the KMD main chain approximately every ten minutes, assuming constant activity. This notarization will then be pushed through the notarization process into the chosen PoW network (Bitcoin). We estimate that a transaction performed on a Smart Chain will receive the KMD main chain’s protection within approximately ten minutes, and will receive the Bitcoin hash rate’s protection in approximately twenty to thirty minutes. - -Another difference between the KMD main chain and a Smart Chain is that the notary nodes only mine the KMD main chain. Asset-chain developers are responsible to create any required network of miners to process their Smart Chain’s transactions. - -This does not need to be a full network of mining farms, such as those in Bitcoin/Litecoin. Rather, power only needs to be of a level necessary to process transactions, and to provide any desired level of hash-rate security. For a small business with intermittent periods of transaction activity, a single, dedicated, full-time server may be enough. Larger businesses can scale as desired and can also work to attract a network of freelance miners. - -Furthermore, developers of Smart Chains need not create their chain so that it relies solely on a PoW consensus mechanism. Instead, developers can utilize Antara Customizations (discussed later in the Core Technology Discussions section and elsewhere in this documentation). These Antara Customizations allow the developer to utilize a hybrid consensus model that combines Proof-of-Stake (PoS) with Proof-of-Work (PoW). - -The PoS consensus mechanism does not require high electrical costs to maintain a basic level of network security. Therefore having a certain percentage of blocks mined via PoS can increase security during the ten-minute waiting period before notarization. - -There are also various members of the Komodo ecosystem who mine for profit, and can be motivated to assist Smart Chain developers in securing a network in exchange for block rewards. - -This combination of options available to a blockchain entrepreneur dramatically reduces the overhead costs and effort the entrepreneur and developer would otherwise have to allocate to a network of high-hash rate miners. These freed resources of the entrepreneur and developer can therefore be allocated to other uses in their business models. The total yearly cost for the Komodo notary nodes to notarize the KMD main chain into the currently chosen PoW chain, Litecoin, is approximately ~180 LTC/year. - - - -This security mechanism is not limited to Smart Chains created within the Komodo ecosystem. In fact, Komodo’s Blockchain Security Services are available to any existing blockchain. With Komodo, any blockchain can be protected with the power of the Litecoin hash rate for a tiny percentage of the cost. - -Thus, an entrepreneur in our ecosystem can have their own independent blockchain that is backed up by the hash rate of the Litecoin mining network, at only a fraction of the cost. In the following sections, we discuss the formation of a new Komodo Smart Chain, the method of distribution and trading using our atomic-swap technology, AtomicDEX, and our "smart contract" like technology, the Antara Framework. diff --git a/docs/basic-docs/start-here/core-technology-discussions/initial-dex-offering.md b/docs/basic-docs/start-here/core-technology-discussions/initial-dex-offering.md deleted file mode 100644 index 2f8ddc432..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/initial-dex-offering.md +++ /dev/null @@ -1,265 +0,0 @@ -# Initial DEX Offering (IDO) - -## Abstract - -There lies great power in the idea that any person, regardless of nationality, creed, or background, can obtain funding to innovate and prosper. An integral tenet of blockchain technology is "decentralization." By decentralizing systems, we reduce the number of control points that can be compromised and manipulated. - -Decentralization plays a more common role in our new cryptocurrency economy, but there is one area of the market that remains centralized and vulnerable: the initial coin offering (ICO). The cryptocurrency industry needs a solution, and Komodo presents an answer with our initial DEX offering (IDO) technology. - -In today’s common ICO model, the high level of centralization creates many problems. Third parties can block or manipulate entrepreneurs’ efforts to innovate and prosper. The centralized location of releasing an ICO blockchain product is vulnerable, allowing whales, hackers, and human error to corrupt or destroy an entrepreneur’s efforts. The negative experience of users in these situations can also impact the perception and adoption of cryptocurrency. Furthermore, the traceable nature of an ICO prevents society from crowdsourcing and purchasing within our inherent right to barter in private. - -The IDO model, as created by Komodo Platform, overcomes these challenges. It provides the necessary technology to create and release a blockchain product to the world with the full power of decentralization. - -Entrepreneurs building on our platform can begin by creating a Smart Chain, and our technology simplifies this process. One need only install the necessary software, execute a few commands on a command prompt, and then establish a connection between two or more Komodo-enabled devices as explained below. Komodo’s core technology will do the rest of the work necessary to create a fully independent blockchain, empowered with an array of features. - -Our dPoW technology is a key feature that provides the necessary security to protect the integrity of the blockchain. Use of dPoW is optional, and since Smart Chains in the Komodo ecosystem are independent by nature, entrepreneurs can discontinue dPoW services at will. - -After creating a blockchain, the entrepreneur then uses our software to release the project to the world. AtomicDEX — our decentralized exchange — is a useful software solution to conduct an Initial DEX Offering (IDO). Because AtomicDEX relies on atomic swaps, enabling you to trade value across any supported blockchain protocol. No third-party manipulators can prevent the entrepreneur from their crowdsourcing and innovative endeavors. - -Through [the privacy technology](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-nature-of-privacy-features-in-the-komodo-ecosystem) available on Komodo Smart Chains, IDO participants can purchase the product within their inherent right to barter in private if they take some precautions. - -Do note that, ERC20 tokens, ETH forks/clones, QRC20 tokens, QTUM forks/clones, and most UTXO type blockchains can also be distributed through an IDO using AtomicDEX. While these types of coins/tokens don't receive other benefits of the Komodo Ecosystem like the dPoW service and UTXO smart contracts (CC modules), they can still be traded on AtomicDEX. - -## The Challenges in Current ICO Platforms - -#### Specific Weaknesses in the Centralized ICO Model - -There are many weaknesses present in today’s Initial Coin Offering (ICO) model. Several notable weaknesses include third-party discrimination, vulnerability to theft and human error, and a lack of privacy. - -##### Third-Party Discrimination - -An entrepreneur seeking to serve their intended audience may experience adverse intervention from a third party. The antagonists may display personal and malicious intent, regardless of the value of the entrepreneur’s innovation. - -##### Centralization of Technology: Theft and Human Error - -Today’s ICOs are typically conducted in escrow, where the purchasers must transfer money to one location for holding. This typically occurs through a single website, and the cryptocurrency funds are held on a centralized collection of server(s). - -The user must wait while the ICO administrators first verify the transactions and distribute the coins. During this time the funding is centralized, and therefore vulnerable to thieves and human error. - -##### Lack of Privacy - -Because ICO transactions are highly traceable, it is difficult, if not impossible, to perform ICOs within our right to barter in private. - -#### Third-Party Discrimination via the Centralized ICO - -The centralized ICO process fails to harness the borderless nature of blockchain technology. A key strength of any blockchain is that any human capable of accessing the technology can activate the blockchain, regardless of their geographical location or social status. Thus, anyone can provide yet another verifiable record of the transaction history, and this decentralization provides a crucial element of security to the blockchain. - -An ICO innovator, therefore, may prefer to use a blockchain platform that transcends man-made barriers, to protect their innovation. Circumventing man-made barriers could be integral to the blockchain’s survival because the element of decentralization prevents malicious actors from creating subjective borders around the blockchain records and then using authority to falsify and manipulate. - -This creates a conundrum. As a human race, we also find strength and empowerment in subjectively defining our own demographics for various reasons, whether they be to form companies, cultures, communities, etc. - -While we find the ability to create subjective demographics useful, it contrasts with the borderless nature of blockchain technology. Members of one demographic may desire to participate in a specific ICO, but another demographic may find this unfavorable. Therefore, the second party might try to forestall progress. The paradox lies in the fact that for the underlying blockchain product to maintain its integrity, it must serve both communities without regard to any man-made barrier between them. - -The problem compounds even further as we observe that on a decentralized blockchain platform, a new ICO product is capable of functioning anywhere there is access to the underlying technology. On a decentralized platform, once a new blockchain product is released any person from either demographic is now able to utilize it. The sentiment of either demographic is irrelevant. The problem becomes most pronounced if members of a competing group attempt to even maliciously prevent an innovation out of selfish reasons. Thus, the innovator must have the option to protect against would-be malicious competitors. - -The overall centralized nature of today’s ICO process, therefore, presents a problem. Entrepreneurs who are not able to navigate the adverse effects of an inhibiting third party may be unable to realize their creative potential. - -#### Centralization of ICO Technology: Hackers and Human Error - -Yet another issue with the traditional ICO model is that the technology upon which an ICO is released is also centralized, which presents vulnerabilities due to human foibles. - -##### Hackers and Human Error - -Because all coins of an ICO typically process through one centralized point during the purchasing period, the entire supply is vulnerable to any person with access to the node. Therefore, both malicious and clumsy human agents can destroy an ICO. The data holding the cryptocurrency can be damaged, stolen, or simply lost through incompetence. - -An entrepreneur can also consider that in today’s ICO model both the funding provided by the purchasers, as well as the actual ICO coins that the entrepreneur intends to sell, remain on the centralized node for a long period of time. It is not just one side of the crowdsourcing endeavor that is at risk, but both. - -This central point of failure can be catastrophic for all participants. - -##### The Right to Barter in Private - -Finally, the lack of current privacy options in the ICO process inhibits blockchain participants from purchasing within our right to barter in private. This right to privately exchange goods and services extends further into history than the written word. We have, as a species, utilized this right to organize into communities, institutions, and even nations. - -Many of humanity’s most meaningful advancements in art, technology, and other human endeavors began in situations where the creator had the security of privacy in which to explore, to discover, to make mistakes, and to learn. - -The right to barter in private, however, is under modern threat as the recent monumental and historical phenomenon known as "The Internet of Information" permits many kinds of people to quietly and without inhibition monitor other people’s shopping and bartering behavior. This is a dangerous development, as it destroys the privacy that empowers much of humanity’s personal growth. We must reserve our right to barter in private, for we observe that there is a myriad of ways in which a common person may explore personal growth in an economic environment. - -The highly traceable nature of today’s centralized ICO model is in direct contradiction to this human need. - -#### The Blockchain Industry Needs a Solution - -Together, these issues show that the current state of the ICO market is plagued with limitations that inhibit freedom, security, entrepreneurship, and even human growth. The cryptocurrency industry needs a solution to these problems, and Komodo presents an answer. - -## The Initial DEX Offering - -The Komodo ecosystem presents a solution, the initial DEX offering (IDO), that solves these issues and even adds new possibilities to the cryptocurrency market. - -The decentralized nature of the IDO enables the entrepreneur to release a blockchain product beyond the reach of a malicious third-party influencer. - -Furthermore, through our decentralized exchange, AtomicDEX, the IDO allows an entrepreneur to release their product in a manner that mitigates and even eliminates many of the issues regarding hackers and human error. - -With the advantage of Komodo’s privacy technology, the participants in an IDO are empowered with their right to barter in private. - -## The Process of Creating a New Blockchain in the Komodo Ecosystem - -Formerly, coding and generating the blockchain itself were the most difficult aspects of the development process. Now, the Komodo team has simplified the process into easy steps. Through Komodo’s Iguana Core technology (introduced in Part I), the entrepreneur can create a new independent blockchain by entering just two simple commands in the command prompt of their computer. - -The following steps rely on one of Komodo’s underlying software processes that run in the background on a user’s computer. The name of this software is the "Komodo daemon," or `komodod`, for brevity. `komodod` is rooted in Iguana Core technology. - -#### The First Command to Create a New Coin - -```bash -./komodod -ac_name=[ENTREPRENEUR'S COIN] -ac_supply=[TOTAL COIN SUPPLY] -gen -``` - -The first part of the command, `./komodod`, initiates a new instance of komodod. - -By default, the initial `./komodod` command executed alone would launch the Komodo main chain, KMD, on the user’s computer. However, the next part of the command tells komodod to behave differently. - -```bash --ac_name=[ENTREPRENEUR'S COIN] -``` - -This command tells komodod not to launch the main KMD chain, but rather to launch the chain that has the indicated name. - -```bash --ac_supply=[TOTAL COIN SUPPLY] -``` - -This tells komodod how many total coins there should be in this chain. - -```bash --gen -``` - -This tells `komodod` that the user desires to mine this network. - - - -Komodod now begins the automated process of creating a new Smart Chain in the Komodo ecosystem. Komodod will first make a fresh and empty clone of the KMD main chain (though it will not yet generate the actual coins), with only a few differences to the underlying nature of the chain. - -#### The Features of the New Smart Chain - -There are several primary differences between a Smart Chain and the main Komodo chain. For example, unlike the main Komodo chain, the Smart Chain will not automatically generate 5.1% rewards for all wallet addresses holding coins. Furthermore, the Smart Chain’s dPoW consensus mechanism is built to notarize to the KMD main chain (as opposed to LTC). - -Some of the differences reveal strong advantages held by members of the Komodo ecosystem. By design, this Smart Chain is capable of automatically adopting any updates that the Komodo core development team add to the framework. The Smart Chain also has a built-in capacity within the framework to allow the entrepreneur to code new rules. - -For example, the entrepreneur may decide not to use a PoW consensus mechanism, but may instead prefer PoS. Other changes can also be made, according to the entrepreneur’s imagination and developer knowledge. So long as the new code that the entrepreneur adds to the Smart Chain does not interfere with the overall framework, the Smart Chain will smoothly integrate with the rest of the Komodo ecosystem. - -For the purposes of our discussion, this new Smart Chain is otherwise the same as the Komodo main chain, including the features to communicate natively with other blockchains via AtomicDEX. The reader may note that this new Komodo Smart Chain is not a colored-token running on top of a parent blockchain, as is often the case in other blockchain ecosystems (like ERC20 tokens on the Ethereum network). Instead, this Smart Chain is a unique and independent blockchain unto itself. - -This empowers the entrepreneur with significant advantages over other blockchain ecosystems. The Smart Chain can run on its own nodes, act according to whatever rules the entrepreneur can imagine, and can scale according to its own audience. Should a Smart Chain in the Komodo network experience an explosion of activity, the overall Komodo ecosystem will not be negatively impacted. This independence grants a significant competitive advantage in the form of overall security, speed, and ease of use for end-users. - -Consider the advantage of developing an entrepreneurial product as a fully independent blockchain. Should the entrepreneur desire at a future point to leave the Komodo ecosystem for any reason, they are free to take their blockchain product with them. - -#### Generating and Mining the New Coins - -Let us return now to the moment after the entrepreneur executes the first command in the command prompt, and komodod creates a fresh and empty clone of the Komodo main chain. While the instance of the komodod program (running on the entrepreneur’s local computer device) will create the necessary code for the new Smart Chain, komodod will not yet generate the coin supply itself. Komodod instead will wait for the next few steps to occur. - -The reason for the wait is that a blockchain’s essence depends upon existing not in isolation, but in a network of multiple devices. This is the nature of decentralization. Komodod will wait until it receives a signal from another device, thus indicating that it has a peer with which to form the Smart Chain network. - -##### The Entire Coin Supply is Distributed in the Genesis Block - -Typically, the entire coin supply for the IDO is created and distributed immediately to the device that mines the first block, the Genesis Block. The code performs this distribution as a one-time reward for discovering the first valid block hash. - -Having established a secure connection with a second device, the entrepreneur will enter the following command on the second device. - -```bash -./komodod -ac_name=[ENTREPRENUER'S COIN] -ac_supply=[TOTAL COIN SUPPLY] -addnode=[INSERT IP ADDRESS OF FIRST DEVICE] -``` - -Note that the first three elements of the command, `./komodod`, `-ac_name`, and `-ac_supply`, are the same. It is important that the parameters inserted into these commands match exactly. Otherwise, the instances of komodod running on the separate devices will ignore each other, and the coin will not be mined. - -::: tip Note - -In the second device, the -gen command is not present. In this circumstance, we are assuming that the entrepreneur wants to capture the entire coin supply on the first device. Technically speaking, assuming the entrepreneur has ownership over both devices, it does not matter if both devices initiate the -gen command. Both devices will attempt to mine the first block and the superior device will receive the coin supply. - -::: - -There is another key difference in the command. - -```bash --addnode=[INSERT IP ADDRESS OF FIRST DEVICE] -``` - -With the execution of the IP address command, the second device knows to look across the available connection (the Internet, VPS service, etc.) for the first device, which is already running an instance of komodod and the new coin. The command here simply tells the computer the proper IP address of the first device. - -As soon as these two devices connect, having all the proper komodod software running and set in place, the mining begins. One of the devices will mine the first block and instantly receive the total coin supply of the entire blockchain into the user’s chosen wallet. - -Both devices sync this information to each other, and the `ENTREPRENEUR’S COIN` now exists in the world. The entrepreneur can also add more and more devices to the network. - -#### Notarizing to the Komodo Main Chain - -To receive the security of the dPoW consensus mechanism, the entrepreneur simply needs to have the elected notary nodes add the `ENTREPENEUR’S COIN` to their internal list of coins to notarize. This will empower the entrepreneur’s product with the same verifiable and decentralized security of the Komodo main chain. - -The process of adding a new notarization service can be executed by the notary nodes with just a simple command. While we are at this early stage of development, this sign-up process for new IDO products is not yet automated. In the future, we intend to automate as much of this process as possible. - -There is a fee for receiving notarization services to help cover the business costs associated with notarization (recall that all notarizations are financial transactions by nature). - -Entrepreneurs are thus able to use the Smart Chain’s native dPoW consensus mechanism to notarize to the Komodo main chain to create a secure backup of the coin’s history. Even in the event of an attack at this early stage of existence, the entrepreneur can rest assured that their product will survive, so long as one copy of the blockchain’s history exists. - -Everything is set on the backend for the entrepreneur, and they are now fully prepared to begin the IDO process. Naturally, we understand that for many potential entrepreneurs in the Komodo ecosystem, this process is unfamiliar territory. We encourage interested entrepreneurs to reach out to our team at `partners@komodoplatform.com` for guidance during development. - -## The Distribution of Coins - -#### Observations on the Centralized ICO Method - -Previously, the entrepreneur at this point would have been required to go through a centralized ICO process. - -This could have required several cumbersome and possibly dangerous steps. For example, the entrepreneur would begin gathering cryptocurrencies from their audience to personally hold in escrow before the process of matching purchases to the new blockchain coin were conducted. Until the distribution of the new blockchain coin is completed, the purchasers have to trust the issuer. - -To distribute these coins, the entrepreneur had two primary options. They could have created and distributed a digital software wallet capable of holding the entrepreneur’s coins. The entrepreneur would then have to send all the appropriate coins to each wallet address, according to the process they established during their ICO. This process may be error-prone as the issuer either has to do it manually or write a custom program to do it. - -Or, the entrepreneur would have to make formal arrangements with another service to manage this process, such as with a centralized exchange, and then be required to act within the centralized exchange’s arbitrary framework. -The centralized ICO process can be arduous and, at times, disastrous. - -#### Enter the IDO - -##### Powered by Komodo’s AtomicDEX & Privacy Technology - -The Komodo IDO model is an extension of Komodo’s AtomicDEX technology. AtomicDEX is an atomic swap powered, decentralized exchange. It enables users to directly exchange cryptocurrencies from one person to another without third-party involvement (i.e. no centralized exchanges, escrow services, vouchers, etc.). Furthermore, as the IDO model is entirely decentralized, anyone can use it at will. There are no centralized authority figures capable of creating artificial control points that can be manipulated at the expense of the users. - -To begin the distribution process, the entrepreneur first chooses how many nodes they would like to use for the distribution. Nodes can be any type of machine capable of connecting to AtomicDEX. Typically, a small business entrepreneur may choose to use server machines. Server capacity can be rented online, and the servers can be distributed geographically throughout the world if desired. - -While renting a multiplicity of servers may be the method of choice for an established small business, it is not a requirement. An owner of an even smaller business, operating on a low budget, can simply use their own computer(s), geographically stationed nearby for convenience. On the other hand, a large corporation could use the server capacity they already own. The number and strength of the machines is a choice made by the entrepreneur. - -Having decided the method of distribution, the entrepreneur will then prepare the total supply of coins. (We are assuming the coins are still located on the first device that mined the entrepreneur’s Genesis Block.) The entrepreneur will first break down the total collection of coins into smaller digital pouches and distribute them to the AtomicDEX nodes previously created. These small bags of coins are ultimately what will be traded on AtomicDEX with their audience. - - - -When the entrepreneur sends the coins to all their nodes throughout the AtomicDEX network, they are distributed to each node's wallet through a normal transaction. With the coins distributed as desired, the entrepreneur then elects the time and date when each bag of coins will be available for purchase. When a bag of coins becomes available on AtomicDEX for trading, members of the Komodo ecosystem simply purchase the coins using atomic swaps. - -##### The Many Solutions of the IDO Model: Security, Privacy, Decentralization, and Freedom - -This method of conducting an Initial DEX Offering mitigates and circumvents the issues found in a centralized ICO. The entire process is conducted in a decentralized manner. The IDO entrepreneur has direct access to their audience, as no centralized human authorities are acting as middlemen. - -The IDO process implements solutions that prevent both methods of theft that are possible in the centralized ICO process. Unlike the centralized ICO, once the distribution of the bags takes place the effect of their distribution adds a layer of security from a would-be hacker. The hacker can only steal funds at the node they manage to penetrate. Were the hacker to steal coins before the actual IDO, the entrepreneur would have the option to simply create a `NEW ENTREPRENEUR’S COIN` again, without losing any personal wealth. - -Furthermore, since the trades happen atomically, the entrepreneur is only in possession of either their own `ENTREPRENEUR’S COIN` or the cryptocurrency funds provided by the IDO participants — but not both. The entrepreneur is never at risk of losing both their own funds and the funds of their audience, which is a strong advantage over today’s ICO model. - -Since the coins are immediately available on AtomicDEX for trading, the entrepreneur’s audience has an immediate trading market. This stands in contrast to today’s ICO model, where users often wait weeks or even months before liquidity for their ICO product arises in a centralized exchange. - -Finally, through Komodo's [inherent zero-knowledge technology](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-nature-of-privacy-features-in-the-komodo-ecosystem), participants have the option of privacy when purchasing the IDO product. This enables them to support the crowdsourcing efforts of the entrepreneur within their inherent right to barter in private. - -Upon conclusion of the distribution of the IDO coin supply, the entrepreneur has successfully and immediately completed all the crowdsourcing-related steps that could have taken months in today’s typical ICO model. - -Komodo’s IDO model provides greater ease-of-use, flexibility, and security. - -#### Ways an IDO can be Conducted - -At this point, let us assume that the Entrepreneur has created their coin using one of the following processes: creating a Komodo Smart Chain, cloning/forking ETH or QTUM, cloning/forking any other [compatible UTXO-based blockchain](https://github.com/KomodoPlatform/coins#prerequisites-for-a-coin-to-be-compatible-with-atomicdex-api) or minting a new ERC20/QRC20 token. There are several ways an IDO can be conducted using AtomicDEX, and all the coins/tokens can be distributed in return for any coin/token already available on AtomicDEX. The entrepreneur can decide the available pairs, prices, and volumes available on each pair. - -##### The Straightforward Method - -- The entrepreneur can fork the [AtomicDEX Desktop repository](https://github.com/KomodoPlatform/atomicDEX-Desktop) and add their coin/token to the GUI. -- This modified software will be used both by the entrepreneur to place sell orders and by the purchasers to buy. -- This method needs the entrepreneur to launch electrum servers for their coin if it is a Komodo Smart Chain or another UTXO type blockchain. The entrepreneur will need server software that supports lite wallets if their coin is an ETH or QTUM fork/clone. -- The entrepreneur must also launch [AtomicDEX-API](https://github.com/KomodoPlatform/atomicDEX-API) on a server to act as a seed node for the trading pairs they are planning to support. - -##### A Slightly more Involved Method - -- The entrepreneur can fork the [AtomicDEX Desktop repository](https://github.com/KomodoPlatform/atomicDEX-Desktop) or start from scratch. They create a custom IDO GUI with the specific features needed to conduct an IDO and only add the coins/tokens involved in their IDO. -- This method allows the entrepreneur to create an exclusive feel to their IDO and remove distractions. This GUI is developed for the IDO and will only be used for it. -- This method also needs the entrepreneur to launch electrum servers for their coin if it is a Komodo Smartchain or another UTXO type blockchain. And server software that supports lite wallets if their coin is a ETH or QTUM fork/clone. -- The entrepreneur must also launch [AtomicDEX-API](https://github.com/KomodoPlatform/atomicDEX-API) on a server to act as a seed node for the trading pairs they are planning to support. - -##### Easy method, be Featured on AtomicDEX - -- The entrepreneur can contact the Komodo team at `partners@komodoplatform.com` and discuss their requirements. -- The Komodo team can add a new tab to the subsequent release of AtomicDEX that features the new coin and has all the features needed to conduct an IDO. -- The Komodo team can also launch the necessary infrastructure needed to enable a coin to have lite wallets and be enabled in AtomicDEX. -- The entrepreneur and the purchasers can both use this software and an IDO can be conducted through it. diff --git a/docs/basic-docs/start-here/core-technology-discussions/introduction.md b/docs/basic-docs/start-here/core-technology-discussions/introduction.md deleted file mode 100644 index dbaff7183..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/introduction.md +++ /dev/null @@ -1,40 +0,0 @@ -# Introduction - ------------------ - -
- -Advanced Blockchain Technology, Focused On Freedom - -
- ------------------ - -The Komodo project focuses on empowering users with Freedom through -blockchain technology. There are many forms of Freedom that Komodo can provide, and we currently focus on empowering two types of users: the blockchain entrepreneur, and the average cryptocurrency investor. Together, our community of entrepreneurs, investors, and other users form an economic ecosystem. - -The foundational pillar of the Komodo ecosystem is security. Komodo provides a unique and innovative form of security that is as strong as the Bitcoin network, yet does not require the incredible cost. Every member of the Komodo ecosystem receives the benefits of this security. The investor relies on it for everyday use. The entrepreneur relies on it to protect their blockchain innovation at a cost that is affordable even to small businesses and startups. - -Another of Komodo’s powerful technologies is a new method of trading cryptocurrencies directly from one person to another. It is a new kind of "decentralized exchange." Our decentralized exchange removes all forms of middlemen, vouchers, and escrow services. It relies on an underlying concept called the "atomic swap", and we are the leaders in this technology. - -Our atomic-swap powered decentralized exchange serves both the investor and the blockchain entrepreneur. - -For the investor, they can trade cryptocurrencies without having to pass through a centralized exchange, which can be an arduous and even dangerous process. They also do not have to use an escrow service, voucher, nor even an intermediary coin—not even Bitcoin. Furthermore, there is no registration process required, nor are there any withdrawal limits. We currently support approximately 95% of the cryptocurrencies in existence, including Bitcoin-protocol based coins, Ethereum, and Ethereum-based ERC20 tokens. - -For the entrepreneur, our decentralized exchange enables the release of new products to the world without middleman involvement. Furthermore, even entrepreneurs who have previously built other blockchain projects outside our ecosystem can easily feature their coin on our decentralized exchange. The only requirement is that the blockchain product have the proper security elements in the core of the blockchain’s code. - -Komodo also has powerful privacy features built into our platform. When activated, these features allow the investor to trade and purchase goods and services within their right to privacy. This also allows the entrepreneur to release their product, and to crowdsource funds, from an audience that may prefer to maintain this privacy. - -There are many other technologies and features in the Komodo ecosystem, and we are experiencing a rapid growth of both entrepreneurs and investors. - -The documentation in the Core Technology Discussion section provides an in-depth discussion about Komodo’s unique security features, our decentralized exchange, the method of releasing new products on it, and our native privacy features. - -We welcome feedback from our readers. If you have any questions or concerns over the course of reading this material, please reach out to our team directly. You may find our contact information on our accompanying website: [https://komodoplatform.com](https://komodoplatform.com) - -#### Note on Changes Since Whitepaper Creation (cr. 2019) - -The documentation in this section is based on the Komodo whitepaper that was written in 2017. The content was updated in July 2019 to ensure technical accuracy. We recommend that all newcomers read this documentation to enhance their understanding of the nature and design of Komodo. - -Since 2017, the Komodo team has greatly advanced the technologies on the Komodo Platform, and these new technologies are discussed in other areas of the technical-documentation website. - -Also, zero-knowledge transactions are still available on Komodo-based blockchains, but they are no longer available on the KMD main chain. This change was made largely in response to community feedback and industry developments. diff --git a/docs/basic-docs/start-here/core-technology-discussions/miscellaneous.md b/docs/basic-docs/start-here/core-technology-discussions/miscellaneous.md deleted file mode 100644 index dbdb97312..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/miscellaneous.md +++ /dev/null @@ -1,290 +0,0 @@ -# Miscellaneous - -## Details Regarding KMD Main Chain - -| Era of Block Rewards | Block Height | Block Reward | Coin Supply | -| ----------- | ------------ | ------------ | ----------- | -| Current Block Rewards | \~1150000 | 3 KMD | \~115000000 | -| First Reward Reduction | 7777777 | 2 KMD | \~200000000 | -| Final Reward Reduction | 15555553 | 1 KMD | \~215000000 | - -The foundational coin of the Komodo ecosystem is named after the ecosystem itself, Komodo (KMD). - -#### Rewards - -Those who hold KMD may earn rewards of up to 5.1% annually. Any wallet address that holds at least 10 KMD is eligible. KMD holders must simply move their KMD once a month—even if the funds are sent back to the same address from which they originated—in order to earn their reward. This reward is built into the core code of Komodo. - -The reward comes from an opportunity provided by our unique security system, dPoW. The nature of the reward is rooted in the financial incentive that is typically given to miners on a normal PoW chain. On a normal PoW chain, when a miner mines a new block, the blockchain mints new coins and delivers them to the miner’s indicated wallet. For instance, on the Bitcoin blockchain, the reward for mining a new block is currently ~12.5 BTC. In dPoW, we do not need to allocate such a high incentive to miners, as we already maintain access to the hash rate of our chosen PoW network, Bitcoin. Therefore, when we created the KMD main chain, we recoded this coin-minting reward to distribute 5.1% annual rewards to all holders of at least 10 KMD. - -To earn rewards in the full amount of 5.1%, users must move their funds on the blockchain at least once per month. The reward is calculated as a part of the utxo transfer process. The KMD code only calculates rewards for utxos up to one month, and then stops. By simply sending the full balance of a wallet to the same receiving address, a user can generate a new utxo. In this manner, the user can claim their current rewards, and continue receiving them for at least one month. - -The KMD 5.1% reward will continue for a period of approximately twelve to fourteen years. Specifically, the reward will cease when the KMD chain reaches a block height of 7777777. - -Note that no one is forced into using KMD in our ecosystem. We are often asked why we chose this route, as the free nature of the Komodo ecosystem can be in direct contrast to the philosophies of many other ecosystems and exchanges. Other ecosystems often require users to use the developer’s coin. - -The reason why we follow a more open practice is that we strive to adhere to the guiding principles of decentralization and open-source technology. We want to create a blockchain platform where people are free to use whatever is most useful for them in their entrepreneurial endeavors. Keeping KMD as an optional element empowers the members of the Komodo ecosystem with freedom. - -## The Nature of Privacy Features in the Komodo Ecosystem - -##### The Option of Privacy is Essential - -One primary goal of the Komodo ecosystem is to provide our users with the highest levels of security. The option to enable oneself with privacy is an inherent part of a strong security system. Privacy empowers users with the ability to make choices without being directly controlled or observed by a third-party actor. - -Many of humanity’s most meaningful advancements in art, technology, and other human endeavors began in situations where the creator had the security of privacy in which to explore, to discover, to make mistakes, and to learn thereby. - -##### Privacy Issues in Popular Privacy-Centric Blockchains - -Across the entire cryptocurrency industry, current pathways to obtain privacy in the blockchain industry have many problems. - -One of the most popular methods to obtain privacy is the use of a centralized mixing service. In this process, users send their cryptocurrencies to service providers, who then mix all the participants’ coins together, and return the coins according to the relevant contributions. With this method, the most dangerous issue, among many, is that for the duration of the mixing period users lose control over their currency. The funds, therefore, are subject to theft and human error. - -Other decentralized coin-mixing methods, such as the [coin shuffle,](https://bitcoinmagazine.com/articles/shuffling-coins-to-protect-privacy-and-fungibility-a-new-take-on-traditional-mixing-1465934826/) require coordinating with other human parties. This also introduces the potential for the same issues of theft and human error, and adds yet another risk: the coordination between human parties can result in the disclosure of a user’s privacy. - -Some cryptocurrencies support mixing as a part of the normal transaction process out of a desire to provide constant anonymization. Varying methods for randomizing these transaction-mixing patterns exist among the many different brands of relevant cryptocurrencies, and each feature strengths and weaknesses in their approach. - -#### Komodo's Approach to Privacy Technologies - -The roots of the Komodo ecosystem stem from the seminal work of Satoshi Nakamoto and his Bitcoin protocol. One of the key challenges in this technology is that the original protocol does not make any account for privacy. Therefore, Komodo began not as a fork of the vanilla Bitcoin protocol, but rather as a fork of Zcash. The latter is a privacy-centric fork of Bitcoin, and therefore Komodo inherits technology from both Bitcoin and Zcash by this action. - -The Komodo Smart Chain software, komodod, retains the inherent privacy features of Zcash. These primarily consist of the ability to convert money from a transparent address to a private address, and then to transfer money from one private address to another. When sending money that is already private to an address that is also private, Zcash technology allows the funds to move without leaving a public data trail for later analysis. - -This is one of the most powerful forms of blockchain privacy in existence, as the provided privacy is effectively permanent. - -##### Private and Non-Private Addresses - -On any privacy-enabled Smart Chain, there are two types of addresses. One is transparent, the other is private. - - -##### Transparent Addresses - -We call a transparent address a "T address." These are fully accessible to the user, and they are the means of conducting normal transactions. All currency entering and leaving a T address is fully visible to the network. - -The user must use these addresses for most interactions on-chain, including most, if not all, of the Antara Module transactions, and when using AtomicDEX. - -##### Private Addresses - -We call a privacy-enabled address a "Z address," as they utilize the Zcash parameters and zk-SNARK technology. - -Z addresses often have RPCs that are separate from the RPCs used for T addresses. For example, [z_gettotalbalance](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-gettotalbalance) is separate from [getbalance.](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#getbalance) - -The cost of interacting with Z addresses is often higher than the cost of interacting with a T address. This is due to the fact that Z transactions require more block space, due to their demands for increased levels of encryption. - -### Method of Moving Funds Privately - -There are three types of transactions that can take place in respect to privacy technology. - -All of the following transactions are accomplished using the [z_sendmany](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-sendmany) RPC. - -#### Transparent to Private - -------- - -
- -T -> Z - -
- ------- - -A user sends funds from a T address to a Z address. - -This is not a private transaction. An observer of the blockchain can observe both the T address from which the funds are consumed and the Z address to which the funds are sent. - -#### Private to Private - ------- - -
- -Z -> Z - -
- ------- - -This is a private transaction. Using zk-SNARK technology inherited from Zcash, this transaction moves funds from one address to another without leaving any data available in the public domain for later observation. - -The user may also consider enhancing their privacy through services such as [Tor](https://www.torproject.org/). - -All privacy from zk-SNARK technology is derived solely as a part of this type of transaction. - -#### Private to Transparent - ------- - -
- -Z -> T - -
- ------- - -This is not a private transaction. Rather, this is the transaction wherein funds again become public, and therefore usable for services such as a typical Antara Module or an AtomicDEX exchange. - -Observers on the blockchain can observe both the Z address from which the funds are consumed and the T address to which the funds are sent. - -### Additional Privacy Considerations - -Although the anonymization process provides a measure of privacy and may appear to be sufficient, there are still more precautions a user must take. Two main attacks are available to a would-be sleuth. - -#### The Timing Attack - -In this attack, the sleuth simply studies the time the funds disappear from a T address and looks for funds to appear in another T address soon thereafter. If the privacy-user persistently chooses predictable timing for initiating and completing their transfer of funds, a determined sleuth may deduce the user's trail of funds. - -For effective privacy, the user should wait for other users on the Smart Chain to exercise privacy transactions, and thereby conceal their own privacy behavior. The more users using privacy features, the more private the transactions become. - -#### The Knapsack Attack - -The Knapsack Attack is similar to the Timing Attack, but as applied to amounts. For example, if there is only one KMD address that sends 1000000 KMD from a T address to a Z address, and later 1000000 KMD emerges from a Z address to a T address, the sleuth can easily discern the user’s trail of funds. - -To protect against the Knapsack Attack, users can vary their amount of funds in both `T -> Z` and `Z -> T` transactions. - -### A Word on Risks Inherent in zk-SNARK Technology - -Zero-knowledge transactions rely on the Zcash parameters as put forth by the Zcash team. The Zcash parameters are a "zero-knowledge" form of technology. This is a powerful form of privacy, and arguably superior to other forms as it is effectively permanent. Relying on the Zcash parameters allows us to turn our creative resources to other blockchain-technology challenges, while still empowering members of the Komodo ecosystem with the option of privacy. - -To create the Zcash parameters, the original Zcash developers had to create a series of keys that, when combined, created a master key that could unlock and lock the parameters. After using the master key to create the parameters, the team destroyed every individual key. The team conducted this endeavor in a public manner. We encourage interested readers to view the "Zcash Ceremony" explanation, and to search for other viewpoints as well. - -To briefly summarize the security measures, the Zcash team used several layers of protection including: multi-party computation, air-gapped compute nodes, hard-copy evidence trails, a uniquely crafted distribution of the Linux operating system, and the physical destruction of each piece of hardware that held an individual key. The resulting layers of defense would be of the highest level of difficulty for an outsider to penetrate. Furthermore, the method of creation and destruction ensured that the internal security of the project was faultless, so long as at least one member of the entire Zcash team was honest. - -By our observation, the team performed this endeavor with sufficient competence and due diligence. Furthermore, given the nature of the project, the longstanding reputation of the Zcash developers, and the modus operandi of their lives’ work, we believe they were properly motivated to perform the creation and destruction in a capable and honest manner. - -Nevertheless, there are privacy advocates in the cryptocurrency industry who maintain a degree of suspicion over any project that requires an element of human trust. This suspicion extends to the Zcash parameters. These observers continually scrutinize the Zcash project, searching for more and more processes by which the creation ceremony could have failed. Yet, while various theories have been put forth, no actual failure in the Zcash parameters has been discovered. - -In adopting the Zcash parameters, we receive frequent questions regarding how they affect Komodo-based currency. The answer is that the privacy in the Komodo ecosystem is permanent, regardless of any potential fault by the Zcash team. Furthermore, we can adopt any updates the Zcash team releases to the parameters. - -In the unlikely event that someone was able to retain a complete copy of the master key, the only power the holder would have, would be the ability to create new private money in the currency of any Smart Chains utilizing zero-knowledge transactions. - -This holder could then shift that value into transparent, spendable money. This could negatively impact any affected Smart Chain's local community, and we would be required to adapt our platform. If a fault in the Zcash parameters were to be discovered, the Komodo team has various contingency methods at our disposal to remove the Zcash parameters and replace them with a new set of parameters. - -Though in Komodo we do not see this as a realistic threat, we nevertheless include the information here in our documentation to provide complete transparency for any user who seeks to invest their resources in a privacy-enabled Komodo Smart Chain. - -## The Utxo: An Elusive, Yet Fundamental Concept - -All Bitcoin-based software relies heavily on a technology called the "utxo," short for Unspent Transaction. This technology was invented in the original Bitcoin protocol. Yet despite the technology's age, even the most active of cryptocurrency users rarely know what utxos are or why they exist. - -To better understand utxos, let us first examine the language of a common user when describing how much cryptocurrency money they have and how they perceive those funds. We will therefore need to understand the concept of "satoshis," the way a blockchain handles the collection and distribution of funds, and how we utilize these core technologies when trading on AtomicDEX. - -### Comparing the Utxo to Fiat Money - -Let us assume a cryptocurrency user, whom we name Charlie, has $10,000 in his physical wallet. Naturally, when Charlie thinks about the amount of physical (or "fiat") money he has, he says to himself, "I have $10,000." - -However, there is no such thing as a $10,000-dollar bill. Instead, Charlie actually has a collection of smaller bills stacked together. For instance, he could have a stack of $100-dollar bills, the total of which equals $10,000 dollars. - -If Charlie goes to purchase an item that costs $1, and he only has $100-dollar bills in his wallet, to make his purchase he will take out a single $100-dollar bill and give it to the cashier. The cashier then breaks that $100-dollar bill down into a series of smaller bills. The cost for the item, $1, remains with the cashier, and the cashier then provides change—perhaps in the form of one $50-dollar bill, two $20-dollar bills, one $5-dollar bill, and four $1-dollar bills. - -Charlie now thinks to himself, "I have $9,999." Specifically, however, he has ninety-nine $100-dollar bills, a $50-dollar bill, two $20-dollar bills, one $5-dollar bill, and four $1-dollar bills. - -We emphasize that not only does he not have ten thousand $1-dollar bills, he also does not have one million pennies ($0.01). Furthermore, because pennies are the smallest divisible unit of value in Charlie’s wallet, we could point out that each bill is a collection of its respective units of pennies. For instance, a $1-dollar bill in Charlie’s wallet we could describe as, "a bill that represents a collection of one hundred pennies and their value." - -### Understanding Cryptocurrencies and Their Utxos - -#### A Satoshi is The Smallest Divisible Unit of a Cryptocurrency - -Continuing with our explanation of utxos, we next need to understand the concept of "satoshis." The name "satoshi" is derived in honor of Satoshi Nakamoto, author of the original Bitcoin whitepaper. By convention in the cryptocurrency community, one satoshi is equal to one unit of a coin at the smallest divisible level. For instance, 1 satoshi of Bitcoin is equal to 0.00000001 BTC. - -Let us suppose now that Charlie has 9.99000999 BTC (Bitcoin) in his digital wallet. Assuming Charlie correctly understands the concept of satoshis, Charlie could say to himself, "I have nine hundred and ninety-nine million, nine hundred and ninety-nine satoshis of bitcoin." This is how Charlie might mentally perceive the collection of money that exists in his digital wallet, like he perceives the $9,999 in his fiat wallet. - -#### A Utxo is a Packet of Satoshis, just as a Fiat Dollar Bill is a Packet of Pennies - -Recall now that with fiat money, Charlie did not think about how his original $10,000 was comprised of smaller individual $100-dollar bills. Similarly, Charlie also does not think about how his 9.99000999 BTC could be comprised of smaller collections of satoshis. - -Furthermore, just as Charlie did not carry around fiat money as a collection of pennies, he also is not carrying around a raft of satoshis. Were he to try to carry a million pennies in his physical wallet, the weight of the wallet would be unmanageable. Similarly, if the Bitcoin protocol were to attempt to manage nine hundred and ninety-nine million, nine-hundred and ninety-nine satoshis, the "data weight" would be so heavy, the Bitcoin protocol would be enormous and unmanageable. - -To optimize "data weight," the Bitcoin protocol therefore bundles up the satoshis into something that is like the example of dollar bills earlier, but with one important difference. In fact, here is where the Bitcoin protocol exercises a superiority over fiat money by deviating from the limitations fiat money must obey when bundling smaller values into larger values. - -In fiat money, one hundred pennies are bundled into a one-dollar bill, which can then be bundled into a larger bill, and so on. All the sizes of fiat money are preset and predetermined by the issuer of the fiat money when they print their bills and coins. - -The Bitcoin protocol, however, does not need to pre-plan the sizes of "bills" (i.e. the collections of satoshis) in the owner’s wallet. Bitcoin is freer in this sense; it can shift and change the sizes of its "bills" at will because there is no need to accommodate for the printing of physical coins and paper. - -Instead, the Bitcoin protocol allows for the developer of digital wallets to write code that can optimize how bitcoin satoshis are packaged into "bills," and thus the community of developers can work together to keep the data weight of the blockchain manageable. The better the digital-wallet developer, the more efficient the size of the "bills" (a.k.a. the packets of satoshis). - -The Bitcoin protocol does have one limitation, however: It must keep track of how these satoshis are being collected into larger "bills" in everyone’s digital wallets. After all, a key idea of Bitcoin is that everything happens under the public eye, where it can be verified. - -Because the Bitcoin blockchain must keep track of the sizes of these packets of satoshis, the only time the packets can be assembled or disassembled into larger and smaller sizes is at the moment when the user is spending money on the public blockchain. It is at this time that the user is under the public eye, and therefore his actions can be verified. - -To compare this limitation to fiat money, consider the effect created were Charlie to cut a $100-dollar bill into smaller pieces. The $100-dollar bill would no longer be respected as a valid form of currency. - -As the word "utxo" is not a sonorous word, some users in the Komodo ecosystem simply refer to utxos as "bills." The concept is effectively the same. However, as the rest of the blockchain industry primarily uses the word "utxo," we frequently must use this word to maintain a common line of communication. The word utxo will be used throughout the rest of this documentation, to keep in line with industry practices. - -The utxo packet can be any size, and the developer of the GUI software decides on this process. Most importantly, and to reiterate, a utxo can only be resized during the process of spending, as this is the moment when the user interacts with the public blockchain. - -To further clarify this, let us return to Charlie’s example with fiat money. Recall that when Charlie went to purchase a $1-dollar item, he only had $100-dollar bills in his wallet. He had to give out one $100-dollar bill, and then receive a broken-down collection of dollar bills in return. - -This is exactly how it works with utxos. Charlie has a collection of utxos in his digital wallet. When he goes to buy something, he will give out utxos until he surpasses how much he owes, and then the extra change from the last utxo will be broken down and returned to him. - -For example, let us suppose that Charlie’s 9.99000999 BTC is comprised of three utxos worth the following values: -| Utxos in Charlie’s Wallet | Value | -| ------------------------- | -------------- | -| Utxo #1: | 0.50000000 BTC | -| Utxo #2: | 0.49000999 BTC | -| Utxo #3: | 9.00000000 BTC | -| Total | 9.99000999 BTC | - -Charlie now desires to purchase an item that costs 0.60000000 BTC. He will have to hand out enough utxos from his wallet until he covers the costs of this transaction, just as he would if he were using fiat money. The Bitcoin protocol calculates the change from the transaction and then returns his change to him. - -Remember that there is a fee when spending money on a blockchain. Since we are using Bitcoin in this example, the fee would be paid to cryptocurrency miners. Let us imagine that the fee the miners charge Charlie is 999 satoshis. - -We begin by looking at how Charlie would see the process of making the purchase, assuming he does not understand the concept of utxos. For now, Charlie only understands how much is in his wallet at the satoshi level as he conducts his transaction. - -| Value | Description | -| ------------------ | ----------------------------------------------------------------- | -| 9.99000999 BTC | The amount Charlie initially owns | -| (-) 0.60000000 BTC | The amount Charlie sends to the digital cashier for his purchase | -| (-) 0.00000999 BTC | The network fee paid to miners | -| ------------------ | ----------------------------------------------------------------- | -| 9.39000000 BTC | The amount left in his wallet | - -This deduction for his purchase all appears very simple to Charlie—a testament to -the Bitcoin protocol’s effective design. - -In the background, however, the digital wallet handles the utxos and the change process in a manner as determined by the programmer. In Charlie’s example, let us assume that it proceeds this way: - -| Value | Description | -| ------------------------ | ------------------------------------------------------------------------ | -| 0.60000999 BTC | The total amount that Charlie owes to the cashier and network | -| (-) 0.50000000 BTC | The wallet sends the full value of **utxo #1** to the digital cashier | -| ------------------------ | ------------------------------------------------------------------------ | -| 0.10000999 BTC | This is the remaining total amount that Charlie still owes | - -The wallet now brings out utxo #2, which is worth 0.49000999 BTC: - -This utxo is broken down or shattered into smaller pieces. - -| Value | Description | -| -------------------- | ---------------------------------------------------------------------- | -| 0.49000999 BTC | The size of Charlie’s **utxo #2**, now in the process of change | -| (-) 0.10000000 BTC | This shatter of **utxo #2** goes to the cashier (payment fulfilled) | -| (-) 0.00000999 BTC | This shatter of **utxo #2** pays the network fee to the miners | -| -------------------- | ---------------------------------------------------------------------- | -| 0.39000000 BTC | This last shatter now returns to Charlie’s wallet as a new utxo | - -Charlie now has one new utxo in his wallet, and it is worth 0.39000000 BTC: - -| Charlie’s New Wallet State | Value | -| ---------------------------- | ---------------- | -| Utxo #3: | 9.00000000 BTC | -| Utxo #4: | 0.39000000 BTC | -| ---------------------------- | ---------------- | -| Total | 9.39000000 BTC | - -If Charlie wants to buy something later, these utxos will have to be broken up once more, according to the costs and programming of the digital wallet. Again, whatever is left over from his last utxo comes back to his own wallet as a new utxo. - -Now let us suppose that Charlie receives 0.4 BTC from someone else. In Charlie’s wallet, he will see a total of 9.79 BTC. However, in his wallet there are now actually three utxos: - -| Charlie’s New Wallet State | Value | -| -------------------------- | -------------- | -| Utxo #3: | 9.00000000 BTC | -| Utxo #4: | 0.39000000 BTC | -| Utxo #5: | 0.4000000 BTC | -| Total | 9.79000000 BTC | - -As a result, the number and sizes of utxos in Charlie’s wallet will vary over time. He may have many smaller utxos that make up his full balance, or sometimes he might just have one large utxo that comprises all of it. For Charlie, it is normally possible to ignore this since the wallet developer could handle everything automatically. - -However, a developer in the Komodo ecosystem will likely encounter the concept of utxos in the course of software development, and therefore we encourage developers to practice their understanding. - -## Conclusion - -This concludes a thorough explanation of the foundational technologies of the Komodo ecosystem. We are working diligently to improve the user experience. While some may say that the cryptocurrency industry is but a bubble, at Komodo we believe we have not yet begun the fight. We hope that the innovations we provide will be a meaningful contribution to the remarkable advent of blockchain, decentralization, and open-source technologies. diff --git a/docs/basic-docs/start-here/core-technology-discussions/references.md b/docs/basic-docs/start-here/core-technology-discussions/references.md deleted file mode 100644 index 231eff9a8..000000000 --- a/docs/basic-docs/start-here/core-technology-discussions/references.md +++ /dev/null @@ -1,14 +0,0 @@ -# Acknowledgements and References - -- BarterDEX – A Practical Native DEX ( [https://github.com/SuperNETorg/komodo/wiki/barterDEX-Whitepaper-v2](https://github.com/SuperNETorg/komodo/wiki/barterDEX-Whitepaper-v2) ) -- Nakamoto Satoshi (2008): Bitcoin: A peer-to-peer electronic cash system. ( [http://www.bitcoin.org/bitcoin.pdf](http://www.bitcoin.org/bitcoin.pdf) ) -- Mtchl (2014): The math of Nxt forging ( [https://www.docdroid.net/ahms/forging0-4-1.pdf.html](https://www.docdroid.net/ahms/forging0-4-1.pdf.html) ) -- King Sunny, Nadal Scott (2012): PPCoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake ( [https://peercoin.net/assets/paper/peercoin-paper.pdf](https://peercoin.net/assets/paper/peercoin-paper.pdf) ) -- Delegated Proof-of-Stake Consensus ( [https://bitshares.org/technology/delegated-proof-of-stake-consensus/](https://bitshares.org/technology/delegated-proof-of-stake-consensus/) ) -- Miers Ian, Garman Christina, Green Matthew, Rubin Aviel: Zerocoin: Anonymous Distributed E-Cash from Bitcoin ( [https://isi.jhu.edu/~mgreen/ZerocoinOakland.pdf](https://isi.jhu.edu/~mgreen/ZerocoinOakland.pdf) ) -- Ben-Sasson Eli, Chiesa Alessandro, Garman Christina, Green Matthew, Miers Ian, Troer Eran, Virza Madars (2014): Zerocash: Decentralized Anonymous Payments from Bitcoin ( [http://zerocash-project.org/media/pdf/zerocash-extended-20140518.pdf](http://zerocash-project.org/media/pdf/zerocash-extended-20140518.pdf) ) -- Ben-Sasson Eli, Chiesa Alessandro, Green Matthew, Tromer Eran, Virza Madars (2015): Secure Sampling of Public Parameters for Succinct Zero Knowledge Proofs ( [https://www.ieee-security.org/TC/SP2015/papers-archived/6949a287.pdf](https://www.ieee-security.org/TC/SP2015/papers-archived/6949a287.pdf) ) -- NXT Community: NXT White paper ( [http://wiki.nxtcrypto.org/wiki/Whitepaper:Nxt](http://wiki.nxtcrypto.org/wiki/Whitepaper:Nxt) ) -- Larimer Daniel, Scott Ned, Zavgorodnev Valentine, Johnson Benjamin, Calfee James, Vandeberg -- Michael (March 2016): Steem, An incentivized, blockchain-based social media platform.( [https://steem.io/SteemWhitePaper.pdf](https://steem.io/SteemWhitePaper.pdf) ) -- BitFury Group (Sep 13, 2015): Proof of Stake versus Proof of Work White Paper ( [http://bitfury.com/content/5-white-papers-research/pos-vs-pow-1.0.2.pdf](http://bitfury.com/content/5-white-papers-research/pos-vs-pow-1.0.2.pdf) ) diff --git a/docs/basic-docs/start-here/learning-launchpad/README.md b/docs/basic-docs/start-here/learning-launchpad/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/basic-docs/start-here/learning-launchpad/common-terminology-and-concepts.md b/docs/basic-docs/start-here/learning-launchpad/common-terminology-and-concepts.md deleted file mode 100644 index 8336c28ce..000000000 --- a/docs/basic-docs/start-here/learning-launchpad/common-terminology-and-concepts.md +++ /dev/null @@ -1,515 +0,0 @@ -# Common Terminology and Concepts - -## 51% Attack - -A 51% attack is a dangerous event wherein an attacker uses the fair rules of blockchain technology to "steal" an item of value from their intended victim. - -A Komodo Smart Chain that uses the Komodo Notary Node dPoW service receives protection from the 51% Attack. - -#### Process of Conducting a 51% Attack - -In a 51% Attack, an attacker first performs a transaction that spends funds to their intended victim. - -Once the victim distributes to the attacker the purchased item of value, the attacker then provides 51% of the total hash rate of the blockchain network to support a version of the blockchain history wherein the transaction never took place. - -The attacker must maintain this hash rate long enough for the "false" version of history to become so deeply embedded, removal is impossible. Once accomplished, the attacker may discontinue their hash rate and leave with their spoils. - -#### Komodo's dPoW Security Service is Designed to Prevent 51% Attacks - -The Komodo blockchain's consensus mechanism protects Komodo Smart Chains from 51% Attacks. For more information, see the [Delayed Proof of Work Core Technology Discussion.](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html#the-51-attack) - -## Antara Address - -An Antara Address is a user address that is uniquely associated with a single Antara Module. - -The Antara Address is based in part on the private key associated with the pubkey that the user provides during the initiation of an Antara-enabled Smart Chain instance. - -The Antara Address is different from a normal base58 encoded address, as the Antara Address also takes into account other information besides the pubkey's private key. The additional information includes an EVAL code that is unique to the Antara Module associated with this Antara Address. - -For more information, see the [Understanding Antara Addresses section here.](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) - -## Antara Customization - -An Antara Customization is a blockchain-functionality enhancement created by the Komodo team to add features that extend the capabilities of the default Bitcoin/Zcash protocol fork, upon which Komodo is based. - -Antara Customizations are activated at runtime using special parameters. - -For more information, see the [Antara Customizations section here.](../../../basic-docs/antara/antara-setup/antara-customizations.html) - -## Antara Framework - -The Antara Framework is a collection of features and functionality created by the Komodo developers to enhance the capabilities available to a Smart Chain developer. - -The framework includes Antara Customizations, Antara Modules, Antara Smart Chain Composer (coming soon), among other Komodo technologies. - -## Antara Module - -An Antara Module is a Smart Chain enhancement that allows for arbitrary code to be included and evaluated as a part of achieving consensus. - -Most developers use Antara Modules without directly engaging with the arbitrary code of the module. - -Advanced developers can develop new modules by adding new arbitrary code into a new Antara Module. - -## Asset - -An asset in the Komodo ecosystem typically refers to a blockchain coin or token that represents value to the holder. - -Assets can represent both digital and real-world valuables. However, enforcing blockchain asset behavior on real-world valuables requires an arbitrating party, such as a legal system or physical security service. - -## Atomic Swap - -An atomic swap is an exchange of assets that takes place between two separate and unconnected blockchains. - -Atomic swap technology is unique in that it requires no middleman to hold the assets in escrow during the process of exchange. Instead, users retain the private keys to their funds until the precise moment the exchange occurs. - -Should either party fail to complete the trade, Komodo's atomic-swap software ensures that all parties receive their funds in return, and neither side receives a reward for the failure. - -For more information, [discover the AtomicDEX Introduction section here.](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html) - -## Block - -A block is a collection of transactions. - -In the Komodo ecosystem, by default miners and stakers on a Smart Chain network create a new block every minute. Each block contains transactions that were created by users since the previous block. - -Various block customizations are available in the [Antara Customizations section.](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-blocktime) - -## Block Explorer - -A block explorer is a website that allows users to query information about a particular blockchain. - -Users can request information about a specific transaction, block, address, and more. - -## Block Reward - -A block reward is a financial reward given to the miner or staker who finds the nonce necessary to create a new valid block hash. - -Because the Komodo ecosystem and the KMD main chain are designed to avoid competing directly with the Bitcoin hash rate, KMD also features a different kind of block reward. - -Users automatically receive a monthly 5.1% Reward (given in KMD) for holding +10KMD in any address on the KMD main chain. - -This reward derives from the funds that would otherwise be granted to a miner on a competitive Proof-of-Work based blockchain. - -For more information, see the [Rewards section.](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#details-regarding-kmd-main-chain) - -## Burn - -In various instances, a user can "burn" cryptocurrency assets by sending the assets to an address from which recovery is provably impossible. The address in this situation is called a "burn address." - -Burn addresses can only receive funds. These addresses do not have associated private keys necessary for spending, and this can be verified using publicly available encryption tools. - -## CC Address - -"CC Address" is another name for an [Antara Address.](#antara-address) - -The term "CC Address", however, is used only among developers of Antara Modules, as this activity involves directly managing CryptoConditions (CC). - -## CC Transaction - -A CC transaction is a transaction that is directly associated in any way with an Antara Module. - -A normal user would not call these types of transactions "CC transactions," but would instead call them "transactions" as normal. - -## Centralized Exchange (CEX) - -A centralized exchange is a corporate entity that allows users to send cryptocurrency funds into the care of the corporation to hold in escrow while the user trades for alternate currencies with other users. - -For more information about centralized exchanges, [read the Introduction to AtomicDEX here.](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html#why-is-atomicdex-special) - -## Cluster - -A "cluster" can refer to a Smart Chain Cluster in the Komodo ecosystem. - -A Smart Chain cluster is a collective of Smart Chains that act in unison to manage a single coin supply, or to serve a unified purpose that requires multiple chains acting under a compatible directive. - -This technology uses Komodo Antara Cross-Chain Syncing ("MoMoM") to function. - -## Coinbase - -To add coins into the total coin supply of a blockchain, the blockchain must mint new coins. - -This minting process occurs in a special transaction that is included as the first transaction in each block of the blockchain. - -This transaction is called the `coinbase` transaction. - -## Confirmation - -Confirmation typically refers to the confirmation of a block. - -A block is confirmed when a miner or staker submits a correctly formed block hash to the network for processing and the blockchain network accepts this block hash into the blockchain history. - -## Consensus Mechanism - -A consensus mechansim is a core aspect of any blockchain software. The consensus mechanism is the aspect of the software's code that collects all publicly available information, performs calculations to ensure that the history of the chain is proceeding in an honest manner, and sends the final result to be added to the chain of block histories that have come before. - -Komodo software builds upon the Bitcoin consensus mechanism by default. The Bitcoin protocol is arguably the most secure and well tested consensus mechanism in existence, and therefore this provides Komodo users with a strong degree of security in any associated Komodo technology. - -## Cross-Chain Syncing - -Cross-Chain syncing is the process by which Smart Chains in the Komodo ecosystem are able to make actionable information on one chain available to another participating chain. - -For more information, [read the Crosschain API documentation.](../../../basic-docs/smart-chains/smart-chain-api/crosschain.html) - -## CryptoCondition (CC) - -A CryptoCondition is a conditational statement that is evaluated by the consensus mechanism. CryptoConditions allows for arbitrary logical requirements and fulfillments to be evaluated during runtime. - -For more information, [read the Advanced Development Tutorial Series.](../../../basic-docs/antara/antara-tutorials/advanced-series-0.html) - -## Daemon - -A daemon is an instance of software running on the user's machine. Typically, the word "daemon" refers to a software process that runs in the background on the user's node, as opposed to running in a manner that would require constant direct engagement. - -The name of the Komodo Smart Chain software, "komodod," is an abbreviation of "Komodo Daemon." - -## Decentralization - -Decentralization is the movement of transferring any subject from centralized parties and individuals to decentralized parties. - -In blockchain, decentralization often refers to the ability to accurately record and verify a historical record. Whereas in the old record-keeping system, a centralized authority recorded and verified the accuracy of a ledger, the blockchain system allows all users on the network to record and verify all activity. - -## Decentralized Exchange (DEX) - -A decentralized exchange (DEX) is an entity that enables users to trade assets within at least a partially decentralized environment. - -For example, a common DEX uses a decentralized network of gateway nodes to hold user funds in escrow within the trading environment. No single individual has access to the escrow treasury. - -Komodo features a new form of DEX: AtomicDEX. This uses atomic swaps, and provides a revolutionary form of trading cryptocurrencies. Users maintain control over their assets at all times during the trading process, which makes AtomicDEX a truly decentralized DEX. - -## Initial DEX Offering (IDO) - -A initial DEX offering (IDO) is a method of releasing cryptocurrency assets to the public without passing through the technology of a centralized authority. - -For more information, [read the IDO section.](../../../basic-docs/start-here/core-technology-discussions/initial-dex-offering.html) - -## Delayed Proof of Work (dPoW) - -Delayed Proof of Work is Komodo's signature method for achieving consensus on a network of multiple blockchains. - -Delayed proof of work relies on a small network of sixty-four nodes that create a trustless notarization of all the history of the Komodo ecosystem and write this notarization into the history of a stronger Proof of Work blockchain network (Bitcoin). - -By having the notarization visible for all to view and verify, Komodo enables the ecosystem to operate with Bitcoin-level security without having to compete directly with Bitcoin for PoW hash rate security. - -An important aspect of notary nodes to understand is that notary nodes are not arbiters of "truth." All information a notary nodes signs in a notarization is created publicly and verified by all full nodes on any participating blockchain. Notary nodes cannot alter transaction histories; notary nodes can only notarize the history on behalf of the network, and nothing more. - -For more information, [read the Core Technology Discussion regarding dPoW.](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html) - -## Dependency - -In a programming environment, a dependency can be described as a foreign collection of code that the developer adds to their source code in order to enhance functionality. - -The developer typically does not hold a strong understanding of the dependency and must trust that the developer of this dependency is acting with professional due diligence. - -In blockchain technology, developers are encouraged to avoid dependencies wherever possible. - -## Double Spend - -A "double spend" is the act of spending the same value twice, and blockchain technology is built to prevent users from this behavior. - -In a double spend, a user sends money to one person, and then sends the exact same money again to another person. - -The dangers associated with a double spend prevented digital currency from becoming feasible until the invention of the Bitcoin protocol's consensus mechanism. - -## Equihash Algorithm - -An equihash algorithm is a blockchain mining algorithm that discourages certain high-powered and specially built mining devices from mining on the network. - -## Gas - -Gas is a concept that pertains to foreign blockchain platforms, such as Ethereum. - -Gas is a cryptocurrency that is spent as payment for the blockchain's decentralized network of nodes to process arbitrary "smart contract" code. - -Komodo does not require gas. Rather, when users execute arbitrary code (using Antara Modules), the only fee required is the fee paid to the miners when performing a transaction. This fee is paid in the native coin on which the arbitrary code is run. Compared to the gas-based smart-contract model, the Komodo fee structure is exponentially less expensive. - -## Genesis Attack - -In a Genesis Attack, the attacker launches a fresh version of the targeted blockchain. Using a high rate of hash power and competitive mining equipment, the attacker proceeds to recreate the entire blockchain history as though the so-called "true" history never existed. - -Once the block height of the attacker's chain surpasses the height of the "true" chain, the attacker releases their empty creation on the network. - -When the default Bitcoin protocol encounters the attacker's chain on the network, the protocol observes that this "empty" chain is created properly and is longer than the so-called "true" chain. - -At this point, the protocol will automatically erase the "true" chain from all nodes on the network and the nodes will then sync the "empty" blockchain to their local machines. - -## Genesis Block - -The first block in a blockchain. - -Historically, a large portion of the total coin supply of the associated blockchain is distributed to the miner who mines the Genesis Block. - -## Hash Rate - -The rate at which hashes are created by a node on the network. - -Often, the term "hash rate" is used in reference to the total power of all miners mining a blockchain network. Miners produce hashes in their search for a properly formed hash that satisfies the requirements for adding the next block to the blockchain history. - -## Iguana Core - -Iguana Core is a core component in essentially all Komodo software. Iguana is a collection of blockchain tools and enhancements, designed by Komodo's lead developer, JL777. - -## Jumblr - -Jumblr was a decentralized zk-SNARK based mixing service on the Komodo main chain, KMD. Jumblr enabled users to coordinate their transparent-to-private and private-to-transparent currency conversions. This allowed users to mask their privacy-related transactions by performing them in equal amounts synchronously. - -In the spring of 2019, Jumblr technology was removed from the KMD chain. This occurred in response to community feedback and industry developments. - -## Liquidity Maker - -A liquidity maker on the AtomicDEX network is a user who offers assets for trade and waits for a user to accept the offer. - -## Liquidity Pool - -A liquidity pool is a collection of live offers on an AtomicDEX trading network. - -## Liquidity Taker - -A liquidity taker on the AtomicDEX network is a user who accepts a standing and live offer of another user. - -## Magic - -To help differentiate one runtime instance of Komodo software from another, komodod creates a unique number for each chain. - -The development name this number is "magic." - -Each time a request arrives in the Komodo daemon, the magic number is checked to ensure that it is the number expected. When correct, the daemon allows the request access to the process. - -## Mempool - -The collection of unprocessed transactions on the network waiting for confirmation. - -## Miner - -A user, or hardware controlled by a user, that is attempting to collect transactions from the mempool and format them in a new block. - -The miner who is first to mine a new block typically receives a reward from the network. This can include fees from the transactions successfully mined in the block. This can also include a possible coinbase transaction that adds new coins to the chain's total coin supply and gives them to the miner. - -## Multi-Chain Syncing - -Multi-chain syncing is the act of syncing one Komodo Smart Chain with another with verifiable and actionable information. - -This allows Komodo Smart Chains to work together to serve an audience that may need more than one blockchain for scalability or other purposes. - -## Multi-Chain Architecture - -A multi-chain architecture is a term to describe a blockchain platform that allows for multiple blockchains to operate and collaborate together within the same network, and optionally using the same coin supply. - -## Node - -A node can be a unique desktop computer connected to the Internet. It can also be a virtual-private server (VPS) that is rented or purchased, and which the developer can access at will. Or, it can be another type of unique instance of a computational machine. - -## Nonce - -A nonce is a number that the miner guesses while attempting to create a block hash that fits the requirements for the consensus mechanism and the next block. - -Nonce is short for, "a number you use once." - -More information [is available in this section.](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html#what-is-a-consensus-mechanism) - -## Notarization - -A "notarization" in the Komodo ecosystem is a special transaction performed by the notary nodes that writes a hash of the entire Komodo history up to this point in time. - -Notarizations are a foundational aspect of Komodo's security capabilities. - -For more information, [read the dPoW section on notary nodes.](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html#the-komodo-solution-delayed-proof-of-work-dpow) - -## Notary Node - -A notary node is an elected security steward in the Komodo ecosystem. - -There are 64 notary nodes in total. - -Notary nodes can be either a single individual, or a group of people working together to secure and manage one node. - -## On-Demand Notarization - -The software of a default, unmodified, PoW-based Komodo Smart Chain will only instruct mining nodes to attempt to mine a new block when there are a few transactions in the mempool. This conserves energy and helps the chains to avoid processing nearly empty blocks. - -Developers who wish to avoid the on-demand notarization situation have a few options available. Using Antara Customizations that allow for a hybrid of PoS and PoW will help to keep the blockchain stable when transaction activity is low. Also, developers can create a node on the network that constantly executes transactions of low value, to ensure the mempool is always non-empty. - -## Orderbook - -An orderbook is a record of all trade offers on an exchange. Typically, the orderbook only displays current offers. - -Komodo's AtomicDEX software offers a decentralized orderbook, wherein users send orders to a P2P network for distribution, and all nodes on the network assemble the orderbook locally. - -## Passphrase - -A passphrase is typically a twelve to twenty-four sequence of words that is used as a base password to create a series of blockchain addresses and private keys. - -## Proof of Stake (PoS) - -A proof-of-stake (PoS) consensus mechansim requires users to place personal funds on the network as collatoral in exchange for the right to "stake" new blocks on the blockchain. - -## Proof of Work - -A proof-of-work (PoW) consensus mechanism requires miners on the network to complete a simple puzzle before the miner may obtain the right to add a new block to the blockchain and receive a block reward. - -Solving the puzzle requires work from the computer, and therefore the correct answer to the puzzle is considered to be "proof of work" accomplished in solving the puzzle. - -## Public Key (pubkey) - -A public key or pubkey is a blockchain address that can receive funds on the network. - -Sending funds out of this pubkey requires a matching private key that unlocks this public key (also called a public address). - -On a non-Komodo blockchain a user may not interact often with their full pubkey, but rather they may use an abbreviated version of it. This shorter version is called a based58 encoded address. - -On the other hand, users are required to use at least one full pubkey when using Antara Modules. This pubkey serves as the basis for all Antara-related addresses. - -## Remote Procedure Call (RPC) - -A remote procedure call (RPC) is a call to the Komodo daemon from a separate software process. - -An RPC can request that the Komodo daemon send money to an address, or the RPC could request information about the state of the chain, among many other possibilities. - -## Runtime Fork - -In general, Komodo Smart Chains are created using the exact same software installation, but each Smart Chain has a separate data directory. - -Each time the user initiates an instance of Smart Chain software, the user includes parameters that indicate which Smart Chain they are launching. These parameters can be simple, such as the "name" or "coin supply" of the desired Smart Chain. - -Because each Smart Chain is based on the same software (generally speaking) and they differentiate at the moment of initiation, they are called "runtime forks." This represents the fact that each Smart Chain forks from the main KMD chain at runtime. - -## Satoshi - -The smallest divisible unit of a coin. All coins in the Komodo ecosystem follow the Bitcoin-protocol standard where `1` coin has `8` decimal places. Therefore, a satoshi is `0.00000001` of a coin. - -## SPV Electrum Server - -An SPV Electrum Server is a server that provides "lite mode" type functionality. These servers have a full copy of the blockchain history and the servers are able to help complete the requests of users on the blockchain network who do not want to download and sync the full blockchain history. - -SPV Servers cannot assist a user to perform a zero-knowledge type transaction. Instead, users creating zero-knowledge transactions must download the full blockchain to their local node. - -## Seed Node - -A seed node is a node that is called at runtime and helps the caller to find other nodes on the network. - -Seed nodes help new nodes on the network to obtain enough of a connection to the peer-to-peer network to download and sync the blockchain's history. - -## Smart Chain - -A Smart Chain is a blockchain built on Komodo technology. - -Komodo is a fork of Zcash, which is itself a fork of Bitcoin. Therefore, each Smart Chain contains all the upstream technology, including Komodo, Zcash, and Bitcoin features. - -A few notable Komodo-based features of Smart Chains include Antara Modules, which allow for arbitrary code to be executed as a part of achieving consensus, and cross-chain syncing, which allow for multiple Smart Chains to collaborate in maintaining scarcity and user activity. - -## Smart Contract - -A smart contract is a popular concept on other blockchain platforms. A smart contract allows developers to program scripts that update blockchain state based on user activity. - -Komodo has a replacement technology, Antara Modules, that are capable of achieving all that a smart contract can achieve, and more. Please see the [Antara Overview discussions](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.html#introduction) for more information. - -## Staker - -A staker is a user, or a node controlled by a user, that places funds in escrow on a Smart Chain network in exchange for the right to "stake" new blocks in the blockchain history. A staker receives rewards each time they successfully stake a block. - -## T Address - -A "t address" is a transparent address. Transactions performed in this address are fully visible to the network. - -## T Transaction - -A "t transaction" is a transparent transaction. The transaction can be fully viewed by the network. - -## Terminal - -The UNIX terminal is a simple software application that allows a user to execute commands and receive replies without a graphical user interface (GUI). - -Linux and MacOS users will find a UNIX terminal installed by default, whereas Windows users may need to install secondary software, such as [GitBash.](https://gitforwindows.org/) - -## Token - -A token is a digital asset which functions on top of a blockchain. Tokens are separate from coins. - -Foreign blockchain platforms, such as Ethereum, use token models such as ERC20 to allow users to print, distribute, and program their own currencies. - -The Komodo Platform uses the Tokens Antara Module (or any similar module) to transform and restrict the Smart Chain's coins so that they behave as tokens with desirable features This allows for ERC20-like possibilities, and more. - -## Trade Clearing - -The term "trade clearing" refers to the process of completing a promised trade between users. - -In AtomicDEX, trades are first matched on the peer-to-peer network, and then AtomicDEX uses our own signature atomic-swap process to clear the trade. Once both users either complete their sides of the trade, or abandon the procedure (and receive their appropriate refunds), the trade is considered cleared. - -## Trade Matching - -The term "trade matching" refers to the process of matching an offer to buy or sell with a willing trade partner. - -In AtomicDEX, trade offers are distributed on a decentralized peer-to-peer network. Liquidity makers make new offers, and liquidity takers accept offers made by liquidity makers. - -## Trustless - -The word "trust" has a different connotation in blockchain technology. - -Blockchain's specific and unique contribution to the field of technology is to allow users not to trust each other in achieving consensus over a history of transactions. - -Rather, users all collect the same data from the open peer-to-peer network and use the same software and calculations to arrive at the same conclusions themselves. The less an individual user must trust another individual user, the more effective the blockchain is. - -By removing the need for trust, power over the history of transactions and the correct "truth" of history is decentralized in favor of the average user, and away from centralized points of control. As centralized points of control are easily corrupted and manipulated, this has the potential to allow the average user to have a more fair level of influence within the blockchain network. - -## Turing Complete - -A programming language is considered "Turing Complete" if, when granted a few basic assumptions, the language is theoretically able to “compute any computable sequence.” - -In other words, the language should be able to solve any mathematical problem that uses only computable numbers. - -According to Turing’s definition, “...a number is computable if its decimal can be written down by a machine.” - -Komodo's Antara Modules allow for Turing Complete programming languages to add arbitrary code to the evaluation process of a consensus mechanism of a Smart Chain. - -## Tx - -An abbreviation of "transaction." - -## Txid - -An abbreviation of "transaction id." - -## Utxo - -The term "utxo" is an abbreviated form of "unspent transaction." - -Utxos can be difficult for new developers to understand. - -For more information, please [read the Utxo explanation here.](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-utxo-an-elusive-yet-fundamental-concept) - -## Virtual Machine Interpreter - -A Virtual Machine (VM) interpreter is a popular concept on other blockchain platforms. The virtual machine is decentralized across all nodes on the network. Any smart contract code that a user pays gas to have executed will be evaluated within the VM. The VM sends the results to the associated blockchain for transaction processing. - -Komodo's Smart Chain technology eliminates the need for a virtual machine. Instead, developers add their arbitrary code to an Antara Module. The code is evaluated as a part of achieving blockchain consensus. Users do not need to pay gas fees. Instead, they only pay the transaction fee necessary to send their transaction to the network. This is paid in the native coin of the Smart Chain. - -## Z Address - -A "z address" is a privacy-enabled address. These are active on a default Smart Chain, but developers of the Smart Chain can elect to disable z addresses. - -Users use the [z_sendmany](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-sendmany) remote procedure call (RPC) when dealing with z addresses. - -Z addresses only offer privacy when funds are sent from one z address to another. When a user sends money from a t address to a z address, or vice versa, the transaction should not be considered private. - -Please see the [privacy discussion section](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-nature-of-privacy-features-in-the-komodo-ecosystem) for further details and warnings. - -## Z Transaction - -A "z transaction" is a zero-knowledge transaction. When a z transaction occurs between two z addresses, only the user is able to see the details of the transaction. No further data remains in the public domain for later analysis. - -Please see the [privacy discussion section](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-nature-of-privacy-features-in-the-komodo-ecosystem) for further details and warnings. - -## Zcash Parameters - -The Zcash parameters are an implementation of zk-SNARK technology that allow for zero-knowledge transactions. - -Assuming the Zcash parameters were implemented properly, zero-knowledge transactions leave no trace in the public domain for later data analysis. - -Please see the [privacy discussion section](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-nature-of-privacy-features-in-the-komodo-ecosystem) for further details and warnings. - -## zk-SNARK - -"zk-SNARK" stands for "zero-knowledge succinct non-interactive argument of knowledge." This is a powerful form of privacy technology pioneered by the Zcash team. - -As Komodo is downstream from the Zcash protocol (which is itself downstream from Bitcoin), Komodo inherits all zk-SNARK technology by default. - -Please see the [privacy discussion section](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-nature-of-privacy-features-in-the-komodo-ecosystem) for further details and warnings. diff --git a/docs/basic-docs/start-here/learning-launchpad/learning-path-outline.md b/docs/basic-docs/start-here/learning-launchpad/learning-path-outline.md deleted file mode 100644 index 78465af24..000000000 --- a/docs/basic-docs/start-here/learning-launchpad/learning-path-outline.md +++ /dev/null @@ -1,478 +0,0 @@ -# Learning Path Outline - -## Introduction - -Welcome to the educational center for Komodo technology. This section provides a descriptive outline for new developers in the Komodo ecosystem. - -The content first familiarizes the developer with basic blockchain principles, and then narrows down on principles that are unique to Komodo. - -Once the developer is comfortable on a conceptual level, the content leads the developer into the process of utilizing the Komodo software itself in a development environment. - -Using Komodo software is about as difficult as using any other programming framework. The developer needs to first understand how the software functions on a conceptual level, and then the developer learns the vocabulary necessary to integrate Komodo software into their personal creative endeavors. - -This process can take anywhere from a single full day to a few weeks, depending upon the skill level of the developer. Each step of the journey provides a time estimate based on a normal developer that has a few years' experience in a mainstream programming language. - -## A Description of Our Intended Audience - -As mentioned in the [Documentation Orientation](../../../basic-docs/start-here/about-komodo-platform/orientation.html) section, this website is intended for readers who are already familiar with a mainstream programming language. - -Now, we divide readers further into two categories. - -##### The Normal Komodo Developer - -The first is a developer who intends to utilize Komodo technology only as it is provided to them. This is the most common type of developer we expect in the Komodo ecosystem. - -This developer likely intends to utilize Komodo software to release a blockchain product that either stands alone, or compliments another software product the developer is creating. - -For example, this developer could be involved with the creation of a blockchain-based asset for a business they are building. This developer expects an audience to purchase and trade these assets, and the audience may utilize Komodo's white-label software for asset management. - -As another example, this type of developer could be building software for a web application that integrates with blockchain technology. The developer could be utilizing Antara Modules, such as [Oracles,](../../../basic-docs/antara/antara-api/oracles.html#introduction) to securely record data that is relevant to or even created by their audience. Once the data is recorded, the developer could display this information on their website, for simple gameplay enhancements or data-driven storytelling. - -##### The Advanced Komodo Developer - -The advanced Komodo developer intends both to use the Komodo software as it is provided to them, and also to add in their own customized functionality beyond the scope of the normal software. This developer is highly skilled in a mainstream programming language, such as C/C++, and is prepared to thoroughly understand and manipulate blockchain software. - -For example, this developer may intend to build customized Antara Modules to add to the consensus mechanism of their Smart Chain. These customized modules could create unique and fully playable blockchain-based games of a complexity level similar to [this Komodo-based Roguelike game](../../../basic-docs/antara/antara-tutorials/rogue-module-tutorial.html#introduction), or [this Komodo-based version of Sudoku.](../../../basic-docs/antara/antara-api/sudoku.html) - -#### How Each Type of Developer Should Approach the Educational Outlines - -Both types of developers should begin at the beginning. - -The Normal Developer should proceed until they reach the content with a difficulty level labeled `Advanced` and then stop, while the Advanced Developer there should proceed. - -We recommend that developers complete steps with a priority label of `Recommended`. There are also a few sections labeled `Optional` that may be skipped, although the developer who completes them will, hopefully, find them worth the while as these sections contain short cuts and other recommended best practices. - -## Step 0: Install Komodo Software - -Priority: Recommended - -Difficulty: Normal - -Time: 10 Minutes - -------- - -Access to Komodo software allows the developer to immediately begin learning through direct experimentation. - -We recommend that all developers install Komodo software not by using pre-built binaries, but rather by installing and compiling from source code. - -This allows the developer to later have instant access to Komodo security patches, feature enhancements, and upgrades. - -[Link to Komodo Source Code Installation Methods](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html) - -[Link to AtomicDEX Source Code Installation Methods](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) - -## Step 1: Reach Out to Our Community on Discord - -Priority: Recommended - -Difficulty: Normal - -Time: 5 Minutes - -------- - -Discovering Komodo is best accomplished with a friend. - -Komodo utilizes a third-party chat service called Discord. - -[Reach out to us on Discord at this link.](https://komodoplatform.com/discord) - -Once you are logged in to the Komodo Discord server, you will see a list of channels on the left side of your browser. All channels begin with a `#` hashtag. - -Say hello in channels such as `#arrivals`, `#start-here`, or `#introductions`. - -The `#support` channel is a good place to ask for basic support with Komodo software. - -To find fellow developers, head to the `#dev-general` channel. All channels that begin with `dev` are created for developers. - -We look forward to meeting you there! - -## Step 2: Begin a Conceptual Understanding of Komodo's Software - -Priority: Recommended - -Difficulty: Normal - -Time: 10 Minutes - -------- - -With the Komodo software installed and a connection made to our community, you are prepared to begin learning about Komodo on a conceptual level. - -These conceptual concepts must be grasped first, before attempting to manipulate blockchain assets and software. The concepts help to orient you in your development process. - -##### Platform Overview - -The Platform Overview section provides the broadest conceptual understanding of the Komodo Platform. - -[Link to Platform Overview.](../../../basic-docs/start-here/about-komodo-platform/about-komodo-platform.html) - -##### Product Introductions - -The Production Introductions section contains simplified introductions to Komodo software products and their architecture. - -[Link to Product Introductions](../../../basic-docs/start-here/about-komodo-platform/product-introductions.html) - -##### Doc Orientation - -The Doc Orientation section gives the reader an understanding of the nature of this documentation website. - -[Doc Orientation](../../../basic-docs/start-here/about-komodo-platform/orientation.html) - -## Step 3: Read the Core Technology Discussions Section - -Priority: Recommended - -Difficulty: Normal - -Time: 1 - 8 Hours - ------------ - -The Core Technology Discussions section provides a thorough explanation of blockchain technology and Komodo. The principles explained herein are crucial in later stages. - -##### Introduction - -The Introduction section presents a broad overview of the nature of the Komodo ecosystem and the philosophy and goals that drive this community. - -[Link to Introduction Section](../../../basic-docs/start-here/core-technology-discussions/introduction.html) - -##### Delayed Proof of Work - -The Delayed Proof of Work section explains to the reader the fundamental aspects of blockchain technology that apply to members of the Komodo ecosystem. The primary aspects that a developer should understand here are the value of the consensus mechanism and the nature of Komodo notarization. - -[Link to Delayed Proof of Work Section](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html) - -##### Initial DEX Offering (IDO) - -This section helps the reader to understand the basic process an entrepreneur and developer goes through in releasing a new blockchain-based product. This can be called a "Initial DEX Offering," or IDO for brevity. - -This also helps the reader to understand how Komodo uses runtime forks to allow each Komodo developer to create their own blockchain that can be connected to the rest of the ecosystem. - -[Link to IDO Section](../../../basic-docs/start-here/core-technology-discussions/initial-dex-offering.html) - -##### The Antara Framework - -The Antara Framework section explains to the reader the basic concepts of the Antara Framework. This framework is a key aspect of the Komodo development process. The framework provides functionality that can be compared to "smart contracts" found on other blockchain platforms. - -[Link to Antara Framework Section](../../../basic-docs/start-here/core-technology-discussions/antara.html) - -##### AtomicDEX and Atomic Swaps - -As a developer gains understanding of blockchain technology, and as your audience grows, you will likely seek to make atomic swaps available to your users. The AtomicDEX software is our signature method for conducting atomic swaps. - -This section helps the reader to understand why atomic swaps are a key to the future of cryptocurrency trading and how they work. - -[Link to AtomicDEX and Atomic Swaps Section](../../../basic-docs/start-here/core-technology-discussions/atomicdex.html) - -##### Miscellaneous - -The Miscellaneous section explains a few leftover concepts that we recommend the reader understand. For example, a developer will no doubt encounter a "Utxo," or the developer may be curious about privacy on a Komodo Smart Chain, and this section provides preparation. - -[Link to Miscellaneous Section](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html) - -## Step 4: Complete the Beginner Series in the Antara Tutorials Section - -Priority: Recommended - -Difficulty: Normal - -Time: 1 Hour - ------------- - -The Beginner Series tutorials provide the reader with an easy pathway into the process of using Komodo technology. - -Many of the technical aspects of using Komodo software are simplified here, to allow you to familiarize yourself with the nature of blockchain commands and responses without having to encounter everything all at once. - -As a part of this tutorial, you will download a separate piece of software (a Docker-based image) in which you will enter your first commands. - -Towards the end of the series, we then walk you through the process of interacting with Komodo Smart Chains in the terminal. - -[Link to Beginner Series Tutorial - Part 0 - Preparation](../../../basic-docs/antara/antara-tutorials/beginner-series-part-0.html) - -## Step 5: Familiarize Yourself with Smart Chain API Basics - -Priority: Recommended - -Difficulty: Normal - -Time: < 1 Hour - --------------- - -Having completed the Beginner Series, the reader is now prepared to use the terminal more frequently while interacting with Komodo Smart Chains. - -The Smart Chain API Basics tutorial walks the reader through many of the common commands and Remote Procedure Calls (RPCs) and assists the reader in becoming comfortable in the Komodo environment. - -[Link to Smart Chain API Basics Tutorial](../../../basic-docs/smart-chains/smart-chain-tutorials/smart-chain-api-basics.html#api-tutorials-introduction) - -## Step 6: Enhance Your Development Environment and Experience - -Priority: Optional - -Difficulty: Normal - -Time: 1 - 5 Hours - ----------------- - -At this point, the Normal Developer should be generally comfortable with the basic concepts of utilizing the default Komodo Smart Chain software. - -The following tutorials are optional, but we still recommend that the developer explore the concepts contained herein. You may find short cuts and solutions that will help you avoid common pitfalls in the development process. - -##### Basic Environment Setup for Linux VPS - -Many, if not most, developers in the Komodo ecosystem use a Linux-based Virtual Private Server (VPS) to build software. Working on a VPS simplifies many aspects of the development process, as the VPS grants the developer a disposable and rapidly customizable environment for troubleshooting. - -[Link to Basic Environment Setup for Linux](../../../basic-docs/smart-chains/smart-chain-tutorials/basic-environment-setup-for-linux-vps.html#introduction) - -##### Creating Komodo Smart Chains - -Up to this point in the outline, the developer has either relied on tutorial software to provide a Smart Chain, or the developer has relied on a `regtest` chain. - -Now, it is time to try creating your own Smart Chain. - -[Link to Creating a Default Smart Chain](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html#creating-a-new-smart-chain) - -##### Creating a Smart Chain on a Single Node - -Sometimes in the development process, the developer may find convenience in having a Smart Chain running on a single node. This is not the way that blockchain software is intended to function, but single-node blockchains are useful, nonetheless. - -[Link to Creating a Smart Chain on a Single Node](../../../basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.html) - -##### Running Komodo Software in Debug Mode - -Debug Mode allows a developer to access the last lines of code executed by the daemon before the software crashes. - -A Normal Developer will likely only use this when communicating with a support agent, in the unlikely event of a malfunction in the software. An Advanced Developer, on the other hand, may use Debug Mode frequently. - -[Link to Running Komodo Software in Debug Mode](../../../basic-docs/smart-chains/smart-chain-tutorials/running-komodo-software-in-debug-mode.html) - -##### Updating Smart Chain Software From Source Code - -As the developer installs their software from source code, updating frequently is easy and recommended. Read the following section to become familiarized. - -[Link to Updating Smart Chain Software From Source Code](../../../basic-docs/smart-chains/smart-chain-setup/updating-from-source.html) - -##### Ecosystem Launch Parameters - -The developer is likely to encounter an opportunity to interact with members of another Smart Chain community in the Komodo ecosystem. - -At some future point, you may also be interested in having your own Smart Chain added to this list by purchasing Komodo's dPoW security services. - -The list of launch parameters for all Smart Chains supported by the Komodo notary nodes can be found here. - -[Link to Ecosystem Launch Parameters](../../../basic-docs/smart-chains/smart-chain-setup/ecosystem-launch-parameters.html) - -##### Learn How to Manually Delete Blockchain Data - -Sometimes, a developer will need to delete their synced blockchain data and re-sync with the network. The following section teaches the safe way to conduct this process. - -[Link to Smart Chain Maintenance Section](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html) - -##### Common Runtime Parameters - -As Komodo Smart Chain software is based on the Bitcoin protocol, we inherit many runtime parameters that are useful in creating a secure and efficient blockchain network. - -We recommend that the developer search through our abbreviated list of popular runtime parameters and experiment with one or two, to gain a conceptual understanding. This can help to expand your growing awareness of the potential of blockchain technology and how it is superior to fiat-based currency systems. - -[Link to Common Runtime Parameters](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html) - -## Step 7: Experiment with Antara Customizations - -Priority: Recommended - -Difficulty: Normal - -Time: 20 - 60 Minutes - ------------- - -The most basic aspect of Komodo's Antara Framework is the ability to customize your Smart Chain. These customizations are provided by Komodo as enhancements to the default Bitcoin/Zcash protocol. - -We recommend that you scan through the list of enhancements, read the basic descriptions, and experiment with one or two that interest you. - -[Link to Antara Customizations](../../../basic-docs/antara/antara-setup/antara-customizations.html#smart-chain-customizations) - -## Step 8: Read the Overview of Antara Modules - Part I - -Priority: Recommended - -Difficulty: Normal - -Time: 30 Minutes - ---------------- - -Antara Modules are where the power of the Komodo Smart Chain and the Antara Framework begin to come into full display. Antara Modules allow the developer to expand blockchain potential far beyond the limits by which many other blockchain ecosystems are bound. - -The Overview Part I provides a more thorough discussion about how the framework overcomes many problems faced by the blockchain industry. - -[Link to Overview of Antara Modules - Part I](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.html#introduction) - -## Step 9: Read the Overview of Antara Modules - Part II - -Priority: Recommended - -Difficulty: Normal - -Time: 30 Minutes - ----------- - -Part II of this discussion delves more deeply into the underlying methods by which Antara allows developers to solve problems. - -[Link to Overview of Antara Modules - Part II](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.html) - -## Step 10: Understand Antara Addresses - -Priority: Recommended - -Difficulty: Normal - -Time: 5 Minutes - ---------------- - -At this point, the developer is familiar with common blockchain addresses. - -However, Antara requires the user to manage additional addresses for Antara-based currency. The passphrase for these addresses can all be the same, but the public address will not be. - -These addresses keep funds separate between different modules on a Smart Chain, and assist in maintaining token scarcity, among other uses. - -[Understanding Antara Addresses](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) - -## Step 11: Experiment With the Default Heir Antara Module - -Priority: Recommended - -Difficult: Normal - -Time: 15 Minutes - -------------- - -A simple application of the Antara Framework is the Heir Antara Module. This simple module allows a user to designate an inheritor of their funds, should the user become inactive on a Smart Chain. - -Read the introductory section to gain a more thorough understanding, and then try executing each command found in the Heir Module Flow section. - -The Heir Antara Module is active on the MORTY Smart Chain that serves as a test chain in the Komodo ecosystem. - -```bash -./komodod -pubkey=$pubkey -ac_name=MORTY -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 & -. -``` - -Funds are freely available on this chain. Use the following [faucetget](../../../basic-docs/antara/antara-api/faucet.html#faucetget) RPC to tap the community faucet and receive `0.1` coins. This should be enough for the Heir Module Flow experiment. - -```bash -./komodo -ac_name=MORTY faucetget -``` - -Copy the returned hex value and broadcast it using the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) RPC. - -[Link to Heir Module Introduction](../../../basic-docs/antara/antara-api/heir.html#introduction) - -[Link to Heir Module Flow](../../../basic-docs/antara/antara-api/heir.html#heir-module-flow) - -## Step 12: Experiment with the Tokens Antara Module - -Priority: Recommended - -Difficulty: Normal - -Time: 15 Minutes - --------------- - -The Tokens Antara Module is often useful as it allows the developer to quickly and easily mint new currencies on their Smart Chain. - -Use the `tokenscreate` RPC method to create your own tokens, and then experiment with other RPCs. This module is also available on the MORTY Smart Chain. Make sure to save the returned `txid` after broadcasting your raw transaction. (See the Examples section for a demonstration of the token creation method.) - -[Link to Tokens Antara Module - tokenscreate RPC](../../../basic-docs/antara/antara-api/tokens.html#tokencreate) - -Use the `tokensinfo` RPC method to view your new tokens. - -[Link to Tokens Antara Module - tokensinfo RPC](../../../basic-docs/antara/antara-api/tokens.html#tokeninfo) - -## Step 13: Read the Introduction to AtomicDEX - -Priority: Optional - -Difficulty: Normal - -Time: 15 Minutes - ------------- - -The Normal Developer is now nearly finished with a grand tour of the Komodo software. The key remaining target is AtomicDEX, our signature method for exchanging cryptocurrencies using atomic swaps. Be one of the first people in the history of mankind to exchange assets with an anonymous person over the Internet without any middleman whatsoever. - -This introductory discussion covers some of the same concepts that the reader encountered in the Core Technology Discussions section, but with several useful additional details. - -[Link to Introduction to AtomicDEX](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html#why-is-atomicdex-special) - -## Step 14: Experiment with Atomic Swaps - -Priority: Recommended - -Difficulty: Normal - -Time: 1 Hour - ------------ - -Follow this walkthrough to perform your first atomic swaps. - -[Link to AtomicDEX Walkthrough](../../../basic-docs/atomicdex/atomicdex-tutorials/atomicdex-walkthrough.html#setting-up-the-coin-list) - -(If you still need to install AtomicDEX software, [click here for instructions on installing from source code.)](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) - -For those Normal Developers who make it this far, congratulations! You have completed the grand tour of the Komodo software suite. - -Going forward, we recommend that you experiment with individual RPCs and customizations throughout the documentation, until you feel fluent in utilizing Komodo technology. - -Please keep in touch with our community on [Discord.](https://komodoplatform.com/discord) We are excited to see what you create! - -## Step 15: Begin the Advanced Development Tutorial - -Priority: Recommended - -Difficulty: Advanced - -Time: 5 - 15 Hours - ---------- - -Advanced Developers should now be familiar enough with the nature of Komodo technology to begin a more thorough approach to manipulating blockchain technology. - -The following tutorial series walks the developer through the initial development process. The tutorial will first explain several integral aspects of blockchain technology that blockchain engineers are required to understand. Then, the series walks the reader through the process of creating a simplified version of the Heir Antara Module. - -This tutorial series expects that you are comfortable with downloading a Github repository and manually inspecting the source code to determine the nature of the source code's functionality. - -Once you complete this tutorial, you are among the most advanced of community developers. You may feel prepared to offer your services to businesses that would like to use your skills to commission customized Antara Modules for their unique business purposes and competitive-advantage desires. - -[Link to Advanced Series - Part 0 - Introduction](../../../basic-docs/antara/antara-tutorials/advanced-series-0.html) - -## Step 16: Inspect Komodo Community Bounties - -Priority: Optional - -Difficulty: Advanced - -Time: ~ - ----------- - -Now that you are comfortable building new Antara Modules, it's time to put your skills to use and build something for the community. - -The Komodo team is looking for talented C/C++ developers to build new Antara Modules that can be included with Komodo's default suite of modules. - -Creating a new default module can take up to a month's worth of time, and we try to make sure the value of the bounties is worth your while. - -[Link to Komodo Bounties](https://forum.komodoplatform.com/c/jobs-bounties) - -Alternatively, reach out to the Komodo development team on the `#dev-general` channel on [Discord](https://komodoplatform.com/discord) and ask where help is needed. - -We look forward to working with you! diff --git a/package.json b/package.json index a5c24acff..601317f02 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,10 @@ "author": "Contributors from Komodo Platform", "license": "MIT", "devDependencies": { - "@vuepress/plugin-back-to-top": "^1.8.2", - "moment": "^2.29.4", + "@vuepress/plugin-last-updated": "^1.5.0", + "moment": "^2.29.2", "vue-cookie-law": "^1.13.3", "vuepress": "^1.8.2", - "vuepress-plugin-autometa": "^0.1.13", "vuepress-plugin-google-tag-manager": "^0.0.4", "vuepress-plugin-medium-zoom": "^1.1.8", "vuepress-plugin-redirect": "1.2.0-alpha.0" diff --git a/prepare-atomicDEX-docs.sh b/prepare-atomicDEX-docs.sh deleted file mode 100755 index fc1dad3d3..000000000 --- a/prepare-atomicDEX-docs.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -set -ev - -rsync -avh --delete ./docs/basic-docs/atomicdex/ ./AtomicDEX-docs/docs/basic-docs/atomicdex/ -rsync -avh --delete ./docs/basic-docs/atomicdex-api-20/ ./AtomicDEX-docs/docs/basic-docs/atomicdex-api-20/ -rsync -avh --delete ./docs/basic-docs/atomicdex-api-20-dev/ ./AtomicDEX-docs/docs/basic-docs/atomicdex-api-20-dev/ -rsync -avh --delete ./docs/basic-docs/atomicdex-api-legacy/ ./AtomicDEX-docs/docs/basic-docs/atomicdex-api-legacy/ -rsync -avh --delete ./docs/.vuepress/public/ ./AtomicDEX-docs/docs/.vuepress/public/ -rsync -avh --delete ./postman/ ./AtomicDEX-docs/postman/ -rm -f ./AtomicDEX-docs/docs/.vuepress/atomicDEX-sidebar.js -cp ./docs/.vuepress/atomicDEX-sidebar.js ./AtomicDEX-docs/docs/.vuepress/atomicDEX-sidebar.js -rm -rf ./AtomicDEX-docs/.git diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..d5f9b16db --- /dev/null +++ b/test.txt @@ -0,0 +1,39095 @@ +# An Advanced Approach to Komodo's Antara Framework + +## Introduction + +The following content is provided for the experienced C/C++ developer who desires to create new Antara Modules for Komodo Smart Chains. + +The content herein provides introductory instruction that can allow the developer to more easily read existing Antara-related code and follow advanced tutorials that examine specific Antara Modules. + +## Link to Learning Path Outline + +The following tutorial series is intended for advanced Komodo developers who intend to manipulate the default software setup. Please review the placement of this tutorial in [the Learning Path Outline section.](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html#step-15-begin-the-advanced-development-tutorial) + +## Antara Encompasses Several Technologies + +The Antara Framework greatly enhances blockchain functionality. Antara allows a developer to use their Smart Chain's consensus mechanism to enforce arbitrary code. Antara even allows clusters of Smart Chains to work together in this effort. + +The level of freedom this grants to the blockchain developer is sometimes difficult to comprehend until one has either seen the technology in action or engaged with the technology directly. + +The Antara Framework takes into account several different advanced technologies. To limit the scope of our introduction, for now we focus only on one crucial aspect: "CryptoConditions," or "CC" for brevity. + +## A Less Conceptual Discussion of CryptoConditions + +#### CryptoConditions in Brief + +CryptoConditions is a technology that allows for arbitrary logical conditions and fulfillment to be evaluated as a part of consensus. This allows for a Smart Chain's consensus mechanism to evaluate the results of arbitrary code and update state in the blockchain's data in a decentralized and secure fashion. + +CryptoConditions technology is not a new concept. The [Interledger](https://interledger.org/) team originally proposed this technology in 2016. + +The [original proposal](https://tools.ietf.org/html/draft-thomas-crypto-conditions-01) was that it would be an open-source industry-wide standard format. The Interledger team does not seem to have continued exploring the technology beyond the original proposal. + +Komodo, on the other hand, found the CryptoConditions concept to be intriguing. In 2018, Komodo adopted this open-source technology into the suite of offerings in our Antara Framework. + +Our implementation uses many of the key ideas put forth by the Interledger team, and at the same time we depart in several significant ways. Those who are curious for specific details on this topic can explore the open-source code in the respective repositories. + +The important takeaway is that the Antara Framework encompasses several underlying technologies, one of which is CryptoConditions (CC). This technology allows a developer to add arbitrary logical conditions and fulfillment to their Smart Chain, and to rely on the consensus mechanism to ensure state integrity in a decentralized environment. + +#### CryptoConditions Depends Upon Transactions and Booleans + +At the most fundamental level, blockchain data is advanced only through transactions. A blockchain itself is but a list of transactions, bound into blocks. By design, each transaction must be confirmed by the consensus mechanism. + +Therefore, all decentralized data that a developer wishes to create or use with their arbitrary code must first be added to a transaction. This transaction is then passed through the consensus mechanism. Transactions that are successfully confirmed are finally added to the blockchain, and therefore the data is also added. + +To take advantage of this functionality, a developer adds customized source code to the Antara Framework to form a new module. Whenever a relevant transaction occurs on the blockchain, the consensus mechanism calls the developer's module, validates the logical conditions and fulfillment as put forth by the arbitrary code, and either confirms or denies the transaction. + +To simplify this process, Antara requires that the developer build their module such that each CryptoConditions (CC) transaction returns a boolean value as a part of the final results. If the returned boolean value is `true`, the transaction is approved. + +With this framework in place, the developer can also add any other data to be saved as a part of the transaction. This data is included in a special part of the transaction called an [OP_RETURN](https://en.bitcoin.it/wiki/OP_RETURN), or opreturn for brevity. We will discuss opreturns in greater detail further on. + +Through Antara, the developer receives a powerful tool for creating and executing decentralized arbitrary code. A developer can also add data to any transaction, and their Smart Chain can utilize this data in future executions of arbitrary code. The primary requirement is that the arbitrary code return a meaningful boolean value as a part of the final result. + +#### Building an Antara Module is Harder Than Creating a Balance-Based Smart Contract + +Antara Modules are fundamentally different than the "smart contracts" that are familiar on other blockchain platforms. The key difference is that Antara Modules directly rely on ["unspent transactions,"](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-utxo-an-elusive-yet-fundamental-concept) which are called "utxos" for brevity. Smart contracts, on the other hand, rely on the total balance of funds held within an address. + +Utxo-based modules are harder to create than balance-based smart contracts. However, utxo-based modules result in dramatically more powerful and secure functionality, as they leverage the existing Bitcoin-utxo system. + +For example, with balance-based smart contracts, a bug in the smart-contract language can result in terrible events, such as the malicious printing of new coins in a smart contract, or the draining of all funds within a shared contract. Events such as these can happen even when the smart-contract author is a competent developer. + +In a utxo-based module, the risk of such events is exponentially reduced. One reason utxo-based modules are more secure is that every update of the blockchain's state must be executed as a transaction, and therefore the data must pass the normal rules of consensus. + +Komodo is based on the Bitcoin protocol, and therefore Komodo's Smart Chain consensus mechanism is built on the most rigorously tested and heavily supported software in the industry. Balance-based smart contracts cannot compare to this level of security. + +As the developer engages with Antara Module development, they can learn how utxo-based modules allow for increased speed in achieving consensus, greater simplicity in software architecture, more flexible functionality between Smart Chains, and many more superior features. + +#### A Brief Look at an Antara Module Template + +The following file, `customcc.cpp`, is a blank template a developer can use when beginning the creation of a new Antara Module. Take a brief look to familiarize yourself with the essential layout. + +[Link to customcc.cpp file](https://github.com/jl777/komodo/blob/dev/src/cc/customcc.cpp) + +The key takeaway is that the entrypoints to Antara's CryptoConditions technology are broken down into a few functions and tables. Once the developer grasps the nature of working with these entry points, building Antara Modules becomes a simple exercise in the common aspects of software development. + +Komodo already offers many SDK functions, tutorials, and best practices to simplify the learning curve and development process, and we continue to develop more of these sources of assistance. + +Before the developer can begin creating new Antara Modules, there are several key concepts to understand in the Bitcoin Protocol. + +------------ + +[Link to Next Tutorial in the Advanced Series](../../../basic-docs/antara/antara-tutorials/advanced-series-1.html) +# Advanced Series — Smart Chain Development Basics + +#### Understanding Utxos is Important in Antara Modules + +In the [Learning Launchpad Outline](../../../basic-docs/start-here/learning-launchpad/learning-path-outline.html) the reader received encouragement to understand the basics of blockchain technology in preparation for this tutorial. The [Core Technology Discussions section](../../../basic-docs/start-here/core-technology-discussions/introduction.html) provides a useful introduction to most concepts that are necessary for blockchain engineers. + +A key basic concept to understand is the unspent transaction, or utxo. For a brief reminder on the nature of a utxo, read [this section in the Core Technology Discussions section.](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html#the-utxo-an-elusive-yet-fundamental-concept) + +Observe the data structure of a transaction. + + + +This transaction has an id, which is given as one of the first key-value pairs. + +```json +"txid": "6d3b67086ef6964e4022654938e71eb5a248aa5a1853b999381126c7d4dd0364" +``` + +The term, `txid`, stands for transaction id. + +Within this transaction there are two arrays. One contains the vins and the other contains the vouts. + +A vin and a vout are short for "vector in" and "vector out". + +The vins and vouts can be considered to be sub-transactions that take place within the main transaction. + +##### Observing the vin + +The vins in a transaction consume unspent values from previous transactions. + +Observe the first (and only) vin in this transaction. + +```json + "vin": [ + { + "txid": "00f6bf6baa77aa4d0537e034c501f120aa8c687917cb24827e994ac4167b2700", + "vout": 1, + "address": "RMhKqTr1ssari1wFoVFSSjdLsBXPkDdAac", + "scriptSig": { + "asm": "3045022100f26e8fa0fe08ad5d97fe4b2e56b409ef1126aed537878801eb1a38eb5152031d02205444da469fb12d9351b35e235e87c91db09fdbf9a7ac21c44c845046b672eac4[ALL]", + "hex": "483045022100f26e8fa0fe08ad5d97fe4b2e56b409ef1126aed537878801eb1a38eb5152031d02205444da469fb12d9351b35e235e87c91db09fdbf9a7ac21c44c845046b672eac401" + }, + "value": 0.10000000, + "valueSat": 10000000, + "address": "RMhKqTr1ssari1wFoVFSSjdLsBXPkDdAac", + "sequence": 4294967294 + } + ], +``` + +This vin takes funds from an address, `RMhKqTr1ssari1wFoVFSSjdLsBXPkDdAac`. + +The amount of funds the vin takes from that address is `"value": 0.10000000`. + +##### Observe the vouts + +To spend these funds, the transaction creates the vouts. + +Observe the two vouts of this transaction. + +```json + "vout": [ + { + "value": 0.04995000, + "valueSat": 4995000, + "n": 0, + "scriptPubKey": { + "asm": "0275610ca15c4688cfebef16f84bce3691dc309591e23fc7298cf3683d9c3fd1ef OP_CHECKSIG", + "hex": "210275610ca15c4688cfebef16f84bce3691dc309591e23fc7298cf3683d9c3fd1efac", + "reqSigs": 1, + "type": "pubkey", + "addresses": [ + "RMhKqTr1ssari1wFoVFSSjdLsBXPkDdAac" + ] + } + }, + { + "value": 0.05000000, + "valueSat": 5000000, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 f3f476150b5a0f65a0972520653e6523dc2bd5ac OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914f3f476150b5a0f65a0972520653e6523dc2bd5ac88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "RXX78ba9g6aXuNLfeHTN24WhPWj3jWqyia" + ] + } + } + ], +``` + +The first vout sends `0.04995000` coins to the same address we saw in `vin0`. + +The second vout sends `0.05000000` coins to a new address. + +If we take the total value of all vins and subtract the total value of all vouts, we see that there is `0.00005000` difference. + +By design, any leftover amount not claimed by a vout is given to the miner that mines the block that contains this transaction. This is the mining fee. + +##### Making Inferences + +To summarize, the utxo takes `0.1` coins from an address, sends `0.04995` back to the same address, and then sends `0.05` coins to a new address. The leftover amount is automatically given to the miner of the block. + +This suggests that the user who created this transaction desired to send `0.05` coins to the new address. The user may have created this transaction using the [sendtoaddress]() API method. + +From here, the software daemon took control. The software found that within the user's wallet was an existing value of `0.1` coins. This became the vin for the transaction. The first vout the software created was sent back to the address in the user's own wallet. This `0.04995000` value is the "change" from the transaction. The second vout contains the `0.05` the user intended to send to the new address. + +#### Utxo is an Unspent Vout + +A vout that can be spent, but has not yet been spent, is a utxo. + +To determine whether a vout is spent, the developer cannot look directly at the data in a transaction. Rather, the developer makes a requst to the software to look at all following transactions on the blockchain. + +If there is a later transaction that has a vin that consumes the `0.05` vout, that would indicate that the vout is spent. If there is no such transaction, then the vout is still a utxo. + +A transaction can have multiple vouts, and therefore each transaction can technically contain multiple utxos. + +Often times, in conversation developers may call a full transaction a "utxo," for simplicity's purposes. Yet, for developers to truly understand the underlying concept, they should understand that "utxo" refers to a vout, not to a txid. + +#### A Utxo is Not Spent Until Confirmation + +A utxo is not considered spent under any circumstances until the transaction that spends it receives confirmation from the Smart Chain's consensus mechanism. + +Therefore, transactions sent to the [mempool](https://en.bitcoin.it/wiki/Protocol_documentation#mempool) are technically still unspent transactions, even if the user is fairly certain the transaction will be confirmed in the next block. + +A useful comparison here can be found by observing people seeking to attend a ticketed event, such as a music concert. To gain acceptance into the music hall, a person must first have a ticket. We compare this to the creation of a txid. The person must wait in line. This is similar to the mempool. The person must have their ticket stamped, and this is akin to the consensus mechanism approving the transaction. Then the person may enter the music hall. This is the transaction becoming a part of the blockchain history. + +The essence of blockchain technology is that a utxo can only be spent once. In building modules for the Antara Framework, we constantly keep this principle in mind, and the consensus mechanism is our guide. + +## Formation of a Transaction + +Contrary to what one may think, a blockchain transaction is not a simple accounting entry that says, "Address X pays Y amount of funds to address Z." Rather, a transaction also contains a Bitcoin script that must be satisfied before the requested funds can be spent. + +The manner in which transactions are created has evolved over time. Originally, the process consisted only of a "Pay to Pubkey" script, or "P2PK" for brevity. + +In a P2PK transaction, the software checks the cryptographic signature of the public key attempting to spend funds and if the signature is correct the transaction is approved. + +These simple transactions are common in coinbase transactions. (Recall that a coinbase transaction is the transaction that mints new coins onto a blockchain. Coinbase transactions are most frequently encountered as block rewards for miners/stakers, and in the Gensis Block of a chain.) + +If the reader would like a more thorough technical explanation of P2PK transactions, tutorials and explanations abound across the web. [Here is one such example.](https://learnmeabitcoin.com/glossary/p2pk) + +#### Quantum Computers, Cold Addresses, and Change + +As the early Bitcoin community gained experience, Satoshi Nakamoto foresaw a potential danger. Far in the future, a quantum computer will be able to break the encryption protection of any pubkey address and thereby steal funds. + +To solve this problem, Satoshi invented a method to have a "cold address." Cold addresses are based on a pubkey, but there are various cryptographic functions that separate the two. + +A user can send their funds to a cold address without revealing the associated pubkey. This allows the user to keep their pubkey private, and thus protect their funds from being spent even by a quantum computer, so long as the relationship between the cold address and the pubkey remains a secret. + +Naturally, to spend their funds, the user must utilize their pubkey to create the transaction signature, and thus they reveal the relationship between the cold address and the pubkey. Once the secret is revealed, the cold address no longer offers any protection against quantum computers. + +This encouraged Satoshi to redesign the Bitcoin protocol so that, by default, each time a utxo is spent the leftover amount in the utxo is sent to a new cold address. This is the reason for the "change" addresses that a user sees in their wallet each time they send funds on a default Bitcoin-based blockchain. + +#### Smart Chain and CryptoConditions' Pubkey Parameter Disables Change Addresses + +An astute reader may note that in the above example transaction, the "change" did not go to a new address, but rather to the same address from which the `0.1` coins were taken. The reason for this pertains to CryptoConditions (CC), as the transaction was performed on a Smart Chain that utilizes CryptoConditions. + +When using CC technology, the user typically must provide a designated pubkey via the [pubkey]() launch parameter. The reason for this will be discussed later. + +A side effect of using this pubkey parameter is that once this is set, the software will stop creating new "change" addresses with each transaction. Instead, the software will send the "change" back to the same cold address that is associated with the pubkey. + +If a user wants to keep funds safe from quantum computers, there are separate CC-related modules that provide protection. For example, [the upcoming Dilithium Antara Module.](https://komodoplatform.com/dilithium-quantum-secure-blockchain/) + +#### Pay to Pubkey Hash Transactions + +Transactions that send funds to a cold address are called "Pay to Pubkey Hash" transactions, or P2PKH for brevity. + +When performing a P2PKH transaction, the protocol has a few extra steps to perform. The protocol must check that the hash of the pubkey (which is included as a part of the cold address) is appropriately matched to the pubkey itself. The structure of a P2PKH transaction includes opreturns that instruct the daemon to perform these verification steps. + +The Internet contains many thorough explanations of P2PKH transactions. For more information, [here is one such tutorial.](https://learnmeabitcoin.com/glossary/p2pkh) + +Once a cold address is associated with a pubkey, the Bitcoin protocol no longer attempts to use these quantum-secure P2PKH transactions, as they require an extra 25 bytes of data space. Instead, the protocol reverts to the original P2PK transactions. + +CryptoConditions typically requires the [ac_pubkey](../../../basic-docs/antara/antara-setup/antara-customizations.html#ac-pubkey) Antara Customization parameter to be enabled. One of the effects of this parameter is that each time a user makes a transaction, the "change" is automatically sent back not to a new cold address, but rather to the pubkey included in the `ac_pubkey` parameter. Therefore, as user transactions are already always returning to a default pubkey, the Antara Module developer can simply skip P2PKH transactions altogether and use only P2PK transactions instead. + +#### Pay to Script Hash Payments + +In addition to P2PK transactions, the original Bitcoin protocol allowed for any type of script opcode in transactions. This seemed like a promising idea at first, but developers quickly discovered that this level of freedom also brought instability. Satoshi limited the options available, and P2PK and P2PKH become the overwhelming majority of all transctions. + +The community still desired the freedom to execute scripts as a part of transactions, and this eventually led to the Pay to Script Hash, or P2SH, standard. + +This method allows the user to lock their funds to the hash of a script. The script itself is typically designed to ensure that the funds are spent in a secure manner, and this is often through a P2PK or P2PKH transaction that is included in the script. + +To unlock the funds, a user provides the original script. The blockchain daemon checks that the script matches the hash, executes the script, and the funds are unlocked. + +For more information about P2SH transactions, [a useful tutorial can be found here.](https://learnmeabitcoin.com/glossary/p2sh) + +#### Understanding Op Codes + +Each of the above transactions relies on an operation code, also called "opcode", to execute. + +For example, the P2PKH transaction relies on the OP_CHECKSIG opcode `172` to execute. The opcode is included as a part of the transaction data, typically as a header and in hex format. + +When the daemon detects the opcode in the raw data, the daemon understands what is being asked by the developer and performs the appropriate action. + +Originally, Bitcoin had many opcodes available. Satoshi disabled a large number of opcodes for stability reasons. To see a list of current opcodes in Bitcoin, [visit the Bitcoin wiki.](https://en.bitcoin.it/wiki/Script#Opcodes) + +#### A New Op Code: OP_CheckCryptoCondition + +The CryptoConditions standard itself relies on a new opcode, OP_CHECKCRYPTOCONDITION, or OP_CCC for brevity. + +This opcode is not included in the Bitcoin protocol. Rather, the OP_CCC standard was originally written and designed by the Interledger team. The full, original OP_CCC specification is a thirty-three page document, [which you can see here.](https://tools.ietf.org/html/draft-thomas-crypto-conditions-04) + +There is no need to read and master the entire original proposal, however, as Komodo's Antara Framework automates much of the underlying aspects. The primary takeaway is that the developer uses OP_CCC to create a "CryptoConditions transaction," also called a "CC transaction" for brevity. + +A CC transaction includes several special features. This can include a logical condition that must be met for the utxo the transaction creates to be spent in the future. A CC transaction can also include a fulfillment of the logical conditions set forth in a previous CC transaction. The binary encodings of these CC transactions can be used in a Smart Chain utxo. These features are the foundation of a CC-related Antara Module. + +OP_CCC provides many relatively convenient use cases, and the developer can expand on these use cases when necessary. For example, a standard use case of OP_CCC is a `1of1` CC script. This type of CC transaction requires only 1 signature, and is accompanied by a few custom constraints. Many of the current default Antara Modules rely on the `1of1` script OP_CCC. + +A more intricate use case of OP_CCC, on the other hand, can be found in the upcoming Payments Module. This module uses a `1of2` CC script, which allows for one of two signatures to sign a CC transaction, and the script also features several customized constraints. + +---------- + +[Link to Next Tutorial in the Advanced Series](../../../basic-docs/antara/antara-tutorials/advanced-series-2.html) + +# Advanced Series — Antara Module Development Basics + +## The Eval Code + +In the Komodo source code, each Antara Module has an associated arbitrary number, called an "eval" code. This code can be any digit between `0` and `255`, there can be only one code per module, and each code is currently one byte in size. To add a new Antara Module, the developer begins by adding a new eval code to the table of all active eval codes on their Smart Chain. + +We define all eval codes in the [~/komodo/src/cc/eval.h](https://github.com/jl777/komodo/tree/jl777/src/cc/eval.h) file. The following eval codes represent the essential, default modules in a Smart Chain. + +```C +#define FOREACH_EVAL(EVAL) \ + EVAL(EVAL_IMPORTPAYOUT, 0xe1) \ + EVAL(EVAL_IMPORTCOIN, 0xe2) \ + EVAL(EVAL_ASSETS, 0xe3) \ + EVAL(EVAL_FAUCET, 0xe4) \ + EVAL(EVAL_REWARDS, 0xe5) \ + EVAL(EVAL_DICE, 0xe6) \ + EVAL(EVAL_FSM, 0xe7) \ + EVAL(EVAL_AUCTION, 0xe8) \ + EVAL(EVAL_LOTTO, 0xe9) \ + EVAL(EVAL_MOFN, 0xea) \ + EVAL(EVAL_CHANNELS, 0xeb) \ + EVAL(EVAL_ORACLES, 0xec) \ + EVAL(EVAL_PRICES, 0xed) \ + EVAL(EVAL_PEGS, 0xee) \ + EVAL(EVAL_TRIGGERS, 0xef) \ + EVAL(EVAL_PAYMENTS, 0xf0) \ + EVAL(EVAL_GATEWAYS, 0xf1) +``` + +As the eval code must range between `0` and `255`, a Smart Chain can have up to 256 total modules. The developer of a Smart Chain can determine which modules to add from the available modules in the ecosystem. At this time, we do not yet have 256 total modules, and therefore there is no need to choose. + +#### Validation Code + +The developer adds validation code that will be executed any time the daemon encounters a transaction bearing the relevant module's eval code. + +This is where the true power of CC begins. When validating a normal transaction, the daemon has access only to information included in the transaction itself. With a CC transaction, however, the daemon is running arbitrary code, and therefore anything is possible. The validation code can look trough the blockchain history, observe transactions in the mempool, and even utilize Antara's cross-chain technology. + +Technically, OP_CCC scripts do not have a required structure. The scripts only need to follow the general structure of the initial layout. The developer may follow the general guideline, as provided in our templates and tutorials. This allows the developer to code and debug their OP_CCC related modules in an efficient manner. + +#### Flexbile Pubkey Expression + +To understand how CryptoConditions (CC) manages addresses and scripts, the developer should first understand a few basic concepts regarding pubkeys. + +Originally, Bitcoin pubkeys were 64 bytes, as opposed to the 33 byte pubkeys of today. The 64 byte pubkeys had a left half and a right half which were used for internal functions in the daemon. Using cryptographic methods, a developer could derive the left half of the function from the right half, and vice versa. + +Early Bitcoin developers took advantage of the ability to derive one half of the pubkey from the other, and compressed the pubkey to a smaller size. They also instituted prefixes that informed the daemon whether the pubkey was odd, even, or large (`02`, `03`, and `04` respectively). In the end, the developers compressed the 64 byte pubkey into a 33 byte version. + +Today, there are multiple ways to express a pubkey. There are compressed and uncompressed versions of the pubkey, and the pubkey can also be expressed as two different base58 encoded addresses. All of these are associated with the same private key. + +#### Pubkeys and CC Addresses + +When working with software based on the Bitcoin protocol, a common problem a developer encounters is found in creating an address that is associated with a script. A frequent solution is to hash the script and use the hash as the address. Komodo uses this solution in the Antara CC implementation. Using this method, the CC script serves as the CC address. + +With this in mind, the essential structure of a CC script is as follows. (The automatically generated content is handled by the daemon's internal functions and can be ignored.) + +``` +evalcode + pubkey + automatically generated content +``` + +Each CC script utilizes the eval code of the module to which the CC script belongs. Since the CC script includes both the pubkey and the module's unique eval code, a pubkey makes a unique CC address for each module. + +Funds that are sent to a CC address can be spent only by the module with the appropriate eval code, and therefore funds created and associated with an eval code maintain scarcity within this module. + +A common and simple CC script exists in nearly all of the default Antara Modules. The structure of this script consists of a single signature from a pubkey and CC validation. This is essentially the equivalent of a P2PK Bitcoin script; the CC validation returns `true` or `false`, whereas the P2PK Bitcoin script returns `1` or `0`. + +#### Global CC Address + +By convention, each Antara Module has a global CC address where the privkey is publicly available. As usual, spending from this global CC address requires that the spender meet all validation rules set forth by the developer. Therefore, the lack of privacy for the private key is not an issue. + +One purpose for this global CC address is to create a repository that is global (within the module) for information regarding specific instances of this module on the chain. + +For example, typically the design of an Antara Module requires that each time a user initiates an instance of the module, the user also sends a small amount of funds to this global CC address. This transaction contains data about the instance the user desires to create. Other users on the network can retrieve the data in this global CC address, and thereby gain knowledge about the current state of all module instances on the Smart Chain. + +## Vector Inputs and Outputs + +A transaction in the Bitcoin protocol consists of input and output vectors, called "vins" and "vouts" for brevity. The vins take funds from utxos, combine them into one "spend" transaction, and create new vouts. Some of the vouts may be new utxos. + +``` +vin0 + vin1 + ... + vin[n-1] -> vout0 + vout1 + ... vout[n-1] +``` + +Each of the vouts has a spend script that must be satisfied before the vout can be spent. + +Suppose vout0 is a normal utxo with a small amount of funds and the receiver of this utxo desires to spend it. They create a new transaction with a vin that consumes vout0. This vin must satisfy any scripts that are contained in vout0. + +#### CC Enhances the Script Between Vin and Vout to Advanced Levels + +A key power of CryptoConditions (CC) is the ability to enhance the script that must be satisfied between a vin and a vout. In CC, the vout contains the logical condition, and the vin contains the logical fulfillment. + +With access to arbitrary code, CC allows the Bitcoin protocol to rival the "smart contracts" common on other platforms. Yet, CC accomplishes this without requiring the virtual-machine counterpart that other smart-contract platforms require. Instead, the consensus mechanism is directly engaged with the scripts in the vins and vouts of transactions. + +The Bitcoin protocol's consensus mechanism is constantly placed under the most intense of pressure in the industry, and therefore is likely the most reliable consensus mechanism available. The ability to engage the consensus mechanism in arbitrary code while not changing the consensus mechanism itself grants Antara security and stability. The utxo system of the Bitcoin protocol also reduces the likelihood that modules themselves will contain bugs internally. (The reader should note that CC cannot eliminate attack vectors altogether.) + +#### The Many Possibilities of OC_CHECKCRYPTOCONDITION + +Consider the implications of the combination of possibilities contained in this new opreturn, OP_CCC. As there can be up to 256 eval codes per Smart Chain, there can be up to 256 different types of CC outputs per chain. Each CC transaction can contain multiple vins and vouts, each of which provides CC related fulfillments and conditions. Also, each module has a globally available CC address to allow for chain-wide functionality, making the possibilities per vin or vout 257. + +Observe the essential structure of a transaction with 3 vins and 2 vouts. + +``` +vin0 + vin1 + vin2 -> vout0 + vout1 +``` + +With the possibilities of OP_CCC, the combination allows for 1.12e+12 possibile combinations. + +``` +257 * 257 * 257 * 257 * 257 = 1.12e+12 +``` + +This is a dramatic increase in the possibilities over the limits of the original Bitcoin protocol. + +While the possibilities of a transaction are essentially limitless, the developer must create validation code that ensures the module and its transactions function as intended. Therefore, in practice the developer often limits the possibilities to `1` to `3` types per vin or vout. + +## Introduction to the Remote Procedure Call (RPC) + +A Remote Procedure Call (RPC) allows a module developer the ability to offer easy access to their module's functionality. The role of the RPC calls are to create properly signed raw transactions that are ready for broadcasting. + +The developer places the command name of each RPC they desire to create into a table in the CC source code. From this table, the built-in komodo-cli software is able to access and execute the RPC. In this manner, developers of all skills levels can integrate Antara Modules into other software. + +Antara Modules can have any RPCs the developer desires, or even have no RPCs. By convention, each Antara Modules has a few default RPCs: `address`, `list`, and `info`. For example, the Dice module has, `diceaddress`, `dicelist`, and `diceinfo`. Respectively, these RPCs return information about a CC-related address, the list of all instances of this module on the Smart Chain, and information about the chain-wide state of the module. + +## Creating a Global CC Address + +The following code from the Faucet module serves as an example of the manner in which we begin the creation of a global CC address for this module. + +```C +const char *FaucetCCaddr = "R9zHrofhRbub7ER77B7NrVch3A63R39GuC"; +const char *FaucetNormaladdr = "RKQV4oYs4rvxAWx1J43VnT73rSTVtUeckk"; +char FaucetCChexstr[67] = { "03682b255c40d0cde8faee381a1a50bbb89980ff24539cb8518e294d3a63cefe12" }; +uint8_t FaucetCCpriv[32] = { 0xd4, 0x4f, 0xf2, 0x31, 0x71, 0x7d, 0x28, 0x02, 0x4b, 0xc7, 0xdd, 0x71, 0xa0, 0x39, 0xc4, 0xbe, 0x1a, 0xfe, 0xeb, 0xc2, 0x46, 0xda, 0x76, 0xf8, 0x07, 0x53, 0x3d, 0x96, 0xb4, 0xca, 0xa0, 0xe9 }; +``` + +For a template of this logic pattern, view the [CCcustom.cpp](https://github.com/jl777/komodo/tree/jl777/src/cc/CCcustom.cpp) file. + +[Link to CCcustom.cpp file](https://github.com/jl777/komodo/tree/jl777/src/cc/CCcustom.cpp) + +Note that at the bottom of the file there is a switch statement. There, the above values are copied into an in-memory data structure for each CC type. This allows the entire CC codebase to access the global CC addresses in a standard manner. + +To create a global CC address for a new module, follow these steps. + +#### Create a value using getnewaddress + +With the `komodod` daemon running, use the [getnewaddress](../basic-docs/smart-chains/smart-chain-api/wallet.html#getnewaddress) RPC with `komodo-cli` to get a new address. (You may use any Komodo Smart Chain, such as the KMD main chain, for this procedure.) + +Copy this value into the first line of the code. For example, in the Faucet code above the result is as follows. + +```C +const char *FaucetNormaladdr = "RKQV4oYs4rvxAWx1J43VnT73rSTVtUeckk"; +``` + +#### Retrieve the pubkey using validateaddress + +Use the [validateaddress](../basic-docs/smart-chains/smart-chain-api/util.html#validateaddress) RPC with `komodo-cli` to obtain the pubkey of the new normal address from the previous step. + +Place the returned value into the `[67]` line of code. + +```C +char FaucetCChexstr[67] = { "03682b255c40d0cde8faee381a1a50bbb89980ff24539cb8518e294d3a63cefe12" }; +``` + +#### Restart the Daemon with the pubkey + +Stop the daemon and restart with the [pubkey](../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#pubkey) launch parameter enabled. Use the pubkey from the validateaddress RPC as the pubkey value. + +#### Ensure the Myprivkey Function is Properly Enabled + +Check that the `if ( 0 )` statement is enabled in the `Myprivkey()` function in the `/src/cc/CCutils.cpp` file. + +#### Obtain the CCaddress + + + +Execute the `address` RPC call and use the returned value to complete the `CCaddr` line of code. + +``` +const char *FaucetCCaddr = "R9zHrofhRbub7ER77B7NrVch3A63R39GuC"; +``` + +#### Obtain the privkey in Hex Format + +From the response returned by the `address` RPC, use the hex value of the private key to complete the appropriate line of code. + +``` +uint8_t FaucetCCpriv[32] = { 0xd4, 0x4f, 0xf2, 0x31, 0x71, 0x7d, 0x28, 0x02, 0x4b, 0xc7, 0xdd, 0x71, 0xa0, 0x39, 0xc4, 0xbe, 0x1a, 0xfe, 0xeb, 0xc2, 0x46, 0xda, 0x76, 0xf8, 0x07, 0x53, 0x3d, 0x96, 0xb4, 0xca, 0xa0, 0xe9 }; +``` + + + +Stop the daemon and restart it using the new pubkey. + +#### Add the First RPC + + + +Add a line to the `/src/rpcserver.h` file to create the `address` function for the module. + +Update the commands array in the `/src/rpcserver.cpp` file. + +#### Copy the Existing Default RPCs to the New Module + +From the `/src/wallet/rpcwallet.cpp` file, copy and paste the existing RPC functions to create new versions for the new module. Change the eval code and customize the functions as desired. + +Add an entry into the `/src/cc/eval.h` file. + + + +## Introduction to Validation + +A large portion of Antara Module customization pertains to the manner in which the validation code constrains CC transaction input. + +The CC validation code is called at the time that the consensus mechanism is validating a CC transaction. The consensus mechanism only calls the CC validation code and waits for a response of `true` or `false`. Whether or not the CC validation code is effective is a matter for the developer to resolve. + +The developer is responsible for properly designing both the validation code and the RPC implementations. Both should work together to ensure that RPCs cannot create transactions that should not exist, and the CC validation code should only validate proper transactions. + +The CC validation code is already locked in the main loop of the Bitcoin protocol at the time the code is called. Care should be taken with the CC validation code to ensure that the code does not cause a deadlock on the chain. + +------------ + +[Link to Next Tutorial in Advanced Series](../../../basic-docs/antara/antara-tutorials/advanced-series-3.html) +# Advanced Series — Preparing for Heir Development + +This tutorial in the series assists the reader in preparing to later build a full simplified prototype of the default [Heir Antara Module.](../../../basic-docs/fluidity/fluidity-api/heir.html) + +The primary aim for buildling the Heir prototype is to give the developer direct engagement with Antara Module development, with a focus on the CryptoConditions (CC) aspects. This process will give the developer a better grasp of the broad potential of the Antara framework. + +Furthermore, in the process of completing this tutorial the developer will learn how the source code is organized. + +## A Conceptual Understanding of the Intended Product + +To gain an idea of the intended result, read the introduction of the Heir Module API. (Read until the start of the section named Heir Module Flow and then pause.) + +[Link to Introduction to the Heir Antara Module](../basic-docs/fluidity/fluidity-api/heir.html#introduction) + +The basic concept to understand is that the Heir module allows the owner of a Smart Chain digital asset to designate an inheritor of the asset, should the owner become inactive on the chain. + +In terms of design, this is a relatively straightforward Antara Module, which is one reason we use it here. + +## Complete the Heir Module Flow Section (Optional) + +Before we begin the development process, it may be helpful to first experiment with the flow of RPC commands for the existing Heir module. + +This section is optional, but recommended. + +At this point in the tutorial series, the reader can either create a new default Smart Chain to test the Heir Module, or they may use an existing Smart Chain, such as RICK. + +[Link to instructions to create a new default Smart Chain.](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html#creating-a-new-smart-chain) + +The reader will need to create a new default Smart Chain either way as a part of the tutorial, but if the reader chooses to use the RICK Smart Chain for this optional step, the reader has the opportunity to observe another Antara Module in action. This presents a learning opportunity. + +The module we refer to here is the [Faucet Antara Module](../../../basic-docs/antara/antara-api/faucet.html) + +#### On the Relevant of the Faucet Module + +The Faucet Module allows a user to tap into existing funds on a public Smart Chain. This module provides a simple example of the nature of an Antara Module for our study. + +Faucet allows a user to lock an arbitrary amount of funds within an Antara address. Other users on the network are able to withdraw funds from this Antara address in small portions. To prevent spam requests, Faucet requires a small amount of proof-of-work from the requesting user's node. + +From this outline, we observe the basic business logic of the Faucet module. The module involves storing funds in a designated address, the creation of a faucet that can disburse funds, and the ability to limit the rate at which funds are withdrawn. + +Compare this to our desired Heir module. The Heir module's business logic must allow a designated address the ability to inherit designated blockchain funds. + +In both cases, the module's business logic is bound to transactions. + +#### Launch the RICK Smart Chain (Optional) + +The live community test chain, RICK, has the Heir Module enabled and can serve the purpose of providing a live demonstration. + +Launch the chain as follows. + +```bash +./komodod -pubkey=$pubkey -ac_name=RICK -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 & +``` + +#### Create a pubkey + +Use the following guide to create an Antara pubkey and address on the RICK Smart Chain. + +[Link to Antara pubkey creation guide](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html#creating-and-launching-with-a-pubkey) + +#### Retrieve RICK Funds Using the Faucet Module + +To obtain funds on the RICK Smart Chain we utilize the Faucet Antara Module. + +```bash +./komodo-cli -ac_name=RICK faucetget +``` + +This returns a raw transaction that you must now broaadcast using [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) + +Wait a few moments, and then use the [getinfo](../basic-docs/komodo-api/control.html#getinfo) method to verify that your wallet now contains RICK funds. + +#### Complete Each API Method of the Heir Module + +With funds in your wallet, you are prepared to experiment with the API commands available in the Heir Module Flow section. We recommend experimenting with each command until you have executed each at least once. + +[Link to Heir Module Flow](../basic-docs/fluidity/fluidity-api/heir.html#introduction) + +## Transactions as a Data Source + +Transactions are a data source for Antara-based software. + +Transactions can store data in multiple forms. In the simplest form, transaction data records the movement of coins from one address to another. However, blockchain transactions are capable of storing additional data beyond simple coin movement. + +When we desire to place additional data into a transaction, we place this data into an OP_RETURN, or "opreturn" for short. + +Observe the following transaction data structure for the existing Heir module: + +##### Command + +```bash +./komodo-cli -ac_name=HELLOWORLD heirfund 0 5 MyDogHeir 037736c263991316c6a23397a982a1f8c18ae8642e944448162a93a824c31f9299 100 'http://billionaire.com/mywill md5=5385639869' +``` + +##### Response (annotated) + + + +The opreturn is the last output in a transaction, and this output is never spendable under any circumstances. The opreturn is the location where all Antara Module data is stored. We will demonstrate how this is accomplished further on. + +The opreturn vout contains two key-value pairs that are related to each other, `asm` and `hex`. The first, `asm`, is simply a less encoded version of the `hex` value. + +In the above example data structure, note how the value for the key, `asm`, begins with `OP_RETURN ... `, and is followed by additional hex-encoded data. The additional hex-encoded data is arbitrary, and can be used for any purposes a developer sees fit. + +Taking the value in the fully encoded key-value pair, `hex`, here is an approximate breakdown of the data. + +| Translation | Hex Value | +| ----------- | --------- | +| 6a | OP_RETURN | +| 4c85 | Encoded length of the following data. This value is not a string, the value is encoded in the Smart Bitcoin variable length format, and the value is not directly readable. | +| ea | Stands for "EVAL_HEIR". The eval code here tells the daemon that this is an Antara Module, and that the specific module is HEIR | +| 46 | Stands for "F", which is a letter marker to indicate that this Heir transaction is a "Funding" transaction | +| 210... | The remaining portion of the hex encoded data is not related to the core software, but rather to the arbitrary data designed by the developer. Maximum data length is 10000 bytes | + +In all modules, some of the hex-encoded data can be decoded using the [decodeccopret](../../../basic-docs/smart-chains/smart-chain-api/util.html#decodeccopret) command on the data contained in the `hex` key-value pair. In our example, the decoded data is as follows. + +```json5 +{ + "result": "success", + "OpRets": [ + { + "eval_code": "EVAL_HEIR", + "function": "F" + } + ] +} +``` + +When an Antara Module instance begins its life cycle an initial transaction is created. In our example, the transaction we see above is an initial transaction of a full, non-simplified Heir module. + +Note that the transaction takes value from normal inputs and sends it to CC outputs, as indicated in the `type` key-value pair. + +#### Value Taken From Normal vins + + + +#### Value Sent to CC vouts + + + +#### Key Takeaways + +The important aspect to note here is that an initial transaction of a module instance typically takes value from normal inputs and sends it to CC outputs. + +As time progresses, more transactions on the Smart Chain are performed under this module instance. Each of the module instance's transactions spends from the previous transaction outputs associated with the instance and creates new unspent transactions. This process effectively creates a [linked-list data structure.](https://en.wikipedia.org/wiki/Linked_list) + +With each transaction, the opreturn output is never spent, and remains in the blockchain as a source of Antara Module data (read only). + +----------- + +[Link to Next Tutorial in Advanced Series](../../../basic-docs/antara/antara-tutorials/advanced-series-4.html) +# Advanced Series — Final Conceptual Discussion + +Up to this point in the tutorial series we have discussed the general concepts of the Antara Framework and we have discussed initial preparations to build a simplified prototype of the Heir Antara Module. + +This section of the tutorial series reviews many of the conceptual aspects of the Antara Framework while also diving more thoroughly into technical details. + +This is the final conceptual discussion necessary before we begin writing code. + +## Understanding CryptoConditions + +According to the industry-wide CryptoConditions standard, a CryptoCondition is a logical expression evaluated on electronic signatures and hashes of transaction data. + +CryptoConditions are stored in the scripts of transactions and are evaluated by a supporting CryptoCondition C library. + +In a Komodo Smart Chain, the default CC library is included during the installation procedure. + + + +#### Antara Extensions to CryptoConditions + +In addition to the industry-standard CryptoCondition (CC) library, Komodo's implementation of CC integrates the ability to add arbitrary code into a Smart Chain's consensus mechanism. This allows developers to create essentially an unlimited number of application-specific transaction-validation rules. + +For example, in the Heir Module, if the heir attempts to claim funds, the validation code checks whether the owner of the fund has shown recent activity, according to a specified amount of time. The owner can show activity by either adding to or spending from the fund. If the owner has not shown signs of activity, the validation code allows the heir to claim the funds. + +Through CryptoConditions and Antara's extensions, the consensus mechanism can rule over the outcome of the cryptocondition logic and arbitrary validation code across the Smart Chain's decentralized network of nodes. + +#### Makeup of a CryptoCondition + +A CryptoCondition consists of two parts: + +- Part I: A condition that must be met + - This is stored in the transaction output's `scriptPubKey` +- Part II: A fulfillment + - This is stored in the `scriptSig` field of the input of the transaction that spends the above output + + +The condition (Part I) contains data that checks the CryptoCondition in "fingeprinted" form. + +The term, "fingerprinted," comes from the industry-wide standard CC library. To fingerprint data, the CC library acquires the target data, combines it with other data that the developer does not need to manage, and then creates a hash, or "fingerprint." + +For example, a condition can be a requirement that only a specific fingerprinted `pubkey` be allowed to spend this transaction output. + +The fulfillment (Part II) contains instructions and data about how the consensus mechanism should evaluate the CryptoCondition. For example, the fulfillment could include an instruction to check a spending-transaction's electronic signature as well as the the `pubkey` associated with this signature. + +To spend a CC output of a transaction, a node on the network sends a spending transaction that contains a CC input that fulfills the CC output's condition. The consensus mechanism of the Smart Chain checks that the fulfillment is correct. For this it uses the C CryptoCondition library to evaluate the fulfillment of the spending transaction. The result of this evaluation is checked against the condition stored in the previous transaction output. + + +For our example above of an electronic signature, the consensus mechanism runs the logical conditions and fulfillments of the CryptoCondition to verify the electronic signature with the provided pubkey. Then the validation logic calculates the fingerprint of the pubkey and checks it against the condition. + +In adding Cryptoconditions to the Antara framework, Komodo extended the original CC protocol by adding an additional aspect beyond the inputs and outputs. This additional part is called the EVAL CryptoCondition, or eval code. + +Each Antara Module has its own unique eval code. The eval code is a number between 0 and 255, and it identifies the specific Antara Module that is associated with a CC transaction. When the consensus validation logic encounters the Antara Module's eval code in a transaction input, the validation logic calls the module's validation function. + +The process of validation of an Antara Module's transaction is depicted on the diagram below: + +
+ + + +
+ +#### The Simplest form of a CryptoCondition + +The simplest CryptoCondition evaluates an electronic signature of a spending-transaction's `scriptsig`. Assuming the evaluation is successful, the spending-transaction is then able to spend funds from the output of another transaction. + +At first glance, you may be confused about why a CryptoCondition is useful in this event, as a normal blockchain protocol can already accomplish this task. + +The answer is that there is an important difference in the CryptoCondition implementation. When a CryptoCondition transaction output is spent, the Antara Module's code can enforce additional validation logic. This is accomplished via the eval code that is stored as a part of the CryptoCondition's inputs and outputs. We will describe this further in the Heir Module development section. + +The ability to enforce additional logic is the key difference that illuminates the power of Antara. For example, additional arbitrary validation code can include logic that allows a user to spend the output only at the appropriate time. The transaction output can be spent only via a spending transaction that has the matching fulfillment, and both the CryptoCondition and the Antara Module validation code evaluate to `true`. + +Even the basic CryptoCondition features offer more complex logical expressions than a normal Bitcoin Script. For example, with CC a spending transaction could be required to have signatures from at least `M` of `N` acceptable `pubkeys`. + +As logical conditions and subconditions can be added to a CryptoCondition as desired, the developer can utilize both the CryptoConditions features and customized module's validation code to build complex logic that governs the movement of Smart Chain assets. In this sense, Antara is an advanced evolution of the basic Bitcoin Script security features, such as pubkey or pubkey hash scripts. We will examine validation code in greater detail later in this tutorial. + +In this section, we became acquainted with the concept of logical conditions that are associated with transaction outputs, and logical fulfillments associated with spending-transactions. These two elements make up the rudimentary aspect of a CryptoCondition. + +There are yet other elements of an Antara-based CryptoCondition. One element is called the `EVAL` code, and it is stored in the CryptoCondition's inputs and outputs. We will touch on this topic soon. + +#### Antara Module as Data and Business Logic Layer of Business Application + +An Antara Module can be described as a combination of a data layer and a business-logic layer in an application. The data layer is the collection of transactions related to the Antara Module, and the business-logic layer is the module's arbitrary code. + +These two layers tie in with other layers in an Antara-based software application. For example, the software external to the blockchain could include a presentation layer, consisting of a Graphical User Interface (GUI) and other visual elements. External applications interact with an Antara Module via its RPC calls. + +Also, there can often be an additional oracle layer, wherein oracle software connects nodes to external data sources across the Internet. This can be the case in Antara-based software applications that make use of the [Oracles](../basic-docs/fluidity/fluidity-api/oracles.html#introduction) Antara Module. + +#### A Global CC Address in the Antara Framework + +Recall that each Antara Module has an associated global CC address. The private key to this global CC address is publicly available. The address can be used for such tasks as sharing funds between users of this module, and anyone can attempt to spend funds from this address. + +The following is an example of a global CC address created and assigned for the Heir module. + +```cpp +const char *HeirCCaddr = "RDVHcSekmXgeYBqRupNTmqo3Rn8QRXNduy"; +const char *HeirNormaladdr = "RTPwUjKYECcGn6Y4KYChLhgaht1RSU4jwf"; +char HeirCChexstr[67] = { "03c91bef3d7cc59c3a89286833a3446b29e52a5e773f738a1ad2b09785e5f4179e" }; +uint8_t HeirCCpriv[32] = { 0x9d, 0xa1, 0xf8, 0xf7, 0xba, 0x0a, 0x91, 0x36, 0x89, 0x9a, 0x86, 0x30, 0x63, 0x20, 0xd7, 0xdf, 0xaa, 0x35, 0xe3, 0x99, 0x32, 0x2b, 0x63, 0xc0, 0x66, 0x9c, 0x93, 0xc4, 0x5e, 0x9d, 0xb9, 0xce }; +``` + +| Function | Description | +| -------- | ----------- | +| HeirCCaddr | the global CC address itself | +| HeirCChexstr | the pubkey | +| HeirCCpriv | the privkey for the global CC address | +| HeirNormaladdr | The normal address for the same pubkey and privkey. Spending from this address does not validation by the Antara Module | + +In the Antara codebase, the global CC address is sometimes called the "unspendable" address. This is likely a reference to the fact that for any user to spend funds from this address, the spending transaction must pass the module's validation code. + +For example, the global CC address could store funds shared between several users. As a global CC address's privkey is publicly available, anyone might try to spend these funds. This is where the Antara validation code will exercise control over whom is allowed to spend funds, and by which rules. The RPC aspect of the Antara Module must prevent the creation of inappropriate transactions as well. + +A transaction can also send a nominal fee to the global CC address with the intention of turning this transaction's output into a search key (called a marker). To ensure these markers remain publicly visible forever, the module's validation code can disable spending for these markers. With this combination, the developer can use the `SetCCunspents` SDK function to enumerate all transactions in the global CC address, and thus discover the module's transaction history. + +## Antara Development Checklist + +Development requirements for each Antara Module: + +- Allocate a new `EVAL` code for your contract +- Assign a global address for the module +- Define the module's transactions + - This includes the structure of their inputs, outputs, and opreturn format +- Implement the common RPC functions that nearly all modules feature + - These are typically functions for retrieving a list of all of the module's initial transactions, and for retrieving user addresses and the global CC address +- Implement the module's specific RPC functions + - These are used to create the module-related transactions and to return relevant information about the module's data and state +- Implement the module's validation code + +## Antara Module Architecture + +From an architectural standpoint, an Antara Module is simply a C/C++ source file. + +
+ + + +
+ +There are two parts to the module's source file: the implementation of RPC's and the validation code. You also need to inform the basic komodod source code of your new Antara Module through the following steps. + +- Allocate a new eval code for your Antara Module in `src/cc/eval.h` +- add your module's global addresses and the validation code entry function into the registry of Antara Modules in `src/cc/CCcustom.cpp` + +#### RPC Implementations + +The first part of the Antara's module source file consists of the implementation of all Remote Procedure Calls (RPC's) for this module. These typically either perform transactions or query information about state and data. + +The developer must also implement high-level functions for any desired RPC commands that are called by the RPC engine and are responsible for converting the RPC data to native C++ data types. + +These functions should be added into an existing source in the `/src/rpc` directory. Alternatively, the developer might create his own RPC source file. + +A reference to the RPC-command functions should be added to the global RPC command table in the `/src/rpc/server.cpp` source file. + +With this properly completed, the Smart Chain daemon's compiler will automatically make each RPC available at the command line through the `komodo-cli` software and via the `curl` utility. + +Essentially all modules have at least these two RPC's. + +- XXXXlist + - This lists all initial transactions relevant to the module +- XXXXinfo + - This RPC typically also requires an additional input -- a transaction ID for which information is desired + - When called, the method then returns information about this transaction ID + +Include other RPC implementations as desired. + +#### Antara Module Validation Code + +The main purpose of Antara Module validation code is two-fold. First, it ensures that the structure of the sequence of an Antara Module related transactions and their data is accurate. Second, the validation code prevents inappropriate Antara-related transactions from entering the chain. In other words, module validation code should protect against malicious transactions, and this is the code's most important task. + +Antara Module Validation code is triggered anytime a node attempts to add a CC spending-transaction to the chain. + +A module's validation code is activated only when a transaction has at least one CC input that bears the module's `EVAL` code inside the scriptSig in the transaction. + +A module's initial transaction may not have a CC input. When this happens, the validation code is not triggered. Therefore, the transaction may be handled by the normal blockchain protocol. + +As an aside, when the developer needs to write code that validates a spending transaction that spends a utxo that has no CC inputs, the code must first validate the utxo as well. If the result of the validation of the utxo is `false`, then the code can also reject the spending transaction. We will delve into this topic in thorough detail further in the tutorial. + +#### The EVAL Code + +A unique 8-bit `EVAL` code is attached to each Antara Module. The `EVAL` code is used by the core Smart Chain daemon's transaction-validation code to route any relevant transactions to the appropriate module's validation code. + +The `EVAL` code itself is actually a simple CryptoCondition. The CryptoCondition tests for the byte value and, if the value is `true`, routes the result according to the core Smart Chain daemon's code. + +### Antara Module Transaction Structure + +
+ + + +
+ +A CryptoCondition (CC) input is called a "vin" and a CryptoCondition output is called a "vout". + +A CC transaction has one or more vins and one or more vouts. + +When creating a CC transaction, the transaction's vins can consume the vouts of previous transactions that were either related to CC, or not related. + +When they are not related to CC, the vin of the current transaction does not need to include a CC fulfillment. + +However, if the current transaction's vins are consuming vouts from a CC-related transaction, then the current transaction's vins must contain logical fulfillments that meet the requirements of the previous transaction's CC vouts. Also, the current transaction's CC vins contain the transaction id (txid) of the previous transaction. + +A CC transaction typically also has an opreturn vout that contains module data. + +#### Antara Module SDK + +Komodo is building an SDK for Antara Module development. The SDK is still in the early stages. Some of the SDK functions are already available, and can be found in the following source files: + +- CCtx.cpp +- CCutils.cpp +- cc.cpp +- eval.cpp + +We will return to the SDK functions when we discuss the Heir module development process. + +----------------- + +[Link to Next Tutorial in Advanced Series](../../../basic-docs/antara/antara-tutorials/advanced-series-5.html) +# Advanced Series — Developing the Heir Module Prototype + +## Heir Module Development + +Having finished an overview of the Antara development layout, we are now prepared to create a simplified prototype of the [Heir Module](../basic-docs/fluidity/fluidity-api/heir.html#introduction). + +#### Links to Heir Source Code and Building Instructions + +A complete working example of this simplified Heir CC module tutorial can be found at the following link. We invite the reader to download and review the final code while progressing through the tutorial. + +[Link to Simplified Heir Module](https://github.com/dimxy/komodo/tree/heir-simple) + +The source files are found in the following directories. + +- src/cc/heir.cpp +- src/cc/CCheir.h +- src/wallet/rpcwallet.cpp +- src/rpc/server.cpp +- src/rpc/server.h + +#### Downloading and Installing From Source + +At this time, the reader will need to have the Komodo Smart Chain source code available. The reader begins with this default source code and adds to it to create a new Antara Module. + +Instructions to download and build Komodo software is found here. + +[Link to Instructions for Building from Source](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#linux) + +## Begin Development + +Our tasks are the following: + +- Add a new `EVAL` code to represent this module +- Create a global CC address +- Define the Heir Module transactions + - vouts, or logical conditions + - vins, or logical fulfillments +- Implement the RPC interface +- Create the validation code + +## Create the EVAL Code + +In a previous section of this advanced series, we discussed the nature of creating a new EVAL code for an Antara Module. + +[Link to EVAL code instructions here.](../../../basic-docs/antara/antara-tutorials/advanced-series-2.html#the-eval-code) + +Review the above linked section and attempt to create an EVAL code on your own for this simplified Heir Module. + +When you are finished with your attempt, compare your results with the downloadable files for this tutorial. + +[Link to EVAL code source file in simplified Heir Module downloadables.](https://github.com/dimxy/komodo/blob/heir-simple/src/cc/eval.h) + +## Global CC Address + +We also recently discussed the method of adding a Global CC Address as a part of initiating a new Antara Module. + +[Link to Global CC Address instructions here.](../../../basic-docs/antara/antara-tutorials/advanced-series-2.html#creating-a-global-cc-address) + +Review the above linked section and attempt to create a Global CC Address on your own. + +When you are finished with your attempt, compare your results with the downloadable files for this tutorial. + + + +[Link to Global CC Address file in simplified Heir Module downloadables.](https://github.com/dimxy/komodo/blob/heir-simple/src/cc/CCcustom.cpp) + +## Heir Module Transactions + +We require three types of module transactions + +- an initial transaction with which a user creates the fund for inheritance +- a transaction for additional funding +- a transaction for spending funds by the owner or heir + +#### The Initial Transaction: Creating a Fund + +| Input/Output | Description | +| ------------ | ----------- | +| `vins.*` | Normal input
- The `*` notation implies that this can apply to any number of inputs
- These vins are typical of core blockchain software and not related to CC | +| `vout.0` | The `1of2` CC address that holds the funds that belong to the owner and, once available, to the heir | +| `vout.1` | The transaction fee to account for the `vout.0` amount above
- The amount in `vout.1` is used as a marker. We will discuss markers and their uses cases further on in the tutorial | +| `vout.2` | Normal change
- Recall that `change` is the leftover amount from the original utxo that the user does not intend to send to the destination address, and which the user desires to keep
- Any amount of leftover funds not included in the `change` utxo is forfeited to the miner of the block; this is how miners receive their mining fee | +| `vout.n-1` | OP_RETURN EVAL_HEIR 'F' ownerpk heirpk inactivitytime heirname
- This is the is the opreturn vout, and it contains any data relevant to the module
- The 'F' is a flag that indicates that this transaction is a "Funding" CC transaction
- `ownerpk` and `heirpk` respectively represent the pubkeys of the owner and heir
- Concerning `inactivitytime`, the owner should either make a donation to or spend from the `1of2` address within the `inactivitytime` amount of time to prevent opening the `1of2` address to the heir for spending.
- `heirname` is the name of this instance of the Heir Module | + +Through a funding transaction, the owner of the initial funds creates a "plan," which we can also call a "contract," and deposits funds for future spending. + +The initial funds are taken from the normal `vout` values of a utxo. The initial transaction of this plan can be the beginning of the relationship between the funds in the utxo and the Heir Module. + +The main funds for the plan are allocated to `vout.0` of our CC transaction. + +By design, and setting aside issues of timing, we desire that either the owner or the inheritor of the funds should be able to spend this utxo. We assume that the owner has one address, and the inheritor has another. To achieve this, we use an advanced CryptoConditions feature that states that either of two addresses can spend the funds. This is called a `1of2` CryptoCondition, and it is placed as a logical condition into `vout.0`. + +A fee is allocated to `vout.1`. This is used as a marker. The marker allows a developer to use a special SDK function, `SetCCunspents()`, to create a list of all initial transactions for the module. + +As usual, out of the remaining amount of our initial utxo, we need to send all that we desire to keep to our `change` address. + +Also, we need to leave an amount as an incentive for the miner. Any remainder beyond the sum total of our new `vout` values will automatically be allocated in this manner. We typically leave `10000` satoshis of our Smart Chain coin, by convention. + +Note the `F` letter in the opreturn structure. The `F` stands for "fund." By convention, the first byte of any opreturn is the `EVAL` code. The second byte is the transaction functional id, we use it to understand the transaction data structure in the opreturn. + +We also stored other relevant data in the opreturn: + +- The owner and inheritor pubkeys +- Inactivity time + - this is the amount of seconds during which the owner must exhibit activity to maintain sole control over the funds + - If the owner does not spend funds during this time period, the inheritor will gain the ability to spend these funds as well +- The descriptive name of this funding plan + +#### The Add Coins Transaction + +| Input/Output | Description | +| ------------ | ----------- | +| `vins.*` | normal inputs | +| `vout.0` | the funding CC `1of2` address for the owner and heir. This address consists of two parts: the owner and heir pubkeys. Either owner or heir can spend this vout | +| `vout.1` | normal change | +| `vout.n-1` | OP_RETURN 'A' fundingtxid HasHeirSpendingBegun | + +This transaction serves the purpose of adding more funds to the owner's address. The transaction uses normal coin inputs (non-CC) and sends them to the CC `1of2` address. + +We include the transaction id (txid) of the initial transaction in the opreturn to bind the add transaction to the plan. + +Note the functional id, `A`. This flag indicates that this transaction is an `add` type of funding transaction. + +#### The Claim Coins Transaction + +| input/output | description | +| ------------ | ----------- | +| vin.0 | normal input transaction fee | +| vin.1+ | input from CC `1of2` address | +| vout.0 | normal output, sent to the owner or the heir address | +| vout.1 | `change` to CC `1of2` address | +| vout.2 | `change` to user's address from transaction fee input, if any | +| vout.n-1 | OP_RETURN EVAL_HEIR `C` fundingtxid HasHeirSpendingBegun | + +This transaction allows either the owner or the heir to spend funds from this plan instance. + +To pay the transaction fee to the miners, the transaction has a normal input that draws from the wallet of the transaction creator. + +The transaction also has a CC input for spending the claimed value from the `1of2` fund address. + +As for outputs, the claimed value is sent to the claimer's normal address, allowing the claimer to spend funds as usual. Unspent or leftover "change" from the transaction is returned to the `1of2` address. + +We also indicate the normal `change`. + +The functional id, `C`, in the opreturn indicates that this is a "claim" type transaction. + +We also include all the same opreturn data as in the `A` transaction, include the `fundingtxid` and the `HasHeirSpendingBegun` flag. + +## Heir Module RPC Implementations + +#### heirfund + +For a user to call the `heirfund` RPC, the user will need to supply the name of the RPC and its parameters as arguments. + +We model the syntax as follows: + +```bash +./komodo-cli -ac_name=YOURCHAIN heirfund amount name heirpubkey inactivitytime +``` + +##### Descriptions of the heirfund Syntax + +| Argument | Type | Description | +| -------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| amount | (number) | The initial funding amount, in coins or tokens
- This parameter is considered to be the amount of tokens if the tokenid parameter is present) | +| name | (string) | The name of the heir funding plan (arbitrary) | +| heirpubkey | (string) | The heir's public key (in hexademical) | +| inactivitytime | (number) | The time (in seconds) that must pass without the owner executing an `heiradd` or `heirclaim` method, after which the address unlocks to the heir | + +#### Adding the Command to the Source File + +To add a new command to `komodo-cli` we open the `src/server.cpp` source file add a new element to the `vRPCCommands` array. + +```cpp + { "heir", "heirfund", &heirfund, true }, +``` + +| Object | Description | +| ------ | ----------- | +| heir | a common name for all heir contract RPC calls | +| heirfund | the name of the new command | +| &heirfund | the address of the RPC interface function | +| true | indicates that the command description will be shown in the help command output; placing `false` here would hide this RPC from the help menu | + +#### Add the RPC Function Declaration + +We add the RPC function declaration in the `rpc/server.h` source file. + +The declaration in this file is essentially the same across all RPC functions. + +```cpp +UniValue heirfund(const UniValue& params, bool fHelp); +``` + +### The Two Levels of an RPC Implementation + +There are two levels to an RPC implementation. + +The first level is a short RPC function that has the same name as the RPC command itself (such as `heirfund`). + +The body of this level is added to a source file in the `rpc/` subdirectory in the source code (for this example, we added the RPC functions for Heir Module in the wallet/rpcwallet.cpp). + +Creating a new RPC source file for each Antara Module's RPC functions is considered a best practice. + +This function checks the RPC parameters and the needed environment, and then forwards the RPC to the second level. + +To begin the RPC command, we declare the `heirfund` function and clear the global error object. + +```cpp +// heirfund command rpc-level implementation, src/wallet/rpcwallet.cpp +UniValue heirfund(const UniValue& params, bool fHelp) + + CCerror.clear(); // clear global error object +``` + +Recall that a Smart Chain must have the [ac_cc](../basic-docs/smart-chains/smart-chain-setup/smart-chain-customizations.html#ac-cc) and [ac_ccenable](../basic-docs/smart-chains/smart-chain-setup/smart-chain-customizations.html#ac-ccenable) customization parameters properly initiated for any Antara Module to function. + +Therefore, we check that the wallet and Heir Module features are available in the Smart Chain. We also check the RPC parameter's required number: + +Ensure that the wallet object is initialized: + +```cpp + if (!EnsureWalletIsAvailable(fHelp)) + return NullUniValue; +``` + +Ensure that the chain parameters needed for Antara Modules are correctly set. For example, [addressindex]() and [spentindex]() should both be enabled. Also, ensure that the Heir Module is enabled on this chain. + +```cpp + if (ensure_CCrequirements(EVAL_HEIR) < 0) + throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); + // output help message if asked or params count is incorrect: + if (fHelp || params.size() != 4 ) + throw runtime_error("heirfund funds heirname heirpubkey inactivitytime\n"); +``` + +Lock the user's wallet: + +```cpp + LOCK2(cs_main, pwalletMain->cs_wallet); +``` + +The `UniValue` object is a special type used to pass data in RPC calls. The `UniValue` object is native to all blockchains based on the Bitcoin protocol. For parameters, UniValue requires an array of UniValue objects. + +We must convert these UniValue objects into normal C/C++ language types, and then pass them to the second level of our module implementation. + +Convert the parameters from the UniValue type to their basic C++ types and add checks to ensure that the converted parameter values are correct. + +This content is abbreviated. [For links to the full source code and example files, click here.](../../../basic-docs/antara/antara-tutorials/heir-module-tutorial.html#links-to-heir-source-code-and-building-instructions) + +Note the method for parsing the hex representation of the pubkey parameter and converting it to a `CPubKey` object. + +```cpp + CAmount amount = atof(params[0].get_str().c_str()) * COIN; // Note conversion from satoshis to coins through a multiplication of 10E8 + if( amount < 0 ) + throw runtime_error("amount cant be negative"); + std::string name = params[1].get_str(); + std::vector vheirpubkey = ParseHex(params[2].get_str().c_str()); + CPubKey heirpk = pubkey2pk(vheirpubkey); + int64_t inactivitytime = atoll(params[3].get_str().c_str()); +``` + +Finally, call the Heir Module code, pass our values (now in C++ type format), and set these as the value of the final `result` object. Bear in mind that the returned value from the Heir Module code, `HeirFund`, returns a hexadecimal value. + +```cpp + UniValue result = HeirFund(amount, name, heirpk, inactivitytime); + RETURN_IF_ERROR(CCerror); // use a macro to throw runtime_error if CCerror is set in HeirFund() + return result; +} +``` + +[See the linked source code (line number is approximate.)](https://github.com/dimxy/komodo/blob/heir-simple/src/wallet/rpcwallet.cpp#L7740) + +### Second Level Implementation + +The second level of the RPC implementation is the transaction creation code. This resides in the `src/cc/heir.cpp` source file. + +#### Implementing heirfund transaction creation +The following content displays the skeleton of the heirfund RPC implementation. + +[For links to the full source code and example files, click here.](../../../basic-docs/antara/antara-tutorials/heir-module-tutorial.html#links-to-heir-source-code-and-building-instructions) + +```cpp +// heirfund transaction creation code, src/cc/heir.cpp +std::string HeirFund(int64_t amount, std::string heirName, CPubKey heirPubkey, int64_t inactivityTimeSec) +{ +``` + +Create a mutable version of a transaction object. + +```cpp + CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); +``` + +Declare and initialize an `CCcontract_info` object with Heir Module variables, such as our global CC address, our global private key, etc. + +```cpp + struct CCcontract_info *cp, C; + cp = CCinit(&C, EVAL_HEIR); +``` + +#### Adding Inputs to the Transaction + +Add inputs to the transaction that are enough to make a deposit of the requested amount to the Heir fund. Also add one fee to serve as a marker, and another for the miners. + +By tradition, we use a constant fee of `10000` satoshis. + +We use the `pubkey` from the komodod `-pubkey` launch parameter as the destination address for the funds withdrawn from the `1of2` plan address. + +We use a function in the CC SDK, `AddNormalinputs`, to add the normal inputs to the mutable transaction. + +```cpp + const int64_t txfee = 10000; + CPubKey myPubkey = pubkey2pk(Mypubkey()); + if (AddNormalinputs(mtx, myPubkey, amount+2*txfee , 60) > 0) { +``` + +The parameters passed to the `AddNormalinputs()` function are: + +- The transaction itself +- The user's pub +- The total value for the funding amount +- he marker and the miner fees +- The limit on the quantity of utxos the daemon can take from the wallet of the user + - Naturally, only utxos that are available via the wallet's private keys can be used for these inputs + +#### Adding Outputs to the Transaction + +According to our specification, we need two outputs: one for the funding deposit and one for the marker. + +Here, we use two CC SDK functions that are designed to create CC vouts. + +The first is `MakeCC1of2vout`. This creates a CC vout with a threshold of `2` addresses that can spend from the plan funds. We supply as arguments the two potential addresses, represented here as `myPubkey` and `heirPubkey`. + +`MakeCC1vout` creates a vout with a simple CryptoCondition which sends a transaction fee to the Heir Module global CC address. (This is returned by the `GetUnspendable()` function call below.) We need the global CC address so that we can both mark the transaction, and to find all Heir funding plans. + +You will always need some kind of marker for any instance of an Antara Module plan for at least the initial transaction. Otherwise, you might lose the instance's data in the blockchain. + +We call this a marker pattern in Antara development, and we will explore this later in the tutorial. + +This first statement creates a vout with a threshold CryptoCondition. This allows spending via one of two possible pubkeys. The statment then adds this vout to the transaction. + +Note the eval code, `EVAL_HEIR`. This triggers the Heir validation code whenever a Heir Module transaction occurs. + +The second statement creates a marker vout with a simple CryptoCondition. There is a small fee sent to the Heir Module's global CC address. The statement then adds this vout to the transaction. This vout will be used for retrieving the list of all instances of the Heir Module via the heirlist RPC. + +```cpp + mtx.vout.push_back( MakeCC1of2vout(EVAL_HEIR, amount, myPubkey, heirPubkey) ); + mtx.vout.push_back( MakeCC1vout(EVAL_HEIR, txfee, GetUnspendable(cp, NULL)) ); +``` + +Finish the creation of the transaction by calling the `FinalizeCCTx` function along with its parameters from the `cp` object, the `mtx` object itself, the owner's pubkey, and the transaction fee amount. + +Note the cast to `uint8_t` for the constants `EVAL_HEIR` and `F` function id. This is important, as the cast supposes a one-byte size for the serialization of these values. If this size was not inferred, then the type would be an `int`. + +Also, an opreturn object with the data from this module instance is passed. To create the opreturn object, serialize the needed ids and variables to a `CScript` object. + +```cpp + std::string rawhextx = FinalizeCCTx(0, cp, mtx, myPubkey, txfee, + CScript() << OP_RETURN << (uint8_t)EVAL_HEIR << (uint8_t)'F' << myPubkey << heirPubkey << inactivityTimeSec << heirName)); + return rawhextx; + } +``` + +In case the `AddNormalinputs()` function cannot find sufficient owner coins for the requested amount (including the transaction fee), we set the `CCerror` error object. + +```cpp + CCerror = "not enough coins for requested amount and txfee"; + return std::string(""); +} +``` + +Note that we do not need to add the normal change output here because the `FinalizeCCTx` function adds the change output for us. + +`FinalizeCCTx` also builds the transaction input `scriptSigs` (both normal and CC aspects), adds tx signatures to them, and returns a signed transaction in hexadecimal encoding. + +Also note the `E_MARSHAL()` function. This serializes variables of various supported types to a byte array. The byte array is then serialized to a `CScript` object. The object is stored in the `scriptPubKey` transaction field in the last opreturn vout with transaction data. + +There is also the mirror `E_UNMARSHAL()` function. This is used for unpacking opreturn data from a CScript object to C++ variables, and for further processing. + +The returned transaction is ready to be sent to the Smart Chain network using the [sendrawtransaction](../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) RPC. + +#### Implementing the heirclaim RPC + +As before, this implementation has two levels. The first level checks the required environment and converts the parameters. The second level creates the final transaction. + +##### heirclaim syntax + +```bash +./komodo-cli -ac_name=YOURCHAIN heirclaim fundingtxid amount +``` + +##### Add the RPC command to komodo-cli + +Add a new command to `komodo-cli` by adding a new element into the `vRPCCommands` array in the source file `src/server.cpp`. + +```cpp + { "heir", "heirclaim", &heirclaim, true }, +``` + +Using the previous section of the tutorial as an example, add an `heirclaim` RPC implementation in the `src/rpc/wallet.cpp` source file. + +Add the `heirclaim` declaration in the `src/rpc/server.h` header file. + +```cpp +// heirclaim command rpc-level implementation, src/wallet/rpcwallet.cpp + +UniValue heirclaim(const UniValue& params, bool fHelp) +{ + CCerror.clear(); // clear global error object +``` + +Check that the wallet is available. + +In case the user asks for help via the `--help` parameter, or in case the parameters are not correctly submitted, print a `help` message to the console. + +Also check that cc contract requirements are satisfied: + +```cpp + if (!EnsureWalletIsAvailable(fHelp)) + return NullUniValue; + if (fHelp || params.size() != 2) + throw runtime_error("heirclaim txfee funds fundingtxid\n"); + if (ensure_CCrequirements(EVAL_HEIR) < 0) + throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); +``` + +Lock the wallet: + +```cpp + LOCK2(cs_main, pwalletMain->cs_wallet); +``` + +Convert the parameters from `UniValue` to `c++` type: + +```cpp + uint256 fundingtxid = Parseuint256((char*)params[0].get_str().c_str()); + CAmount amount = atof(params[1].get_str().c_str()) * COIN; // Note conversion from satoshis to coins by multiplication by 10E8 +``` + +Call the `HeirClaim` transaction creation function and return the created transaction in hexadecimal. + +```cpp + UniValue result = HeirClaim(fundingtxid, amount); + RETURN_IF_ERROR(CCerror); // use a macro to throw runtime_error if CCerror is set in HeirFund() + return result; +} +``` +#### Transaction creation code for heirclaom RPC + +Implement the `HeirClaim` transaction creation code in the `src/cc/heir.cpp` source file. + +```cpp +// heirclaim transaction creation function, src/cc/heir.cpp +std::string HeirClaim(uint256 fundingtxid, int64_t amount) +{ +``` + +Start with creating a mutable transaction object: + +```cpp + CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); +``` + +Initialize the `cp` object: + +```cpp + struct CCcontract_info *cp, C; + cp = CCinit(&C, EVAL_HEIR); +``` + +Find the most recent owner transaction to calculate the owner's inactivity time. The helper function, `FindLatestOwnerTx()`, returns the latest transaction id, the `owner` and `heir` public keys, `inactivity time setting` value, and the `hasHeirSpendingBegun` flag value. + +```cpp + const int64_t txfee = 10000; + CPubKey ownerPubkey, heirPubkey; + int64_t inactivityTimeSec; + uint8_t hasHeirSpendingBegun; + uint256 latesttxid = FindLatestOwnerTx(fundingtxid, ownerPubkey, heirPubkey, inactivityTimeSec, hasHeirSpendingBegun); + if( latesttxid.IsNull() ) { + CCerror = "no funding tx found"; + return ""; + } +``` + +Check whether the inactivity time of the owner has surpassed the amount designated in the plan. The `CCduration` CC SDK function returns the time (in seconds) since the confirmation of the block that bears the provided transaction to the chain-tip block. + +If `hasHeirSpendingBegun` is already `true`, there is no need to also check the owner's inactivity time. + +```cpp + int32_t numBlocks; // not used + bool isAllowedToHeir = (hasHeirSpendingBegun || CCduration(numBlocks, latesttxid) > inactivityTimeSec) ? true : false; + CPubKey myPubkey = pubkey2pk(Mypubkey()); // pubkey2pk sdk function converts pubkey from a byte array to CPubKey object + if( myPubkey == heirPubkey && !isAllowedToHeir ) { + CCerror = "spending funds is not allowed for heir yet"; + return ""; + } +``` + +Create the claim transaction inputs and outputs. + +Add normal inputs for the transaction fee: + +```cpp + if (AddNormalinputs(mtx, myPubkey, txfee, 3) <= txfee) { + CCerror = "not enough normal inputs for txfee"; + return ""; + } +``` + +Get the address of the `1of2` threshold CryptoCondition output (where the funds were deposited). Add CC inputs for the requested amount. + +```cpp + char coinaddr[65]; + GetCCaddress1of2(cp, coinaddr, ownerPubkey, heirPubkey); +``` + +Add CC inputs for this address with the use of a custom function: + +```cpp + int64_t inputs; + if( (inputs = Add1of2AddressInputs(mtx, fundingtxid, coinaddr, amount, 64)) < amount ) { + CCerror = "not enough funds claimed"; + return ""; + } +``` + +Add a normal output to receive the claimed funds, and a CC change output for the remaining amount. + +```cpp + mtx.vout.push_back(CTxOut(amount, CScript() << ParseHex(HexStr(myPubkey)) << OP_CHECKSIG)); + if (inputs > amount) + mtx.vout.push_back(MakeCC1of2vout(EVAL_HEIR, inputs - amount, ownerPubkey, heirPubkey)); +``` + +Add normal change (if any), add OP_RETURN data, and sign the transaction: + +```cpp + return FinalizeCCTx(0, cp, mtx, myPubkey, txfee, CScript() << OP_RETURN << E_MARSHAL(ss << (uint8_t)EVAL_HEIR << (uint8_t)'C' << fundingtxid << (myPubkey == heirPubkey ? (uint8_t)1 : hasHeirSpendingBegun))); +} +``` + +In the opreturn we add a pair of standard ids: the CC `EVAL` code, the functional id, and the `fundingtxid` to serve as the funding plan identifier. + +The `hasHeirSpendingBegun` value is a special flag. When this value is changed to `1`, it indicates that the heir has spent funds in the fund at least once. Therefore, it is no longer necessary to check the inactivity time of the owner. + +Once `hasHeirSpendingBegun` is set to `true`, this flag should also be set to `true` in the following transaction OP_RETURN values. + +#### Implementations for heiradd, heirlist and heirinfo + +- `heiradd` allows a user to add more funding to a plan. +- `heirlist` is a standard RPC for all CC modules. This RPC outputs a list of all initial transaction IDs, which serve as the identifiers for each plan. +- `heirinfo` provides some data about a funding plan + +The implementation for these RPCs can be found in the github repository with the source code of this contract. + +[RPC implementation can be found here.](https://github.com/dimxy/komodo/blob/heir-simple/src/wallet/rpcwallet.cpp) + +[Transaction creation and retrieval code can be found here.](https://github.com/dimxy/komodo/blob/heir-simple/src/cc/heir.cpp) + +## Heir Module Helper Functions + +#### Simplified Add1of2AddressInputs() Function Implementation + +```cpp +// add inputs from cc threshold=2 cryptocondition address to transaction object, src/cc/heir.cpp +int64_t Add1of2AddressInputs(CMutableTransaction &mtx, uint256 fundingtxid, char *coinaddr, int64_t amount, int32_t maxinputs) +{ + int64_t totalinputs = 0L; + int32_t count = 0; +``` + +By default, the CC SDK function, `SetCCunspents`, fills the provider vector with a list of unspent cc outputs of the provided `coinaddr` Bitcoin address. + +For our Heir Module, we pass the `1of2` address where the plan's funds are stored. + +```cpp + std::vector> unspentOutputs; + SetCCunspents(unspentOutputs, coinaddr, true); // get a vector of cc uxtos for the address in coinaddr[] +``` + +Iterate through the returned uxtos and add those that are appropriate to the transaction's vin array: + +```cpp + for (std::vector>::const_iterator it = unspentOutputs.begin(); it != unspentOutputs.end(); it++) { + CTransaction tx; + uint256 hashBlock; + std::vector vopret; +``` + +Load the current uxto's transaction and check whether it has an opreturn in the back of the array of outputs. + +```cpp + if (GetTransaction(it->first.txhash, tx, hashBlock, false) && tx.vout.size() > 0 && GetOpReturnData(tx.vout.back().scriptPubKey, vopret) && vopret.size() > 2) + { + uint8_t evalCode, funcId, hasHeirSpendingBegun; + uint256 txid; +``` + +Check that the uxto matches this plan. + +```cpp + if( it->first.txhash == fundingtxid || // if this is our contract instance coins + E_UNMARSHAL(vopret, { ss >> evalCode; ss >> funcId; ss >> txid >> hasHeirSpendingBegun; }) && // unserialize opreturn + fundingtxid == txid ) // it is a tx from this funding plan + { +``` + +To add the utxo to the transaction's vins, set the utxo's vout number and transaction id in the transactions vins. Pass an empty call to the `CScript()` function in the `scriptSig` parameter. This will be filled by the `FinalizeCCtx` function. + +```cpp + mtx.vin.push_back(CTxIn(it->first.txhash, it->first.index, CScript())); + totalinputs += it->second.satoshis; +``` + +Stop once sufficient CC inputs are found. + +In the event that the `amount` parameter is `0`, add all available inputs to calculate all available funds. + +```cpp + if( amount > 0 && totalinputs >= amount || ++count > maxinputs ) + break; + } + } + } +``` + +Return the total amount of inputs added to the transaction's vin array: + +```cpp + return totalinputs; +} +``` + +#### Simplified Implementation of the FindLatestOwnerTx() Function + +To calculate the owner-inactivity time and to enable the heir to claim the funds, we implement the function, `FindLatestOwnerTx()`. + +This function iterates through the transactions of this plan, (which we can also call this instance of the Heir Module) and finds the owner's latest transaction. We pass into this function the initial funding txid of the plan we desire to inspect. + +The function returns the pubkeys of both the owner and the heir, the owner inactivity time, and a flag that indicates whether the heir has already spent funds from the `1of2` address. + +All returned values of the function are retrieved from the transactions' opreturns. + +```cpp +// find the latest owner transaction id +// this function also returns some values from the initial and latest transaction opreturns +// Note: this function is also called from validation code (use non-locking calls) + +uint256 FindLatestOwnerTx(uint256 fundingtxid, CPubKey& ownerPubkey, CPubKey& heirPubkey, int64_t& inactivityTime, uint8_t &hasHeirSpendingBegun) +{ + uint8_t eval, funcId; +``` + +Initialize the flag as though the heir has not yet spent any of their plan's funds. + +```cpp + hasHeirSpendingBegun = 0; +``` + +Initialize the following variables. + +```cpp + CTransaction fundingtx; + uint256 hashBlock; + std::vector vopret; + std::string name; +``` + +Load the initial funding transaction, check whether it has a correct opreturn, and de-serialize it. + +Check the transaction rules. Return an empty id if the funding transaction cannot not be loaded or is incorrect. + +```cpp + if (!myGetTransaction(fundingtxid, fundingtx, hashBlock) || // NOTE: use non-locking version of GetTransaction as we may be called from validation code + fundingtx.vout.size() == 0 || // no vouts, even opreturn + !GetOpReturnData(fundingtx.vout.back().scriptPubKey, vopret) || // could not get opreturn from the last vout + !E_UNMARSHAL(vopret, ss >> eval; ss >> funcId; ss >> ownerPubkey; ss >> heirPubkey; ss >> inactivityTime; ss >> name;) || // could not unmarshal opreturn + eval != EVAL_HEIR || // incorrect eval code in 1st byte + funcId != 'F') // incorrect funcid in the 2nd byte + return zeroid; +``` + +Initialize the CC contract object for the Heir Module's `EVAL` code. + +```cpp + struct CCcontract_info *cp, C; + cp = CCinit(&C, EVAL_HEIR); +``` + +Declare the `coinaddr` array and use the `GetCCaddress1of2` function to pass the array the `1of2` address that holds our funds. + +```cpp + char coinaddr[64]; + GetCCaddress1of2(cp, coinaddr, ownerPubkey, heirPubkey); +``` + +Get the vector with uxtos for the `1of2` address. + +```cpp + std::vector> unspentOutputs; + SetCCunspents(unspentOutputs, coinaddr, true); +``` + +Iterate through the returned uxto's to find the last funding or spending owner transaction: + +```cpp + int32_t maxBlockHeight = 0; + uint256 latesttxid = fundingtxid; // set to initial txid + for (std::vector>::const_iterator it = unspentOutputs.begin(); it != unspentOutputs.end(); it++) + { + CTransaction vintx; + uint256 blockHash; + std::vector vopret; + uint8_t eval, funcId, flagopret; + uint256 txidopret; + + int32_t blockHeight = (int32_t)it->second.blockHeight; +``` + +Retrieve the transaction from the returned array. Check and unmarshal the transaction's opreturn and check whether this transaction is from the relevant Heir plan. + +```cpp + if (myGetTransaction(it->first.txhash, vintx, blockHash) && // NOTE: use non-locking version of GetTransaction as we may be called from validation code + vintx.vout.size() > 0 && + GetOpReturnData(vintx.vout.back().scriptPubKey, vopret) && + E_UNMARSHAL(vopret, ss >> eval; ss >> funcId; ss >> txidopret; ss >> flagopret) && + eval == EVAL_HEIR && + (funcId == 'C' || funcId == 'A') && + fundingtxid == txidopret ) { +``` + +As the `SetCCunspents` function does not return uxtos in chronological order, order them by block height to find the latest utxo. + +```cpp + if (blockHeight > maxBlockHeight) { +``` + +Check whether this transaction indicates owner activity. Use a pair of CC SDK functions, `TotalPubkeyNormalInputs()` and `TotalPubkeyCCInputs()`, that iterate through the vin array to find if the transaction was signed with the owner's pubkey. + +```cpp + if (TotalPubkeyNormalInputs(vintx, ownerPubkey) > 0 || TotalPubkeyCCInputs(vintx, ownerPubkey) > 0) { +``` + +If this transaction represents owner activity, reset the latest txid to this current txid. + +Set the flag for the transaction opreturn. + +```cpp + latesttxid = it->first.txhash; + hasHeirSpendingBegun = flagopret; + maxBlockHeight = blockHeight; + } + } + } + } +``` + +Return the latest owner txid. + +```cpp + return latesttxid; +} +``` + +## Heir Module Validation + +#### Simplified Validation Function Implementation + +Validation provides the logic control of spent Antara-module value, and validation also provides the data added to the Smart Chain. + +Recall that validation code is invoked for a transaction at the time the CC-related value is spent (as opposed to only being invoked at the time the value is added). We trigger the invocation of this validation function when at least one transaction input is a CC input bearing this module's `EVAL` code. + +Validation code typically is not called for the CC module's initial transaction. Instead, we invoke validatation at the time the initial transaction is spent in a second transaction. + +One way to invoke validation for the first transaction when performing the second transaction is to load the initial transaction and validate it first. If the initial transaction turns out to be invalid, it can remain in the chain and is otherwise ignored. In this case, if a CC marker is used, it can be cleared and the transaction is removed from the RPC list output. + +#### Guidelines for Validation + +In our Heir Module prototype, we have three transactions to validate: the initial funding, the adding transaction that adds more funds, and the transaction that claims the funds. The first and second of these transactions do not have any CC vins, and therefore all are validated together with the transaction that claims the funds. + +Here are several common aspects of a module that require validation: + +- The basic transaction structure +- The basic data structure in the OP_RETURN + - Validation here ensures data integrity in the chain + - All OP_RETURNs should contain the `EVAL` code and functional id in the first two bytes +- Avoid all foreseeable attack vectors + - Ensure DOS attacks are eliminated, especially in the event of a malformed transaction + - Check the array size before use of any transaction +- Check the previous Heir Module transactions which this transaction spends and which have no cc inputs. This is accomplished by retrieving the transaction id from the opreturn and loading and validating the previous transaction + +#### Heir Module Validation Rules + +The following are the aspects of validation the Heir Module requires. + +- The initial funding transaction + - Validate that the `1of2` address accurately matches `pubkeys` in the opreturn +- The claiming transaction + - Validate that this transaction spends transactions from the same funding plan. This funding transaction id's values from the opreturn outputs of the previous transactions should match. (the previous transactions are often referred as `vintx` in code) +- Validate whether the heir is allowed to spend the funds + - Check whether the flag indicates that the Heir is already spending the funds + - Check whether enough time has passed since the last time the owner was active on the chain +- When validating, separate the owner's funding transaction from any other contributions to the `1of2` address + - Although the Heir Module is initiated based on the owner's initial transaction, nothing prevents other users on the Smart Chain from contributing funds + - Therefore, when validating, for each utxo contained in the `1of2` address, calculate whether or not the utxo's vins contain the owner's pubkey +- During the course of validation, we fully check opreturn format + +This validation logic is performed in the `HeirValidate()` function. The function is invoked whenever a CC transaction bearing the appropriate eval code occurs on the chain. When this eval code appears, the consensus mechanism calls the `HeirValidate()` function, executes the indicated validation code, and adds the transaction to the chain. + +#### HeirValidate() Implementation + +Explanation of code: + +- Transaction-validation entry function + - (This is actually a callback) +- Parameters + - `cpHeir` - Pointer to the module's variable structure + - `eval` - Pointer to the CC dispatching object + - Used to return invalid state + - `tx` - The transaction itself + - `nIn` - Not used in validation code + +```cpp +bool HeirValidate(struct CCcontract_info* cpHeir, Eval* eval, const CTransaction& tx, uint32_t nIn) +{ +``` + +Check that the basic transaction structure has the opreturn with the correct basic `evalcode` and `funcid`. + +::: tip + +There is no need to check the function ids of the (`F`) funding transaction or the (`A`) add transaction, as these transactions have no Heir CC vins. Therefore, we do not create validation code for them. + +::: + +```cpp + std::vector vopret; + if( tx.vout.size() < 1 || !GetOpReturnData(tx.vout.back().scriptPubKey, vopret) || vopret.size() < 2 || vopret.begin()[0] != EVAL_HEIR || + vopret.begin()[1] != 'C') + + // interrupt the validation and return invalid state: + + return eval->Invalid("incorrect or no opreturn data"); // note that you should not return simply 'false' +``` + +Decode the transaction's opreturn with the `E_UNMARSHAL` function. This function places the opreturn serialized data into several variables. One of them, the `fundingtxid` variable, is the transaction id (txid) of the initial funding transaction. We will use it further to find the latest owner transaction to check when the owner was last active on the chain. + +```cpp + uint8_t evalcode, funcId; + uint256 fundingtxid; //initialized to null + uint8_t hasHeirSpendingBegun; + if (!E_UNMARSHAL(vopret, ss >> evalcode; ss >> funcId; ss >> fundingtxid; ss >> hasHeirSpendingBegun;)) + // return invalid state if unserializing function returned false: + return eval->Invalid("incorrect opreturn data"); +``` + +Check that the `fundingtxid` is a valid txid: + +```cpp + if( fundingtxid.IsNull() ) + return eval->Invalid("incorrect funding plan id in tx opret"); +``` + +Here we come to a good place to load the initial transaction, check whether it exists, and whether it has a correctly formed opreturn. + +Call the `FindLatestOwnerTx()` function. This function obtains the opreturn parameters and the `hasHeirSpendingBegun` flag, and checks the initial transaction. + +```cpp + CPubKey ownerPubkey, heirPubkey; + int64_t inactivityTimeSec; + uint8_t lastHeirSpendingBegun; + uint256 latesttxid = FindLatestOwnerTx(fundingtxid, ownerPubkey, heirPubkey, inactivityTimeSec, lastHeirSpendingBegun); + if (latesttxid.IsNull()) { + return eval->Invalid("no or incorrect funding tx found"); + } +``` + +Log in the terminal that the daemon process is in the validation code: + +```cpp + std::cerr << "HeirValidate funcid=" << (char)funcId << " evalcode=" << (int)cpHeir->evalcode << std::endl; +``` +Prepare for validation rules that are specific for each function id (`F`, `A`, and `C`). + +```cpp + switch (funcId) { +``` + +For `F` and `A`, we return an invalid response, as the process should never be able to access these function ids. + +```cpp + case 'F': + case 'A': + return eval->Invalid("unexpected HeirValidate for heirfund"); +``` + +Validation for the claiming transaction. + +- Check whether we are spending the correct funding transactions + - For example, check that the transactions are from the correct module instance, as identified by the `fundingtxid` + - If incorrect, return `false` +- If the heir is claiming the funds, check that he is allowed to do so + - For example, check the inactivity time of the owner and whether the heir has already spent funds from the `1of2` address +- Check whether the new flag, `hasHeirSpendingBegun`, is set correctly + +Both of the following support functions, `CheckSpentTxns` and `CheckInactivityTime`, are in the `heir.cpp` source file. + +[Link to heir.cpp source file](https://github.com/dimxy/komodo/blob/heir-simple/src/cc/heir.cpp] + +```cpp + case 'C': + if (!CheckSpentTxns(cpHeir, eval, tx, fundingtxid)) + return false; + if (!CheckInactivityTime(cpHeir, eval, tx, latesttxid, inactivityTimeSec, heirPubkey, lastHeirSpendingBegun, hasHeirSpendingBegun) ) + return false; + break; +``` + +For unsupported function ids, return an invalid state. + +```cpp + default: + std::cerr << "HeirValidate() illegal heir funcid=" << (char)funcId << std::endl; + return eval->Invalid("unexpected HeirValidate funcid"); + } +``` + +If all rules pass, return a valid state. + +```cpp + return eval->Valid(); +} +``` + +#### Validation Code Errors + +During the development of validation code, you will likely receive validation errors when any CC module validation function returns an invalid state. + +For example, when sending a raw transaction, the daemon checks the transaction while adding it to the mempool. + +During this process, if the CC validation code returns an invalid state you will see the following error: + +```cpp +error code: -26 +error message: +16: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) +``` + +When this happens, check the server output for a more specific error description. The first line of the output contains the `eval->invalid()` message from your validation code. + +```cpp +CC Eval EVAL_HEIR Invalid: incorrect opreturn data spending tx 4b6e1ed868cf941dabf9edc7f675321bdb4258692ba02f56dc21100f88981ac4 +ERROR: CScriptCheck(): 7961fe4f9f3bdabef154404ea8ec7a11be1546febc34efe67faede8d930c0749:1 VerifySignature failed: Script evaluated without error but finished with a false/empty top stack element +ERROR: AcceptToMemoryPool: BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags 7961fe4f9f3bdabef154404ea8ec7a11be1546febc34efe67faede8d930c0749 +``` + +-------------- + +[Link to Next Tutorial in Advanced Series](../../../basic-docs/antara/antara-tutorials/advanced-series-6.html) +# Advanced Series — Miscellaneous + +This last tutorial in the Advanced Series provides miscellaneous information that our development team considered to be useful for prospective developers. + +Congratulations on finishing the Advanced Series. Make sure to reach out to the Komodo team to see if there are any bounties that you can fill with your new ability to create Antara Modules. And we welcome you to the Komodo ecosystem as a prepared developer. We look forward to seeing what you create. + +## Terminology + +| Term | Definition | +| ---- | ---------- | +| CryptoCondition, or CC | An encoded expression, coupled with a supporting C library, that allows the Smart Chain's consensus mechanism to check several types of logical conditions based on electronic signatures and hashes | +| Antara module | A collection of customized code that a developer adds into the default daemon to add unique functionality, including customized consensus rules and more | +| CC input | A transaction input, CC encoded. Typically spends value from a CC output | +| CC output | A transaction output, CC encoded | +| funding plan | The txid of an Antara Module's initial transaction, it is the identifier for all of the Antara module's CC transactions, related to this funding plan | +| normal inputs | Inputs spending value from normal transaction outputs (not CC outputs) | +| normal outputs | Not CC outputs, but normal transaction outputs (pubkey, pubkey hash, etc.) | +| OP_RETURN, opreturn | A special output in a transaction that holds user and module data. The output is prepended by an OP_RETURN script opcode and therefore spending from this output is impossible | +| tx, txn | Short for "transaction" | +| txid | Transaction id; a hash of a transaction | +| unspendable address | The global cc contract address, for which its public and private key are commonly known. This address is used for conditionally sharing funds between contract users. As the address's private key is not a secret, by default anyone can spend value from this address. However, CC validation code often applies business logic conditions and checks to ensure that only transactions that meet the given criteria are actually able to spend funds in this address | +| vin | An input, or an array of inputs, in a transaction structure (tx.vin) | +| vout | An output, or an array of outputs, in a transaction structure (tx.vout) | + +## CC contract patterns + +The following are useful patterns during Antara module development. + +#### Baton Pattern + +The baton pattern allows the developer to organize a single-linked list in a Smart Chain. + +To traverse a linked list using the baton method, start with the first transaction in any plan instance and iterate through the other transactions to collect properties in their opreturns. + +### Marker Pattern + +The marker pattern is used to place a mark on all similar transactions. This is accomplished by sending a small value to a common fixed address. Typically, we use the global CC address. + +You can also create either a normal marker or a CC marker for the purpose of finding transactions related to your module. + +When using normal markers, there is a small problem that is easily solved. The global CC address allows any user to spend its funds, and therefore anyone can spend your marker transaction. To overcome this, use the CC SDK function, `Settxids()`, to retrieve all transactions with markers in the CC contract list function. + +Another method is to create an unspendable CC marker. In this method, send a small value to a CC output with a well-known address. To retrieve the list of CC-marker transactions, use the CC SDK function, `SetCCunspents()`. This returns a list of transactions with unspent outputs for that known address. + +When using the unspendable CC marker method, in the validation code you should disable spending from this address. This prevents a scenario where spending from the address causes you to lose markers. (For example, if you were to allow for spending from this address using a burn transaction, the burn transactions would take the burned markers into a hidden state, thus removing the markers from the list of initial transactions.) + +In all cases, the CC module validation code should disable unauthorized attempts to spend any markers. + +Concerning the method that relies on the CC marker, if the global CC address is used for storing not only the marker value, but also other funds, you need to ensure that marker values are not spent. + +A code example for finding transactions marked with a normal marker: + +```cpp + std::vector > addressIndex; + struct CCcontract_info *cp, C; + cp = CCinit(&C, ); + SetCCtxids(addressIndex, cp->normaladdr, false); + for (std::vector >::const_iterator it = addressIndex.begin(); it != addressIndex.end(); it++) { + CTransaction vintx; + uint256 blockHash; + if( GetTransaction(it->first.txhash, vintx, blockHash, false) ) { + // check tx and add its txid to a list + } + } +``` + +Many other Antara modules contain examples for finding marked transactions in any CC module standard list function. + +::: tip + +The SetCCtxids() function requires that the Smart Chain [txindex](../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#txindex) launch parameter NOT be adjusted beyond the default and automatic settings. + +::: + +A code example for finding transactions marked with an unspendable CC marker: + +```cpp + std::vector > addressIndex; + struct CCcontract_info *cp, C; + cp = CCinit(&C, ); + SetCCunspents(addressIndexCCMarker, cp->unspendableCCaddr, true); + for (std::vector >::const_iterator it = addressIndexCCMarker.begin(); it != addressIndexCCMarker.end(); it++) { + CTransaction vintx; + uint256 blockHash; + if( GetTransaction(it->first.txhash, vintx, hashBlock, false) ) { + // check tx and add its txid to a list + } + } +``` + +::: tip + +The CCunspents() function requires the Smart Chain [addressindex](../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#addressindex) and [spentindex](../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html#spentindex) launch parameters to be set to `1`. + +::: + +#### Txidaddress Pattern + +You can use the txidaddress pattern to send value to an address from which the value should never again be spent. + +A function CCtxidaddr is available for creating an address that is not associated with any known private key. It creates a public key with no private key from a transaction id. + +For example, the [Payments]() Antara Module uses `CCtxidaddr` to create a non-spendable txidpk from the `createtxid`. Furthermore, the module also uses the `GetCCaddress1of2` function to create a `1of2` address from both the Payments module global pubkey and txid-pubkey. + +This allows the module to collect funds on a special CC address that is intended only for a particular type of creation transaction. Funds are sent to this address via the `MakeCC1of2vout` function. Only the Payments module global pubkey and txid-pubkey can successfully create transaction that can be sent to this special address. + +For this RPC, we also use the `vData` optional parameter to append the opreturn directly to the `ccvout` itself, rather than an actual opreturn as the last `vout` in a transaction. + + + +```cpp +opret = EncodePaymentsMergeOpRet(createtxid); +CPubKey txidpk = CCtxidaddr(txidaddr, createtxid); +std::vector> vData = std::vector>(); +if ( makeCCopret(opret, vData) ) + mtx.vout.push_back(MakeCC1of2vout(EVAL_PAYMENTS, inputsum-PAYMENTS_TXFEE, Paymentspk, txidpk, &vData)); +GetCCaddress1of2(cp, destaddr, Paymentspk, txidpk); +CCaddr1of2set(cp, Paymentspk, txidpk, cp->CCpriv, destaddr); +rawtx = FinalizeCCTx(0, cp, mtx, mypk, PAYMENTS_TXFEE, CScript()); +``` + +Using a modification to the `IsPaymentsvout` function, we can now spend a `ccvout` in the Payments module back to its own address, without needing a `markervout` or an opreturn. + +```cpp +int64_t IsPaymentsvout(struct CCcontract_info *cp, const CTransaction& tx, int32_t v, char *cmpaddr, CScript &ccopret) +{ + char destaddr[64]; + if ( getCCopret(tx.vout[v].scriptPubKey, ccopret) ) + { + if ( Getscriptaddress(destaddr, tx.vout[v].scriptPubKey) > 0 && (cmpaddr[0] == 0 || strcmp(destaddr, cmpaddr) == 0) ) + return(tx.vout[v].nValue); + } + return(0); +} +``` + +In place of the `IsPayToCryptoCondition()` function we can use the `getCCopret()` function. This latter function is a lower level of the former call, and will return any `vData` appended to the `ccvout` along with a `true`/`false` value that would otherwise be returned by the `IsPayToCryptoCondition()` function. + +In validation, we now have a totally different transaction type than the types that are normally available. This new type allows us to have different validation paths for different `ccvouts`, and it allows for multiple `ccvouts` of different types per transaction. + +```cpp +if ( tx.vout.size() == 1 ) +{ + if ( IsPaymentsvout(cp, tx, 0, coinaddr, ccopret) != 0 && ccopret.size() > 2 && DecodePaymentsMergeOpRet(ccopret, createtxid) ) + { + fIsMerge = true; + } else return(eval->Invalid("not enough vouts")); +} +``` + +## Various Tips and Tricks in Antara Module Development + +#### Test Chain Mining Issue + +On a test chain consisting of two nodes, we do not recommend that you set both nodes to mine. When there are only two nodes, a blockchain struggles more to achieve consensus, and the chain can quickly stop syncing properly. Instead, have only one node mine for the two-node test chain. + +#### Limits on AddNormalInputs() Function Calls per Transaction + +Keep the number of `AddNormalInputs()` function calls to one for each block of code that creates a transaction. + +As an example of why we should not exceed more than one call, we can look at the `FillSell()` function. This function calls `AddNormalInputs()` two times at once. The first time the `AddNormalInputs()` function must add a txfee and the second time it adds coins to pay for tokens. + +Let us suppose we have only two utxos in our wallet, one for `9,000,000` satoshis and another for `10,000` satoshis. In this case, when we execute the `FillSell()` function our large uxto is added during the first call and then we receive an error in the second call, `filltx not enough utxos`. + +Instead, we recommend that the developer place only one I think it is always better to combine these calls into a single call. + +#### Troubleshooting Node Syncing on Test CC Chain + +Sometimes, a developer may find after developing a new CC module that a node cannot sync with other nodes in their test network. Executing the [getpeerinfo](../basic-docs/smart-chains/smart-chain-api/network.html#getpeerinfo) shows fewer synced blocks than synced heads. The developer may also see errors in the console log on the malfunctioning node. + +When this happens, the cause is most commonly rooted in the CC module's validation code. For example, the developer may have changed validation rules, and in so doing may have rendered old transactions invalid in the node's state. + +A quick remedy in this situation is to [manually delete the blockchain data on the malfunctioning node and resync the network.](../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) Old transactions should pass validation, assuming the new validation code takes their situation into account. + +When resyncing the node is not a viable solution, another option is to use code logging and the gdb debug software to investigate the cause of failure. + +Yet another solution, if necessary, is to setup the validation code to only be effective after a certain block height. See the following example. + +```cpp +if (strcmp(ASSETCHAINS_SYMBOL, "YOURCHAIN") == 0 && chainActive.Height() <= 501) + return true; +``` + +You may also use the hidden `reconsiderblock` komodo-cli command to restart the malfunctioning node's syncing process at a desired block height. + +#### Deadlocks in Validation Code + +If komodod hangs while executing Antara module validation code, consider that some blockchain functions use locks. The combination of your validation code and the locks could be causing deadlocks in the consensus mechanism. If this is the case, use functions that are non-locking instead. + +For example, the `GetTransaction()` function is a locking function. Instead, use `myGetTransaction()` or `eval->GetConfirmed()`. +# Komodo Developer Path | Preparation + +## Introduction + +The following six guided tutorials cover introductory topics for a new developer in the Komodo ecosystem. This tutorial here guides the reader in creating and installing the necessary environment for the tutorials. + +The tutorials rely extensively on downloadable "docker images" of Komodo software. A downloadable docker image is an entirely self-contained virtual machine that holds installations of the software necessary to complete the tutorials. + +The developer does not need to alter or make any additions to the Komodo source code itself as a part of these tutorials. + +#### Full Overview of Komodo Developer Path Tutorials + +The following is a brief summary of the docker tutorial stages. + +- Install Development Environment +- Create a New Blockchain (10 minutes) +- Integrate the Faucet Module (5 minutes) +- Connect Your Programming Language to the Tutorials (10 minutes) +- Make an NFT (5 minutes) +- Build a Token DEX (30 minutes) +- Sync the community testnet blockchain RICK (or MORTY) +- Retrieve test coins from a website faucet +- Use a mobile wallet to send coins between your dev node and a community blockchain +- Repeat the tutorials and test with colleagues + +#### Menu Options in Docker Images + +The options from the main menu of the docker image are the following. + +- TUTORIALS + - Go through the tutorials, including starting a blockchain, run a faucet, create a token dex, use a MuSig Schnorr Signature +- RICK + - dPoW community testnet blockchain +- MORTY + - dPoW community testnet blockchain +- MAINT + - For basic maintenance of this guided tutorial application +- EXIT + - Return to shell + +## Rapid Summary (TL;DR) + +If the reader is in a hurry and does not have time to follow all of the instructions in Part I, the following three terminal commands accomplish the essential aspects of the full tutorial's objectives. + +```bash +docker pull komodocakeshop/dev-allinone-learn-kmd +``` + +```bash +docker run -it -p 127.0.0.1:9253:9253 komodocakeshop/dev-allinone-learn-kmd +``` + +```bash +learn-kmd +``` + +After the last command, follow the onscreen instructions. + +From here, the reader may optionally skip all of the following content and proceed directly to the next article in this tutorial series. + +## The Unique Nature of the Docker-Image Tutorials + +These guided tutorials are different from many other developer tutorials in the Komodo documentation. + +Normally, a developer builds the Komodo software from source. In the tutorials here, however, the developer downloads a "docker image." + +A docker image can be described as a complete, self-contained virtual machine that already bears all necessary software installed. This includes the Komodo software, the Zcash parameters, and any necessary instances of Smart Chains. + +Once the docker image is downloaded and initiated in the terminal, the developer can utilize all installed software as normal. + +In this tutorial, the docker container contains two starting nodes. + +If the reader is not familiar with docker, do not worry. These tutorials use docker only as a development tool, and not as a complex deployment strategy. + +The tutorial's image uses the default docker network. Advanced docker users are welcome to adjust docker settings as desired. + +#### Sending Commands to the Docker Image's Seed Node + +The developer uses a text console within the docker container to controll the blockchain seed node during the guided tutorials. This text console interfaces with the `127.0.0.1` Remote Procedure Call (RPC) server. + +The guided tutorial features a preset chain called `TUT1`. The parameters of this chain are an initial coin supply of `1000` and an RPC port of `9253`. + +The `docker run` command specifies the RPC port as a passthrough port. This makes the port available outside the docker image, should the developer choose to integrate the docker image's Smart Chain, `TUT1`, with an external programming environment, such as Python or Node.js. + +Supported languages include all languages that can call RPC commands in the terminal, as well as those that can implement tools such as curl, postman, insomnia, and other similar development tools. + +The docker image is suitable for testing only; do not use the image in a production setting. + +The mining node RPC port is not passed through the docker container at runtime because it is randomly generated. The developer can reconfigure this setting, but the tutorials do not cover this topic. + +## Install Docker + +#### Estimated Time: 2 Minutes + +The following instructions are written for an Ubuntu 18.04 (LTS) user with root privileges. + +After completing the following steps, a non-privileged user may continue to use the docker image without further requiring the `sudo` command. + +```bash +sudo apt update +``` + +```bash +sudo apt install apt-transport-https ca-certificates curl software-properties-common +``` + +```bash +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +``` + +```bash +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" +``` + +```bash +sudo apt update +``` + +```bash +apt-cache policy docker-ce +``` + +```bash +sudo apt install docker-ce +``` + +```bash +sudo systemctl status docker +``` + +```bash +sudo usermod -aG docker ${USER} +``` + +```bash +sudo su - ${USER} +``` + +## Download Komodo Image + +#### Estimated Time: 3 Minutes + +The "all-in-one" Komodo image is available for development only. + +This image includes Komodo software and the Zcash parameters. + +```bash +docker pull komodocakeshop/dev-allinone-learn-kmd +``` + +#### (Optional) Install the Reduced-Size Docker Image + +If the reader already has the Zcash parameters installed, a smaller docker image is available. Use of this image is entirely optional; the only benefit it serves is a reduced storage-space footprint. + +```bash +docker pull komodocakeshop/dev-learn-kmd +``` + +#### Check the Local Image + +Once downloaded, check that the image is in your local docker catalogue using the `docker images` command. + +#### Command + +```bash +$ docker images +``` + +#### Expected Response + +```bash +REPOSITORY TAG IMAGE ID CREATED SIZE +komodocakeshop/dev-learn-kmd latest 3792dab98cce 2 days ago 992MB +``` + +## Start Komodo Development Container + +#### Estimated Time: 10 seconds + +Start the container. + +This drops into a bash prompt that is ready to start the guided tutorials. + +```bash +docker run -it -p 127.0.0.1:9253:9253 komodocakeshop/dev-allininone-learn-kmd +``` + +#### (Optional, for Smaller Docker Image Only) Mount the Local Zcash Parameters + +For users relying on pre-existing Zcash parameters and using the smaller Komodo docker image, mount the parameters as a read-only volume. + +```bash +docker run -it -p 127.0.0.1:9253:9253 -v /home/${USER}/.zcash-params:/root/.zcash-params:ro komodocakeshop/dev-learn-kmd +``` + +## Follow The Guided Tutorial Blockchain Starter Kit + +#### Estimated Time: 4 minutes + +The guided tutorial starts by automatically creating two sets of randomly generated keys that should be used throughout the tutorials. + +Alternatively, run everything from command line using the komodo-cli. + +## Begin Guided Tutorial + +#### Estimated Time: 20 seconds + +Type `learn-kmd` to start the guided tutorials. + +```bash +learn-kmd +``` + +
+ + + +
+ +The "quick start" menu opens with the following screen. + +
+ + + +
+ +------------------------------- + +[Click here to proceed to the next tutorial in this series](../../../basic-docs/antara/antara-tutorials/overview-of-development-on-komodo-part-1.md) +# Komodo Developer Path | Create a Blockchain + +## Create a Blockchain + +#### Estimated Time: 10 minutes + +The following tutorial uses the Komodo tutorial docker image to create a blockchain. This tutorial is part of a series. + +[To return to the previous tutorial, click here.](../../../basic-docs/antara/antara-tutorials/overview-of-development-on-komodo-part-0.md) + +#### Select the Appropriate Tutorial from the Menu + +Begin with the first guided tutorial by selecting `TUTORIALS` and then `TUT1` from the menu. The following screen should appear. Note the detailed instructions onscreen. You may follow these through the tutorial. + +
+ + + +
+ +#### Create a Seed Node + +##### Estimated Time: < 1 Minute + +The guided tutorial interface follows these screens: + +- From the `SEED-MENU` select `SPINUP-SEEDNODE` + +
+ + + +
+ +- Enter `1000` coins as the supply when prompted +- Use the `SEED-GETINFO` menu item to query the chain's current state + - At this time, you will notice that although our `TUT1` chain has started, the `GETINFO` menu item replies that the chain has `0` blocks + - This is due to the fact that the chain is still waiting for a mining node to mine blocks + +Return to the main `TUT1` menu. + +
+ + + +
+ +## Create Mining Node + +##### Estimated Time: < 1 Minute + +The `TUT1` chain is designed as a blocks-on-demand Smart Chain. This type of chain uses a Proof of Work consensus mechanism for the first 128 blocks, thus forcing the mining of these first blocks, regardless of the number of transactions occurring on the chain. After block 128, the chain stops automatically mining blocks and instead waits until there are a few transactions in the mempool. This style of chain saves computing resources. + +For the `TUT1` chain these settings are managed within the pre-built docker image. Later, you will learn how to adjust these settings manually. + +While the settings of the Smart Chain are set to blocks-on-demand, a node on the network has to indicate a desire to mine for the process to begin. Follow the instructions below to launch a mining node on `TUT1`. + +Go `BACK` in the menu until you see the options for both `SEED-MENU` and `MINING-MENU` + +
+ + + +
+ +Select `MINING-MENU`, then `SPINUP-MININGNODE`. + +Enter `1000` coins as the supply when prompted (we assume here that you entered 1000 coins earlier). + +Use the `GETINFO` command to query blockchain state. The chain will still have `0` blocks, but should have `1` connection. This is the connection to the seed node. + +## Start Mining + +##### Estimated Time: < 1 Minute + +- From the `MINING MENU` select `MINING-START` + - The mining process now begins + - Mining the first several blocks requires 30 to 90 seconds +- From the `MINING MENU` select `MINER-GETMININGINFO` + - This queries the mining state of both the network and this node + - You may see approximately 1.0 solutions per second (`localsolps`) + - You should see the number of blocks increase when you repeat the `MINER-GETMININGINFO` menu item + +
+ + + +
+ + +## Validate An Address + +##### Estimated Time: < 1 Minute + +The guided tutorial in the docker image automatically creates a blockchain address for the user during the startup process. + +Typically, when blockchain software creates an address for a user, the address is automatically imported into the user's wallet so that the user can use it. + +In these tutorials, however, we generate an address that is not automatically imported. This gives you a chance to import the address yourself under the tutorial guidance. + +Make sure that you are still in the `MINING-MENU` menu. + +Enter the `WALLET` section. + +
+ + + +
+ +- Select `VALIDATE` to call the [validateaddress](../../../basic-docs/komodo-api/util.html#validateaddress) Remote Procedure Call (RPC) method. + +
+ + + +
+ +The results should be similar to the following. + +
+ + + +
+ +Note the `address` in the response. This is the address that was generated for this tutorial. + +However, note that the `ismine` value is `false`. (`ismine` stands for "is mine".) + +The private key that was automatically generated by the docker image needs to be imported. + +## Import Private Key for the Wallet + +In the guided tutorials, you do not need to manage the private key directly. However, this is a good time to become familiar with the concept. + +A private key could look like the following. + +``` +E9873D79C6D87DC0FB6A5778633389_SAMPLE_PRIVATE_KEY_DO_NOT_IMPORT_F4453213303DA61F20BD67FC233AA33262 +``` + +When you enter a private key such as the above into the blockchain software, the automated encryption will match this address with a public key, also called a "pubkey". + +A pubkey can look like the following. + +``` +04fe53c78e36b86aae8082484a4007b706d5678cabb92d178fc95020d4d8dc41ef44cfbb8dfa7a593c7910a5b6f94d079061a7766cbeed73e24ee4f654f1e51904 +``` + +The public key is the address that receives and holds money. The private key unlocks the address and allows the user to spend money. + +Keep the private key private at all times. Never share it - not even with a member of the Komodo team. + + + +To import the private key that was automatically generated for you, select `WALLET`, then `IMPORT-DEV-WALLET`. + +This automatically executes the [importprivkey](../../../basic-docs/komodo-api/wallet.html#importprivkey) RPC method, importing the private key and thus the address. + +Now, when funds are sent to this address, your wallet has the keys necessary to spend them. + +## Check the Wallet Balance + +##### Estimated Time: < 1 Minute + +From within the `WALLET` menu, select `BALANCE`. + +This automatically executes the [getbalance](../../../basic-docs/komodo-api/wallet.html#getbalance) RPC method. + +
+ + + +
+ +Note that your wallet has the full `1000` coins, and a little extra. + +These `1000` coins were mined into your address as a reward for mining the first block of the blockchain. This is called the Genesis Block. + +The extra fraction of a coin should be of an amount similar to the displayed `.12532156` above. + +This extra fraction of a coin comes in part as a reward for the blocks mined. + +By default, each block mined on a Komodo Smart Chain rewards the miner with `0.001` coins. + +At the time the screenshot above was taken, the mining node had mined approximately `125` blocks, thus accounting for the extra fraction of a coin. + +## List Unspent Transactions (Utxos) + +##### Estimated Time: < 1 Minute + +The mining node holds the funds. The funds are represented on the blockchain as "unspent transactions," or "utxos." + +Utxos can be difficult for a complete beginner to understand. + +A utxo is similar in nature to a dollar bill in your physical wallet. You can have many bills in your wallet, and the total amount of bills you have determines your total amount in your wallet. + +Likewise, you can have many utxos in your digital wallet, and the total value of all utxos determines the total amount in your digital wallet. + +If you would like a full explanation, [read this post on the Komodo blog](https://komodoplatform.com/whats-utxo/), or read section III of the [Komodo Whitepaper](https://komodoplatform.com/whitepaper). + +In this guided tutorial, we will automatically execute a command that allows us to look at the utxos in our wallet. + +Still within the `WALLET` submenu, choose the `LISTUNSPENT` option. This executes the [listunspent]() RPC method. The result should be similar to the following. + +
+ + + +
+ +The number of utxos here will differ according to the number of blocks your mining node has mined. Each block mined generates a new utxo in your wallet. + +## Stop Mining + +##### Estimated Time: < 1 Minute + +The [setgenerate]() RPC method tells a node to start and stop mining. + +Within the `MINING` menu, choose the `MINING-STOP` menu item. + +The screen will flash and then return to the `MINING` menu. This indicates that mining is stopped. + +Recall that in this guided tutorial there are only two nodes on the `TUT1` blockchain, and that only one of the nodes is a mining node. + +As we have stopped the mining node, the blockchain itself is stopped. If we were to attempt to use the other node to send a transaction to the blockchain, no node would mine this transaction, and therefore the transaction would wait indefinitely for confirmation. + +## (Optional) Shut Down Both Nodes + +If you would like to exit the tutorial at this time, you may shut down both nodes from within the docker menu. + +- `MINING-MENU` -> `SHUTDOWN-NODE-MINER` +- `SEED-MENU` -> `SHUTDOWN-NODE-SEED` + +Otherwise, you may proceed with the tutorial series by clicking on the link below. + +-------- + +[Link to the next tutorial in this series](../../../basic-docs/antara/antara-tutorials/overview-of-development-on-komodo-part-2.md) +# Komodo Developer Path | Using a Faucet + +#### Total Estimated Time: 5 minutes + +This tutorial is part of a series. + +[To return to the previous tutorial, click here.](../../../basic-docs/antara/antara-tutorials/overview-of-development-on-komodo-part-1.md) + +## Introduction + +In the non-digital world, a faucet is a tap fitting of your regular bathroom or kitchen water supply. Faucets sometimes drip. + +A blockchain faucet is based on this concept. The digital faucet drips small amounts of coins to people that send a request to the faucet. + +In this tutorial, we use a Komodo technology called an Antara Module to create a faucet on our `TUT1` Smart Chain. + +There are many types of Antara Modules, and the [Faucet Antara Module]() is but one of them. + +Transferring funds via the faucet will allow us to perform other tasks further in the tutorials. + +#### The Expected Current State of Our TUT1 Smart Chain + +- The mining node has ~1000 coins +- The mining node has several utxos + - One large utxo with approximately 1000 coins + - Many small utxos, each having 0.0001 coins + - These utxos are rewards for mining blocks +- Both the mining node and the seed node should be running + - If you stopped the nodes at the end of the last tutorial, restart them using the `SPINUP` functions found within each node's menu +- The mining node should be set to mine + - To restart the mining node, use the `MINING-START` function in the `MINING-MENU` section + +#### Next Steps in the Tutorial + +- On the mining node we send some of our funds to the chain's built-in faucet + - To accomplish this, in this guided tutorial we use an automated version of the [faucetfund]() Remote Procedure Call (RPC) +- On the seed node, which currently has 0 coins, we send a request to the faucet for funds + +## Send All Funds to Self + +##### Estimated Time: 2 minutes + +We first consolidate all the utxos in our wallet, both large and small, into a single utxo. We send this consolidated utxo to the Antara Module that acts as a faucet. + +The reason we first consolidate the utxos into one is related to a subtle nuance of Antara Module technology. One requirement of all funds entering an Antara Module is that they must have been spent at least once before. This requirement simplifies some of the underlying code of an Antara Module. + +All the utxos in our current mining wallet were generated either in the first block, or they were generated as a part of a mining reward. Therefore, they have not yet been spent. + +To consolidate them in the guided tutorial, we use an automated version of the [sendtoaddress]() RPC. + +- Enter the `MINING-MENU` +- Enter the `WALLET` submenu and select `SENDALLSELF` + - This tutorial function performs several automated tasks + - First, the function checks our total balance using the getinfo RPC + - The function gathers the address that we saw earlier in the validateaddress RPC + - Finally, the function sends the entire amount to this address using the sendtoaddress RPC + - This sends everything in our wallet in a circular loop back into our wallet + +Wait for this transaction to be mined in a block. (This process is also called "confirming a transaction.") + +One way to check the status of the transaction is to use the `LIST` function from the last tutorial. Right after performing the `SENDALLSELF` function, you will have zero utxos in your wallet. Once a utxo reappears in your wallet, you know that the transaction is successfully mined. + +::: tip + +When you finally have a utxo in your wallet again, you will notice that you have two utxos instead of one. This may be surprising, but this provides a good opportunity to learn about "dust." + +The mathematics behind blockchain technology are complex, and transactions are rarely able to have perfectly clean total amounts. There is often a remnant of funds in the amount of a tiny fraction of a coin. These leftover funds remain in your wallet as a separate utxo, and as they are typically of such little value, they are effectively useless. This is why they are called "dust." + +::: + +## Send Funds to the Faucet + +##### Estimated Time: 1 minute + +In this guided tutorial, we use an automated version of the [faucetfund]() RPC. This takes any number of coins we choose from our wallet and sends them to the Faucet Antara Module. + +Once the funds are in the module, other users on the chain can request to have some of the funds. The funds are disbursed in small amounts, and the module has a feature that discourages users from spamming the faucet to drain all of the funds at once. + +- From the `MINING-MENU`, select `FAUCET` +- Select the `FUNDFAUCET` function +- Enter `200` as the amount of coins to send + - (This amount is arbitrary. We choose `200` for simplicity's sake.) + +## Claim a Small Amount of Funds from the Faucet + +##### Estimated Time: 5 Minutes + +Use the `BACK` function on each page until you again reach the option to choose between the `MINING-MENU` and the `SEED-MENU`. + +Choose the `SEED-MENU`. + +#### Validate the Seed Wallet + +Just as before, we want to make sure that we've imported our tutorial private key before we send any funds to any address. + +- Select `WALLET` and then `VALIDATE` +- If the proper `ismine` is `false`, we need to import the private key +- From the `WALLET` submenu, select `IMPORT-DEV-WALLET` + - This automatically performs the importprivkey RPC for us + +#### Claim Funds from the Faucet + +- Return to the `SEED-MENU` section. +- Select `FAUCET` +- Select `GETFUNDS` + +The `GETFUNDS` function in this guided tutorial is yet another automated version of an RPC. This time, the RPC is the [faucetget]() method. + +The faucetget method requests funds from the `TUT1` faucet. + +The Antara Module software automatically checks a few things to make sure that we are not attempting to spam and drain the faucet. One task the Antara Module requires is a small amount of work from our computer. The CPU of our computer will perform a few complicated encryption calculations. This may take a few seconds to perform. + +The time and electricity this consumes from our computer helps to offset any incentive a malicious actor would have when trying to drain the faucet. + +The Antara Module will also check to make sure that our `SEED` node's wallet history is relatively fresh. The `SEED` node is entirely separate from the `MINING` node's data directory, and therefore no issues are detected. + +## Check for the Returned Coins + +##### Estimated Time: 1 minute + +There are many RPCs available to check the balance of a wallet. + +A common RPC is the [getinfo](). This checks many aspects of the Smart Chain's current state, including the wallet's balance. + +One of the most common RPC's is the [getbalance]() method. This returns only information about the wallet's balance. + +A final example is the []listunspent]() RPC, which returns infromation about all utxos in the user's wallet. + +- In the `SEED-MENU` section, select `SEED-GETINFO` to perform an automated getinfo RPC + - In the response, look for the `balance` property + - There should be at least `0.1` coins in your wallet +- In the `SEED-MENU` section once again, select `WALLET` +- Within the `WALLET` submenu, select the `BALANCE` function to perform an automated getbalance RPC +- Also within the `WALLET` submenu, select `LIST` to perform the automated listunspent RPC + +---------------------- + +[Link to next tutorial section]() +# Komodo Developer Path | Connecting to Another Programming Environment + +#### Total Estimate Time: ~10-20 Minutes + +This tutorial is part of a series. + +[To return to the previous tutorial, click here.]() + +## Introduction + +Until now we have relied on automated functions in the guided tutorials for assistance in executing Remote Procedure Calls (RPC's). Such RPC's include getinfo, listunspent, faucetfund, and more. + +The very purpose of an RPC is to allow another programming environment to access the functionality of the software. For example, an RPC allows Python or JavaScript source code to send a secure call to the Komodo Smart Chain with a request to perform an action, and to return information about the result. + +All RPC's are available in any mainstream programming language, and we are now prepared to experiment with this feature. + +In this tutorial, we focus on the most essential aspect of this process, the Unix `curl` command. Using `curl` to access Komodo software from the source code of another environment is relatively straightforward, depending upon the programming language itself. + +The guided-tutorial software that holds our `TUT1` Smart Chain has an exposed RPC port that we use to connect to our seed node. + +#### Inquiring About Language Wrappers + +Before we continue with the tutorial, there is a tangential point to mention. + +In the Komodo community, for many popular programming languages there are available enhancements beyond the `curl` command. These enhancements allow a developer to more easily integrate with Komodo. + +In these languages, someone from the Komodo community has created a language "wrapper." A wrapper essentially allows a developer to import all the Komodo RPC calls directly into the source files of their chosen language. + +Therefore, the developer can often simply call the Komodo RPC suite into the source file and access each RPC on demand. + +For information regarding availability of language wrappers for your preferred language, please reach out to our team and to the community on [Discord.](https://komodoplatform.com/discord) + +## Obtaining the Necessary Passwords and Credentials + +##### Estimated Time: 1 minute + +The Smart Chain software controls access to all your valuable assets. Allowing other software on your node to access and manipulate these assets is a potential security risk. Therefore, the Smart Chain software requires a password and username from any software that attempts to access the Smart Chain's exposed port. + +These credentials are called the rpcpassword, rpcuser, and rpcport. + +The file that holds these values is typically installed in a `~/komodo/COINNAME/COINNAME.conf` file. You can change the values in this file before launching the Komodo software, and they will be loaded at runtime. + +In our guided tutorial, the name of our coin is `TUT1`, and therefore the name of the credential file is `TUT1.conf`. + +We have placed the `TUT1.conf` file for the `SEED` node in a different location, to allow for the underlying tutorial software to function properly. + +Here is the location: `/root/.komodo/TUT1/TUT1.conf` + + + +Obtain your `TUT1` RPC credentials and copy/paste them into a nearby location before continuing with the tutorial. + +## Using curl + +##### Estimated Time: 5 minutes + +#### Conceptualizing the curl Command + +A `curl` command must be sent to the Komodo software daemon through a Unix shell, or terminal. + +When using `curl` from another programming environment, the developer's source code first opens an instance of a Unix terminal. This is typically achieved through some type of environment enhancement. For example, a JavaScript developer might use Node.js to open a Unix terminal instance. The specific Node.js function the developer would use is [child_process.exec().](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) + +The developer's source file then creates a `curl` command that fulfills the intended purposes of the developer's software, and sends this `curl` command to the Komodo software daemon. + +The `curl` command sends a json reply, which the developer captures in their source code and utilizes in any manner the developer desires. + +#### Installing jq + +The returned json object is provided without human-friendly json formatting. + +To make json responses easier to read, Komodo developers typically make use of a third-party software called "jq". + +[You can download and install jq at this link.](https://stedolan.github.io/jq/) + +Once installed, with each `curl` command simply include a pipe and a call to jq, along with any desired jq optional parameters. Komodo developers typically include the `-r` parameter for raw outputs, to help jq interpret the raw string. + +## The Anatomy of a curl Command + +Observe the anatomy of a sample `curl` command, as executed in the terminal. For this example, we use the getinfo RPC. + +#### Command + +```bash +curl -s --user user3044755432:passd30f503069f140e8e0ffe4d3f1645a8eae8e923b20e6011630cc98880ec5c47320 --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"curl test\", \"method\": \"getinfo\", \"params\": []}" -H 'content-type: text/plain;' http://127.0.0.1:9253/ | jq -r '.result' +``` + +| Property | Description | +| -------- | ----------- | +| curl | the name of the Unix command | +| -s | the "silent" option; this prevents the shell from returning extraneous information about the command's progress | +| --user | informs the shell that there will be a username and a password directly following this property | +| userXXXX:passXXXX | the rpcuser and rpcpassword, as provided in the coin's .conf file | +| --data-binary | informs the shell that additional data should be included with the curl command, and that the data should be sent exactly as it is provided | +| "{ | begin the string that contains the data object; everything within this string is sent directly to the Komodo daemon for processing | +| \"jsonrpc\": \"1.0\" | informs the Komodo daemon that it is receiving a json rpc object, and that the object is formatted according to version 1.0 of the Komodo RPC's source code | +| \"id\": \"curl test\" | informs the daemon that the json object sent is a curl command | +| \"method\": \"getinfo\" | informs the daemon that the developer is using the [getinfo]() RPC | +| \"params\": [] | provides the required or optional parameters that accompany the Komodo RPC; in this case, the getinfo RPC does not have any parameters, and therefore the array is empty | +| }" | end of the string that contains the data object | +| -H | informs the shell that there is an extra http header to include | +| 'content-type: text/plain;' | the http character set parameter; states that the header is provided in plain-text format | +| http://127.0.0.1:9253/ | the http destination. The 127.0.0.1 tells the shell to serve the content to the node's localhost server. The :9253 extension is the rpcport, as provided in the coin's .conf file | +| \| jq -r | instructs the shell to pipe the response through the jq software; the -r instruction informs jq that this is a raw object | + + +The response to the getinfo RPC `curl` command is as follows. Note that this is a json string and the developer must actively convert the response into a json object. For example, in JavaScript the appropriate function is `JSON.parse()`. + +#### Response + +```json +{ + "version": 2001526, + "protocolversion": 170007, + "KMDversion": "0.4.0a", + "synced": false, + "notarized": 0, + "prevMoMheight": 0, + "notarizedhash": "0000000000000000000000000000000000000000000000000000000000000000", + "notarizedtxid": "0000000000000000000000000000000000000000000000000000000000000000", + "notarizedtxid_height": "mempool", + "KMDnotarized_height": 0, + "notarized_confirms": 0, + "walletversion": 60000, + "balance": 0, + "blocks": 0, + "longestchain": 0, + "timeoffset": 0, + "tiptime": 1231006505, + "connections": 1, + "proxy": "", + "difficulty": 1, + "testnet": false, + "keypoololdest": 1561227622, + "keypoolsize": 101, + "paytxfee": 0, + "relayfee": 1e-06, + "errors": "", + "pubkey": "030746f79b31d1bb46aa10ee8ee72a06eba7375ca0aca411fa684936457363cdad", + "CCid": 2, + "name": "TUT1", + "sapling": -1, + "p2pport": 9252, + "rpcport": 9253, + "magic": 230635964, + "premine": 1000 +} +``` + +## Mine on the Seed Node Using curl + +Use `curl` to tell the `SEED` node to begin mining the `TUT1` Smart Chain. Use the [setgenerate]() RPC for this function. + +Note that this RPC requires parameters in the `curl` command: `\"params\": [true,1]` + +#### Command + +```bash +curl -s --user user3044755432:passd30f503069f140e8e0ffe4d3f1645a8eae8e923b20e6011630cc98880ec5c47320 --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"curl test\", \"method\": \"setgenerate\", \"params\": [true,1]}" -H 'content-type: text/plain;' http://127.0.0.1:9253/ | jq -r '.result' +``` + +The setgenerate RPC always returns `null` as a response. + +#### Response + +```json +null +``` + +## Discover the State of Mining on the Seed Node + +Use the [getmininginfo]() RPC to ensure that the command executed successfully. + +#### Command + +```bash +curl -s --user user3044755432:passd30f503069f140e8e0ffe4d3f1645a8eae8e923b20e6011630cc98880ec5c47320 --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"curl test\", \"method\": \"getmininginfo\", \"params\": []}" -H 'content-type: text/plain;' http://127.0.0.1:9253/ | jq -r '.result'                   +``` + +#### Response + +```json +{ + "blocks": 1, + "currentblocksize": 1000, + "currentblocktx": 0, + "difficulty": 1, + "errors": "", + "genproclimit": 1, + "localsolps": 1.041666666666667, + "networksolps": 0, + "networkhashps": 0, + "pooledtx": 0, + "testnet": false, + "chain": "main", + "staking": false, + "generate": true, + "numthreads": 1 +} +``` + +## Stop Mining on the Seed Node + +To instruct the node to cease mining, we again use the [setgenerate]() RPC, but this time we provide the parameter as `false`. + +```bash +curl -s --user user3044755432:passd30f503069f140e8e0ffe4d3f1645a8eae8e923b20e6011630cc98880ec5c47320 --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"curl test\", \"method\": \"setgenerate\", \"params\": [false]}" -H 'content-type: text/plain;' http://127.0.0.1:9253/ | jq -r '.result'        +``` + +#### Response + +```bash +null +``` + +-------------------- + +[Proceed to next tutorial article in the series.]() + +# Komodo Developer Path | Understanding Tokens + +## Introduction + +Each Smart Chain in the Komodo ecosystem can act as a fully tokenizable platform. This provides many opportunities to the developer in creating on-chain assets that represent varying types of value for their users. + +For example, tokens can be used to represent real world assets, and users can then trade these tokens using Komodo's [Token DEX]() and [AtomicDEX]() features. The developer could also create tokens that provide incentives to their audience. Or, tokens can represent collectible assets. These are but a few examples of the usefulness of on-chain tokenization. + +## Conceptualizing Tokens + +#### A Token is a Satoshi + +All Smart Chain coins abide by the Bitcoin-protocol standard wherein 1 coin is divisible for up to eight decimal places: `1.00000000`. The smallest unit of a Smart Coin therefore is `0.00000001` coins. By convention it is called a "satoshi," in honor of the inventor of the Bitcoin protocol. + +On a Smart Chain, each individual token is derived from one individual satoshi. Therefore, each coin can be transformed into 100,000,000 tokens. + +At the time of the creation of these tokens, the creator can define their properties, grant meta data to them, and establish the nature of their scarcity. + +All of this functionality is established and secured through the [Tokens Antara Module](). + +#### Fungible Token Creation + +With `0.1` of our `TUT1` tutorial coins, we can create `10,000,000` tokens in one creation transaction using the [tokencreate](../../../basic-docs/antara/antara-api/tokens.html#tokencreate) RPC. + +In the process of creation we can choose a name for these tokens. + +All of the tokens created from this single transaction are fungible one with another, and maintain scarcity across the Smart Chain. + +*(It is even possible with Antara technology to maintain token scarcity across multiple chains, but this is an advanced topic that we do not cover here.)* + +#### Non-Fungible Token Creation + +Alternatively, rather than creating a large collective of many fungible tokens, you could instead create non-fungible tokens. To achieve this, use the tokencreate RPC to create one token at a time. Each token requires `1` satoshi, plus transaction fees. + +#### Attaching Data to Tokens + +We can attach meta data to the tokens at their creation. + +The maximum size of data that can fit in a single Komodo transaction is `10000` bytes. This is enough to include all sorts of data, and even simple images. + +The developer is naturally free to use their imagination in the design of this data. For example, you can describe their purpose and add a json data structure that informs other software of the properties of this token. + +Advanced developers can even add functionality to allow the tokens to gain new data over time as they are passed through transactions. + +## Create a Token Set on TUT1 Smart Chain + +In our guided tutorial, we now create `50,000` tokens that we give the name `GOLD`. + +- Enter the `SEED-MENU` +- Select the `TOKENS` submenu +- Select `CREATE` +- Enter the name `GOLD` +- Use `0.0005` tokens +- For the short description `Some GOLD tokens` + +This creates 50,000 GOLD tokens by sending 0.0005 TUT1 coins to the [Tokens Antara Module.]() + +Wait a minute or so for the transaction to be mined and then use the `GETINFO` function to check the balance of our wallet. There are now `0.0993` coins remaining from the `0.1` coins we had previously. + +We used `0.0005` coins to create the tokens. + +We had a fee paid to the miners of `0.0001` coins. + +We also had another fee of `0.0001` coins that were sent to a special address in the Tokens Antara Module, called the "global address." The transaction for this fee had a small amount of data that permanently tells the entire `TUT1` Smart Chain community that we created these tokens. Therefore, if other users or developers want to learn about our `GOLD` tokens, they have a starting point in this global address. + +## Seed or Mining Node RPC: tokenlist & tokeninfo to find details of the tokens + +To see our tokens afterwards, we can use the [tokenlist]() and [tokeninfo]() RPC's. + +In our guided tutorial, we have automated functions available to make this simpler. + +- `SEED-MENU` > `TOKENS` > `LIST` +- `SEED-MENU` > `TOKENS` > `INFO` > `GOLD` + +`LIST` calls the tokenlist RPC. This returns an array of token ids. A "token id" is the id of the transaction that created the token. We use this token id nearly every time hereafter when we transact with these tokens. + +`INFO` calls the tokeninfo RPC. This RPC requires the token id of the token we desire to inspect. In our case, we chose the `GOLD` token. + +
+ + + +
+ +## Create SILVER Tokens + +Repeat the process to create `SILVER` tokens. + +- `SEED-NODE` > `TOKENS` > `CREATE` +- Name: `SILVER` +- Amount: `0.002` +- Description: `Some SILVER tokens` + +Wait for confirmation and then verify that our `0.0993` TUT1 balance is reduced to `0.0971`. + +
+ + + +
+ +## Create ROCK Tokens + +- `TOKENS` > `CREATE` +- Name: `ROCK` +- Amount: `0.04` +- Description: `Some ROCK Tokens` + +Use the `LIST` function to find the token id for `ROCK`, and then use the `TOKENS` > `ROCK` function to retrieve the token's full information. We see the token id included as a part of the returned data. + +
+ + + +
+ +
+ + + +
+ +## Create a Non-Fungible Token + +Switch to the mining node. + +Recall that to create a non-fungible token, we simply use only one satoshi of the coin. + +- `MINING-MENU` > `TOKENS` +- `TOKENS` > `CREATE` +- Name: `NFT1` +- Amount: `0.00000001` +- Description: `First unique token` + +## Compare the Tokens on One Node Against the Other + +Check the balance of the `NFT1` token on both the `SEED` node and the `MINING` node. + +- `TOKENS` > `BALANCE` > `NFT1` + +Note that the balance is different for the two. + +
+ + + +
+ +
+ + + +
+ +## Tutorial Series Conclusion + +Thank you for following along on this introductory tutorial. + +We have covered many topics using our guided-tutorial software. + +To learn more about any particular aspect, visit the links below. + +If you are ready to proceed with the next tutorials in our educational series, return to the [Learning Launchpad]() section. + +- Create a new Smart Chain + - [Create a Default Smart Chain](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html#creating-a-new-smart-chain) + - [ac_name]() +- Create a coin supply + - [ac_supply]() +- Create and use a faucet + - [Faucet Antara Module]() +- Mine transactions + - [setgenerate]() +- Create fungible and non-fungible tokens + - [Tokens Antara Module ]() +# Gateways Module Tutorial + +## Tutorial + +In this tutorial, we will create a gateway that can serve to represent KMD. The following are the steps in the gateway-creation process: + +- Create a new asset chain and provide representative tokens +- Prepare a special oracle to monitor Komodo's chain state +- Bind the tokens and the oracle to our gateway +- Deposit KMD into the gateway +- Exchange tokens with other tokens on-chain +- Use the tokens to withdraw KMD + +Please ensure that you have the KMD main chain downloaded and synced before continuing further in the guide. + +Also, please open an empty text file and save all output transaction ids and hex-encoded data from each step. You will need the information at various stages. + +#### Manually Compile and Install Komodo From Source + +For this tutorial, please compile and install Komodo software from the source repositories. + +[Information on manual installations can be found at this linked documentation.](https://docs.komodoplatform.com/komodo/installation.html) + +#### Create a New Blockchain + +For this tutorial we will create a temporary asset chain called `HELLOWORLD` for educational purposes. + +Make sure that the total `ac_supply` of this asset chain is fairly large. `777777` coins will do for our purposes. + +[Follow these linked instructions](../installations/creating-asset-chains.html#creating-a-new-asset-chain) before continuing. + +Recall also that a user must have a `pubkey` enabled when interacting with a Custom Consensus asset chain. [View this linked material for an explanation.](../customconsensus/custom-consensus-instructions.html#creating-and-launching-with-a-pubkey) + +If desired, the reader may use an existing asset chain instead of a temporary educational chain. [Follow this link](https://github.com/jl777/komodo/blob/master/src/assetchains.old) for a list of asset-chain launch parameters. + +#### Create a Token to Represent an External Cryptocurrency + +For the GatewaysCC module to function it must have access to tokens that can represent an external cryptocurrency. We use the [Tokens](../customconsensus/tokens.html) CC module to this effect. + +#### Decide the Number of Tokens to Create + +We want the number of total tokens to be the maximum possible amount of the represented cryptocurrency that we expect to hold. + +Each token is created not from a full coin, but rather from a satoshi. + +For example, `1` HELLOWORLD coin creates `100000000` tokens. + +The HELLOWORLD satoshis should pair on a one-to-one basis with KMD satoshis. + +For our purposes, we will use `1000` coins of HELLOWORLD. + +#### Creating the tokens + +To create the tokens, execute the following command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencreate KMD 1000 KMD_equivalent_token_for_gatewaysCC +``` + +This creates a `100000000000` token supply of on-chain tokens with the name of `KMD`, which represent the external cryptocurrency, `KMD`. + +For more details on the above command, see [tokencreate.](../customconsensus/tokens.html#tokencreate) + +This command returns a hex value as a response: + +````json +{ + "result": "success", + "hex": "01000000022c223cfc9c3349aed24ca89e44af6fcdb030150443bd6ac55e2080ce4b097c3002000000484730440220316605c400c47e2d5aa6104ac5c5229e71683b8db9482efa1655d257690d338802202344f254b208a6d724f52f4503531cf005a8ca68119bde4b6cb281ab9fccaf1101ffffffff80e66c0c47311449c5effc2782134006f05fd31e79659bc4b0608d7e247e280c0000000049483045022100ec494d3fa5c76fe0382e83980affdfd091509fb4e18b20fff8c095374e6b6bee022015ddaf95dc8b03e8cbba00ff7a377b80a7bd2200a68669718c329c617549757701ffffffff0400a0724e18090000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc1027000000000000232102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702acc01f66fa15090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000396a37e3632103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc0354414b0e54657374696e672070686173652e00000000" } ``` +```` + +Select the hex value (`01000000022c223c...`) and copy it (CTRL + SHFT + C). + +Broadcast this value using [sendrawtransaction:](../komodo-api/rawtransactions.html#sendrawtransaction) + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex +``` + +This returns a string, and this string is our `tokenid`. + +```bash +315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf +``` + +Copy the `tokenid` into the text editor we opened at the beginning of the tutorial and keep it available for future use. + +Watch the mempool using [getrawmempool](../komodo-api/blockchain.html#getrawmempool) to verify that the `tokenid` is successfully mined: + +```bash +./komodo-cli -ac_name=HELLOWORLD getrawmempool +``` + +Once the `tokenid` disappears from the mempool the transaction is mined. + +If this asset chain were receiving full dPoW security services, at this point it would be appropriate to wait for notarization. We can use [getinfo](../komodo-api/control.html#getinfo) to watch for the `notarizations` property to increase: + +```bash +./komodo-cli -ac_name=HELLOWORLD getinfo +``` + +On this educational asset chain, however, we can continue without waiting for notarization. + +We can check to see that our token is successfully created on the chain using [tokeninfo:](../customconsensus/tokens.html#tokeninfo) + +```bash +./komodo-cli -ac_name=HELLOWORLD tokeninfo insert_token_id +``` + +We can check the balance of our `pubkey` using [tokenbalance:](../customconsensus/tokens.html#tokenbalance) + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenbalance insert_tokenid insert_pubkey +``` + +#### Create an Oracle + +We use the [oracles](../customconsensus/oracles.html) Custom Consensus module to add external data to the blockchain. + +The name of our oracle should be identical to the name of our tokens, `KMD`, and the data format must start with `Ihh` (height, blockhash, merkleroot): + +Create the oracle using [oraclescreate:](../customconsensus/oracles.html#oraclescreate) + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclescreate KMD blockheaders Ihh +``` + +This returns a hex value: + +```json +{ + "result": "success", + "hex": "010000000185b76ed0fbdb9ee2bdb5693f491b6ea23de6498f42c6e83f9f36c1eaf411dd990200000049483045022100aa198a2ae959ee191e1359df48867480bf5a1a5bd4fa76b4398481c89ff3095102205034824dcd56b312183acd65c27a002a13dae84f5d22c767f1efaae09ef63a5c01ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aac378740a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000001c6a1aec43064e5957544852014c0e5765617468657220696e204e594300000000" +} +``` + +Broadcast the returned hex data using [sendrawtransaction:](../komodo-api/rawtransactions.html#sendrawtransaction) + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_data +``` + +This returns a transaction id, which is the `oracleid`: + +```bash +0df7c4d844f08dba08abd4bb174558739f17cfe268feb005fb6333b3761d9203 +``` + +Record this in the text editor. + +To prepare for the oraclefeed dApp, use [oraclesregister](../customconsensus/oracles.html#oraclesregister) to register as a publisher for the oracle. This must be done on a node which can post KMD block headers and which can execute withdrawal transactions: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesregister insert_oracleid data_fee_in_satoshis` +``` + +This returns a hex value (not shown for brevity), which we now broadcast: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_value +``` + +Retrieve the data publisher's `pubkey` using [oraclesinfo:](../customconsensus/oracles.html#oraclesinfo) + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesinfo insert_oracleid +``` + + + + + +The property, `"publisher"`, in the entry, `"registered"`, of the returned json object is the data publisher's `pubkey`, also called the `publisherpubkey`. + +Subscribe to the oracle using [oraclessubscribe](../customconsensus/oracles.html#oraclessubscribe) to receive utxo information for data publishing. + +The frequency of data-publishing transactions we can perform in a block is equal to the number of active subscriptions committed to the oracle. Therefore, we must have at least one subscription for the oracle to allow publishing. + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclessubscribe insert_oracleid insert_publisherpubkey insert_amount_of_funds_to_add +``` + +This returns a hex value (not shown for brevity), which we now broadcast: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_value +``` + +::: warning Note +Execute the oraclessubscribe and sendrawtransaction methods several times and with the same amount. This gives us the opportunity to broadcast more than one sample of data per block. In our example, we want to publish data for more than one KMD-height per block. +::: + +Verify the oracle information to ensure it is properly established: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesinfo insert_oracleid +``` + +#### Activating Gateway Binding + +We now create a gateway and bind our information to it, using the [gatewaysbind](../customconsensus/gateways.html#gatewaysbind) method. + +This method requires that we decide how many total gateway signatures we desire (`N`), and how many signatures are required to withdraw funds (`M`). + +For our educational example, we may set both `N` and `M` equal to `1`, for simplicity. + +As a part of this command we will need to indicate the `pubtype`, `p2shtype`, and `wiftype` values for our chosen coin. For KMD, these values are `60`, `85` and `188` respectively. + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysbind insert_tokenid insert_oracleid KMD insert_tokensupply 1 1 insert_gatewayspubkey 60 85 188 +``` + +This method returns a hex value (not shown for brevity), which we now broadcast: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_value +``` + +The broadcast returns a transaction id, also called the `bindtxid`. Copy this information into the text editor. + +Assuming all is properly created and executed, we may now review our new gateway using [gatewaysinfo:](../customconsensus/gateways.html#gatewaysinfo) + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid +``` + +Use the returned information to verify that the `tokenid` and `oracleid` match the information in our text editor. + +#### Assemble an Oracle dApp + +An oracle dApp automates the transfer of merkleroot data to our oracle. The Komodo software suite includes built-in tools for creating an oracle dApp. + +Change into the correct directory (this command assumes we installed Komodo in the default directory): + +```bash +cd ~/komodo/src/ +``` + +Compile the dApp: + +```bash +gcc cc/dapps/oraclefeed.c -lm -o oraclefeed +``` + +Run the dApp: + +```bash +./oraclefeed HELLOWORLD insert_oracleid insert_mypubkey Ihh insert_bindtxid & +``` + + + + + +#### Using the Gateway + +With our gateway created and our oracle dApp running as a background process, we are finally prepared to test our gateway. + +First, we need the `gatewaysDepositAddress`. This is the address where we will deposit our KMD on the main KMD chain. + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid +``` + + + +The `deposit` property contains the `gatewaysDepositAddress`. When we send funds to this address, we receive in return HELLOWORLD KMD tokens to an on-chain address that we indicate as follows. + +Use the [z_sendmany](../komodo-api/wallet.html#z-sendmany) method to send funds to two addresses simultaneously. The first address is the `pubkey` that corresponds to our pubkey on the HELLOWORLD asset chain which will receive tokens. The second address is the `gatewaysDepositAddress` on the KMD chain. We send a nominal amount into the first address, and the amount we wish to have available for trading into the second address. This is done on the external chain -- in this case, KMD. + +```bash +./komodo-cli z_sendmany "insert_address_where_KMD_funds_are_currently_held" '[{"address":"addressOfPubkeyForTokenizedKmd","amount":0.0001},{"address":"gatewaysDepositAddress","amount":0.1}]' +``` + +The returned string is the `operation_id`. Use this with the [z_getoperationstatus](../komodo-api/wallet.html#z-getoperationstatus) method. + +```bash +./komodo-cli z_getoperationstatus '["insert_operation_id"]' +``` + +Execute this every few seconds until the `status` property reads `success`. Once this occurs, find the `txid` value. This is our `cointxid`, and we copy this into our text editor. + +Wait for the transaction to be mined. Once confirmed, execute the [gettransaction](../komodo-api/wallet.html#gettransaction) method with the `cointxid` to obtain more information we will need later. + +```bash +./komodo-cli gettransaction insert_cointxid +``` + +Via the returned information from the `gettransaction` method, we can verify the addresses were correct by looking at the `vout` properties. At the bottom, there is a `hex` value. Copy the value to the text editor for later. + +In the returned results there is also a `blockhash` value, which we can use to find out the height of the block which contains the `cointtxid` by using the method below. + +/komodo-cli getblock insert_cointxid | jq '.height' + +Next, execute the following command for more information: + +```bash + ./komodo-cli gettxoutproof '["insert_cointxid"]' + ``` + +This returns a `proof` value. Transfer this to the text editor. + +We now have the necessary data to execute the [gatewaysdeposit](../customconsensus/gateways.html#gatewaysdeposit-2) method on the HELLOWORLD asset chain. + +The `gatewaysdeposit` method broadcasts the relevant data on the asset chain so that the gateway nodes may validate the information and prepare to distribute the KMD tokens. + +Here is the information we need for this call: + +- `BINDTXID`: our bindtxid +- `HEIGHT`: the `height` value of the `blockhash` containing the `cointxid` transaction +- `COIN`: KMD for this example +- `COINTXID`: the `cointxid` returned from `z_sendmany` +- `CLAIMVOUT`: the `vout` of the claim (this value should be 0, as it is our first use) +- `DEPOSITHEX`: the `hex` value that is found by executing `gettransaction` on the cointxid +- `PROOF`: the `proof` value returned after executing `gettxoutproof` on the cointxid +- `DESTPUB`: the public key where the KMD tokens should be received on the asset chain (the same pubkey used earlier to retrieve the first address for the z_sendmany method) +- `AMOUNT`: the amount of the deposit (in this case 0.1) + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysdeposit BINDTXID HEIGHT COIN COINTXID CLAIMVOUT DEPOSITHEX PROOF DESTPUB AMOUNT +``` + +Successfully executing this command will return a hex value. + +Broadcast the hex data: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_data +``` + +The broadcast returns a transaction id. Copy this to the text editor. It is the `deposittxid`. + +::: warning Note +For the deposit to process successfully, the oraclefeed dApp must first process the block height of the z_sendmany transaction through the oracle +::: + +#### Claim the Funds on the Asset Chain + +To claim the funds we must spend the marker and the deposit asset, and perform the claim. + +This method is only available to the owner of the `privkey` corresponding to the pubkey used previously in the `gatewaysdeposit` method. The pubkey should be the `-pubkey=$PUBKEY` parameter used to launch the daemon. + +- `BINDTXID`: our bindtxid +- `COIN`: KMD for this example +- `DEPOSITTXID`: the transaction id returned from the `gatewaysdeposit` call +- `DESTPUB`: the public key where these tokens should be received on the asset chain +- `AMOUNT`: the amount of the deposit (in this case 0.1) + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysclaim BINDTXID COIN DEPOSITTXID DESTPUB AMOUNT +``` + +Broadcast the returned hex value: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction insert_hex_data +``` + +Once this transaction is successfully confirmed, the gateway will credit tokens to our indicated pubkey. These tokens are now usable as regular Token CC tokens. + +::: warning Note +For the claim to process successfully, the deposit and bind transaction must be confirmed first. This requires either 101 confirmations, or if the chain has dPoW, 1 notarization. +::: + +#### Withdrawing KMD Funds + +When finished with our tokens, we may send them to the gateway and withdraw the corresponding KMD funds via the [gatewayswithdraw](../customconsensus/gateways.html#gatewayswithdraw) method. Only the current owner of the KMD funds may execute the `gatewayswithdraw` method for these funds. + +::: tip +Recall that for the gateway to function, the oracle dApp must be running. +::: + +Before we execute `gatewayswithdraw`, we must first import the private key for the `gatewaysdeposit address` on node which has oraclefeed dApp running (this is needed only once). + +Find the `gatewayDepositAddress` in the `deposit` property of the returned values of the following command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysinfo insert_bindtxid +``` + +Find the private key returned from this command: + +```bash +./komodo-cli -ac_name=HELLOWORLD dumprivkey insert_gatewayDepositAddress +``` + +Execute the following commands on the node running the oraclefeed dApp: + +```bash +./komodo-cli importprivkey "insert_private_key" "label" false +``` + +Information for the next command: + +- `BINDTXID`: our bindtxid +- `COIN`: KMD for this example +- `WITHDRAWPUB`: the pubkey where the withdrawn coins should appear on the external chain; in this case, the KMD pubkey +- `AMOUNT`: the amount to withdraw + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewayswithdraw insert_bindtxid KMD insert_withdraw_pubkey insert_desired_withdraw_amount +``` + +Once executed, the remaining portion of the withdrawal process should happen automatically. + +Congratulations, you have successfully completed the cycle of the Gateways CC module. + +## Full Example + +The following content provides the full terminal input and output of a complete gateway cycle. + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencreate KMD 1 testing +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100ab0161028985d24b473d758ee9cbb944006c27b69eb6ec5b0625e7c72bdab400000000494830450221008914c99e55f8471d7985db10fead22d4abdd52670709da9c962e20a1dd77064c022022e1900ab245872eede0439e3acbd8e481304a9ba71039590ee4ca452a628fa801ffffffff0400e1f50500000000302ea22c802090bc95b90831a7837c7ef178f6fd47f26a933bcf8de56da4a2f62894ab6c73fc8103120c008203000401cc1027000000000000232102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702ace0707c48180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000326a30e36321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0034b4d440774657374696e6700000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokeninfo 315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclescreate KMD testing Ihh +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100d7be6a83f6398b2b30315d6a9fb6af048971fbdc233e36fb4307fde654ab5a0000000049483045022100a0155127857c36c35d72e718f052a8a6b2ac5003f8a67e622c006f2f071e5d020220087febeac78eba36a2b6c92a860f32141f9dc453f77988f9da6cfaa14d1e9d9001ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aace051724e180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000146a12ec43034b4d44034968680774657374696e6700000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesregister 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 10000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100da09e69ee37b713b3bbc5e4cf5f7b9525766af13c86fd5bddb246aff675cbe000000004847304402202d1aa9c1c39ed4428f381d727780fdd6fddfeef616595b7add6b0c7dac66e35f022070c227072ea93b099941daa1b5a2a41afa84ea955a536727c2307c10dc5aa53c01ffffffff041027000000000000232102407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9eac1027000000000000302ea22c802070f8ca74a159596583083b3744665976848f8c9f2e6d61b962e66c8a0d6b225d8103120c008203000401ccd02a724e180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac00000000000000004f6a4c4cec52407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9e21024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0102700000000000000000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesinfo 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclessubscribe 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 1 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000100e078a6ecd74f0b1609656ea3e7ee54c4a95ae66bfd19929c2e2cdc781b0f410000000049483045022100d48c862acde5e8756d11ef14ea9aaae26cf3da4344b49eb0e496b639c91499e602204dd685b86aae4dd8685e0b14b53c8a2957f5980a61f36d30eb8886726894570401ffffffff0400e1f50500000000302ea22c8020d5ad5ece52f2a6c9dd46cd4e658abce5dc1881e9c470d5cdf1f3f71199996f788103120c008203000401cc1027000000000000232102407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9eace0707c48180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac00000000000000004f6a4c4cec53407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9e21024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff000e1f5050000000000000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysbind 315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 KMD 100000000 1 1 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 60 85 188 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000101069d6ef8a20a726959a9802151f3367558a3e2360bb5620cf269c5949777430000000048473044022065e97dc3e0f8aee9c6bc041c728c18ab021c174b8570a8c332a170ec7a94773f022023c19d04002940298ae961d1c155e889df29ae9976bb61cfebd87715de3d7fbf01ffffffff031027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cce051724e180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000796a4c76f142034b4d443c5500bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d3100e1f5050000000001010121024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0407eab204e0889bab53c76e8a1b399a79e0ff1205ed044b8af09c22744632b9e00000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysinfo 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD dumpprivkey RXEXoa1nRmKhMbuZovpcYwQMsicwzccZBp +``` + + + + + +Command: + +```bash +./komodo-cli importprivkey "privkey" "label" false +``` + + + + + +Command: + +```bash +./oraclefeed HELLOWORLD 9e2b634427c209afb844d05e20f10f9ea799b3a1e8763cb5ba89084e20ab7e40 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 Ihh 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d +``` + + + + + +#### Example Continues - From Gateway USER Node + +Make a Deposit + +```bash +./komodo-cli listaddressgroupings +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD getaccountaddress "" +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysinfo 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d +``` + + + + + +Command: + +```bash +./komodo-cli z_sendmany "RFUL6arBgucq9TUPvTaUTnpQ2DkrcxtSxx" '[{"address":"RBm4FN3JhjhbVFaGKJ8DQgtgPHKXvhFMs3","amount":0.0001},{"address":"RXEXoa1nRmKhMbuZovpcYwQMsicwzccZBp","amount":0.1}]' +``` + + + + + +Command: + +```bash +./komodo-cli z_getoperationstatus '["opid-fbe98b01-a870-4bd5-9bc9-b937b08c79b5"]' +``` + + + + + +Wait until this height is oraclized by the `oraclefeed` dApp. + +Find the `height` and `hex` values here: + +Command: + +```bash +./komodo-cli getrawtransaction 907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98 1 +``` + + + + + +Command: + +```bash +./komodo-cli gettxoutproof '["907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98"]' +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysdeposit 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d 1116196 KMD 907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98 0 010000000197d6ea16c68dc5db95b72e029a0e23cb403ae0a33b561b863963cfd9cbfec747000000006b483045022100aca47515602989979b514b6211c375e4d0d9471dd8297c5238c12245ad01dd830220191105caf1b63313c6988194f5f03fd6f70d4a30edc7820add1185d35edff1bb012102924664b536f3710a8e8abea38bb4bf71b470a653a4dceabd50df08d7b2a38436ffffffff0310270000000000001976a9141b355cb6b76cab1b16cb873db8828fe5d2521ae488ac80969800000000001976a914f0d1fc29f8962ac2805a1659192d9ad26794d22988ac38c7fa00000000001976a91482804b943dd6a2008af73f8ba40449c062f0935188ac50e6fd5b 04000000380b8fd2b9bdf570358980a4c9fc94e418ac656913999b5f9a016ec5afc46b0b188320f231637a0ded0b0bdada1f34c81ad5873b8c3f096b2014018af13f43980000000000000000000000000000000000000000000000000000000000000000b2e6fd5ba786061d57fff87a00000000000046430000000000000200000000000000000000000000fd40050035435dd2c1df5c20cb48e0617b6cee81f5349f0735b36fe93f17f82d678ad3eb374d0e398b049fddcb21a4d7ddf7345867c6a363eddcfe61f31d49dbc35652794c60da61bd5f164fd554f17b5bd669f636744412822af2ebd0f318dacb71514720164c59c392ef2b1ccc3a5dc5c9c83cd37a11f98b97c8f5170a357a972ec3cacbeb0dab34b757354883b46a598f2b93fcd735b4163db6b2b037f7d7d71a773e909ac4ce3f1228012d5bebfd9edad9842ae8c6cddf6942c543594b85013591a604c4223a3d2e007ed25f5994e9d8f6b6a704daf57cad41aea9609923612eee2fc55ad075c91c23a8cc46af9a45a7390c537d2e2302994239ae44230537ceaa2188e7f4eb6a0ab55471d152b9177e9fd90843504f29d3e92fd3d7142caae018b51318ec6b86083b7e2d155ce868f6b673b13cf1ed59107d15c6c84201441dde14074930f4755ec64975f354a99bd957021c073768f575dde3ab020dd73b488e2d03d57bc414a16d45b3e2052b24fb2360ec5f73524525fc59d2151b89310b19764541b801ad72171085bc6275832222484b8d7ee6ed91ab6a544c45af5c4d8445b0624f04a234aec6997eecf007f0e971eea33b21e45ba8f72825fa84605cdfa929aeb6dc425f2612000e7ce2ba04ff8c53061154eb38cba7f6d0bfe5dab031dadea2095e01e93f9e063d0b42e412f865572625f77aa8b10b58f7b0428ea0ff530ea10d37150496bb181e37fc5814ad524ce4618955e9158b6aebb956b02b961f920ee48eb5a08efc39d27fc2fd4ec175e38798bcca7331a7b5da2ca6c56fcb98e740c2f471eac6b67ced78125c5fcecd4f76eac1d76233aa58ed808e398b9e2b1eaa74e773d18276b732239403ce0c452cb26f0f34156a0a63e007ccfbd76f168fb941fbd2fbe23b57e519835c804ace6e22e281b3d0adda7c4b93a87d94500103315c780fe91ee67320a422eecb4a6daedc2d774567bfebc1d5b72fa693178f3443aa1eb47f18d6931f7b0fc6ec151caad4eae5f787c2a963c3963ffc924ba66a7ea1754763faf2884de0c86a0f75fe7f8dfb1265b449184668cb7348520810cf731663f5180ac31642d6b135d5ce7de88ba63d6db3d6c5dfa19492281dfed3b3765451717f3497ac2b4c040e2e4e77219b2586c227cd138b8d94ccc273fbfbb51a35523870c503e2d8527b840ced11917075e8a41ae9616f1df8d41df5bae39c6d6de5bb8d43d401bb9089723db59f0f06aa4fdf4145a905812ef799eb574abb9985de878a289e5f4b1256ca2121d553465f44065580cb5bde170459d1c22e8d388cbec9e37dc3cca07e489a9859942a9ccef4a5e45eed7228b94c86d10a233b5a1ddfcb1735cb9b16de6e8f49f3c841796acba31a8e9c90b531952ed03bd72e0b00fa3373ea4bc845d7469afae305639c772285a5223bf2d86a12c92312dc19db86400c6760b9e75af40ce4c16278bba8a804d5a69b88290dd4c2b43423bee9eb97c54261f956a32d80fdd3f421d1199ee45d42ad657e928be2e9fa54d844cff60b06bc525ce54daca9689e0616bfdbdbc36e09bea11a276d25d3ca9a80ed7109183784dfd1d23b7c791a7913a633e2d28948c655e68ade706654e38f717fe29119af4282430c8d1f702a52ea189f1e9e6faafb213205a195dab1c2d01dc6a3711f671ea118e8a3c995632903c58ebbd4eae5dbc4555b24c1649e89e03efb92134b9e24fb9fc649462f928d992fa33d45edcb4ef13f0d5c2cb6663e7dbf2414b5ed617e56b8715ace6910807e4a901ba603dab4092f9eeb46566ec3f38f3a1789c60822530c390d19b1d939217b7a691abb91454fce76cccf3557ddb3fc55bd4f44761aa9363db0f38360adf60e743ba3b902788bb254637f6074df62460400000003a973b7134b7fcbcb1fe70fdfaaf056c209a9f5dd77800eb37b065ca8317cbb3a980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890445df562c183ed7279f2f8e37ba249447439884d5b7030eac6485112eb07ea2d010b 02d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d 0.1 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000010db4b1686d1f27de5e2a11c793dfd30f09b296754f95ae8649858cca97d5b07a0000000049483045022100ad6bc26f0c66b89f5d63aff251c78965a50201f909a997b8ed6469da0334aa0c0220136d71f5ad1f4496785df81864f9be3ae7b8dd012dae08d59fd544869eacb3ba01ffffffff041027000000000000302ea22c80205fd998129698de9cf1455f4f4795794c9e57bf1fd5f28598b5e6c0322de5d0358103120c008203000401cc1027000000000000232102980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890acd02a724e18090000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000fd04096a4d0009f144034b4d440d8d1f63bf680d6191b100d90992b0f6bf6ce1cc851f259da8b49e74524e7a890121024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0012fea85ecfda42975a2aaed72e946792df41a486033af8dc45ab1e4ddcb34b1b424081100980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee12789000000000fd080230313030303030303031393764366561313663363864633564623935623732653032396130653233636234303361653061333362353631623836333936336366643963626665633734373030303030303030366234383330343530323231303061636134373531353630323938393937396235313462363231316333373565346430643934373164643832393763353233386331323234356164303164643833303232303139313130356361663162363333313363363938383139346635663033666436663730643461333065646337383230616464313138356433356564666631626230313231303239323436363462353336663337313061386538616265613338626234626637316234373061363533613464636561626435306466303864376232613338343336666666666666666630333130323730303030303030303030303031393736613931343162333535636236623736636162316231366362383733646238383238666535643235323161653438386163383039363938303030303030303030303139373661393134663064316663323966383936326163323830356131363539313932643961643236373934643232393838616333386337666130303030303030303030313937366139313438323830346239343364643661323030386166373366386261343034343963303632663039333531383861633530653666643562fd360604000000380b8fd2b9bdf570358980a4c9fc94e418ac656913999b5f9a016ec5afc46b0b188320f231637a0ded0b0bdada1f34c81ad5873b8c3f096b2014018af13f43980000000000000000000000000000000000000000000000000000000000000000b2e6fd5ba786061d57fff87a00000000000046430000000000000200000000000000000000000000fd40050035435dd2c1df5c20cb48e0617b6cee81f5349f0735b36fe93f17f82d678ad3eb374d0e398b049fddcb21a4d7ddf7345867c6a363eddcfe61f31d49dbc35652794c60da61bd5f164fd554f17b5bd669f636744412822af2ebd0f318dacb71514720164c59c392ef2b1ccc3a5dc5c9c83cd37a11f98b97c8f5170a357a972ec3cacbeb0dab34b757354883b46a598f2b93fcd735b4163db6b2b037f7d7d71a773e909ac4ce3f1228012d5bebfd9edad9842ae8c6cddf6942c543594b85013591a604c4223a3d2e007ed25f5994e9d8f6b6a704daf57cad41aea9609923612eee2fc55ad075c91c23a8cc46af9a45a7390c537d2e2302994239ae44230537ceaa2188e7f4eb6a0ab55471d152b9177e9fd90843504f29d3e92fd3d7142caae018b51318ec6b86083b7e2d155ce868f6b673b13cf1ed59107d15c6c84201441dde14074930f4755ec64975f354a99bd957021c073768f575dde3ab020dd73b488e2d03d57bc414a16d45b3e2052b24fb2360ec5f73524525fc59d2151b89310b19764541b801ad72171085bc6275832222484b8d7ee6ed91ab6a544c45af5c4d8445b0624f04a234aec6997eecf007f0e971eea33b21e45ba8f72825fa84605cdfa929aeb6dc425f2612000e7ce2ba04ff8c53061154eb38cba7f6d0bfe5dab031dadea2095e01e93f9e063d0b42e412f865572625f77aa8b10b58f7b0428ea0ff530ea10d37150496bb181e37fc5814ad524ce4618955e9158b6aebb956b02b961f920ee48eb5a08efc39d27fc2fd4ec175e38798bcca7331a7b5da2ca6c56fcb98e740c2f471eac6b67ced78125c5fcecd4f76eac1d76233aa58ed808e398b9e2b1eaa74e773d18276b732239403ce0c452cb26f0f34156a0a63e007ccfbd76f168fb941fbd2fbe23b57e519835c804ace6e22e281b3d0adda7c4b93a87d94500103315c780fe91ee67320a422eecb4a6daedc2d774567bfebc1d5b72fa693178f3443aa1eb47f18d6931f7b0fc6ec151caad4eae5f787c2a963c3963ffc924ba66a7ea1754763faf2884de0c86a0f75fe7f8dfb1265b449184668cb7348520810cf731663f5180ac31642d6b135d5ce7de88ba63d6db3d6c5dfa19492281dfed3b3765451717f3497ac2b4c040e2e4e77219b2586c227cd138b8d94ccc273fbfbb51a35523870c503e2d8527b840ced11917075e8a41ae9616f1df8d41df5bae39c6d6de5bb8d43d401bb9089723db59f0f06aa4fdf4145a905812ef799eb574abb9985de878a289e5f4b1256ca2121d553465f44065580cb5bde170459d1c22e8d388cbec9e37dc3cca07e489a9859942a9ccef4a5e45eed7228b94c86d10a233b5a1ddfcb1735cb9b16de6e8f49f3c841796acba31a8e9c90b531952ed03bd72e0b00fa3373ea4bc845d7469afae305639c772285a5223bf2d86a12c92312dc19db86400c6760b9e75af40ce4c16278bba8a804d5a69b88290dd4c2b43423bee9eb97c54261f956a32d80fdd3f421d1199ee45d42ad657e928be2e9fa54d844cff60b06bc525ce54daca9689e0616bfdbdbc36e09bea11a276d25d3ca9a80ed7109183784dfd1d23b7c791a7913a633e2d28948c655e68ade706654e38f717fe29119af4282430c8d1f702a52ea189f1e9e6faafb213205a195dab1c2d01dc6a3711f671ea118e8a3c995632903c58ebbd4eae5dbc4555b24c1649e89e03efb92134b9e24fb9fc649462f928d992fa33d45edcb4ef13f0d5c2cb6663e7dbf2414b5ed617e56b8715ace6910807e4a901ba603dab4092f9eeb46566ec3f38f3a1789c60822530c390d19b1d939217b7a691abb91454fce76cccf3557ddb3fc55bd4f44761aa9363db0f38360adf60e743ba3b902788bb254637f6074df62460400000003a973b7134b7fcbcb1fe70fdfaaf056c209a9f5dd77800eb37b065ca8317cbb3a980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890445df562c183ed7279f2f8e37ba249447439884d5b7030eac6485112eb07ea2d010b2102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d809698000000000000000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysclaim 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d KMD 07d79e39354cc38a76dfe2ca8a5fb711432192237608ea066621662f13e0c08e 02d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d 0.1 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000030a9a982a898012f4cc982796f381f16c9e2e5fe28e0be58ad59c7c90409530f8020000004847304402207959e4befae9e917cde7d6ba6f5e62e4cf679858b1a5c8b1eb270b1c7eac7c7e0220503ea9a24245db21b4db8ae68e48da6c5d33ef436371c6d03872d45d1364047c01ffffffffc6fc3b75a37a6ed10507a1bb73f2c5d5c8f75bcb358b0aa4bab3b80b5aa39f19010000007b4c79a276a072a26ba067a565802103ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb408140d4c46b8282d42d7e7ebe99361264c21b9ee221b7b3a47e1549e06bf06659fa194298618a2969a421543753a5994ebc3944e93ac6072a233ab617b229b3922a52a100af038001f1a10001ffffffff8ec0e0132f66216606ea08762392214311b75f8acae2df768ac34c35399ed707000000007b4c79a276a072a26ba067a565802102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d8140f3938953c9087e1e25c31263c5a717dd59d2f7d6f0815cfd7c0cb01a6c4d586b630b11cca1e60a19036d937095941660e488a07494fc721471d4a53f5eb89a25a100af038001f1a10001ffffffff048096980000000000302ea22c8020abd72b18452f1bc72f4312dbb1cd341b7c7f38a994ddacd8b35412231f01cb088103120c008203000401cc804a5d0500000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc1027000000000000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000936a4c90e374bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d31034b4d440d8d1f63bf680d6191b100d90992b0f6bf6ce1cc851f259da8b49e74524e7a898ec0e0132f66216606ea08762392214311b75f8acae2df768ac34c35399ed7072102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d809698000000000000000000 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenbalance 315d16c2dddd737f8a48f81499908897b53d05d20fb1344e349e304fb603f6bf +``` + + + + + +#### User Withdraws Funds + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewayswithdraw 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d KMD 0271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328 0.1 +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000020e2778e5c0917b00a995ffd0e027ac896492b70b2004ca0096d5309bc1d695ce0000000048473044022072bd3e74c1fb6a56111fc34caab1d605cedfbcb0a9dcd1a4c8d0dae9db61d43902205ccea739077b3374559353af3392e637b7c462ca699f9b9dba786b5398491b4201ffffffff8425c1bf730444ceac45a47376164d66a156e6c2a48116ec14cd17a88f8ab8e5010000007b4c79a276a072a26ba067a565802102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d814051e39b89bace8226f3ca1779b754f2b57ee480e9636b16322bb36a89ec22de967ea66cdc906debb5f6b7c26a51ac2d089966aeb92d07aacc43507b1555c02313a100af038001f1a10001ffffffff058096980000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc102700000000000023210271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328ac1027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401ccd02a724e18090000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000536a4c50f157bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d31034b4d44210271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328809698000000000000000000 +``` + + + + +# Introduction to Antara Tutorials + +Welcome to the Antara tutorial documentation. + +This section contains tutorials that are specifically designed for the aspects of Komodo Smart Chain software that deal with the Antara framework. + +The Antara framework encompasses many of the enhancements and innovations that Komodo adds to upstream technologies. Aspects of Antara include the Antara Customizations for a Smart Chain and Antara Modules, which allow for advanced blockchain functionality. + +For tutorials regarding other Komodo software, such as AtomicDEX, which offers cross-chain atomic-swap compatibility, please see the respective documentation centers. + +For a targeted learning approach to Komodo's Smart Chain software, please see the Learning Launchpad. + +[Link to Learning Launchpad](../../../basic-docs/start-here/learning-launchpad/learning-path-outlines.html) + +# Musig Module Tutorial + +## Installation + +MuSig is currently only available on MacOS and Linux operating systems. + +Please check with the Komodo team on [Discord](https://komodoplatform.com/discord) for information regarding Windows functionality. + +### Install Dependencies + +Ensure that local repositories are up to date: + +```bash +sudo apt-get update && sudo apt-get upgrade -y +``` + +Install Dependencies: + +```bash +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl libcurl4-gnutls-dev cmake clang libsodium-dev -y +``` + +### Build instructions + +Build `komodod` by executing the following series of commands. Each line should be executed separately: + +```bash +git clone https://github.com/jl777/komodo +cd komodo +git checkout jl777 +./zcutil/fetch-params.sh +./zcutil/build.sh -j$(nproc) +``` + +Compile the appropriate library: + +```bash +cd src/cc +./makecclib +cp sudokucc.so ../libcc.so +cd ../.. +make -j$(nproc) +``` + +### Update + +Update the `komodod` daemon by executing the following series of commands. Each line should be executed separately: + +```bash +cd komodo +git checkout jl777 +git pull +cd src/cc +./makecclib +cd ../.. +make -j$(nproc) +``` + +### Launch the Asset Chain + +Change into the `~/komodo/src` directory: + +```bash +cd ~/komodo/src +``` + +Launch the MuSig asset chain using the following launch parameters. + +```bash +./komodod -ac_name=MUSIG -ac_supply=100000 -ac_reward=10000000 -pubkey= -ac_cclib=sudoku -ac_cc=2 -addnode=5.9.102.210 & +``` + +### Obtain a Pubkey + +Without a pubkey, the MuSig asset chain will not function properly on the user's local machine. Follow these instruction for obtaining and setting a pubkey: + +- [Instructions for obtaining and setting a pubkey](../customconsensus/custom-consensus-instructions.html#creating-and-launching-with-a-pubkey) + +Once the asset chain is relaunched with the new pubkey included as a launch parameter, the MuSig asset chain is prepared for use. + +### Acquire Funds for Testing + +::: tip Note + +The reader should launch the asset chain with a pubkey whose private key is already imported to the wallet. If this is not the case, restart the asset chain with an appropriate pubkey, or use the [importprivkey](../komodo-api/wallet.html#importprivkey) method to import the private key of the desired pubkey. + +::: + +The MuSig asset chain has an available faucet. The faucet allows a user to obtain a nominal amount of funds for testing and orientation purposes. + +Ensure that the terminal's working directory is in the `~/komodo/src` directory: + +```bash +cd ~/komodo/src +``` + +Execute the `faucetget` method: + +```bash +./komodo-cli -ac_name=MUSIG faucetget +``` + +This method returns a hex value in the terminal. Select the entire hex value and copy it to the clipboard. (Use `CTRL + SHFT + C` to copy within the terminal) + +Broadcast the hex value using the `sendrawtransaction` method: + +```bash +./komodo-cli -ac_name=MUSIG sendrawtransaction +``` + +Wait for the transaction to be confirmed. + +Once the broadcast transaction is confirmed, check the balance using the `getbalance` method: + +```bash +./komodo-cli -ac_name=MUSIG getbalance +``` + +There should be a small amount of funds in the balance. + +## Full Example + +The aim of this example is to create a `20f2` MuSig pubkey, fund it, and spend from it. + +To accomplish this, two nodes are necessary. + +In this MuSig example we use the following pubkeys on our two nodes: + +- Node1's daemon is launched using the pubkey: `0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a` +- Node2's daemon is launched using the pubkey: `02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567` + +The `EVALCODE` for the MuSig module is `18`. + +For this example, we use [the normal array formatting for `cclib` methods](../komodo-api/cclib.html#cclib-formatting), as we are not creating a bash script. + +Steps 1 through 5 and 11 through 12 need to be executed only on the first node. + +#### Step 1: combine + +Use the [combine](../customconsensus/musig.html#combine) method to create a `combined_pk` address: + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib combine 18 '["0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a","02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567"]' +``` + + + + + +Copy the values of `pkhash` and `combined_pk` and save them in a secure location for later use. + +#### Step 2: send + +Use the [send](../customconsensus/musig.html#send) method to send `1` coin to the `combined_pk` address: + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib send 18 '["03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",1]' +``` + + + + + +Copy the `hex` value to your clipboard. + +#### Step 3: Broadcast the hex Value and Retrieve the sendtxid + +Use the [sendrawtransaction](../komodo-api/wallet.html#sendrawtransaction) method to broadcast the raw hex value: + +Command: + +```bash +./komodo-cli -ac_name=MUSIG sendrawtransaction 0400008085202f890b02b1bdd8707f82bc6f4cdeb4756eb04dfc3cc7a4b5ac38a388c0205cf8f31a0e0000000048473044022004de31b5132f03f761fc0d0d9761efbf77bb27b07ee99f2cc54928e2150f1f16022069381b36bb9839cc9cb3e1d584e00dbd52efadf7e2f3fa092e0bcca839cdce6801ffffffff04949d5bf1722c5df04f58cf2c7e662f32ab65de2f7990ce4c734df4f2991eb60000000049483045022100ab3ab2bb95ef095763dd3eeb56961d1234aa25efd91a30fa14e397717368e6a0022048d7f8268463cfb44f34467bd77eb2aee962eaec09a079741c75c5de898b4f6c01ffffffff0476a06188887bf93bec4e64a3a5681b5e271cb7055a11d0667dc565e498b6190000000048473044022022ef03c33b5942b1af16f7e4a9acd2aa485d73f6f6b5e0a01e15f70238cd85cd022063779c69511ee4eba179b40ce28d80da22d43f19110be2a9a97d0b47d6a5cca201ffffffff045587699381853735482dbfb1fe25dda8d5a7a238c05b872ecfcd97be38232f00000000484730440220051e6047dd9e82b004c29a2837bf127f94caa638c65d96c761371c18ff36170002204e73ddfbbe748f295d7a93e46d942618f291d302b7a666b78b49ab38594a89ac01ffffffff0426d8098ed0c5ee19ac8d4254ec9887ab7a231c68a8d9b024a50f417f0a94ff0000000049483045022100ebd193262a04f8c9cf1872527d2a7d4933222f8ce8ea11add90e263c483ca56a02204a29902ae6b31dc41f84b5ffad3b2076755ad19f25be47479704b2ab5e37463a01ffffffff040e294b76ca4492909b75b829566b3702b35245595e8c4806b7ef6a7f612dd6000000004847304402201573d230af50aa6d326b607ac6ba77bb15c1a143256e5141197ce6729195b0e602201301be6ad22ba5599597205cdfb7e2cf6823ce4597e5b902b6d4336958e0fbe101ffffffff03d9a453070627c94d940f57b40829713ee6b6bce4d801e591117c801221225900000000494830450221009d5eec551265274ade816fdb3a0dfee20e716a7d3f56155b698a9d0c41ccd11202202e811c4611ebf982b34db8a43002c759c54a077023ced1498421c4af2b12a0f901ffffffff03ce7cb872bdfdf264576c45ed899c00731959051cade1a19b088eabc02e07780000000049483045022100a9c8c795e34a393fafb839ef4bbf11e4adf04b4c8a8493ef0bd2353e7a1ddd430220251ff7eb5ca3d2ed4ee4145906532af803caaed756ff3d21e86ac4876333067e01ffffffff030d66186013342f71335bc67d0d87240b4a27809e67ba55e01dd72e7ae1b0af0000000049483045022100d4c82867562aa040a7695ffd53056018e0dc3a071d971b3774cdb8511b0f49aa022029b72c5af1b9c16e27d81827d478910ec3135415037cf2b3492922ff618538bc01ffffffff02f9b92abfa0324272e0ce465b856e6d9b53e3e2e0828934c8a0c8c2c10e67d5000000004847304402205df4c99c581bfe95ea95740320b16c423531663b42e25b97315d3126250c24a202206dff5da29fbb0fe21ae6ce3da7bac1e502feb8fdd7b803c0fafa6541e80ec0ff01ffffffff02bd8679e8383e6d9c4a10917b68b8918ed3f518fe2deef5b23e0012461fbf370000000049483045022100a04210427173ea0721f3cf859b99328c8e234ba39250c033aebfb37fb2c5a1d502200d5cb16ed0dccc5dfc0385a8763340cf98a162e863994069354a5fee187b8bd401ffffffff031008f60500000000302ea22c8020c71ddb3aac7f9b9e4bdacf032aaa8b8e4433c4ff9f8a43cebb9c1f5da96928a48103120c008203000401cc604898000000000023210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac0000000000000000266a2412782103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a000000003f0800000000000000000000000000 +``` + + + + + +The returned value is our `sendtxid`. Copy this to a secure location for later use. + +#### Step 4: Obtain the change_script Value + +Use the [getrawtransaction](../komodo-api/rawtransactions.html#getrawtransaction) method to decode the raw transaction. + +Command: + +```bash +./komodo-cli -ac_name=MUSIG getrawtransaction 09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293 1 +``` + +In the response there are a series of `vout` values, each of which has an array of json objects. Search for the `vout` value that has the `"type":"pubkey"` key pair listed. In this object, retrieve the `hex` value from the `scriptPubkey`: + +```json + +... (omitted for brevity) ... + +"vout": [ + + ... (omitted for brevity) ... + + { + "value": 0.09980000, + "valueSat": 9980000, + "n": 1, + "scriptPubKey": { + "asm": "0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a OP_CHECKSIG", + "hex": "210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac", + "reqSigs": 1, + "type": "pubkey", + "addresses": [ + "RUfCUd3UryKJ49baQvSuAs42wakNunvvfT" + ] + } + }, + + ... (omitted for brevity) ... + + ] + +... (omitted for brevity) ... + +``` + +This `hex` is our `change_script` value. Save this to a secure location for later use. + +#### Step 5: calcmsg + +Use the `calcmsg` method to calculate the `msg` value. The `calcmsg` method needs the `sendtxid` and `change_script` values retrieved from previous commands. + +**cclib calcmsg 18 '["insert_sendtxid_here","insert_change_script_here"]'** + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib calcmsg 18 '["09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293","210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac"]' +``` + + + + + +Copy the `msg` value to a secure location for later use. + +#### Step 6: session + +From this point forward, all steps should be executed on both nodes 1 and 2. + +After each step performed on each node, copy the relevant data to the opposing node. + +##### Node 1 + +The following `session` command requires an array of arguments. The arguments are as follows: + +1. `ind`: the index of the signatory in the set. In this example our current node, Node 1, is `0` +2. `numsigners`: the number of pubkeys participating in the multi-signature transaction +3. `combined_pk`: the `combined_pk` address, retrieved previously +4. `pkhash`: the `pkhash` value, retrieved previously +5. `msg`: the `msg` to be signed, retrieved previously + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib session 18 '[0,2,"03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9","3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603"]' +``` + + + + + +Copy the value of `commitment` both to a secure location and to Node 2. + +##### Node 2 + +Execute the same command as before, only change the `ind` value from `0` to `1` to indicate Node 2. + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib session 18 '[1,2,"03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9","3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603"]' +``` + + + + + +Copy the `commitment` value both to a secure location and to Node 1. + +#### Step 7: commit + +##### Node 1 + +The `commit` method requires an array of arguments. The arguments are as follows: + +1. `pkhash`: the `pkhash` value, retrieved previously +2. `ind`: the index of the opposite node. In our example, Node 2 is `1` +3. `commitment`: the `commitment` value from the opposing node + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib commit 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"2854473733147ebdbf2fb70b956c8086c9d7659ca0093627fe0371098f8bc003"]' +``` + + + + + +Copy the `nonce` value both to a secure location and to Node 2. + +##### Node 2 + +Execute the same command as before, only change the value of `ind` to `0` to indicate Node 1. + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib commit 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",0,"a886a3a3c57efec161f6f72554b66f837de89ffdabe0acc46ae4cd59aab8129e"]' +``` + + + + + +Copy the `nonce` value both to a secure location and to Node 1. + +#### Step 8: nonce + +##### Node 1 + +The `nonce` method requires an array of arguments. The arguments are as follows: + +1. `pkhash`: the `pkhash` value, retrieved previously +2. `ind`: the index of the opposing node. In our example, the index of Node 2 is `1`. +3. `nonce`: the `nonce` from the opposing node + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib nonce 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"02402fe26abd7ed2cf22d872a6b22ced4309aac8ec273b9c89e0f8f5b77f1574db"]' +``` + + + + + +Copy the `partialsig` value both to a secure location and to Node 2. + +##### Node 2 + +Execute the same command, only change the `ind` value to `0` to indicate Node 1, and change the `nonce` to the value retrieved from Node 1. + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib nonce 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",0,"0379f6f42cf4c2cb30d064a6cac22ab6ffb3d93388d49b07f0623ff9bc8d191f89"]' +``` + + + + + +Copy the `partialsig` value both to a secure location and to Node 1. + +#### Step 9: partialsig + +##### Node 1 + +The `partialsig` method requires an array of arguments. The arguments are as follows: + +1. `pkhash`: the `pkhash` value, retrieved previously +2. `ind`: the index of the opposing node. In our example, the index of Node 2 is `1` +3. `partialsig`: the `partialsig` retrieved from the opposing node + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib partialsig 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"9e964dfd402f973ea1e9407e19918b1c3897ff6544d60dcdb19cfb0e5bc4c0c1"]' +``` + + + + + +Copy the `combinedsig` value both to a secure location and to Node 2. + +##### Node 2 + +Execute the same command, but change the `ind` value to `0` to indicate Node 1, and change the `partialsig` to the value retrieved from Node 1 previously. + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib partialsig 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",0,"dc913a9e7532c8edf2f822f482afdcf48c61919bf905fb77f6684a2d7e58d972"]' +``` + + + + + +Copy the `combinedsig` value to a secure location. + +If the values of `combinedsig` produced by both nodes is the same, then you have followed the example without any errors to this point. Visually verify that this `combinedsig` value matches with the `combinedsig` value returned on Node 1. + +#### Step 10: verify + +##### Node 1 + +The `verify` method requires an array of arguments. The arguments are as follows: + +1. `msg`: the `msg` value, retrieved previously +2. `combined_pk`: the `combined_pk` value, retrieved previously +3. `combinedsig`: the `combinedsig` value, retrieved previously + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib verify 18 '["3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603","03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' +``` + + + + + +##### Node 2 + +Execute the same command on Node 2. + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib verify 18 '["3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603","03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' +``` + + + + + +The response from both nodes should display a `"result": "success"` key pair. If this is not the case, you made an error in a previous step. + +#### Step 11: spend + +::: tip Note +Currently, each node will output different raw transaction values, as both nodes are attempting to spend funds to their own wallets. Of the two, the node that broadcasts its returned raw transaction value first will receive the coins. The other node does not need to create or broadcast a transaction value. +::: + +##### Node 1 + +We are now prepared to execute the `spend` method. + +The `spend` method requires an array of arguments. The arguments are as follows: + +1. `sendtxid`: the `sendtxid`, retrieved previously +2. `change_script`: the `change_script` value, retrieved previously +3. `combinedsig`: the `combinedsig` value, retrieved previously + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib spend 18 '["09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293","210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' +``` + + + + + +Copy the `hex` value to a secure location. + +##### Node 2 + +In this example, our desire is to receive the transferred coins on Node 1, not on Node 2. + +Therefore, it is not necessary to execute the `spend` method again, nor is it necessary for Node 2 to execute the following step. + +#### Step 12: sendrawtransaction + +##### Node 1 + +Broadcast the `hex` value using [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction): + +```bash +./komodo-cli -ac_name=MUSIG sendrawtransaction "0400008085202f890193c200495d92c09a3eb527a552c129bf3c991a29478356f92870e1b65ca4da09000000007b4c79a276a072a26ba067a5658021032d29d6545a2aafad795d9cf50912ecade549137163934dfb2895ebc0e211ce8a81401272d03e011f002a464aa75e8c3d093d45a2c4865b7b334998c8dc2fbaa814c17a2f34c9746d2921483b884d577b86465095ce64a4716b4b5d2f0b578860e149a100af03800112a10001ffffffff0200e1f5050000000023210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac0000000000000000686a4c6512792103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a404b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f200000000470800000000000000000000000000" +``` + +Once the broadcast transaction is mined and notarized, the MuSig transaction is complete. + +You have now successfully executed a full cycle of the MuSig module. + + +# Overview of Antara Modules - Part I + +## Introduction + +Welcome to an Overview of Antara Modules - Part I. + +Part I of this discussion covers the basic aspects of Antara modules, without delving deeply into the technical aspects of the technology. + +The conversation should be attainable for a normal developer in the Komodo ecosystem, as well as for non-developers who otherwise possess experience in the blockchain industry. + +A later discussion, [Overview of Antara Modules - Part II](../../../basic-docs/antara/antara-tutorials/antara-conceptual-overview.html), covers additional conceptual aspects of this technology. Part II is not required, but recommended for anyone who intends to utilize Antara technology in a development environment. + +## Smart Contracts on the Komodo Platform + +Komodo is built on the Bitcoin protocol, which features a simple programming language, called Bitcoin Script, that allows a developer to perform rudimentary scripting tasks. + +Traditionally, Bitcoin Script is considered to be incapable of supporting the complex "smart contracts" found on other blockchain platforms. This limitation is mostly from the fact that Bitcoin Script is (intentionally) not Turing complete. + +Now, the capabilities of extending Bitcoin Script into a competitive, and arguably stronger, method for creating smart-contract-like modules is changing through Komodo's Antara Framework. This framework integrates a broader technology, called CryptoConditions, which allows for complex utxo-based logic. + +As is often the case, Komodo Platform is leading the blockchain industry in this brand new technology. This section will explain Antara's implementation of CryptoConditions, how it works, and how utxo-based smart contracts will dramatically alter the blockchain landscape. + +## A Brief Review of Bitcoin Script + +The very first block in the Bitcoin blockchain was mined on or around January 3, 2009. Since then, this revolutionary technology has exploded, forever changing the way we think of money and currency. We owe many of these developments to Satoshi Nakamoto and his original Bitcoin-core code. + +The Bitcoin-core code itself is written in C++. A time-tested and well-known programming language, C++ is Turing complete and can therefore do all that any other Turing complete programming language can do. + +However, Bitcoin transactions are not executed with C++. Instead, transactions are carried out with a special protocol called Bitcoin Script. This scripting language has a number of "opcodes", or commands, that tell nodes how to deal with any specific transaction request. + +While most computer programming languages are considered Turing complete, Bitcoin Script is not. It’s widely accepted that this was an intentional decision. But before we can discuss the relative merits of making a programming language Turing complete, let’s take a moment to understand what exactly "Turing complete" means. + +## Turing Completeness + +In 1936, a British computer scientist and mathematician named Alan Turing published an academic paper called “On Computable Numbers, with an Application to the Entscheidungsproblem.” It is a seminal essay in the fields of computer science and computational theory. + +In the essay, Turing describes a hypothetical machine that, when granted a few basic assumptions, can theoretically “compute any computable sequence.” This basically means it can solve any mathematical problem that uses only computable numbers. According to Turing’s definition, “a number is computable if its decimal can be written down by a machine.” + +Turing called this device a “universal machine” but it is now better known as a “Turing machine.” + +Turing machines are generally described in this way: Imagine a simple device that can read and write numbers. This device also has the ability to store data. (Turing assumes that the device has an infinitely large storage capacity, but this is not essential to understanding the concept of Turing completeness.) + +Now, imagine that this simple machine moves from left to right along a thin, infinitely long piece of tape. It reads a number, decides what to do based on a series of instructions to which it is bound, and then executes the instructions accordingly. + +In simply reading numbers, executing commands, and writing numbers, this simple machine can solve any computational sequence. It may take an arbitrarily long period of time but, theoretically, the machine would eventually solve the problem. + +So what does all of this actually mean? Why is it important? + +The idea of something being “Turing complete” is derived from this idea of a Turing machine. While we know that no machine has an infinitely large memory, we can use the basic theoretical framework to decide whether or not a machine can solve any computable sequence. + +It is in this sense that computer languages are said to be Turing complete. A language is Turing complete if it can solve any mathematical problem made up of computable numbers. + +As we noted above, Bitcoin Script is not Turing complete. This means that there are some problems and sequences that Bitcoin Script is not capable of solving. + +## Gas-based Smart Contract Platforms + +This is where the gas-based smart contract platforms of Ethereum, EOS, NEO, and many other blockchain platforms enter the picture. We will focus on Ethereum, as it is the originator of this model, and it is currently the most popular. + +In December 2013, Vitalik Buterin released [Ethereum’s first white paper.](https://github.com/ethereum/wiki/wiki/White-Paper) One of the major contributions Ethereum offered was a Turing complete programming language, called Solidity, that can be used to write smart contracts. + +In fact, Buterin makes this perfectly clear on the first page of the white paper: + +“What Ethereum intends to provide is a blockchain with a built-in fully fledged Turing-complete programming language that can be used to create 'contracts' that can be used to encode arbitrary state transition functions, allowing users to create any of the systems described above, as well as many others that we have not yet imagined, simply by writing up the logic in a few lines of code.” + +In many ways, Ethereum's 'smart-contract' language is an improvement over Bitcoin Script. It allows “systems which automatically move digital assets according to arbitrary pre-specified rules”, and this opened up a new world of possibilities for blockchain technology. + +At the same time, Turing completeness creates a few vulnerabilities. Let’s discuss. + +## Pros and Cons of Turing Completeness + +Any Turing complete programming language has the ability to create “loops.” A loop just means that a certain operation or set of commands can be written once but commanded to execute an arbitrary number of times. + +In a language that is not Turing complete, like Bitcoin Script, loops are not available. A programmer needs to copy and paste the same piece of code `X` number of times when he wants a computer to execute the operation `X` times. + +While loops are beneficial in some ways, they also present vulnerabilities. A programmer may accidentally write an infinite loop into a smart contract, unnecessarily burdening the network with an infinite number of meaningless operations to perform. + +If malicious spammers want to attack an unprepared network that runs on a Turing-complete language, they can unleash a great number of smart contracts each bearing infinite loops. These pointless, endless operations can cause crippling congestion. + +To avoid this possibility, Buterin introduced the idea of “gas” to the Ethereum network. + +## Gas: A Way to Avoid Infinite Loops + +In short, users must pay a fee for every single operation that they want the network’s nodes to perform. These fees are simply called “gas.” Gas prices discourage malicious actors from spamming the network. It also encourages developers to write efficient contracts that require as few processes as possible. + +Moreover, gas prevents an accidental infinite loop from wreaking havoc on the network, because once all the gas is used up, the network stops processing the contract. The loop runs out of gas and the nodes stop executing the loop. + +An important benefit the gas-based platform brought to the world is that it broke the barrier for allowing developers to decentralize software execution in a p2p environment. + +For example, in a non-decentralized p2p software application, users typically must rely on a centralized server or other impersonal third-party to maintain sanity in the execution of software instructions. Decentralized applications, "dApps", allow users to interact with software while relying not on a centralized server, but on the decentralized blockchain. + +## The Problem with the Gas-based Model + +While the concept of gas is a clever innovation, it also makes complex applications prohibitively expensive, and it hinders innovation and audience growth. + +If a particular contract or dApp needs the network to perform a large number of operations to function as designed, it costs too much money to keep it running. + +Take these two competing statements from Buterin by way of illustration. In January of 2014 he said, “...Our goal is to provide a platform for decentralized applications – an android of the cryptocurrency world, where all efforts can share a common set of APIs, trustless interactions and no compromises.” [But later, in July 2018, Buterin had this to say:](https://www.coindesk.com/vitalik-ethereum-app-builders-screwed-scaling-limits/) “If you want to build a decentralized Uber and Lyft on top of an unscalable Ethereum, you are screwed. Full stop.” + +The "Uber" reference is to a popular phone app where users can hail and share a freelance-taxi service. On average, this app processes 12 financial transactions per second. At the time of Buterin's statement, Ethereum can process 15 transactions per second. Let's make a rough analysis of the cost to maintain this one dApp on Ethereum. + +The value of the gas fees for an Uber-like decentralized app would have to cover ~80% of the cost of maintaining the Ethereum blockchain (`(12 txs / 15 txs) * 100 = 80%`). Today (cr. 2018-2019), it costs about [\$150,000 USD per hour](http://www.crypto51.app/) to maintain the Ethereum hash rate. The dApp developer and their end-users would be responsible for 80% of this, so they would have to pay gas fees of at least $120,000 per hour, which translates to ~$30 per second. + +Therefore, looking only at the costs, and not at the lack of space for multiple dApps, we begin to see the enormous flaws of the gas-based model. While existing large corporations and their customer bases may be able to afford this financial burn rate, it is difficult to conceive of a startup that can afford it. The ongoing gas fees to continually maintain the functionality of this dApp are simply too expensive. + +All this is assuming that the dApp only processes one transaction per ride, per customer. If the dApp is instead a game that has a looping function, the gas fees can grow even more absurd. + +Furthermore, all dApps on the Ethereum platform have to share the same gas, and the same blockchain, and this compounds the problem. If an existing business running a dApp on the platform becomes suddenly popular, the surge of people wanting to use the dApp must purchase gas, and this causes the price of gas to rapidly rise. The burst of activity can also cause the blockchain to grind to a halt. + +While the spike in the price of gas can be advantageous for financial speculation, it is arguably terrible for everything else. For example, a startup business that wants to serve a new customer base using the same gas-based platform must now convince their potential customers to purchase the platform's gas at an unpredictably high price. + +Until blockchain technology is capable of processing potentially billions, if not trillions, of transactions per second on a single blockchain, the gas-based blockchain platform is fundamentally flawed for today's market. The more popular a gas-based platform becomes, the more difficult, expensive, and prohibitive it is for businesses to develop on it, and for users to buy into it. + +Having observed crucial flaws in the currently popular gas-based smart-contract platform, we are now prepared to turn to the smart-contract solution Komodo proposes. + +## Introducing Antara Modules + +Recall that Satoshi Nakamoto's Bitcoin Script is not Turing complete. This choice was deliberate. Leaving Bitcoin Script in a simple form was a quicker, safer alternative to a Turing complete language. This is true because it removes the possibility of infinite loops clogging the Bitcoin network. + +However, at the same time, the lack of Turing completeness also prevented smart-contract-like functionality on Bitcoin-protocol based blockchains — until now. + +Komodo now offers Antara Modules. These modules allow for the same functionalities found in smart contracts, and even more advanced features. This new technology is compatible with Bitcoin-protocol based blockchains, and this includes all Komodo Smart Chains. + +Furthermore, Antara Modules gain more usefulness when combined with Komodo's unique design. Recall that Komodo is built not to require all developers and users to function on the main Komodo blockchain. Rather, Komodo empowers developers with their own independent blockchain, each secured with the hash rate of Bitcoin. This facilitates an interconnected network between all Smart Chains through Komodo's other technologies, such as atomic-swaps, cross-chain syncing, and more. + +This combination of Komodo technologies overcomes the challenges of the currently popular, gas-based, single-blockchain platforms. + +With Antara Modules, the developer can maintain interactivity with the Komodo ecosystem, while also being able to run on a private blockchain. Because the developer has the full blockchain all to themselves, they are able to safely occupy the full transaction capacity without fear of interruption by activity elsewhere in the ecosystem. Developers of highly active blockchains can even split their single blockchain into multiple blockchains, using the Antara framework. + +Likewise, end-users of a blockchain service in the Komodo ecosystem need only purchase the currency of the developer's Smart Chain; there is no need to purchase KMD. Therefore, for the end-user, the price of participating in the developer's business is tied only to the design and success of the developer's blockchain software, and not to the unpredictability of the ecosystem at large. + +In short, if you want to use blockchain technology to compete with the Uber taxi app, Komodo is the platform for you. + +## Antara Modules are Based on Utxo Technology + +Antara Modules function in a completely different manner from the popular gas-based model of other platforms. Before we can explain how Antara Modules work, we must first briefly explain the concept of an "unspent transaction", also called a "utxo," for short. Utxos are integral to a blockchain's functionality, but many users do not know they exist. + +A utxo is simply a bill of value sitting in your digital wallet — much like the many small fiat dollar bills you may have sitting in your physical wallet. The collection of utxos in your digital wallet make up the total balance. + +For example, a user could have in their digital wallet a utxo worth 1 KMD, another utxo worth 2 KMD, and another worth 7 KMD. Altogether, in the software interface the user would see that they have 10 KMD total. Most users would never know that they actually have three separate utxos that make up the full balance, as utxos are typically managed automatically by blockchain software. + +When the user spends money, the blockchain software automatically splits the money they spend into new utxos. If our user desires to spend 6 KMD, the software splits the 7 KMD utxo into two pieces: a 6 KMD utxo is sent to the destination address, as the user instructed, and the remaining 1 KMD is returned to the user as "change." + +The user now has a 1 KMD utxo, a 2 KMD utxo, and another 1 KMD utxo. The total that they see in their wallet is 4 KMD. + +## Antara Modules: Utxo-based Smart Contracts + +Coming to this from a programmer's perspective, a utxo is a programmable object. As with many objects, it allows software to add and subtract properties from it, including properties that allow for Turing-complete programming. In Komodo, utxos allow us to create a smart-contract functionality that is dramatically cheaper to utilize, and more secure in practice; than the gas-based models of other platforms. + +In its simplest form, an Antara Module locks a utxo in a publicly-known address and prevents it from being spent until a certain set of conditions are met. Once the conditions are fulfilled, the utxo is unlocked and sent to the appropriate address. The idea behind it really is that simple. + +It is fundamentally different than the gas-based model. In the gas-based model, a user has a total balance and they instruct their blockchain software to execute a smart-contract either until the contract is complete, or their total balance is gone. + +With Komodo's Antara Modules, a user locks a series of utxos in a contract with a set of instructions that must be met before the utxo can be sent to its final destination. + +This is a dramatically more secure setup. Only the utxos that have been indicated as belonging to an instance of an Antara Module can be spent. This is different from the gas-based model, where a bug in the software can (and frequently does) allow a faulty smart contract to drain the full balance of a wallet. + +Before diving any deeper into Antara Modules, we need to understand a few things about Bitcoin Scripts. + +## How Antara Modules Interact with Bitcoin Script + +There are several different ways to execute a Bitcoin payment. In particular, there are pay-to-pubkey payments, pay-to-pubkey-hash payments, and pay-to-script-hash payments. These three payment types represent the overwhelming majority of Bitcoin transactions, and each type of payment is limited in the possibilities it allows to the user and the developer. + +Now, Komodo has implemented an additional type of payment script that designates a utxo as belonging to a specific instance of an Antara Module. In other words, this new payment script puts constraints on the utxo. The name of this new script is called a "CryptoCondition," and we explore the specifications of this script in later articles. + +#### Antara Modules Maintain Scarcity Within the Module + +Every Antara Module has its own unique code, called an "EVAL" code, and this keeps funds in one module separate from another, and separate from the main Smart Chain's coins. + +When a user spends funds in a manner that links a utxo with an Antara Module, the utxo is locked to this EVAL code in the utxo-data structure. + +This keeps the utxo associated with the Antara Module, and thus the utxo is not free to enter into another Antara Module unles the current module allows this behavior. + +#### A User Has a Unique Address for Each Antara Module +For each Antara Module, the user has a unique address that can only be used with funds created as a part of this module. This keeps funds that are created within an Antara Module separate from funds that are created in other Antara Modules. In this manner, there is never any confusion about where funds are sent. + +#### Each Module Has a Global Address + +Each Antara Module also has a global address that is known and usable by everyone. Even the private key to this address is public. + +Making the private key public allows users to interact with the module using lite-mode software (i.e. syncing the blockchain is not required). Also, the global address serves as a repository of information for all users within the module. + +The global address allows all users to query the state of the module and discover current and past behavior. + +#### Developers Set the Rules for Each Module-Related Transaction + +At the same time, the funds within this module cannot be moved until all the conditions of the module are satisfied. + +For example, the module can require that funds only be spent to a specific and approved address, as set in advance by a group of collaborating users. This is similar to the Bitcoin Lightning Network's intended effect, yet dramatically simpler in design. + +With these rules in place, an Antara Module effectively becomes a miniature consensus mechanism. The module forces consensus for its participants, just like the master consensus mechanism of the Smart Chain. + +Now let's take a closer look at the many advantages of Antara Modules. + +## Advantages Of Antara Modules + +#### Access to Established and Turing Complete Languages + +Antara Modules are hard-coded into the Komodo code base, which means they can be written in C and C++. They can also be written in any compiled programming language that can create a linkable library capable of calling and being called by C/C++ functions. In that sense, Komodo’s utxo-based contracts are language agnostic. + +The C and C++ programming languages are widely understood, time-tested, and, perhaps most importantly, Turing complete. Thus, utxo-based smart contracts can be programmed to do anything that any other existing program or application is able to do. + +#### No Need for a Virtual Machine + +Because Antara Modules on Komodo run in the daemon, developers can avoid the limitations and hassles of having to run code in a virtual machine, as is the case with the many gas-based smart contract platforms. On Komodo, you have far more speed, flexibility, and power. This is made possible by our unique design of connecting independent blockchains together, rather than forcing all users to run on a layer-one main chain. + +#### Utxos are More Secure Than Balance-Based Programming + +Utxo-based modules are more secure than balance-based smart contracts. This is true in several ways. For example, because Komodo’s modules are utxo-based, it is far more difficult, if not impossible, to use a module to flood the main chain's coin supply with illegitimate coins. + +This is not the case with balance-based smart contracts. Because the smart contracts are linked to balances, rather than blockchain-enforced utxos, a malicious actor can manipulate balances to disastrous ends. We have seen this happen again and again and again. + +#### RPCs Make Module Consumption Easy + +Utxo-based smart contracts are also essentially an extension of the Bitcoin protocol, so a series of Remote Procedure Calls (RPCs) can be established. With an RPC, a normal developer can bring the functionality of an existing Antara Module into a foreign software environment with a simple command. + +With many Antara Modules, a Graphic User Interface (GUI) can allow non-technical users to make use of the technology without needing to work through the command line. Eventually, once a large variety of RPC calls are available, a normal developer should be able to build decentralized software using RPC calls alone. + +#### Instantaneous Confirmation + +A challenge that many developers face in the blockchain industry is the aspect of creating software that must wait for decentralized consensus before the software's users can assume finality. + +Antara Modules allow the developer to overcome this challenge. Antara Modules allow for zero-confirmation micro-payments. These micro-payments are secured by Komodo’s delayed Proof of Work security mechanism. The payments are fully peer-to-peer, and are considered confirmed as soon as they are initiated. + +#### No Need for Gas + +Antara Modules do not require a shared “gas” coin for every process executed. Recall that the smart contracts and dApps built on Ethereum must pay in Ethereum's ecosystem-wide gas (Ether) for every single step of progress. The tremendous expense placed on common users and developers makes complex blockchain-based software nigh impossible. + +Komodo, on the other hand, is far more scalable as the cost of blockchain processing is tied only to an individual Smart Chain's native coin, and not to the main Komodo coin (KMD) that ties the ecosystem together. + +## Difficult to Create, but Easy to Reuse + +Creating a new Antara Module is more difficult than creating a new smart contract on a gas-based platform. However, the functionality of a module need only be programmed once, and then other users in the Komodo ecosystem can reuse the finished module. + +Building and designing a new Antara Module requires a strong proficiency in blockchain technology and in advanced programming techniques. The module must be stable and secure enough to withstand the pressure of the wild-open Internet. + +However, once created, other users may rely on the module's RPC commands to utilize the module's functionality without having to understand how the module functions. + +For example, consider how the MuSig Antara Module serves non-blockchain developers. This module relies on Antara to enable a complicated technology called Schnorr Signatures, which are a new method for creating multi-signature blockchain transactions. The RPC's for this module allow any developer of essentially any skill level to adopt the MuSig functionality into the developer's software without having to gain an in-depth understanding of Schnorr technology. + +[See the MuSig module documentation here](../customconsensus/musig.html#introduction) + +As the library of available modules grows, so too do the advantages to the many types of developers in the Komodo ecosystem. For this reason, members of the Komodo community express gratitude to the more experienced blockchain developers who build and share Antara Modules via open-source ideology. + +## Komodo is Developing and Testing Default Modules + +The Komodo team has already created many Antara Modules that are freely available for all developers in the Komodo ecosystem. The team is also exhaustively testing the Antara Modules' code prior to implementation, to ensure a quality and bug-free environment. + +Once complete, the modules are embedded into the default source code of a Komodo Smart Chain. This technology is provided using open-source philosophy, and thus anyone can verify the code of the modules. + +If you would like to have an Antara Module available that is not already in the code base, submit a Pull Request to the Komodo repository on Github with the details of your desired module. If accepted, Komodo will write the module and make it available to all users during our next hard fork. This occurs on an annual or semi-annual basis. + +To our knowledge, no other blockchain project has successfully implemented utxo-based contracts on a live chain. Considering atomic swaps, on-demand scalability, cross-chain interoperability syncing, and utxo-based modules, the Komodo team continues to develop technologies at the bleeding edge of the blockchain industry. + +Join us for Part II of this discussion. Part II delves a little deeper into the methods of Antara Module functionality, and continues preparing the developer for Antara Module utilization. + +[Link to Part II of an Overview of Antara Modules](../../../basic-docs/antara/antara-tutorials/antara-conceptual-overview.html#introduction) +# Overview of Antara Modules - Part II + +## Introduction + +Welcome to an Overview of Antara Modules - Part II. + +The following content is provided for developers desiring to discover deeper levels of potential in Komodo software. The content covers technical aspects of Antara Modules that are not necessary for a common user to understand. Learning this content can help any developer in the Komodo ecosystem utilize or create new Antara Modules. + +#### Assumptions for this Content + +This discussion is intended for developers who feel confident in at least one mainstream programming language, and who understand the core concepts of blockchain and Komodo technology. + +Other readers, such as business or marketing developers, may also find the content useful, although some topics may be difficult to understand. We invite any interested reader to reach out to our team on [Discord](https://komodoplatform.com/discord) with questions. + +Consider reading the following resources, if necessary. + +- [Overview of Antara Modules - Part I](../../../basic-docs/antara/antara-tutorials/antara-overview.html#introduction) +- [The Komodo Whitepaper](https://komodoplatform.com/whitepaper) +- [Mastering Bitcoin](https://github.com/bitcoinbook/bitcoinbook) + +#### Before We Begin: A Brief Note for Non-Blockchain Developers + +Creating a new Antara Module is challenging. Fortunately, not every developer in the Komodo ecosystem is expected to program new modules from scratch. Rather, Komodo anticipates that many developers will consume existing modules without attempting to create new modules. + +Each module built on the Antara framework can be designed to have Remote Procedure Calls (RPC's) that can be called quickly and easily from other software and programming languages. + +A good example can be seen in the MuSig module. This module uses the Antara framework to enable a complicated and useful technology called Schnorr Signatures. The RPC's for this module allow any developer of essentially any skill level to adopt MuSig functionality into their software without having to gain an in-depth understanding of Schnorr technology. + +[See the MuSig module documentation here](../customconsensus/musig.html#introduction) + +As the library of available modules grows, so too do the advantages to the many types of developers in the Komodo ecosystem. + +## Understanding the Problem that Antara Modules Solve + +Antara is Komodo's technology framework that developers use while creating decentralized software. Antara Modules are but one aspect of the wider Antara framework. The modules are a crucial element of the framework, as they allow any capable developer to directly add arbitrary code into the Smart Chain itself. + +The reader may better understand the purpose and use case of Antara Modules by first understanding the key problem that they solve. + +#### A Consensus Mechanism Is Not Easy to Create or Change + +Adding new code into a blockchain's consensus mechanism (CM) is a challenging task. Creating an entirely new CM is more difficult by an order of magnitude. Yet, despite these facts, often when an experienced developer first approaches blockchain technology with creative intent, their initial impulse is to dive directly into the CM itself. As time passes, the developer can come to a realization that they are attempting to solve a problem that is too large for any one person. + +Consider the Bitcoin consensus mechanism. This protocol is approximately ten years old and receives perhaps more attention than all other blockchain protocols combined. Every year, thousands upon thousands of the world's most intelligent developers, mathematicians, and cryptographers pore over the intricacies of this profitable technology. Yet, despite this valuable insight, mistakes in the code continue to reveal themselves: in 2018, the Bitcoin Core and Bitcoin Cash teams together [discovered a flaw in the code](https://www.coindesk.com/the-latest-bitcoin-bug-was-so-bad-developers-kept-its-full-details-a-secret) that would have allowed a malicious user to print an arbitrary number of new Bitcoins. + + + +Mistakes in the code of a CM can cause economic instability, and volatility of this nature can wreak havoc on the lives of the CM's users. For this reason, seasoned blockchain engineers often avoid changing the CM altogether, once it is relatively stable. + +For those few projects that create a useful and unique consensus mechanism, a new challenge immediately presents itself. If the CM relies on a Proof of Work type model, the project team must attract a sufficient number of miners. If the CM is more akin to Proof of Stake, the team must ensure the blockchain's total stake is distributed in a manner that ensures trustlessness. Neither of these tasks are easy to achieve. + +In light of these challenges, the blockchain engineer finds themselves confronted with a paradox. The engineer desires to create something new, and at the same time, they cannot easily change the core software. + +#### A Popular, But Flawed Solution: The Decentralized Virtual Machine + +A popular solution to this paradox is to associate the consensus mechanism (CM) with a virtual machine (VM). This method was made popular by the Ethereum project. + +In this model, the CM's design can be similar to existing and stable CM's, but it has one difference. The CM listens to instructions given by an external VM that is decentralized across all validating nodes. While code inside the VM can be arbitrary, the CM does not listen to the code's execution. Instead, the CM only listens to the same data as before: the history of transactions and associated meta data. + +This solution is more effective than writing an entirely new CM, yet the solution is limited. The limitations include: the requirement of working in the mandatory VM programming language, such as Solidity; an excessive dependency on the core-software development team; volatile economics, and a lack of blockchain processing and storage capacity. + +The requirement of the limited programming language derives from security concerns. All validating nodes in the decentralized VM must run all blockchain-related code in the ecosystem. Having this code written in a unique language designed for the VM reduces the available opportunities to malicious actors. While the limitation provides baseline security, the customized and often unstable nature of the VM programming language can make the creative process difficult. Also, the need to master a new language adds an additional burden to the developer. + +The dependency on the blockchain's core engineers also slows creative progress for ecosystem developers. When the ecosystem developer discovers a new core-level technology that would increase the developer's productivity and creativity, they must convince the main chain's core-software team to implement the new feature. The core-software engineers, however, may have conflicting interests, as their decisions must meet the needs of all developers and users in their ecosystem. + +In many of the VM-based models, economics for blockchain usage can be volatile. The underlying "gas" token that the VM requires (such as Ether) can change in price and value according to the interests of the uneducated masses. This may sound advantageous to a speculator, but a practical business will find that the volatility scares away new users. + +The fact that the VM frequently relies on a single blockchain further hinders developers and users. Block space can be in short supply due to high demand on popular chains. Furthermore, data that is entirely irrelevant to the developer can become required baggage. + +These challenges make the VM model unpleasant for many experienced blockchain engineers. In fact, before Komodo existed, these very concerns inspired the Komodo engineers to avoid the VM model in search of a better solution. + +Antara Modules provide this solution through Komodo's integration of a technology called CryptoConditions. + +## CryptoConditions: An Industry-Wide Standard + +CryptoConditions is a technology that allows for arbitrary logical conditions and fulfillments to be evaluated as a part of consensus. This allows for a Smart Chain's consensus mechanism to evaluate the results of arbitrary code and update state in the blockchain's data in a decentralized and secure fashion. + +CryptoConditions technology is not a new concept. The [Interledger](https://interledger.org/) team originally proposed this technology in 2016. + +The [original proposal](https://tools.ietf.org/html/draft-thomas-crypto-conditions-01) was that it would be an open-source industry-wide standard format. The Interledger team does not seem to have continued exploring the technology beyond the original proposal. + +Komodo, on the other hand, found the CryptoConditions concept to be intriguing. In 2018, Komodo adopted this open-source technology into the suite of offerings in our Antara framework. + +Our implementation uses many of the key ideas put forth by the Interledger team, and at the same time we depart in several significant ways. Those who are curious for specific details on this topic can explore the open-source code in the respective repositories. + +The important takeaway is that Antara Modules rely on a core technology called, CryptoConditions (CC). This technology allows a developer to add arbitrary logical conditions and fulfillment to their Smart Chain, and to rely on the consensus mechanism to ensure state integrity in a decentralized environment. + +## Creativity at the Consensus Level, Without Losing the Consensus Mechanism + +Antara Modules and CryptoConditions together allow a developer to add arbitrary code at the consensus level, and within the core software's daemon, without interfering with the existing consensus mechanism (CM). This grants the developer the ability to add core-level features and innovations without waiting for the approval of other members of the Komodo ecosystem. Combined with Komodo's Bitcoin-hash rate security, the simplicity of Antara Modules provides the developer with a competitive level of creative freedom. + +The entry point between Antara Modules and the CM is a new Bitcoin-script [operation code](https://bitcoin.org/en/glossary/op-code), "OP_CHECKCRYPTOCONDITIONS", or OP_CCC for short. When executed, OP_CCC is able to initiate additional arbitrary code that is written in any programming language, assuming the language can call and execute C/C++ code in return. The arbitrary code is separate from the CM, thus maintaining the CM's reliability. When the arbitrary code completes, OP_CCC returns a `true` or `false` statement to the daemon. If the returned OP_CCC value is `true`, the daemon performs a transaction. + +The transaction can contain meta data in the normal manner. Therefore, these transactions can also implement other data-storage features of Komodo software. Examples include the [key-value storage](../komodo-api/blockchain.html#kvupdate) feature, the [Oracles CC Module](../customconsensus/oracles.html#introduction), or the native `vout` and `batontxid` key-value pairs. + +With access to the meta data established, Antara Modules are able to act as an application-state manager. State-related data is held in utxos that are accessible to the CM. As application-state management is based on the utxo model, the management also follows the CM's rules for consensus. This powerful combination allows the developer to collect, organize, and act upon data in a securely decentralized manner. + +In addition, once the data is notarized, it can also be called by other Komodo-based Smart Chains, depending on the manner in which the developer(s) form their chain. This allows developers to form clusters of blockchains to enhance their software, as opposed to relying on a single blockchain, or on a single child chain. The speed and data-storage capabilities of a cluster are thus exponentially greater than the offerings of many VM-based competitors. + +Also of note is the simplicity of the Antara Module architecture. All new code created for an individual Antara Module is contained in an optional library. Modules from the library are included in compilation only on participating blockchains. In this manner, developers who desire a module's functionality can include the necessary libraries, and those who do not require the module can avoid this excess baggage. + +The Komodo daemon has no need of an external VM. This eliminates what would otherwise be a cumbersome requirement for the developer and the core engineers. At the same time, the daemon offers all the capabilities of a VM-based blockchain — ⁠and arguably more. + +## Antara Modules In Action: Accomplishing Years' Worth of Work In But A Weekend + +Examples of the power of Antara Modules can be found by observing existing modules. Consider how Antara allowed the Komodo ecosystem to swiftly and easily upgrade the Komodo consensus mechanism (CM) to include quantum-proofing capabilities. + +In years past, other blockchain projects in the cryptocurrency community had focused on manually upgrading their CM for quantum-proofing protection. Although this feature appeared to be an advantage, this was not true. Adding customized code to the CM itself to protect addresses from quantum-capable computers was a time-consuming and expensive process. + +Paradoxically, once the new quantum-proof CM was achieved, it only served to isolate the project team. The code itself was untested and unreliable, and the users of the cryptocurrency community had to endure these roadblocks. Furthermore, the customized CM was often incompatible with much of the activity in the open-source blockchain ecosystem; for each industry-wide technological advancement, the team often had to adapt their customized CM on their own. + +Komodo's engineers chose not to spend energy building a new quantum-proof CM, but rather they worked to add Antara Modules first. Once this technology was available, the Komodo core software team took existing quantum-proofing technology, read summaries published by academics and researchers, and created a new Antara Module to add quantum-proofing functionality to the Komodo CM. + +The time between project initiation and releasing a beta version for community testing was approximately one weekend. Only one core developer's attention was required. The Komodo daemon remains compatible with all other software features as before, able to quickly adopt new ideas from others in the open-source community as soon as they arrive. At the same time, users who desire quantum proofing for their long-term financial interests have a module readily available, and users who are not interested have not experienced an interruption in their blockchain services. + +The ability to adopt the ideas of others quickly, while maintaining the accomplishments, security, and compatibilities of one's predecessors, makes Antara Modules a wise choice for experienced developers who wish to have the most advanced technology available without a significant hassle. +# Rogue Module Tutorial + +The Rogue Fluidity module is a Fluidity implementation of the classic Unix game, Rogue. + +This tutorial documentation is associated with the Rogue API documentation. + +[Link to Rogue API documentation](../basic-docs/fluidity/fluidity-api/rogue.html#rogue) + +## Introduction + +The Rogue Fluidity module serves as a proof-of-concept to demonstrate Fluidity's capabilities as a blockchain-based gaming technology. + +The Rogue module is based on the classic [Rogue](http://www.livingroguelike.com/rl-games/the-original-rogue-information-and-how-to-play-online/) game. As such, it can be categorized as a [Roguelike.](http://www.livingroguelike.com/roguelike-info-discussions/what-is-a-roguelike/) + +The core aspects of Rogue gameplay occur on the blockchain. These aspects include such data as character health points, items, movement, attacks, and other relevant game states. + +Komodo's Rogue implementation makes use of the classic on-screen visual representation of gameplay. This interface relies on ASCII characters to represent characters, items, and other in-game objects and actions. + +The procedures to launch and finish a game require the execution of various methods (RPCs). To make the game more easy to start and finish for players who are not comfortable with the terminal, the Komodo team has created a Terminal User Interface (TUI). + +The following installation and walkthrough tutorials can assist the reader in testing Rogue. For more information, please reach out to our community on [Discord](https://komodoplatform.com/discord). The #cc-rogue channel is available for questions and assistance. + +## Installation + +### Requirements + +Rogue is available for modern MacOS, Linux, and Windows operating systems. + +### Download Software Bundles + +Komodo provides downloadable software bundles that contain all necessary components. The user need only download and unzip the contents for their appropriate operating system and they are ready for gameplay. + +Software bundles can be found in the link below: + +[Link to software bundles](https://github.com/tonymorony/komodo_customconsensus_tui/releases) + +Please feel free to ask on our #cc-rogue channel on [Discord](https://komodoplatform.com/discord) for updates and assistance. + +### Compile Rogue Software Manually + +The following instructions are necessary only for users/developers who wish to compile Rogue software from source code. Users who have already downloaded the software bundles linked above do not need to compile source code manually. + +#### Install Dependencies + +##### Linux + +```bash +sudo apt-get update && sudo apt-get upgrade -y +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl libcurl4-gnutls-dev cmake clang libsodium-dev -y +``` + +##### MacOS (OSX) + +Use the terminal to ensure the MacOS XCode tools are installed: + +```bash +xcode-select --install +``` + +Ensure the latest version of `brew` is installed. If necessary, execute the following command: + +```bash +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + +Once `brew` is installed, execute each of the following commands: + +```bash +brew update +brew upgrade +brew tap discoteq/discoteq; brew install flock +brew install autoconf autogen automake +brew install gcc@6 +brew install binutils +brew install protobuf +brew install coreutils +brew install wget +``` + +##### Windows + +Playing Rogue on Windows requires an installation of MinGW, which can be downloaded here: + +[Link to MinGW](http://www.mingw.org/) + +Once installed, use a Debian cross-compilation setup and run the following commands in Linux: + +```bash +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl cmake mingw-w64 +curl https://sh.rustup.rs -sSf | sh +source $HOME/.cargo/env +rustup target add x86_64-pc-windows-gnu +``` + +#### Clone & Compile Komodo + +##### Linux + +```bash +cd ~ +git clone https://github.com/jl777/komodo +cd komodo +git checkout FSM +./zcutil/fetch-params.sh +./zcutil/build.sh -j$(nproc) +``` + +##### MacOS + +```bash +cd ~ +git clone https://github.com/jl777/komodo +cd komodo +git checkout FSM +./zcutil/fetch-params.sh +./zcutil/build-mac.sh -j8 +``` + +##### Windows + +```bash +git clone https://github.com/jl777/komodo +cd komodo +git checkout FSM +./zcutil/fetch-params.sh +./zcutil/build-win.sh -j8 +#This can take some time. +``` + + +::: tip +Change the `8` in the `-j8` portion of the last command to any number of processor threads desired and/or appropriate for your machine. +::: + +##### Update `komodod` + +```bash +cd ~/komodo +git checkout FSM +git pull +./zcutil/build.sh -j$(nproc) +``` + +#### Launch the `ROGUE` chain and Set `pubkey` Value + +##### Step 1 - Start the chain + +Start the ROGUE chain with the following command in a terminal window and wait for the daemon to sync. Keep this terminal open and the daemon running for the duration of your Rogue gameplay. + +```bash +cd ~/komodo/src +./komodod -ac_name=ROGUE -ac_supply=1000000 -addnode=5.9.102.210 -ac_cclib=rogue -ac_perc=10000000 -ac_reward=100000000 -ac_cc=60001 -ac_script=2ea22c80203d1579313abe7d8ea85f48c65ea66fc512c878c0d0e6f6d54036669de940febf8103120c008203000401cc -daemon +``` + +##### Step 2 + +Open a new terminal. This terminal can be used to execute all remaining installation and gameplay commands. + +```bash +./komodo-cli -ac_name=ROGUE getnewaddress +``` + +The returned value is a ROGUE address. We need to find the associated pubkey for this address. + +##### Step 3 + +Use the `validateaddress` method with the address. + +```bash +./komodo-cli -ac_name=ROGUE validateaddress insert_address_here +``` + +The `validateaddress` method will return information similar to the following: + +```JSON +{ + "isvalid": true, + "address": "RPCeZmqW4Aam52DFLmMraWtu5CuXPxqk92", + "scriptPubKey": "76a91498b5caa42ffe9868844c51ba6e085e5e7e92fc2588ac", + "segid": 13, + "ismine": true, + "iswatchonly": false, + "isscript": false, + "pubkey": "02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2", + "iscompressed": true, + "account": "" +} +``` + +Look for the `pubkey` value: + +```bash +"pubkey": "02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2", +``` + +This is the `pubkey` for our address. + +##### Step 4 + +Set the pubkey for the ROGUE Smart Chain. + +```bash +./komodo-cli -ac_name=ROGUE setpubkey 02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2 +``` + + + + + +The pubkey is now set. + +To reuse this pubkey in the future, include the pubkey as a [pubkey](../installations/common-runtime-parameters.html#pubkey) launch parameter. + +Include the `pubkey` in the `-pubkey` launch parameter as follows: + +```bash +cd ~/komodo/src +./komodod -ac_name=ROGUE -pubkey=02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2 -ac_supply=1000000 -addnode=5.9.102.210 -ac_cclib=rogue -ac_perc=10000000 -ac_reward=100000000 -ac_cc=60001 -ac_script=2ea22c80203d1579313abe7d8ea85f48c65ea66fc512c878c0d0e6f6d54036669de940febf8103120c008203000401cc -daemon +``` + +#### Installing the TUI (Optional) + +Komodo offers an unofficial Terminal User Interface (TUI) to allow players to launch and conclude a game without having to interact with the module's API commands. The TUI software is provided for testing and ease-of-use purposes only. + +Use of the TUI is optional, but recommended for most players. + +The TUI software can be found in the downloadable software bundles: + +[Link to downloadable software bundles](https://github.com/tonymorony/komodo_customconsensus_tui/releases) + +## Walkthrough for API + +Under normal circumstances, a user does not need to manually execute methods in the terminal to launch and conclude a game. Rather, the downloadable software bundles contain all necessary tools to play. + +For users/developers who need a reference for the manual process, the following walkthroughs provide detailed step-by-step instructions. + +- [Single-Player Mode Walkthrough](../customconsensus/rogue.html#single-player-mode-walkthrough) +- [Multi-Player Mode Walkthrough](../customconsensus/rogue.html#multi-player-mode-walkthrough) + +### Single-Player Mode Walkthrough + +#### Step 1 + +Open a new terminal and navigate to the `~/komodo/src` directory: + +```bash +cd ~/komodo/src +``` + +#### Step 2 + +Create a new game via the [newgame](../customconsensus/rogue.html#newgame) method. For this example, we choose to have a single player with a `0` buy-in requirement. + +Methods for ROGUE require the use of the [cclib](../komodo-api/cclib.html#cclib) method. The Rogue module's required `EVALCODE` for the `cclib` method is `17`. + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib newgame 17 "[1]" +``` + + + + + +The ROGUE software currently broadcasts the `hex` value automatically. It is not necessary to use the `sendrawtransaction` method. + +The returned transaction id `txid` is the `gametxid`. Save this for future use. + +#### Step 3 + +Check the game's state using the [gameinfo](../customconsensus/rogue.html#gameinfo) method: + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' +``` + + + + + +In the returned json object, observe the `run` value. This lists the specific command that must be executed in the terminal to register the game. + +#### Step 4 + +Register the `gametxid` using the [register](../customconsensus/rogue.html#register) method: + +```bash +./komodo-cli -ac_name=ROGUE cclib register 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' +``` + + + + + + +#### Step 5 + +Check the game's current state again using the [gameinfo](../customconsensus/rogue.html#gameinfo) method. Use the `gametxid` as an argument: + +```bash +./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' +``` + + + + + +Note that the `gameinfo` method now returned a `seed` value, as well as player data. + +In the returned json object, find the `run` value. This is the exact command needed to start the game. + +#### Step 6 - Play + +Wait until the network mines the `register_txid`. Optionally, use the [getrawmempool](../komodo-api/blockchain.html#getrawmempool) method to monitor the status of the transaction. + +Once the transaction is mined, execute the `run` command (found in the returned json object earlier) to start the game: + +```bash +cc/rogue/rogue 3767108440867690538 09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70 +``` + +The game is now running and should be visible on-screen. + +#### Step 7 - Play the Game + +For instructions on in-game controls and objectives, [read this linked section.](../customconsensus/rogue.html#gameplay-documentation) + +#### Step 8 - Bailout + +If your character is still alive and you would like to leave the game while keeping your profits, follow this procedure to save your character: + +To quit the game, type the letter `Q` on the keyboard. This opens a context menu. Type the letter `n` and press `Enter`. + +This begins the process of leaving the game, but you are not finished yet. + +Wait for the ROGUE network to mine all [`keystrokes`](../customconsensus/rogue.html#keystrokes) transactions. To see a list of all `keystrokes` created, check the `keystrokes.log` file in the `~/komodo/src` directory, and use the [getrawmempool](../komodo-api/blockchain.html#getrawmempool) method to verify when the last `keystrokes` are mined. + +When the last transactions are mined, execute the [bailout](../customconsensus/rogue.html#bailout) method to leave the game while keeping the character and items in your `pubkey`, and the method will also transfer your in-game gold to `ROGUE` coins. + +For example: + +```bash +./komodo-cli -ac_name=ROGUE cclib bailout 17 '["09d702b9bf678ee9d4efc29354566b4453e2e4ebdf7bac3496e667e8d435fe70"]' +``` + +After the `bailout` transaction is mined the player may view their surviving character(s) via the [players](../customconsensus/rogue.html#players) and [playerinfo](../customconsensus/rogue.html#playerinfo) methods. + +#### Step 9: Highlander Victory + +In this walkthrough we have used single-player mode. The following [highlander](../customconsensus/rogue.html#highlander) method is only available if the character manages to capture the `amulet` and safely exit the dungeon. In a normal multi-player game, the `highlander` method is available to either the first player to safely retrieve the `amulet`, or to the last player standing after all others have died. + +The player that successfully executes the `highlander` method receives a prize: the collective value of all `ROGUE` coins that were contributed during the buy-in stage. + +The `highlander` method is executed as follows: + +```bash +./komodo-cli -ac_name=ROGUE cclib highlander 17 '["4fd6f5cad0fac455e5989ca6eef111b00292845447075a802e9335879146ad5a"]' +``` + +After the `highlander` transaction is mined the player may view their surviving character(s) via the [players](../customconsensus/rogue.html#players) and [playerinfo](../customconsensus/rogue.html#playerinfo) methods. + +### Multi-Player Mode Walkthrough + +In this walktrough we use two nodes to play a multi-player game of Rogue. + +- Node 1 is `player1` +- Node 2 is `player2` + +For educational purposes, we execute all methods manually, as opposed to using the [TUI](../customconsensus/rogue.html#installing-the-tui-optional). + +#### Step 1: Create a Multi-Player Game + +Open a new terminal and navigate to the `~/komodo/src` directory: + +```bash +cd ~/komodo/src +``` + +For this game, we choose the following details: + +- the max number of players: `2` +- the cost in `ROGUE` coins of the game `buyin`: `0.1` + +Execute the [newgame](../customconsensus/rogue.html#newgame) method on `player1` as follows: + +```bash +./komodo-cli -ac_name=ROGUE cclib newgame 17 '["2","0.1"]' +``` + + + + + +Save the returned `txid` value for future use. This is our `gametxid`. + +Use the [gameinfo](../customconsensus/rogue.html#gameinfo) method to check information about the game: + +```bash +./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' +``` + + + + + +As shown in the returned json object, the game has a `maxplayers` value of `2` and an `openslots` value of `0`, as no players have joined. + +Note that the `gameheight` value is `54265`. This is the block height at which the `gametxid` was created. + +Also note that the `start` value is `54270`. This is the block height at which the `seed` value will be revealed, allowing players to generate the level design and begin the game. + +#### Step 2: Register for the Game + +For our example, `player1` would like to use an existing character that survived a previous game. This allows `player1` to start with all the advantages this character achieved previously, including character statistics and items. + +To activate the existing character, `player1` includes the associated `playertxid` for the character when executing the [register](../customconsensus/rogue.html#register) method. (The `playertxid` values of any `pubkey` can be found using the [players](../customconsensus/rogue.html#players) method.) + +The player also includes the `gametxid` as the first argument of the `register` method. + +```bash +./komodo-cli -ac_name=ROGUE cclib register 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde","8005f81a604df6bbfae91dc8252505df43edbdf06492a2201362cb42dba4d8f2"]' +``` + + + + + +In our example, the `player2` node does not have a character from a previous game, and therefore `player2` executes the `register` method with only the `gametxid`. + +```bash +./komodo-cli -ac_name=ROGUE cclib register 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' +``` + + + + + +Wait until the `txid` values returned on both nodes are mined. (Use the [getrawmempool](../komodo-api/blockchain.html#getrawmempool) method to check the transaction's status.) + +After the transactions are mined, use the [gameinfo](../customconsensus/rogue.html#gameinfo) method to check the game's status again: + +```bash +./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' +``` + + + + + +The `openslots` value is now `0`, as `2` players have joined. + +Note also that the `start` block height has past, and therefore the `seed` value is available. + +Also note that the response includes information about the `playertxid` character provided by `player1` during registration. + +The game is prepared. Both players may begin the game using the command found in the returned `run` value. + +```bash +cc/rogue/rogue 3928429259918614461 4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde +``` + +#### Step 3: Play and Finish the Game + +[View this linked section for instructions on gameplay.](../customconsensus/rogue.html#gameplay-documentation) + +In our example, `player1` decides to bail out of the game without waiting until `player2` dies, and without retrieving the `amulet` from the dungeon. + +To exit, `player1` executes the [bailout](../customconsensus/rogue.html#bailout) method: + +```bash +./komodo-cli -ac_name=ROGUE cclib bailout 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' +``` + + + + + +With the `bailout` transaction mined, the `gameinfo` method now returns updated information: + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' +``` + + + + + +Note that the `alive` property has a value of `1`, indicating that the `player1` character has left and the `player2` character remains. Also note that in the `players` array, the first json object (which describes the `player1` node) has a `status` of `finished`. + +Since `player1` left early, `player2` is the last character standing. The [highlander](../customconsensus/rogue.html#highlander) method is now available to him. + +`player2` first begins the exit procedure by entering `Q`, then `y + Enter`. + +With the exit process in motion, `player2` executes the `highlander` method: + +```bash +./komodo-cli -ac_name=ROGUE cclib highlander 17 '["4ccf9ca8b1198b35b48dc7126c6b9648b243c44076e4c4e4fe474b129028abde"]' +``` + + + + + +The multi-player game is now finished. The `player2` node received the `highlander` prize, including the total `buyin` amount and an increased conversion rate of in-game gold to `ROGUE` coins. + +After the `bailout` and `highlander` transactions are mined, the players may view their surviving character via the [players](../customconsensus/rogue.html#players) and [playerinfo](../customconsensus/rogue.html#playerinfo) methods. + + +## Gameplay Documentation + +As Komodo's Rogue implementation is based off of the classic Rogue game, the classic manual provides the basic instructions for the game: + +[Link to Classic Rogue Manual Here](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) + +After reading the linked manual, there are additional aspects to keep in mind for Komodo's unique implementation. + +### Gameplay Modes + +Komodo's Rogue features two different game modes. There is one mode for single-player gameplay, where the `maxplayer` value is set to `1`, and one mode for multi-player gameplay, where the `maxplayer` value is greater than `1`. + +#### Single-Player Mode + +The single-player mode is more limited in nature. In general, this mode is for practicing or farming purposes. + +There are no time limits. + +As soon as the `register_txid` is confirmed the player may begin to play. + +When concluding the game, the conversion of in-game gold to `ROGUE` coins is halved. See the [highlander](../customconsensus/rogue.html#highlander) and [bailout](../customconsensus/rogue.html#bailout) methods for further details. + +#### Multi-Player Mode + +If more than one player is allowed in the game parameters, the game goes into "Highlander" mode. In this mode, there can be only one winner of each game. The winner is either the last player standing, or the first player to retrieve the `amulet` and successfully exit the dungeon. + +Multi-player mode also adds a time limit that is based on the frequency of keystrokes. So long as the players are frequently entering commands, the time limit will expire in approximately one hour. If players are not frequently entering keystrokes, the time limit can vary. + +There is a waiting period after the `gametxid` is confirmed. This ensures that no player receives an unfair advantage via advanced knowledge of the start time. The delay is `5` blocks. On a default Smart Chain, this creates a `5` minute wait period. Once the `5` blocks are mined, the Smart Chain automatically reveals a `seed` that is created using blockchain-based provable randomization. The `seed` provides the basis for level-design generation. After the level is generated, the players may begin to play. + +Due to the fact that the entropy (based on the `seed`) was the same for both players during level generation, both players will begin at dungeon-level `1`. However, the generation of levels greater than `1` take into account the gameplay of the characters, and therefore the level designs will be different for each player. + +There are two methods for winning the game. The most direct way to win the game is to obtain the `amulet` and return from the dungeon. Alternatively, the player also may win by having the last surviving character. The winner receives all of the `buyin` coins that were originally contributed, as well as an increased conversion ratio for their in-game gold to `ROGUE` reward. + +See the [highlander](../customconsensus/rogue.html#highlander) method for further details. + +### The Mechanics of Saving, Trading, and Reusing Characters + +::: tip Note + +Due to the nature of saving and reusing characters, the Komodo implementation of Rogue changes the manner in which the user saves characters. Instead of typing `s` on the keyboard, type `Q + y + Enter`, then execute the [bailout](../customconsensus/rogue.html#bailout) method to conclude the game. + +::: + +If a player successfully uses either the [highlander](../customconsensus/rogue.html#highlander) or [bailout](../customconsensus/rogue.html#bailout) method to conclude a game, the player may save their character, items, and achieved characteristics. They also convert the character's in-game gold to `ROGUE` coins. The ratio of conversion depends upon the game conditions; see the `highlander` and `bailout` methods for further details. + +#### Recalling an Existing Character + +When either of these methods are executed, the returned response includes a `playertxid` transaction id. The `playertxid` represents the state of this character at the completion of the game. It is used as an argument for the [register](../customconsensus/rogue.html#register) method when recalling the character, items, and achieved characteristics into a future game. + +The `playertxid` value changes with each game, and therefore only the most recent `playertxid` for a character should be used. To see a complete list of current `playertxid` values belonging to the user's `pubkey`, use the [playerinfo](../customconsensus/rogue.html#playerinfo) method. + +When the user registers an existing character, the game dungeon's difficulty begins at level `1`, and the character has no gold (as it was converted to `ROGUE` coins). Also, even if the character has armor and a wielded weapon in their item list, these items are not equipped by default. The player must equip them at the start of the game by typing the letters `w` for weapon and `W` for armor. + +One gameplay element that the Komodo team has changed from classic Rogue is the ability to scale the amount of inventory the character may carry according to the character's strength. The formula is as follows: + +``` +current max inventory = character strength * 2 +``` + +The highest `max inventory` value is `23` unique letters. Throwable-object packages count as a single item. + +If the user bails out of a game while holding more items than they are allowed to carry, the game will automatically flush items from the character's inventory as a part of the `bailout` method. + +#### Trading an Existing Character + +A character that survived a game is also a non-fungible asset and can be traded on the blockchain. When trading a character, the user does not use the `playertxid` value. Rather, the user employs the `tokentxid` value. This `tokentxid` is used in coordination with the [Tokens CC](../customconsensus/tokens.html#introduction) module for on-chain trading. + +The `tokentxid` can be found by using the [playerinfo](../customconsensus/rogue.html#playerinfo) method and submitting the known `playertxid` as an argument. For more information, see the `playerinfo` method. + +The `tokentxid` is created at the character's initial creation and does not change throughout the character's life. When the character dies, the `tokentxid` is sent to a burn address, making the character permanently unplayable. + +# Understanding Antara Addresses + +The method of transferring module-related assets is often slightly different than the typical Smart Chain transaction. + +When making a transaction on a Smart Chain, you normally deal with a sending address and a receiving address. To move coins, you might use methods such as sendtoaddress or z_sendmany. + +When using Antara, however, there are a few new types of addresses to keep in mind when working with transactions. It is not necessary to fully understand all of the address types; only a general understanding is needed. + +### Creating and Launching With a Pubkey + +The first address you must understand is the pubkey. Any user using an Antara based module must have a pubkey indicated in their daemon. This forms the basis for all addresses related to various modules. + + + +To get a pubkey, launch the chain with the normal launch parameters and execute the [getnewaddress](../komodo-api/wallet.html#getnewaddress) API command. + +```bash +./komodo-cli -ac_name=HELLOWORLD getnewaddress +``` + +This will return a new address: + +```bash +DO_NOT_USE_ADDRESSgg2ionaes1J5L786 +``` + +Now, execute the [validateaddress](../komodo-api/util.html#validateaddress) command. + +```bash +./komodo-cli -ac_name=HELLOWORLD validateaddress DO_NOT_USE_ADDRESSgg2ionaes1J5L786 +``` + +This will return a json object with many properties. In the properties you will see: + +```bash +"pubkey": "DO_NOT_USE_ADDRESS019a79b0921a1be6d3ca6f9e8a050feb14eb845fe46b9d756" +``` + +This is will be your module pubkey; you must now indicate it to the daemon. + +To do this, first stop the daemon. + +```bash +./komodo-cli -ac_name=HELLOWORLD stop +``` + +Then relaunch your daemon using the required parameters, and make sure to include your pubkey as an additional parameter. For example: + +```bash +./komodo-cli -ac_name=HELLOWORLD -ac_supply=777777 -ac_cc=777 -pubkey=DO_NOT_USE_ADDRESS019a79b0921a1be6d3ca6f9e8a050feb14eb845fe46b9d756 +``` + +#### CC Addresses + +The daemon will now use the above pubkey as the basis for all addresses used for the different modules. + +To discover the addresses the pubkey provides, you will typically use an `address` related API command from the list of available commands of your chosen module. For example, the [faucetaddress](../basic-docs/fluidity/fluidity-api/faucet.html#faucetaddress) command would return a response like this: + +```json +{ + "result": "success", + "FaucetCCaddress": "R9zHrofhRbub7ER77B7NrVch3A63R39GuC", + "Faucetmarker": "RKQV4oYs4rvxAWx1J43VnT73rSTVtUeckk", + "GatewaysPubkey": "03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40", + "FaucetCCassets": "RQ3ZQycSBM5MPPEopxoEC6R7VLRo1Fmk6f", + "myCCaddress": "RReGLfH2MTrkeLSepkVy5vnQPE29g7KofS", + "myaddress": "RJYiWn3FRCSSLf9Pe5RJcbrKQYosaMburP" +} +``` + +`FaucetCCaddress` is the address that corresponds to the default Faucet module. + + + +`myCCaddress` is the address your node uses for interacting with the Faucet module. This is the user address for managing funds in an Antara module. + +The `myaddress` property is the normal address that corresponds to your pubkey. This is the user's address for the Smart Chain's main coin. + +::: tip + +For readers who are curious, the letters "CC" are an abbreviation of an internal technology that all Antara modules use while creating unique addresses. + +::: + +The use-cases of the different addresses depends on the functionality in question, and the desired outcome. + +Also, each module has its own API commands for moving coins or tokens. For example, the Tokens module offers the [tokentransfer](../customconsensus/tokens.html#tokentransfer) method. +# Assets + +## Introduction + +The Assets Module provides basic distributed exchange (DEX) functionality for trading `tokens` created using the [Tokens]() module. + +The Asset Module allows anyone to buy or sell tokens using the Smart Chain's coins. + +#### Assets Module Flow + +##### Seller's Perspective + +- A token owner places a new "ask" request with the tokenask method specifying the amount of tokens they want to sell and the price. The assets module then creates a new token ask order and the specified amount of tokens is locked in the CC Assets global address +- To fulfill the ask, a buyer executes the tokenfillask method. The purchased token amount moves from the global CC address to the buyer's token CC address. At the same time, the required amount of coins move from the buyer to seller's address. This process can be repeated so long as tokens remaining in the ask order +- At any time, the creator of an order can cancel it via the tokencancelask method. The remaining tokens will return to their token CC address + +##### Buyer's Perspective + +- A buyer places a new bid using the tokenbid method. The bid specifies the amount of tokens and the price. The Assets Module creates a new token bid order and the specified amount of coins is locked in the modules' global CC address. +- A willing seller executes the tokenfillbid method. The token amount sold moves from the seller's token CC address to the buyer's token CC address. At the same time, the locked coins move from the global CC address to the seller's address. This process can be repeated so long as tokens remain in the bid order +- At any time, the creator of an order can cancel it via the tokencancelbid method. The remaining coins will return to their token CC address + +To retrieve a current list of all active orders, use the tokenorders or mytokenorders methods. + +## assetsaddress + +**assetsaddress (pubkey)** + +The `assetsaddress` method returns information about a asset address according to a specific `pubkey`. If no `pubkey` is provided, the `pubkey` used to launch the daemon is the default. + +### Arguments + +| Structure | Type | Description | +| --------- | ------------------ | --------------------------------- | +| pubkey | (string, optional) | the pubkey of the desired address | + +### Response + +| Structure | Type | Description | +| ------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| AssetsCCaddress | (string) | taking the token contract's EVAL code as a modifier, this is the public address that corresponds to the token contract's privkey | +| AssetsNormalAddress | (string) | the unmodified public address generated from the token contract's privkey | +| myCCaddress | (string) | taking the token contract's EVAL code as a modifier, this is the CC address from the pubkey of the user | +| myaddress | (string) | the public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD assetsaddress 028702e30d8465d6aa85f35d2f58c06a6ee17f23f376b56044dadf7b793f2c12b9 +``` + + + +## mytokenorders + +**mytokenorders [evalcode]** + +The `mytokenorders` method displays the public on-chain orders created by the user's pubkey, which is set in `-pubkey` parameter of komodod. + +The additional `evalcode` parameter allows the display of orders for non-fungible tokens bound to this evalcode. + +The Response from this method is similar to the response from the `tokenorders` method. + +## tokenask + +**tokenask numtokens tokenid price** + +The `tokenask` method posts a public ask order. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Structure | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------ | +| numtokens | (number) | the number of tokens to request in the order | +| tokenid | (string) | the txid that identifies the token | +| price | (number) | the price to pay for each token (units are in coins of the parent asset chain) | + +### Response + +| Structure | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenask 1000 c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 1 +``` + + + +Step 2: Use sendrawtransaction to broadcast the order + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000248403cd63777a2086206592c096ddfa1d4ba2647673b330610968eace2cf7b540200000049483045022100bde9eaf43a43fe252530bcf346be3e336e86f0171b817977d38d6ebd4bb0756e0220735f3292ef012fd56f7476700f5649b23aacf2387f4fa5a537e1b6c6daa6c1d101ffffffff4f2016d356282fca9d8278aa04fbdbed98ac6af0bf7a479959c5bb91f95e8ef5020000007b4c79a276a072a26ba067a5658021028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e278140fe6a2cd6fdb5a359d5d6eea9bcf34e5b7d8e2def612afe9c01af1129b006e68344d8f9905ea5f226cdb1556659df0c8741e8e3def1238761721b66718dabe92ca100af038001e3a10001ffffffff03e803000000000000302ea22c80201ab400e039122028345520ba041ac3e6ec81ad28d8415e78d760d55f41097dd58103120c008203000401cc5087b00e000000002321028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e27ac00000000000000004f6a4c4ce373c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b5900e876481700000021028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e2700000000 +``` + + + +## tokenbid + +**tokenbid numtokens tokenid price** + +The `tokenbid` method posts a public bid order. + +To fill the order, the parent chain's coin must be used. + +The method returns a raw hex, which must be broadcast using [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) to complete the command. + +The `sendrawtransaction` method then returns a `txid`, which is the identification method of the bid order, and should be saved for future use. + +### Arguments + +| Structure | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------ | +| numtokens | (number) | the number of tokens to request in the order | +| tokenid | (string) | the txid that identifies the token | +| price | (number) | the price to pay for each token (units are in coins of the parent asset chain) | + +### Response + +| Structure | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenbid 1000 c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 1 +``` + + + +Use `sendrawtransaction` to publish order + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0100000001484256677a6417030dd99716a47b8c9cb06fba6e57ff4617e9932a6cde2972830100000049483045022100fc1926401b27ba044bbf17c36f36030adae52a188594efc75fe42861ab0b997802205e729d6f5587e5a5296b5649a154ce1fe3c581078fac7ae4e2b4577978c05c8901ffffffff0300e8764817000000302ea22c80201ab400e039122028345520ba041ac3e6ec81ad28d8415e78d760d55f41097dd58103120c008203000401cc10d262684a0300002321028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e27ac00000000000000004f6a4c4ce362c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59e80300000000000021028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e2700000000 +``` + + + +The response is the transaction id. + +## tokencancelask + +**tokencancelask tokenid asktxid** + +The `tokencancelask` method cancels a specific `ask`/`sell` order that you created. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Structure | Type | Description | +| --------- | -------- | ------------------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| asktxid | (string) | the txid that identifies the original ask request | + +### Response + +| Structure | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Issue the call and get your raw transaction HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencancelask 9217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e 7194ae293330af80fdbe4b4b2c8b51194f12e334b4a0489288288c1b7336a65c +``` + + + +Step 2: Broadcast using `sendrawtransaction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + +The response is the transaction id. + +Step 3 (optional): Decode the raw transaction (check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + +## tokencancelbid + +**tokencancelbid tokenid bidtxid** + +The `tokencancelbid` method cancels a specific `bid`/`buy` order that you created. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Structure | Type | Description | +| --------- | -------- | ------------------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| bidtxid | (string) | the txid that identifies the original bid request | + +### Response + +| Structure | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Issue the call and get your raw transaction HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencancelbid 9217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e 7194ae293330af80fdbe4b4b2c8b51194f12e334b4a0489288288c1b7336a65c +``` + + + +Step 2: Send raw transaction / broadcast the HEX value from above + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + +The response is the transaction id. + +Step 3: Decode the raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + +## tokenfillask + +**tokenfillask tokenid asktxid fillamount** + +The `tokenfillask` method fills an existing ask. + +It returns a hex-encoded transaction which should then be broadcast using `sendrawtransaction`. + +### Arguments + +| Structure | Type | Description | +| ---------- | -------- | -------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| asktxid | (string) | the txid that identifies the ask order | +| fillamount | (number) | the amount to fill | + +### Response + +| Structure | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create the raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenfillask 9217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e d1b2676bb118d7bb8604dc5bb0a320a2ffb6f7ee118bfd20ed33be3fbd0b9b62 50 +``` + + + +Step 2: Broadcast the hex using sendrawtransaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000031a47a2fa94f27f7e98645a6827f9382991d76fcfd2d84b96065763d1cfed78fc02000000494830450221008be941e56b10fb51459f66288bb68936c55fd17ecbebd12b142f4575b0fe4bf702205f048ad69269ba81530230496fea42983aad88882b1ef7d08304e1230040fb0001ffffffff629b0bbd3fbe33ed20fd8b11eef7b6ffa220a3b05bdc0486bbd718b16b67b2d1000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa27028140da534b773f52c77ebbd590330468ba49333acc0971da444de512b85d039f59f778c8bab7cb1be909b6473789b237966a0f137a9b24c93ebebe0d83ae34a6bd6fa100af038001e3a10001ffffffff2bf671abc3bdfb673c0103a3bd59282c1aee473c6ccc4b591cdb42dc469d68c4000000004847304402204fa686dfdc7c0b7d42e538751aee0534b54747df4f335fb4d3b0d1a86c68e96d02202083fa811dd4506ad83f6d58a420d31ff7ccbae84ea05399b616e3d6f373682401ffffffff050000000000000000302ea22c80201ab400e039122028345520ba041ac3e6ec81ad28d8415e78d760d55f41097dd58103120c008203000401cc3200000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc0065cd1d00000000232103fcc4b37ee767a67b75503832764b559d764d71c13785482b73609159aa6ae9efacf01710252d090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000004f6a4c4ce3539217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000000000002103fcc4b37ee767a67b75503832764b559d764d71c13785482b73609159aa6ae9ef00000000 +``` + + + +The response is the transaction id. + +Step 3: Wait for the transaction to be confirmed + +## tokenfillbid + +**tokenfillbid tokenid bidtxid fillamount** + +The `tokenfillbid` method fills an existing ask. + +It returns a hex-encoded transaction which should then be broadcast using `sendrawtransaction`. + +### Arguments + +| Structure | Type | Description | +| ---------- | -------- | -------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| bidtxid | (string) | the txid that identifies the bid order | +| fillamount | (number) | the amount to fill | + +### Response + +| Structure | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenfillbid 9217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e d1b2676bb118d7bb8604dc5bb0a320a2ffb6f7ee118bfd20ed33be3fbd0b9b62 50 +``` + + + +Step 2: Broadcast the hex or sendrawtransaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000031a47a2fa94f27f7e98645a6827f9382991d76fcfd2d84b96065763d1cfed78fc02000000494830450221008be941e56b10fb51459f66288bb68936c55fd17ecbebd12b142f4575b0fe4bf702205f048ad69269ba81530230496fea42983aad88882b1ef7d08304e1230040fb0001ffffffff629b0bbd3fbe33ed20fd8b11eef7b6ffa220a3b05bdc0486bbd718b16b67b2d1000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa27028140da534b773f52c77ebbd590330468ba49333acc0971da444de512b85d039f59f778c8bab7cb1be909b6473789b237966a0f137a9b24c93ebebe0d83ae34a6bd6fa100af038001e3a10001ffffffff2bf671abc3bdfb673c0103a3bd59282c1aee473c6ccc4b591cdb42dc469d68c4000000004847304402204fa686dfdc7c0b7d42e538751aee0534b54747df4f335fb4d3b0d1a86c68e96d02202083fa811dd4506ad83f6d58a420d31ff7ccbae84ea05399b616e3d6f373682401ffffffff050000000000000000302ea22c80201ab400e039122028345520ba041ac3e6ec81ad28d8415e78d760d55f41097dd58103120c008203000401cc3200000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc0065cd1d00000000232103fcc4b37ee767a67b75503832764b559d764d71c13785482b73609159aa6ae9efacf01710252d090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000004f6a4c4ce3539217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000000000002103fcc4b37ee767a67b75503832764b559d764d71c13785482b73609159aa6ae9ef00000000 +``` + + + +The response is the transaction id. + +Step 3: Wait for the transaction to be confirmed + +## tokenorders + +**tokenorders (tokenid)** + +The `tokenorders` method displays the public on-chain orderbook for a specific token. If no `tokenid` is provided, it displays the on-chain orderbook for all available tokens. + +Information about the `funcid` property: + +- A lowercase `b` describes an bid offer. + +- An uppercase `B` describes a bid fill. + +- A lowercase `s` describes an ask offer. + +- An uppercase `S` describes the ask fill. + +### Arguments + +| Structure | Type | Description | +| --------- | ------------------ | ------------------------------------- | +| tokenid | (string, optional) | the identifying txid for the token id | + +### Response + +| Structure | Type | Description | +| ------------------- | -------------------------- | ------------------------------------------------------------------------------ | +| funcid | (string) | describes either a bid ask `b`, a bid fill `B`, an ask `s`, or an ask fill `S` | +| txid | (string) | the txid of the identifying order or fill | +| vout | (number) | the vout value | +| amount | (number) | the amount remaining in the bid/ask request | +| bidamount/askamount | (number) | the total amount of the relevant bid or ask request | +| origaddress | (string) | the address that made the original bid `b` or ask `s` | +| tokenid | (string) | the tokenid for the relevant bid/ask request/fill | +| totalrequired | (number, `b` and `s` only) | the total amount available in the original big/ask request/fill | +| price | (number, `b` and `s` only) | the price per token, units are in the parent asset chain's coin | + +#### :pushpin: Examples: + +Show all available orders + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenorders +``` + + + +Show orders for specific token + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenorders c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 +``` + + + + +# Channels + +## Introduction + +The Channels Fluidity module facilitates instant payments in a trustless environment. + +When a payment is executed properly with `channels`, as soon as it enters the mempool the odds that the payment can be withdrawn or attacked decrease to almost zero. Many developers and users may find it advantageous to use `channels` to create a secure instant-payment network that can be used within their business environment. + +#### Channels Module Flow + +- Anyone can create a channel using [channelsopen](../customconsensus/channels.html#channelsopen) + - When creating the channel, the user indicates the number and size of their potential payment(s), and what their destination is +- Once the channel is notarized, at any time in the future the user can execute [channelspayment](../customconsensus/channels.html#channelspayment) to release a specific amount of their available payments + - As soon as the `channelspayment` result enters the mempool, the odds of withdrawing the `txid` from processing decrease to almost zero +- The creator of a channel may close the channel at any time using [channelsclose](../customconsensus/channels.html#channelsclose) + - This shows the receiver that this payment stream is permanently ended +- Once the channel's closure is notarized, the creator may withdraw remaining funds using [channelsrefund](../customconsensus/channels.html#channelsrefund) +- The [channelsinfo](../customconsensus/channels.html#channelsinfo) method reveals public information for any or all available channels on an Smart Chain + +## channelsaddress + +**channelsaddress pubkey** + +The `channelsaddress` method displays the various addresses and their balances for a specified pubkey. + +Under normal circumstances, for the `pubkey` the user provides the destination address of the intended channel. + +The global addresses are not used in the Channels Fluidity module. For more information about unique Fluidity addresses, see [this linked explanation.](../customconsensus/custom-consensus-instructions.html#understanding-the-types-of-addresses) + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ---------------------- | +| pubkey | (string, required) | the destination pubkey | + +### Response + +| Name | Type | Description | +| --------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the method executed successfully | +| ChannelsCCAddress | (string) | taking the contract's EVAL code as a modifier, this is the public address that corresponds to the contract's privkey | +| CCbalance | (numeric) | the unspent amount in `ChannelsCCaddress` | +| ChannelsNormalAddress | (string) | the unmodified normal public address generated from the contract's privkey; this is generally used for markers | +| ChannelsCC1of2Address | (string) | the channel address that will store the funds once the channel is opened; this property is only active when the channel is using coins | +| ChannelsCC1of2TokensAddress | (string) | the channel address that will store the funds once the channel is opened; this property is only active when the channel is using tokens | +| myCCAddress(Channels) | (string) | taking the contract's EVAL code as a modifier, this is the Fluidity address from the `pubkey` [used to launch the daemon](../customconsensus/custom-consensus-instructions.html#creating-and-launching-with-a-pubkey) | +| PubkeyCCaddress(Channels) | (string) | taking the contract's EVAL code as a modifier, this is the Fluidity address from the `pubkey` supplied as the argument | +| myCCbalance | (numeric) | the balance of `myccaddress` in coins | +| myaddress | (string) | the unmodified normal public address of the pubkey [used to launch the daemon](../customconsensus/custom-consensus-instructions.html#creating-and-launching-with-a-pubkey) | +| mybalance | (numeric) | the balance of `myaddress` in coins | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD channelsaddress 0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a +``` + + + +## channelsclose + +**channelsclose open_txid** + +The `channelsclose` method marks a specific channel as closed, meaning that no additional payments will be added to the channel. + +The owner of the `channel` may still execute [channelspayment](../customconsensus/channels.html#channelspayment) for any remaining payments in the channel, until all payments are used or withdrawn. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method then returns a `txid` which is used in the [channelsrefund](../customconsensus/channels.html#channelsrefund) method to reclaim funds. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | -------------------------------------------------------------------------- | +| open_txid | (string) | the unique identifying txid that is created when a channel is first opened | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Close a channel + +```bash +./komodo-cli -ac_name=HELLOWORLD channelsclose 2f95b0f4e3dbe7f5ebc0f9479800c9ff3f44e76f5378313c9406ab5a92ff4631 +``` + +Output from Step 1 + +```json +{ + "result": "success", + "hex": "010000000337bc987132bc04b527260b1243d2c6ec3bcf2ce79dff33542ed665bf428a00360400000049483045022100dacf03fc670dfcedff732374e5dfde63668c8f1bb036076a185d620f84cdbefe02206d5c7af679e42bc35d02d97a1809ea9eba48392409be0ddf6172a76469cb9b3601ffffffff37bc987132bc04b527260b1243d2c6ec3bcf2ce79dff33542ed665bf428a003600000000a74ca5a281a1a0819ca28194a067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272814024c8da3b4a5e9595a360e4b3b44e86aa6627df774fd554ee7e55536dae7bd7af452410e6a827b1f14f63643d6cbf48a1336dde0c26d2e2e249dd9cc4aa9f044da129a5278020e73e4b0745bdf31657ac09e3cf99fd65cb262d8498f86c977ece01b551925f028103020000af038001eba10001ffffffff37bc987132bc04b527260b1243d2c6ec3bcf2ce79dff33542ed665bf428a0036010000007b4c79a276a072a26ba067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba012728140decb986f860f6b67fa458e89c50b90ebef048a72a4bfb0bb0cc8c39a5f0fc8763fdc49780154d56a89be1a7b54d17b5a9c1489c6c2b0feb11c921f75d5e8f1b7a100af038001eba10001ffffffff050087930300000000302ea22c80206dafed6d15c24a9a60f01d5972ee08aeb40ba7849d9af3608e97397364ee16a281031210008203000401cc1027000000000000302ea22c8020c9ada2adfc6c6dec0bd9dd29f4e48c86f84c016abc3552b8815ca3c4a44c561b8103120c008203000401cc1027000000000000302ea22c802019be575785c322e9c7d2ae4b5f3df78c9a38ff7357e9e689f26de8e224cb186c8103120c008203000401cca0ad96a60100000023210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272ac0000000000000000956a4c92eb433146ff925aab06943c3178536fe7443fffc9009847f9c0ebf5e7dbe3f4b0952f210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127221027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a4060000008096980000000000000000000000000000000000000000000000000000000000000000000000000000000000" +} +``` + +Step 2: Broadcast the raw transaction using sendrawtransaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000337bc987132bc04b527260b1243d2c6ec3bcf2ce79dff33542ed665bf428a00360400000049483045022100dacf03fc670dfcedff732374e5dfde63668c8f1bb036076a185d620f84cdbefe02206d5c7af679e42bc35d02d97a1809ea9eba48392409be0ddf6172a76469cb9b3601ffffffff37bc987132bc04b527260b1243d2c6ec3bcf2ce79dff33542ed665bf428a003600000000a74ca5a281a1a0819ca28194a067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272814024c8da3b4a5e9595a360e4b3b44e86aa6627df774fd554ee7e55536dae7bd7af452410e6a827b1f14f63643d6cbf48a1336dde0c26d2e2e249dd9cc4aa9f044da129a5278020e73e4b0745bdf31657ac09e3cf99fd65cb262d8498f86c977ece01b551925f028103020000af038001eba10001ffffffff37bc987132bc04b527260b1243d2c6ec3bcf2ce79dff33542ed665bf428a0036010000007b4c79a276a072a26ba067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba012728140decb986f860f6b67fa458e89c50b90ebef048a72a4bfb0bb0cc8c39a5f0fc8763fdc49780154d56a89be1a7b54d17b5a9c1489c6c2b0feb11c921f75d5e8f1b7a100af038001eba10001ffffffff050087930300000000302ea22c80206dafed6d15c24a9a60f01d5972ee08aeb40ba7849d9af3608e97397364ee16a281031210008203000401cc1027000000000000302ea22c8020c9ada2adfc6c6dec0bd9dd29f4e48c86f84c016abc3552b8815ca3c4a44c561b8103120c008203000401cc1027000000000000302ea22c802019be575785c322e9c7d2ae4b5f3df78c9a38ff7357e9e689f26de8e224cb186c8103120c008203000401cca0ad96a60100000023210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272ac0000000000000000956a4c92eb433146ff925aab06943c3178536fe7443fffc9009847f9c0ebf5e7dbe3f4b0952f210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127221027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a4060000008096980000000000000000000000000000000000000000000000000000000000000000000000000000000000 +``` + + + +## channelsinfo + +**channelsinfo (open_tx_id)** + +The `channelsinfo` method fetches info about channels that are relevant to the user, either as sender or receiver. + +If no `open_tx_id` argument is included, the method returns a list of all channels available to this user. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | -------------------------------------------------------------------------- | +| open_txid | (string, optional) | the unique identifying txid that is created when a channel is first opened | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| name | (string) | the name of the channel | +| Open: | (string) | a channel and its relevant information: address of the destination pubkey, number of payments, denomination per payment, and the channel open_tx_id | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD channelsinfo +``` + + + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD channelsinfo +``` + + + +## channelsopen + +**channelsopen destination_pubkey total_number_of_payments payment_size** + +The `channelsopen` method opens a channel between two public keys (sender and receiver). + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method then returns a `txid` which is the unique identifying `channels_tx_id`. + +### Arguments + +| Name | Type | Description | +| ------------------------ | -------- | ------------------------------------------------------- | +| destination_pubkey | (string) | the public key of the intended recipient of the channel | +| total_number_of_payments | (number) | the total number of payments to allocate in the channel | +| payment_size | (number) | the amount per payment, given in satoshis | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create the raw hex + +```bash +./komodo-cli -ac_name=HELLOWORLD channelsopen 027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a4 10 10000000 +``` + + + +Step 2: Broadcast the hex using `sendrawtransaction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000016ee478b8470aee10aa95878bf306f853406993f953703b47fd373eba9ee7659d030000004847304402201267b68487060b6d80a0e8529271cf203f1a018c2caa508e5bdf798cd2f9099802202553dca29335f4fa491d117f5a268027b738b65b6d0945f892896775d98ae95b01ffffffff0500e1f50500000000302ea22c80206dafed6d15c24a9a60f01d5972ee08aeb40ba7849d9af3608e97397364ee16a281031210008203000401cc1027000000000000302ea22c8020c9ada2adfc6c6dec0bd9dd29f4e48c86f84c016abc3552b8815ca3c4a44c561b8103120c008203000401cc1027000000000000302ea22c802019be575785c322e9c7d2ae4b5f3df78c9a38ff7357e9e689f26de8e224cb186c8103120c008203000401cc20e697a60100000023210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272ac0000000000000000956a4c92eb4f0000000000000000000000000000000000000000000000000000000000000000210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127221027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a40a0000008096980000000000b0a3ff942c0de4972a3bbdc90f1a2851bc498f3c947cbf0d9524ccae118f515b00000000 +``` + + + +## channelspayment + +**channelspayment open_tx_id payment_amount (secret)** + +The `channelspayment` method sends a payment in a channel to the receiver. + +The method requires that the channel `open_tx_id` has either one notarization or 60 confirmations. + +The owner of a channel reveals the password of a unique payment `txid` as a part of the payment. This password is intentionally visible to anyone watching the chain at the time of payment, although the password does not persist in the database. + +If the receiver is monitoring the chain at the time of payment and saves the password, and there is a chain reorganization that nullifies the payment, the receiver now has the password to resend the payment. This option is available so long as the channel remains open and the payment has not been refunded. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method then returns a `txid` which is the unique identifying `channels_tx_id`. + +### Arguments + +| Name | Type | Description | +| ------------------------ | -------- | ------------------------------------------------------- | +| destination_pubkey | (string) | the public key of the intended recipient of the channel | +| total_number_of_payments | (number) | the total number of payments to allocate in the channel | +| payment_size | (number) | the amount per payment, given in satoshis | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD channelspayment 2f95b0f4e3dbe7f5ebc0f9479800c9ff3f44e76f5378313c9406ab5a92ff4631 10000000 +``` + + + +Step 2: Broadcast using `sendrawtransaction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000371f8f5550a8cb53b7bdfb752687cd6aaaf1fedb4dd9414a08ee17fd3460047ed0400000049483045022100c512cbccd63871a3eee9069a90b5447a11912a7a6ccd0eeecdf40b92cd9aca2402200d7b36424e04bc77386ac3f1a030a27919d766485d5bb984234f257cc396527601ffffffff71f8f5550a8cb53b7bdfb752687cd6aaaf1fedb4dd9414a08ee17fd3460047ed00000000a74ca5a281a1a0819ca28194a067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127281400245156c5e4923c9dfbba452f4638da8ef58dc385f7511dca21d4cf87bb3fa564864d8b1f8f81742795181988f50b60bd82db618e11b432351595295eafd1c18a129a5278020e73e4b0745bdf31657ac09e3cf99fd65cb262d8498f86c977ece01b551925f028103020000af038001eba10001ffffffff71f8f5550a8cb53b7bdfb752687cd6aaaf1fedb4dd9414a08ee17fd3460047ed010000007b4c79a276a072a26ba067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba012728140be52fb33d895d684c1bd0a7cb12a735814ef7c22b89a11464215a5f80cde369765fc636153d15a8f17e7faee749b5f87ec5f88530b619586f58cc6452794517fa100af038001eba10001ffffffff060087930300000000302ea22c80206dafed6d15c24a9a60f01d5972ee08aeb40ba7849d9af3608e97397364ee16a281031210008203000401cc1027000000000000302ea22c8020c9ada2adfc6c6dec0bd9dd29f4e48c86f84c016abc3552b8815ca3c4a44c561b8103120c008203000401cc1027000000000000302ea22c802019be575785c322e9c7d2ae4b5f3df78c9a38ff7357e9e689f26de8e224cb186c8103120c008203000401cc80969800000000002321027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a4acc0fb96a60100000023210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272ac0000000000000000956a4c92eb503146ff925aab06943c3178536fe7443fffc9009847f9c0ebf5e7dbe3f4b0952f210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127221027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a4060000000100000000000000f676963e7537d614651bc1a3d5508243ab74e32400e4175ebceb03226b956f1a00000000 +``` + + + +Check that the transaction is confirmed: + +```bash +./komodo-cli -ac_name=HELLOWORLD getrawmempool +``` + +## channelsrefund + +**channelsrefund open_tx_id close_tx_id** + +The `channelsrefund` method withdraws funds directly to the Fluidity address of the channel creator. + +The method can only be executed after the channel `close_tx_id` has either one notarization or 60 confirmations. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| ------------------------ | -------- | ------------------------------------------------------- | +| destination_pubkey | (string) | the public key of the intended recipient of the channel | +| total_number_of_payments | (number) | the total number of payments to allocate in the channel | +| payment_size | (number) | the amount per payment, given in satoshis | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Command + +```bash +./komodo-cli -ac_name=HELLOWORLD channelsrefund 2f95b0f4e3dbe7f5ebc0f9479800c9ff3f44e76f5378313c9406ab5a92ff4631 2079c46cd9f3970f9fd73d8022bf6f30aaf5031bf877d2c541c4c0df1dea1be5 +``` + + + +Step 2: Broadcast the hex using `sendrawtransaction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0100000003e51bea1ddfc0c441c5d277f81b03f5aa306fbf22803dd79f0f97f3d96cc479200300000049483045022100bbed947e3c33b21b8519a7d78dc08cb70d3fe3e6c788119db95a459448caa64c02200a1c73431d118a7fad4f58b760b025f399747e127a46da5c421add2e599b897f01ffffffffe51bea1ddfc0c441c5d277f81b03f5aa306fbf22803dd79f0f97f3d96cc4792000000000a74ca5a281a1a0819ca28194a067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127281403fe5789a3f0e25f46a000f381fc2e7f7b759855184532a6e1e0c5e84d1dc284b4d37422735aa93175ea74d6829ac3b68a7c8c928c22b870ab4b9507bc872dbd6a129a5278020e73e4b0745bdf31657ac09e3cf99fd65cb262d8498f86c977ece01b551925f028103020000af038001eba10001ffffffffe51bea1ddfc0c441c5d277f81b03f5aa306fbf22803dd79f0f97f3d96cc47920010000007b4c79a276a072a26ba067a56580210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127281400b4d6aaeb127417839b76dc78d78379147cfff760f03824e5565aae1c371bbd34559d951cdd2e8622bd5f5aa5528d2a20ee95174c3fea09ef48824ecd647c0b2a100af038001eba10001ffffffff051027000000000000302ea22c8020c9ada2adfc6c6dec0bd9dd29f4e48c86f84c016abc3552b8815ca3c4a44c561b8103120c008203000401cc1027000000000000302ea22c802019be575785c322e9c7d2ae4b5f3df78c9a38ff7357e9e689f26de8e224cb186c8103120c008203000401cc008793030000000023210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272ac805f96a60100000023210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba01272ac0000000000000000956a4c92eb523146ff925aab06943c3178536fe7443fffc9009847f9c0ebf5e7dbe3f4b0952f210324f94e76159d69a5163b91588c3a04dac2c80e0011f713e3bfc5a8b67ba0127221027166e21e9579307a1ae4f8c223516e70aae3cbfab4bd6ac7cebfa625dcc0a2a4060000008096980000000000e51bea1ddfc0c441c5d277f81b03f5aa306fbf22803dd79f0f97f3d96cc4792000000000 +``` + + +# Custom CC (WIP) +This document is a work in progress (WIP) + +We are fortunate to have been gifted the ability to launch provable ecosystems to build upon. This tutorial begins with a quick foundation of core concepts then moving into how to make dApps with layer-1, on-chain consensus. The smart-UTXO system of Komodo's Crypto-Conditions. Consensus & Smart Contract customizations. + +## Blockchain Core Concepts +* Public key cryptography is used when a private and public key pair are used for proving something. +* Private Keys are stored in a wallet, not on the blockchain. +* Private keys sign transactions. +* Signatures on transaction are proven by the network using the corresponding public key to spend the claimed ownership of funds. +* Transactions fill blocks, like an item on a shopping list fills a piece of paper. +* Blocks are arranged in sequential order, forming a chain. +* Each block contains agreed transactional information. The proof of the transactional detail and it's arrangement in the block is called consensus. Consensus is achieved by each participant relying on their own computation. +* Coins & Tokens are used in transaction details to transfer value. +* Nodes is the jargon term for computers that do the computations to maintain the network. +* Maintaining the network is done by validating. OP_CODES are the instructions of the network that need validating. +* Some nodes are heavily computational (miners), some are quiet and store a valuable private key within the wallet. +* There's additional software to make this blockchain useful (for transfering value) & easier to use. Like the internet became useful for transfering information, blockchain technology enables dApps to create new ways of collaborating. Blockchain: Mobile Wallets, DEX, Explorers vs WWW: webserver, database, email & streaming protocols) + +## Goal of our custom consensus module +This `customcc` loadable library example is simply something that requires to send 1 coin. It can't get much simpler. + +## Use jl777 branch + +```bash +git clone https://github.com/jl777/komodo.git +git checkout jl777 +cd komodo/src/cc +code . +``` +Open the 3 files +* customcc.h [src](https://github.com/jl777/komodo/blob/jl777/src/cc/customcc.h) +* customcc.cpp [src](https://github.com/jl777/komodo/blob/jl777/src/cc/customcc.cpp) +* makecustom [src](https://github.com/jl777/komodo/blob/jl777/src/cc/makecustom) + +These are the three files we'll work on for learning how to apply custom consensus to a blockchain. For most 1st & 2nd generation blockchain projects, changing consensus is a bold undertaking. Komodo has turned it into a loadable module removing the risk of severe bugs - no other project offers this to a custom blockchain. + +These 3 files are not boilercode. It may look like boilercode but it's the gateway to much more powerful stuff. This is the pandoras box of dApps. Get ready to understand how to develop on a secure multi-chain distrbuted transactional system. + +## customcc.h header file - definitions of functions and variables +From the top, the comments provide a nice summary of what our custom cclib will do. + +### Name of our custom cclib +One is referenced externally (`MYCCLIBNAME`) at komodo start. The other internally (`MYCCNAME`) when programming for function name prefixes. + +```cpp +std::string MYCCLIBNAME = (char *)"customcc"; +#define MYCCNAME "custom" +``` +`MYCCLIBNAME` This is the name of the loadable library module being created. Here it is "customcc". This is what is used on the command line to load your custom consensus when [starting your custom blockchain](/basic-docs/installations/creating-asset-chains.html) on a komodo server. + +```bash +komodod -ac_name=CUSTOM -ac_cc=1 -ac_cclib=customcc ... +``` + +The `MYCCNAME` is the prefix for RPC calls and standard consensus functions (e.g. `validate`). +The naming convention used for building a custom consensus library follows: +* MYCCNAME_FUNCTIONNAME + +For example `custom_validate`. + + +### Declaration of constants +```cpp +#define EVAL_CUSTOM (EVAL_FAUCET2+1) +#define CUSTOM_TXFEE 10000 +``` +The `EVAL_FAUCET2` is a constant (footnote: 1a & 1b) (`0x10` or decimal 16). These `EVAL_...` constants are identifiers. They are used to route the validation code. The low-level bitcoin script in Komodo has a new op_code called `OP_CHECKCRYPTOCONDITION`. When any node on the network needs to validate this `OP_CHECKCRYPTOCONDITION` op_code, it looks up which `EVAL_...` code it is. + +Custom consensus starts at `EVAL_FAUCET2` and add `+1` to it for your customcc library. Therefore, `EVAL_CUSTOM` is `0x11` = decimal 17. + +The `CUSTOM_TXFEE` is the default transaction fee for this type of transaction. The default txfee for this `EVAL_...` code consensus is `10000` assetoshis (0.0001). + + +### Declarations of the RPC calls +This is the way 3rd party developers (e.g. front-end developers) and command-line users will interact with your custom crypto condition. For example commands like `komodo-cli -ac_name=CUSTOM custom_func0` and `komodo-cli -ac_name=CUSTOM custom_func1`. + +```cpp +{ (char *)MYCCNAME, (char *)"func0", (char *)"", 1, 1, '0', EVAL_CUSTOM }, +{ (char *)MYCCNAME, (char *)"func1", (char *)"", 0, 0, '1', EVAL_CUSTOM }, +``` +The declarations for the functions in customcc.cpp - func0 and func1 + +* `MYCCNAME` is declared previously as "custom" +* `func0` is the name of the first RPC call +* The `` can be replaced with your functions help text. +* The `1,1,'0', EVAL_CUSTOM` means: 1 mandatory parameter, maximum of 1 parameter, 0 is the function id for custom consensus `EVAL_CUSTOM`, in this case `0x11` (decimal 17) +* `func1` is the name of the next RPC call +* The `` is the real help text this time. This RPC call `func1` requires no arguments, like `komodo-cli getinfo` +* The `0,0,'1', EVAL_CUSTOM` mean: 0 mandatory parameters, maximum of 0 parameters, 1 is the function id for custom consensus `EVAL_CUSTOM`, in this case `0x11` (decimal 17) + +### Declaration of functions +```cpp +bool custom_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx); +UniValue custom_func0(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); +UniValue custom_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); +``` +These functions follow the naming convention of `MYCCNAME` with a `_`. Validation is always required and named `MYCCNAME` + `_validate`. MYCCNAME is `custom`, therefore the validate function is called `custom_validate`. If MYCCNAME was defined as `mylo`, then my validate function would be called `mylo_validate`. Odds are you will name your first cclib after yourself or someone else just as loveable. + +The validation code is the most important code - it is what makes blockchains sources of truth. Their truthiness relies on validation based on cryptographic principles. + +Functions `custom_func0` and `custom_func1` follow the internal automatic module wiring of cclib. Again `MYCCNAME` + `_` + `RPCFUNCS` declared earlier. + +### Automatic wiring, custom RPC function dispatcher + +The following code is part of the automatic wiring that allows a developer to use 3 files, the `.h` the `.cpp` and the `makecustom` makefile. Automatic wiring saves a developer from potentially introducing bugs in the consensus and by virtue of this saving, testers, users and organizations many hours of resources. + +The custom dispatch is used for dispatching the RPC function declared earlier. + +```cpp +#define CUSTOM_DISPATCH \ +if ( cp->evalcode == EVAL_CUSTOM ) \ +{ \ + if ( strcmp(method,"func0") == 0 ) \ + return(custom_func0(txfee,cp,params)); \ + else if ( strcmp(method,"func1") == 0 ) \ + return(custom_func1(txfee,cp,params)); \ + else \ + { \ + result.push_back(Pair("result","error")); \ + result.push_back(Pair("error","invalid customcc method")); \ + result.push_back(Pair("method",method)); \ + return(result); \ + } \ +} +``` + +The developer must then map the RPC names to the function/method. This mapping follows the same naming convention that has already been defined. Namely, `MYCCNAME` + `_` + `FUNCTIONNAME`. If no match, then an error message returned and no harm done. + +e.g. +```cpp + if ( strcmp(method,"func0") == 0 ) \ + return(custom_func0(txfee,cp,params)); \ +``` + +Finally, in the course of looking where to route the RPC request + +## customcc.cpp file - implementation of functions + + + + + +Ref: [^1a](https://github.com/jl777/komodo/blob/jl777/src/cc/eval.h#L63) + +Ref: [^1b](https://github.com/jl777/komodo/blob/jl777/src/cc/cclib.cpp#L31) +# Dice + +## Introduction + +The Dice Fluidity module allows for a decentralized `dice` game on a blockchain. The `dice` module is essentially a simple, but fully functional example of decentralized software. + +It is also useful as a demonstration to show how Fluidity based modules can leverage provably random entropy to enable blockchain-enforced real-time gameplay. + +The Dice module is a simple gambling game, where one node creates a "house" contract, with seed funds and other parameters, and other users place bets within the indicated parameters. Winners and losers are determined through blockchain technology. This technology includes on-chain, consensus based, provably random entropy that derives from the activity of both the "house" and the users. + +The "house" node should be running the [dicestatus](../customconsensus/dice.html#dicestatus) method at a regular frequency. This method resolves unfinished bets and generates new entropy utxos for the "house" contract. + +To create a "house" contract, use [dicefund](../customconsensus/dice.html#dicefund) to initiate the contract, and then add several utxos to the fund with [diceaddfunds.](../customconsensus/dice.html#diceaddfunds) + +Once the contract is created and funded, users can place a bet using [dicebet.](../customconsensus/dice.html#dicebet) + +Anyone can execute a [dicefinish](../customconsensus/dice.html#dicefinish) RPC after the contract's time expires. This prevents the "house" node from cheating by going offline. + +## diceaddfunds + +**diceaddfunds name fundingtxid amount** + +The `diceaddfunds` method adds funds to the desired `dice` contract. + +Only the owner of the `dice` contract is able to add funds. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------- | +| name | (string) | the name of the user's dice contract | +| fundingtxid | (string) | the txid of the transaction that created and funded this contract | +| amount | (number) | the amount of funds you want to add to your contract from your wallet | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create a raw transaction hex value for adding funds + +```bash +./komodo-cli -ac_name=HELLOWORLD diceaddfunds MYDICECONTRACT ebfcff20fa5ab7bebf14b778e74bd6b34b02f100ff75e4cb611190f160ae4cf7 10 +``` + + + +Step 2: Send the raw transaction / broadcast the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0100000001646b59153d05ed0cb2b241dbbc42cd86df446ea43db8a66c68fdc2462e1bc6850000000049483045022100bdbf75970d7f708c4a5637d703b0a055e65a2eab0e71f6435604281d5981143d022008942029da09aa09bd0c9358b8169528e596968150e85d15c143c6961bf2b39501ffffffff0400ca9a3b00000000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc1027000000000000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcacf0aed71218090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000006d6a4c6ae6454b4d444469636500f74cae60f1901161cbe475ff00f1024bb3d64be778b714bfbeb75afa20fffcebd22d4e75f4939198938b49036f71c3a0e00d20ca05237147aaed0d85cd50ff29000000000000000000000000000000000000000000000000000000000000000000000000 +``` + + + +Step 3: Decode the raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 0100000001646b59153d05ed0cb2b241dbbc42cd86df446ea43db8a66c68fdc2462e1bc6850000000049483045022100bdbf75970d7f708c4a5637d703b0a055e65a2eab0e71f6435604281d5981143d022008942029da09aa09bd0c9358b8169528e596968150e85d15c143c6961bf2b39501ffffffff0400ca9a3b00000000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc1027000000000000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcacf0aed71218090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000006d6a4c6ae6454b4d444469636500f74cae60f1901161cbe475ff00f1024bb3d64be778b714bfbeb75afa20fffcebd22d4e75f4939198938b49036f71c3a0e00d20ca05237147aaed0d85cd50ff29000000000000000000000000000000000000000000000000000000000000000000000000 +``` + + + +## diceaddress + +**diceaddress (pubkey)** + +The `diceaddress` method takes either your pubkey or a pubkey that you provide and returns the smart-contract address for the `dice` smart contract. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | -------------------------------------------------------------------------------------- | +| pubkey | (string, optional) | the pubkey of the requested info; by default it is the pubkey used to launch the chain | + +### Response + +| Name | Type | Description | +| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ | +| result | (string) | whether the diceaddress method was successful | +| DiceCCaddress | (string) | taking the dice contract's EVAL code as a modifier, this is the public address that corresponds to the dice contract's privkey | +| Dicemarker | (string) | the unmodified public address generated from the dice contract's privkey | +| DiceCCassets | (string) | the internal address; this value is not related to the usage of the Dice Fluidity module | +| GatewaysPubkey | (string) | the global pubkey for this Gateways Fluidity module | +| myCCaddress | (string) | taking the dice contract's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myaddress | (string) | the public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +For the non-default pubkey. + +```bash +./komodo-cli -ac_name=HELLOWORLD diceaddress 03fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc +``` + + + +## dicebet + +**dicebet name fundingtxid amount odds** + +The `dicebet` method places a bet on the indicated `dice` contract. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------------- | +| name | (string) | the name of the dice contract for which the user desires to place a bet | +| fundingtxid | (string) | the txid of the transaction that created and funded this contract | +| amount | (number) | the amount the user desires to place as a bet | +| odds | (number) | specify the user's odds | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------------- | +| "result" | (string) | whether the dicebet command executed successfully | +| "hex" | (string) | the data of the user's transaction, in a raw hex-encoded format; broadcast this using `sendrawtransaction` | + +#### :pushpin: Examples + +Step 1: Set your parameters to create a raw transaction and get the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD dicebet KMDDice ebfcff20fa5ab7bebf14b778e74bd6b34b02f100ff75e4cb611190f160ae4cf7 7 7 +``` + + + +Step 2: Send/broadcast the raw transaction hex + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000378c9b0720ac4ffda232bd8ebc1ebf10d78efe23daf59ad887439baf72a3ffd03000000007b4c79a276a072a26ba067a5658021039d966927cfdadab3ee6c56da63c21f17ea753dde4b3dfd41487103e24b27e94e8140fe35ae062eb8239b1eec5407c71e27531f281dc369b55c3d3c235a87f6c10b3d4e7a029a6420e4fa076bd1d3da013287a17973fb6684bc487335ce176e7488d3a100af038001e6a10001ffffffff0b2261be0d143f42b833bcdf6e95582d4071f7d7d1d03eb1de0893eb7dc563ef0200000049483045022100f934f292e5ef9b3c605b83381abec1d99c7119d35a3833e40e65d788191ea51402207e925062602bb603f7109e3f36009563952741e666210195686de27b61515cc801ffffffff0b2261be0d143f42b833bcdf6e95582d4071f7d7d1d03eb1de0893eb7dc563ef0300000048473044022020aa8c2d6dc9727ce32f34ae704eb374b7cf87f43250a2d10072fad266f6602e02201fce01ae5c550438f2a512ab13f4c40d411d7726f32046e989b9747af33fd4e101ffffffff0500ca9a3b00000000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc0027b92900000000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc1727000000000000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcacc91265bf17090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000006d6a4c6ae6424b4d444469636500f74cae60f1901161cbe475ff00f1024bb3d64be778b714bfbeb75afa20fffceb6b2540dd22241ca6e72fe32c1cd1d2a9528140cad290f1599041e06589040067000000000000000000000000000000000000000000000000000000000000000000000000 +``` + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000378c9b0720ac4ffda232bd8ebc1ebf10d78efe23daf59ad887439baf72a3ffd03000000007b4c79a276a072a26ba067a5658021039d966927cfdadab3ee6c56da63c21f17ea753dde4b3dfd41487103e24b27e94e8140fe35ae062eb8239b1eec5407c71e27531f281dc369b55c3d3c235a87f6c10b3d4e7a029a6420e4fa076bd1d3da013287a17973fb6684bc487335ce176e7488d3a100af038001e6a10001ffffffff0b2261be0d143f42b833bcdf6e95582d4071f7d7d1d03eb1de0893eb7dc563ef0200000049483045022100f934f292e5ef9b3c605b83381abec1d99c7119d35a3833e40e65d788191ea51402207e925062602bb603f7109e3f36009563952741e666210195686de27b61515cc801ffffffff0b2261be0d143f42b833bcdf6e95582d4071f7d7d1d03eb1de0893eb7dc563ef0300000048473044022020aa8c2d6dc9727ce32f34ae704eb374b7cf87f43250a2d10072fad266f6602e02201fce01ae5c550438f2a512ab13f4c40d411d7726f32046e989b9747af33fd4e101ffffffff0500ca9a3b00000000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc0027b92900000000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc1727000000000000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcacc91265bf17090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000006d6a4c6ae6424b4d444469636500f74cae60f1901161cbe475ff00f1024bb3d64be778b714bfbeb75afa20fffceb6b2540dd22241ca6e72fe32c1cd1d2a9528140cad290f1599041e06589040067000000000000000000000000000000000000000000000000000000000000000000000000 +``` + + + +## dicefinish + +**dicefinish name fundingtxid bettxid** + +The `dicefinish` method rebroadcasts a bet that was previously broadcast. + +If the returned `hex` value is `0` the bet is finished. + +If the returned `hex` value is not `0`, the `hex` value should be broadcast with [sendrawtransaction.](../komodo-api/rawtransactions.html#sendrawtransaction) If the bet has not finished or is stuck, the `hex` will have a value. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------- | +| name | (string) | the name of the dice contract | +| fundingtxid | (string) | the txid of the transaction that created and funded this contract | +| bettxid | (string) | the txid of the bet for which finish status is requested | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| result | (string) | whether the command executed successfully | +| hex | (string) | if the contract is already finished, the resulting hex is 0; if the contract is not finished, the value of hex will be a rawtransaction that the user can broadcast to let the blockchain automatically declare a winner and close the bet | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD dicefinish DICE3 4132ca8e8d46df9f8a8cbe83c99794497e06bbd190bd71f4abcdedf84e90952e d54335073e549cd75a050fd4d6ba5939307cda7096ba0f3da779fb7d07e46343 +``` + + + +## dicefund + +**dicefund name funds minbet maxbet maxodds timeoutblocks** + +The `dicefund` method creates and funds a dice contract. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +Ideally, the dice creator node should be online throughout the contract's life, to determine `winning bid` or `losing bid`. + +If the dice creator node is offline after the `timeoutblocks` period completes, the system will automatically declare the bet's winner and payout winning funds. + +Typically, the creator should set the `timeoutblocks` property to a longer period. This prevents the house from losing funds if the house's node unexpectedly experiences downtime. + +The `maxodds` property must be between 1 and 9999. + +### Arguments + +| Name | Type | Description | +| ------------- | -------- | --------------------------------------------------------------------------------------------- | +| name | (string) | the name of the user's dice contract | +| funds | (number) | the amount of funds with which the user desires to start | +| minbet | (number) | the minimum amount allowed for a bet | +| maxbet | (number) | the maximum amount allowed for a bet | +| maxodds | (number) | the largest odds an end-user can use for betting | +| timeoutblocks | (number) | the number of blocks before the contract times out and pays the automatically declared winner | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| hex | (string) | the data of the transaction in raw hex-encoded format; broadcast this using the sendrawtransaction method | + +#### :pushpin: Examples + +Step 1: Create your customized Dice contract and get the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD dicefund KMDDice 777777 0.777 7.77 777 7 +``` + + + +Step 2: Send raw transaction / Broadcast the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000a5890b79f42a2039d6b661cec3f0a748f8122b51427d2747d7cddb45e7c774988010000004847304402206544c1d0bb42da89d93e58526a28b3c80ef45dca516ecd11ee3fe7fc35a5261c02207f0b134ff5cdb840692a65eccd86fb2fc2a63afc6f1309a2ed9d054d1a076b1201ffffffff5b90bd88124ebd1a0988c612902234782b737b860189fb5871088d2d3aae2481020000004948304502210091972c641291022da6d49ab8d3790ccdbb0f563b385b89ac723fa688a6c84ee202207198c3d48ce1d9591fce6fb41192145c38f8312c7a78251f4231986070a3283a01ffffffff5bfb06fac51707a69414a1f908ac3f9eb3fca50f303c4ae960f94491e8dc7f5c0100000049483045022100ea0b49d902f844ef280b8621cdc5a5365a779a04a159ba30e00bd0b3eaf284da02205aece19ee807ce11b0ed7b74175df29dd2be4560361174664571a6a596a894fd01ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471020000004847304402203eb318ae650753ab7cc2e9ea9b2cc2477add2fbd9e49e0ac1d7560f7e08ecbb002202d77d75ed2c1d3b53feda45c699374f74d1bf1065b46e3a24514dd072f2a9dcb01ffffffff5d5132ee6f33ba09b4bcfb84beddfcbdf58888ea7f221cc8078a96865e1e0ea10000000049483045022100e3cc5062becc979fc347a9ccde6af8ebba39c0d88105c9a35c89876207fafb0202204f631d063911e4526958f6629a847cca832d845a86adcae248625fd45b03e7d001ffffffff5e626ec0b20cd783ee0bf52aa33189796ddd4649d31b64fdee10b6daecbd079200000000494830450221009f3c17ccc73f28d9ba1d80c149890f56c6aafa576e152eb776082d12d54548eb022053f3b87eee04d9f5ef9f961d79433ec76b0f0e4a2288104212db01f6d2d7d1f801ffffffff5eb56cd4df0702b06debcf36de8309432b8140daa0a2544159ff68bbb96ed2050000000048473044022029bbf3fa5dea810d70ea9ef9b81b5ee72c3b3ec7d59faae4ca9658ed723ef683022060226d854ff44aebeba36bfda9e664185be0999ce7ee8b7b053f67642bd8c64101ffffffff603757f4b8370432cf30b12abdbb93b888e7707cd4321851f926779ee126e24402000000484730440220717994adac8b009a0f110438cef1e226d6674494e774813fad044b340c38052002202852c11fcc5bb1f3aa39e3dbbf00aa0d2b808c1c0769fbd692201cf10e96644b01ffffffff62347ddc97606a28457514a53b16d7fd9534c3c12d3f890cf72536f130737bae020000004847304402202dcf8a066fc56dae83f2259f902707aff7484251666c5b01a2e71e909fe859630220306a4149afce43dc343e103cdf4926ae9bf9f9a7a6eed9bf235efe04e619daea01ffffffff63686994d134931e0b43809f6d9ab73f7053d9aaa143987c56083345eddb5ec60100000048473044022066b3aadd3f2545c953f7389a062831736eda6c01f9df20e56b107d87fa6bfe8d02204357d85e1ab484c779fac5eab5d01fd39f5caf1ecde499873de34ac5e204b7ab01ffffffff0400112e08bd460000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc10270000000000002321039d966927cfdadab3ee6c56da63c21f17ea753dde4b3dfd41487103e24b27e94eac100b47751c020000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000002c6a2ae6464b4d444469636500a09ba104000000004014502e000000000903000000000000070000000000000000000000 +``` + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000a5890b79f42a2039d6b661cec3f0a748f8122b51427d2747d7cddb45e7c774988010000004847304402206544c1d0bb42da89d93e58526a28b3c80ef45dca516ecd11ee3fe7fc35a5261c02207f0b134ff5cdb840692a65eccd86fb2fc2a63afc6f1309a2ed9d054d1a076b1201ffffffff5b90bd88124ebd1a0988c612902234782b737b860189fb5871088d2d3aae2481020000004948304502210091972c641291022da6d49ab8d3790ccdbb0f563b385b89ac723fa688a6c84ee202207198c3d48ce1d9591fce6fb41192145c38f8312c7a78251f4231986070a3283a01ffffffff5bfb06fac51707a69414a1f908ac3f9eb3fca50f303c4ae960f94491e8dc7f5c0100000049483045022100ea0b49d902f844ef280b8621cdc5a5365a779a04a159ba30e00bd0b3eaf284da02205aece19ee807ce11b0ed7b74175df29dd2be4560361174664571a6a596a894fd01ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471020000004847304402203eb318ae650753ab7cc2e9ea9b2cc2477add2fbd9e49e0ac1d7560f7e08ecbb002202d77d75ed2c1d3b53feda45c699374f74d1bf1065b46e3a24514dd072f2a9dcb01ffffffff5d5132ee6f33ba09b4bcfb84beddfcbdf58888ea7f221cc8078a96865e1e0ea10000000049483045022100e3cc5062becc979fc347a9ccde6af8ebba39c0d88105c9a35c89876207fafb0202204f631d063911e4526958f6629a847cca832d845a86adcae248625fd45b03e7d001ffffffff5e626ec0b20cd783ee0bf52aa33189796ddd4649d31b64fdee10b6daecbd079200000000494830450221009f3c17ccc73f28d9ba1d80c149890f56c6aafa576e152eb776082d12d54548eb022053f3b87eee04d9f5ef9f961d79433ec76b0f0e4a2288104212db01f6d2d7d1f801ffffffff5eb56cd4df0702b06debcf36de8309432b8140daa0a2544159ff68bbb96ed2050000000048473044022029bbf3fa5dea810d70ea9ef9b81b5ee72c3b3ec7d59faae4ca9658ed723ef683022060226d854ff44aebeba36bfda9e664185be0999ce7ee8b7b053f67642bd8c64101ffffffff603757f4b8370432cf30b12abdbb93b888e7707cd4321851f926779ee126e24402000000484730440220717994adac8b009a0f110438cef1e226d6674494e774813fad044b340c38052002202852c11fcc5bb1f3aa39e3dbbf00aa0d2b808c1c0769fbd692201cf10e96644b01ffffffff62347ddc97606a28457514a53b16d7fd9534c3c12d3f890cf72536f130737bae020000004847304402202dcf8a066fc56dae83f2259f902707aff7484251666c5b01a2e71e909fe859630220306a4149afce43dc343e103cdf4926ae9bf9f9a7a6eed9bf235efe04e619daea01ffffffff63686994d134931e0b43809f6d9ab73f7053d9aaa143987c56083345eddb5ec60100000048473044022066b3aadd3f2545c953f7389a062831736eda6c01f9df20e56b107d87fa6bfe8d02204357d85e1ab484c779fac5eab5d01fd39f5caf1ecde499873de34ac5e204b7ab01ffffffff0400112e08bd460000302ea22c80200095ece5eee67e1f313e7ba2d156c7617106cd52b75c93ed3fb110ff3fba6e998103120c008203000401cc10270000000000002321039d966927cfdadab3ee6c56da63c21f17ea753dde4b3dfd41487103e24b27e94eac100b47751c020000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000000000002c6a2ae6464b4d444469636500a09ba104000000004014502e000000000903000000000000070000000000000000000000 +``` + + + +## diceinfo + +**diceinfo fundingtxid** + +The `diceinfo` method looks up information about the specific `dice` contract referred by the relevant `fundingtxid`. + +A `fundingtxid` is the txid of the transaction that created and funded the relevant contract. + +Use the [dicelist](../customconsensus/dice.html#dicelist) method to discover a list of available `fundingtxid` hashes on the asset chain. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------- | +| fundingtxid | (string) | the txid of the transaction that created and funded this contract | + +### Response + +| Name | Type | Description | +| --------------- | -------- | --------------------------------------------------------------------------------------------------- | +| "result" | (string) | whether the command executed successfully | +| "fundingtxid" | (string) | the txid of the transaction that created and funded this contract | +| "name" | (string) | the name of the dice contract | +| "sbits" | (number) | a 64-bit int binary encoding of the first 8 characters of the name property | +| "minbet" | (number) | the minimum bet amount this contract accepts | +| "maxbet" | (number) | the maximum bet amount this contract accepts | +| "maxodds" | (number) | the maximum odds the contract accepts | +| "timeoutblocks" | (number) | the number of blocks before the contract allows an automatically declared winner and the bet closes | +| "funding" | (number) | the current amount of funds in the contract | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD diceinfo 0d6e82af9959caec14d7af42fd67db68a45bcd23c755457ebf192a52d62c599c +``` + + + +## dicelist + +**dicelist** + +The `dicelist` method displays the total list of `fundingtxid`'s of all `dice` contracts available on the asset chain. + +A `fundingtxid` is the txid of the transaction that created and funded the relevant contract. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ------------------------------------------------------------------------- | +| fundingtxid | (string) | the txid of the transaction that created and funded the relevant contract | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD dicelist +``` + + + +## dicestatus + +**dicestatus name fundingtxid bettxid** + +The `dicestatus` method prints the status of a `dicebet` and returns whether the `bettxid` received a winning or losing result. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------- | +| name | (string) | the name of the dice contract | +| fundingtxid | (string) | the txid of the transaction that created and funded this contract | +| bettxid | (string) | the bettxid, the result of which is desired | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------- | +| result | (string) | whether the command executed successfully | +| status | (string) | the result of the bet for the relevant bettxid | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=AT1 dicestatus DICE3 4132ca8e8d46df9f8a8cbe83c99794497e06bbd190bd71f4abcdedf84e90952e d54335073e549cd75a050fd4d6ba5939307cda7096ba0f3da779fb7d07e46343 +``` + + +# Faucet + +## Introduction + +The Faucet Fluidity module enables anyone to fund an on-chain faucet on any chain where modules are [enabled.](../installations/asset-chain-parameters.html#summary-of-ac-cc) A Smart Chain may have only one on-chain `faucet`. + +To receive funds from a `faucet`, the [faucetget](../customconsensus/faucet.html#faucetget) method can be executed by anyone on the Smart Chain, as long as their public address satisfies a few constraints. Their daemon's pubkey (corresponding to the address) must have no history of funds or transactions, and an address can claim faucet funds only once on a chain. The call also requires the node to perform a small PoW calculation; this deters leeching. + +When `faucetget` is executed, the on-chain `faucet` sends 0.1 coins to the address that corresponds to the node's pubkey. This requires about 30 seconds of CPU time. + +## faucetaddress + +**faucetaddress [pubkey]** + +The `faucetaddress` method returns the Fluidity address information for the specified pubkey. If no pubkey is provided, the method returns information for the pubkey used to launch the daemon. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------------------------------------------------------------------------------------- | +| pubkey | (string, optional) | the desired pubkey; the method uses the pubkey used to launch the daemon if no pubkey is provided | + +### Response + +| Name | Type | Description | +| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| FaucetCCaddress | (string) | taking the faucet module's `EVAL` code as a modifier, this is the public address that corresponds to the faucet module's privkey | +| Faucetmarker | (string) | the internal address (not related to usage of faucet) | +| FaucetCCassets | (string) | the internal address (not related to usage of faucet) | +| GatewaysPubkey | (string) | the global pubkey for this Gateways module | +| CCaddress | (string) | taking the faucet module's `EVAL` code as a modifier, this is the Fluidity address from the pubkey of the user | +| myCCaddress | (string) | taking the faucet module's `EVAL` code as a modifier, this is the Fluidity address from the pubkey of the user | +| myaddress | (string) | the unmodified public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD faucetaddress 03336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8 +``` + + + + + +## faucetfund + +**faucetfund amount** + +The `faucetfund` method funds the on-chain faucet. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------- | +| amount | (number) | the amount to add to the faucet, taken from the user's available funds | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| hex | (string) | the data in hex-encoded format; you must broadcast this hex using the`sendrawtransaction` RPC for the command to complete | + +#### :pushpin: Examples + +Step 1: Specify faucet amount and get the raw transaction HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD faucetfund 100 +``` + + + + + +Step 2: Broadcast/send raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000013c34d14c6a32219f4b633a1fe01f5826b3bd7b4cbe01c20cfc0c29138d9c99720100000049483045022100b265993f541d580f10e8820f9986bdd479859fdcb2e636dd1ee1b23506eebeac02202234a6e5141345459c4b4959e921aa85b9fa616f4c44ea15e53d08bf4885259501ffffffff0200e40b5402000000302ea22c8020e029c511da55523565835887e412e5a0c9b920801b007000df45e545f25028248103120c008203000401cce06d66fa15090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000 +``` + + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 01000000013c34d14c6a32219f4b633a1fe01f5826b3bd7b4cbe01c20cfc0c29138d9c99720100000049483045022100b265993f541d580f10e8820f9986bdd479859fdcb2e636dd1ee1b23506eebeac02202234a6e5141345459c4b4959e921aa85b9fa616f4c44ea15e53d08bf4885259501ffffffff0200e40b5402000000302ea22c8020e029c511da55523565835887e412e5a0c9b920801b007000df45e545f25028248103120c008203000401cce06d66fa15090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000 +``` + + + + + +## faucetget + +**faucetget** + +The `faucetget` method requests the `faucet` module to send coins. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `faucetget` command yields 0.1 coins and requires about 30 seconds of CPU time to execute. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| hex | (string) | the data in hex-encoded format; you must broadcast this hex using sendrawtransaction for the command to complete | + +#### :pushpin: Examples + +Step 1: Use faucetget and get the raw HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD faucetget +``` + + + + + +Step 2: Broadcast/send the raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000010941cea65a560aeae02f0d49770965490bd99eeac4185f25075685da58e99d40000000007b4c79a276a072a26ba067a565802103682b255c40d0cde8faee381a1a50bbb89980ff24539cb8518e294d3a63cefe128140150ad95012ad8fae990096787d75d563977cef914e812e9dc8b6236243ac5f0050b3af4f2675ad433dcff4be16d113fb9a46357ee60682ed5d76c60f9ccffe8ea100af038001e4a10001ffffffff02b077a43018090000302ea22c8020e029c511da55523565835887e412e5a0c9b920801b007000df45e545f25028248103120c008203000401cc00e1f50500000000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000 +``` + + + + +Step 3: Decode the raw transaction (optional to check if the value are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 01000000010941cea65a560aeae02f0d49770965490bd99eeac4185f25075685da58e99d40000000007b4c79a276a072a26ba067a565802103682b255c40d0cde8faee381a1a50bbb89980ff24539cb8518e294d3a63cefe128140150ad95012ad8fae990096787d75d563977cef914e812e9dc8b6236243ac5f0050b3af4f2675ad433dcff4be16d113fb9a46357ee60682ed5d76c60f9ccffe8ea100af038001e4a10001ffffffff02b077a43018090000302ea22c8020e029c511da55523565835887e412e5a0c9b920801b007000df45e545f25028248103120c008203000401cc00e1f50500000000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac00000000 +``` + + + + + +## faucetinfo + +**faucetinfo** + +The `faucetinfo` method displays the balance of funds in the chain's faucet. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------- | +| result | (string) | whether the command executed successfully | +| name | (string) | the name of the faucet module | +| funding | (number) | the amount of funds available in the faucet | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD faucetinfo +``` + + + + +# Gateways + +## Introduction + +The Gateway Fluidity module allows the user to facilitate, manage, and trade tokenized representations of foreign blockchain assets. + +For example, a user is able to deposit their real-world BTC into a monitored address on the Bitcoin blockchain. Then, on the `gateways` Smart Chain, the ownership of this BTC is tokenized. Only the owner of the token has the right to withdraw the BTC to a chosen address. The user that made the deposit can use the token either for asset trading, or for other creative purposes. + +This allows the `gateways`-enabled Smart Chain to feature secure, on-chain, high-speed trading. + +Using an established `gateways` contract is not considered difficult. However, setting up the gateway requires the user to closely follow several detailed steps. + +## Gateways Module Tutorial Availability + +The Fluidity Tutorials section features a full walkthrough of the Gateways module. + +[Link to Gateways Module Tutorial](../basic-docs/fluidity/fluidity-tutorials/gateways-module-tutorial.md) + +## gatewaysaddress + +**gatewaysaddress** + +The `gatewaysaddress` method returns information about the on-chain gateway. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +### Response + +| Name | Type | Description | +| ------------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| "result" | (string) | whether the command executed successfully | +| "GatewaysCCaddress" | (string) | taking the contract's EVAL code as a modifier, this is the public address that corresponds to the contract's privkey | +| "Gatewaysmarker" | (string) | the unmodified public address generated from the contract's privkey | +| "GatewaysPubkey" | (string) | the pubkey for the gateways module | +| "GatewaysCCassets" | (string) | this property is used for development purposes only and can otherwise be ignored | +| "myCCaddress" | (string) | taking the contract's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| "myaddress" | (string) | the public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysaddress +``` + + + + + +## gatewaysbind + +**gatewaysbind tokenid oracletxid coin tokensupply M N pubkey(s) pubtype p2shtype wiftype [taddr]** + +The `gatewaysbind` method binds the provided sources into a new gateway. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ------------------------------------------------------------------------------------------------------------- | +| tokenid | (string) | the `tokenid` that the gateway will control as a proxy of foreign (off-chain) assets | +| oracletxid | (string) | the `oracletxid` under which the gateway should be created | +| name | (string) | the name of the coin represented by the gateway's proxy token | +| tokensupply | (number) | the maximum available supply of the proxy token; this should be equal to the total number of `tokenid` tokens | +| M | (number) | the minimum number of gateway signatory nodes required to facilitate a gateway transaction | +| N | (number) | the full number of gateway signatory nodes that will control the gateway | +| pubkey | (string) | the pubkey on which tokens will be available after conversion | +| pubtype | (number) | the prefix number of pubkey type of external chain | +| p2shtype | (number) | the prefix number of p2sh type of external chain | +| wiftype | (number) | the prefix number of wif type of external chain | +| taddr | (number) | the 2nd byte of prefix number of pubkey type (optional, only for 2 byte prefix chains) | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step One: + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysbind 202277c3a48ef168b164f7995eaced940e6416afefd6acd5aac0cb0a439df210 51a3fa99ef2abb3c1ce8248896d934bd348b7a1e0c5dbc06688c976247263a25 KMD 100000000 1 1 024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0 60 85 188 +``` + + + + + +Step Two: + +Broadcast using [sendrawtransction:](../komodo-api/rawtransactions.html#sendrawtransaction) + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000152d7d470197f5dc650c9ec09e1c8f4975d315219e3b6edad3c927c2fc23197ca0200000048473044022006bf373f1dd51c638a38d1e592741db73387e6acc186fca2011cd7283520ff770220673be91d346ba72adcbc9ab1df712f750047c2609399256c07ad3170d9ea850401ffffffff031027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cce05c9836180900002321024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0ac0000000000000000796a4c76f142034b4d443c550010f29d430acbc0aad5acd6efaf16640e94edac5e99f764b168f18ea4c377222000e1f5050000000001010121024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0253a264762978c6806bc5d0c1e7a8b34bd34d9968824e81c3cbb2aef99faa35100000000 +``` + + + + + +This is the `bindtxid` for the gateway. + + + +## gatewaysdeposit + +**gatewaysdeposit bindtxid height coin cointxid claimvout deposithex proof destpub amount** + +The `gatewaysdeposit` method is used to alert the gateway of the completed deposit of the foreign (off-chain) asset. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method then returns a `txid` which serves as the **deposittxid**. + +### Arguments + +| Name | Type | Description | +| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| bindtxid | (string) | the bindtxid of the gateway | +| height | (number) | the block height of the `txid` wherein the funds were sent to the foreign-asset gateway pubkey | +| name | (string) | the name of the foreign asset | +| cointxid | (string) | the `txid` returned when the foreign assets were sent to the gateway pubkey | +| claimvout | (string) | the `vout` of the claim (on the first use, this value should be 0) | +| deposithex | (string) | returned from the `txid` wherein the funds were sent to the foreign-asset gateway pubkey | +| proof | (string) | the proof for the `txid`; can be found using the [gettxoutproof](../komodo-api/blockchain.html#gettxoutproof) method | +| destpub | (string) | the public key where the tokens should be received on the Smart Chain | +| amount | (number) | the amount of the deposit | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysdeposit 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d 1116196 KMD 907812ee8d2762b589f6ca88ee8ba18a65ebf5c7486c472df7395628d22d0d98 0 010000000197d6ea16c68dc5db95b72e029a0e23cb403ae0a33b561b863963cfd9cbfec747000000006b483045022100aca47515602989979b514b6211c375e4d0d9471dd8297c5238c12245ad01dd830220191105caf1b63313c6988194f5f03fd6f70d4a30edc7820add1185d35edff1bb012102924664b536f3710a8e8abea38bb4bf71b470a653a4dceabd50df08d7b2a38436ffffffff0310270000000000001976a9141b355cb6b76cab1b16cb873db8828fe5d2521ae488ac80969800000000001976a914f0d1fc29f8962ac2805a1659192d9ad26794d22988ac38c7fa00000000001976a91482804b943dd6a2008af73f8ba40449c062f0935188ac50e6fd5b 04000000380b8fd2b9bdf570358980a4c9fc94e418ac656913999b5f9a016ec5afc46b0b188320f231637a0ded0b0bdada1f34c81ad5873b8c3f096b2014018af13f43980000000000000000000000000000000000000000000000000000000000000000b2e6fd5ba786061d57fff87a00000000000046430000000000000200000000000000000000000000fd40050035435dd2c1df5c20cb48e0617b6cee81f5349f0735b36fe93f17f82d678ad3eb374d0e398b049fddcb21a4d7ddf7345867c6a363eddcfe61f31d49dbc35652794c60da61bd5f164fd554f17b5bd669f636744412822af2ebd0f318dacb71514720164c59c392ef2b1ccc3a5dc5c9c83cd37a11f98b97c8f5170a357a972ec3cacbeb0dab34b757354883b46a598f2b93fcd735b4163db6b2b037f7d7d71a773e909ac4ce3f1228012d5bebfd9edad9842ae8c6cddf6942c543594b85013591a604c4223a3d2e007ed25f5994e9d8f6b6a704daf57cad41aea9609923612eee2fc55ad075c91c23a8cc46af9a45a7390c537d2e2302994239ae44230537ceaa2188e7f4eb6a0ab55471d152b9177e9fd90843504f29d3e92fd3d7142caae018b51318ec6b86083b7e2d155ce868f6b673b13cf1ed59107d15c6c84201441dde14074930f4755ec64975f354a99bd957021c073768f575dde3ab020dd73b488e2d03d57bc414a16d45b3e2052b24fb2360ec5f73524525fc59d2151b89310b19764541b801ad72171085bc6275832222484b8d7ee6ed91ab6a544c45af5c4d8445b0624f04a234aec6997eecf007f0e971eea33b21e45ba8f72825fa84605cdfa929aeb6dc425f2612000e7ce2ba04ff8c53061154eb38cba7f6d0bfe5dab031dadea2095e01e93f9e063d0b42e412f865572625f77aa8b10b58f7b0428ea0ff530ea10d37150496bb181e37fc5814ad524ce4618955e9158b6aebb956b02b961f920ee48eb5a08efc39d27fc2fd4ec175e38798bcca7331a7b5da2ca6c56fcb98e740c2f471eac6b67ced78125c5fcecd4f76eac1d76233aa58ed808e398b9e2b1eaa74e773d18276b732239403ce0c452cb26f0f34156a0a63e007ccfbd76f168fb941fbd2fbe23b57e519835c804ace6e22e281b3d0adda7c4b93a87d94500103315c780fe91ee67320a422eecb4a6daedc2d774567bfebc1d5b72fa693178f3443aa1eb47f18d6931f7b0fc6ec151caad4eae5f787c2a963c3963ffc924ba66a7ea1754763faf2884de0c86a0f75fe7f8dfb1265b449184668cb7348520810cf731663f5180ac31642d6b135d5ce7de88ba63d6db3d6c5dfa19492281dfed3b3765451717f3497ac2b4c040e2e4e77219b2586c227cd138b8d94ccc273fbfbb51a35523870c503e2d8527b840ced11917075e8a41ae9616f1df8d41df5bae39c6d6de5bb8d43d401bb9089723db59f0f06aa4fdf4145a905812ef799eb574abb9985de878a289e5f4b1256ca2121d553465f44065580cb5bde170459d1c22e8d388cbec9e37dc3cca07e489a9859942a9ccef4a5e45eed7228b94c86d10a233b5a1ddfcb1735cb9b16de6e8f49f3c841796acba31a8e9c90b531952ed03bd72e0b00fa3373ea4bc845d7469afae305639c772285a5223bf2d86a12c92312dc19db86400c6760b9e75af40ce4c16278bba8a804d5a69b88290dd4c2b43423bee9eb97c54261f956a32d80fdd3f421d1199ee45d42ad657e928be2e9fa54d844cff60b06bc525ce54daca9689e0616bfdbdbc36e09bea11a276d25d3ca9a80ed7109183784dfd1d23b7c791a7913a633e2d28948c655e68ade706654e38f717fe29119af4282430c8d1f702a52ea189f1e9e6faafb213205a195dab1c2d01dc6a3711f671ea118e8a3c995632903c58ebbd4eae5dbc4555b24c1649e89e03efb92134b9e24fb9fc649462f928d992fa33d45edcb4ef13f0d5c2cb6663e7dbf2414b5ed617e56b8715ace6910807e4a901ba603dab4092f9eeb46566ec3f38f3a1789c60822530c390d19b1d939217b7a691abb91454fce76cccf3557ddb3fc55bd4f44761aa9363db0f38360adf60e743ba3b902788bb254637f6074df62460400000003a973b7134b7fcbcb1fe70fdfaaf056c209a9f5dd77800eb37b065ca8317cbb3a980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890445df562c183ed7279f2f8e37ba249447439884d5b7030eac6485112eb07ea2d010b 02d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d 0.1 +``` + + + + + +Step Two: Broadcast using `sendrawtransction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000010db4b1686d1f27de5e2a11c793dfd30f09b296754f95ae8649858cca97d5b07a0000000049483045022100ad6bc26f0c66b89f5d63aff251c78965a50201f909a997b8ed6469da0334aa0c0220136d71f5ad1f4496785df81864f9be3ae7b8dd012dae08d59fd544869eacb3ba01ffffffff041027000000000000302ea22c80205fd998129698de9cf1455f4f4795794c9e57bf1fd5f28598b5e6c0322de5d0358103120c008203000401cc1027000000000000232102980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890acd02a724e18090000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000fd04096a4d0009f144034b4d440d8d1f63bf680d6191b100d90992b0f6bf6ce1cc851f259da8b49e74524e7a890121024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0012fea85ecfda42975a2aaed72e946792df41a486033af8dc45ab1e4ddcb34b1b424081100980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee12789000000000fd080230313030303030303031393764366561313663363864633564623935623732653032396130653233636234303361653061333362353631623836333936336366643963626665633734373030303030303030366234383330343530323231303061636134373531353630323938393937396235313462363231316333373565346430643934373164643832393763353233386331323234356164303164643833303232303139313130356361663162363333313363363938383139346635663033666436663730643461333065646337383230616464313138356433356564666631626230313231303239323436363462353336663337313061386538616265613338626234626637316234373061363533613464636561626435306466303864376232613338343336666666666666666630333130323730303030303030303030303031393736613931343162333535636236623736636162316231366362383733646238383238666535643235323161653438386163383039363938303030303030303030303139373661393134663064316663323966383936326163323830356131363539313932643961643236373934643232393838616333386337666130303030303030303030313937366139313438323830346239343364643661323030386166373366386261343034343963303632663039333531383861633530653666643562fd360604000000380b8fd2b9bdf570358980a4c9fc94e418ac656913999b5f9a016ec5afc46b0b188320f231637a0ded0b0bdada1f34c81ad5873b8c3f096b2014018af13f43980000000000000000000000000000000000000000000000000000000000000000b2e6fd5ba786061d57fff87a00000000000046430000000000000200000000000000000000000000fd40050035435dd2c1df5c20cb48e0617b6cee81f5349f0735b36fe93f17f82d678ad3eb374d0e398b049fddcb21a4d7ddf7345867c6a363eddcfe61f31d49dbc35652794c60da61bd5f164fd554f17b5bd669f636744412822af2ebd0f318dacb71514720164c59c392ef2b1ccc3a5dc5c9c83cd37a11f98b97c8f5170a357a972ec3cacbeb0dab34b757354883b46a598f2b93fcd735b4163db6b2b037f7d7d71a773e909ac4ce3f1228012d5bebfd9edad9842ae8c6cddf6942c543594b85013591a604c4223a3d2e007ed25f5994e9d8f6b6a704daf57cad41aea9609923612eee2fc55ad075c91c23a8cc46af9a45a7390c537d2e2302994239ae44230537ceaa2188e7f4eb6a0ab55471d152b9177e9fd90843504f29d3e92fd3d7142caae018b51318ec6b86083b7e2d155ce868f6b673b13cf1ed59107d15c6c84201441dde14074930f4755ec64975f354a99bd957021c073768f575dde3ab020dd73b488e2d03d57bc414a16d45b3e2052b24fb2360ec5f73524525fc59d2151b89310b19764541b801ad72171085bc6275832222484b8d7ee6ed91ab6a544c45af5c4d8445b0624f04a234aec6997eecf007f0e971eea33b21e45ba8f72825fa84605cdfa929aeb6dc425f2612000e7ce2ba04ff8c53061154eb38cba7f6d0bfe5dab031dadea2095e01e93f9e063d0b42e412f865572625f77aa8b10b58f7b0428ea0ff530ea10d37150496bb181e37fc5814ad524ce4618955e9158b6aebb956b02b961f920ee48eb5a08efc39d27fc2fd4ec175e38798bcca7331a7b5da2ca6c56fcb98e740c2f471eac6b67ced78125c5fcecd4f76eac1d76233aa58ed808e398b9e2b1eaa74e773d18276b732239403ce0c452cb26f0f34156a0a63e007ccfbd76f168fb941fbd2fbe23b57e519835c804ace6e22e281b3d0adda7c4b93a87d94500103315c780fe91ee67320a422eecb4a6daedc2d774567bfebc1d5b72fa693178f3443aa1eb47f18d6931f7b0fc6ec151caad4eae5f787c2a963c3963ffc924ba66a7ea1754763faf2884de0c86a0f75fe7f8dfb1265b449184668cb7348520810cf731663f5180ac31642d6b135d5ce7de88ba63d6db3d6c5dfa19492281dfed3b3765451717f3497ac2b4c040e2e4e77219b2586c227cd138b8d94ccc273fbfbb51a35523870c503e2d8527b840ced11917075e8a41ae9616f1df8d41df5bae39c6d6de5bb8d43d401bb9089723db59f0f06aa4fdf4145a905812ef799eb574abb9985de878a289e5f4b1256ca2121d553465f44065580cb5bde170459d1c22e8d388cbec9e37dc3cca07e489a9859942a9ccef4a5e45eed7228b94c86d10a233b5a1ddfcb1735cb9b16de6e8f49f3c841796acba31a8e9c90b531952ed03bd72e0b00fa3373ea4bc845d7469afae305639c772285a5223bf2d86a12c92312dc19db86400c6760b9e75af40ce4c16278bba8a804d5a69b88290dd4c2b43423bee9eb97c54261f956a32d80fdd3f421d1199ee45d42ad657e928be2e9fa54d844cff60b06bc525ce54daca9689e0616bfdbdbc36e09bea11a276d25d3ca9a80ed7109183784dfd1d23b7c791a7913a633e2d28948c655e68ade706654e38f717fe29119af4282430c8d1f702a52ea189f1e9e6faafb213205a195dab1c2d01dc6a3711f671ea118e8a3c995632903c58ebbd4eae5dbc4555b24c1649e89e03efb92134b9e24fb9fc649462f928d992fa33d45edcb4ef13f0d5c2cb6663e7dbf2414b5ed617e56b8715ace6910807e4a901ba603dab4092f9eeb46566ec3f38f3a1789c60822530c390d19b1d939217b7a691abb91454fce76cccf3557ddb3fc55bd4f44761aa9363db0f38360adf60e743ba3b902788bb254637f6074df62460400000003a973b7134b7fcbcb1fe70fdfaaf056c209a9f5dd77800eb37b065ca8317cbb3a980d2dd2285639f72d476c48c7f5eb658aa18bee88caf689b562278dee127890445df562c183ed7279f2f8e37ba249447439884d5b7030eac6485112eb07ea2d010b2102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d809698000000000000000000 +``` + + + + + +## gatewaysdumpprivkey + +**gatewaysdumpprivkey bindtxid address** + +The `gatewaysdumpprivkey` method returns the private key for the given `address` and `bindtxid`. + +The private key is returned in the wif format of the associated external chain. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------- | +| bindtxid | (string) | the `bindtxid` for the associated gateway | +| address | (string) | the `address` for which the private key is requested | + +### Response + +| Name | Type | Description | +| --------- | -------- | ----------------------------------------- | +| result | (string) | whether the command executed successfully | +| privkey | (string) | the private key | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysdumpprivkey 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d RVHLGTE3aFGwqpUVsoHJiJGs9pmsnd3fNB +``` + + + + + +## gatewaysexternaladdress + +**gatewaysexternaladdress bindtxid pubkey** + +The `gatewaysexternaladdress` method returns the address on the external chain for the gateways associated with the given `pubkey` and `bindtxid` values. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ----------------------------------------------------------------- | +| bindtxid | (string) | the `bindtxid` for the associated gateway | +| pubkey | (string) | the `pubkey` needed to generate the address on the external chain | + +### Response + +| Name | Type | Description | +| --------- | -------- | ----------------------------------------- | +| result | (string) | whether the command executed successfully | +| address | (string) | the address for the given pubkey | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysexternaladdress 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d 02ebb42018347eb3a4da76e85347bb0f042355ff3d16e323b21f8e6cb10098654e +``` + + + + + +## gatewaysinfo + +**gatewaysinfo bindtxid** + +The `gatewaysinfo` method returns information about the `bindtxid` gateway. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ----------------------------------------- | +| bindtxid | (string) | the `bindtxid` for the associated gateway | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| name | (string) | the name of the command | +| pubkey | (string) | the pubkey that holds the converted proxy tokens | +| coin | (string) | the name of the asset that the proxy token represents | +| oracletxid | (string) | the `oracletxid` of the associated oracle | +| taddr | (number) | the coin-specific address that customizes the address for the relevant foreign coin | +| prefix | (number) | the coin-specific address prefix that customizes the address for the relevant foreign coin | +| prefix2 | (number) | the coin-specific address prefix that customizes the address for the relevant foreign coin | +| deposit | (string) | the t address associated with the gateway pubkey | +| tokenid | (string) | the `tokenid` of the proxy token | +| totalsupply | (number) | the total available supply of proxy tokens | +| remaining | (number) | the amount of proxy tokens not currently issued | +| issued | (number) | the amount of proxy tokens currently issued | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewaysinfo 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d +``` + + + + + +## gatewayslist + +**gatewayslist** + +The `gatewayslist` method displays a list of `bindtxids` for the available gateways. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------ | +| bindtxid | (string) | the bindtxid of an available gateway | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewayslist +``` + + + + + + + +## gatewayswithdraw + +**gatewayswithdraw bindtxid coin withdrawpub amount** + +The `gatewayswithdraw` method sends proxy tokens in the gateways `pubkey`. The gateway then sends the foreign assets to the indicated foreign `withdrawpub` pubkey. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| bindtxid | (string) | the `bindtxid` of the gateway | +| coin | (string) | the name of the asset | +| withdrawpub | (string) | the `pubkey` to which the foreign assets should be sent | +| amount | (number) | the number of proxy tokens to send to the gateway, which will then be exchanged for the relevant amount of the foreign asset | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD gatewayswithdraw 897a4e52749eb4a89d251f85cce16cbff6b09209d900b191610d68bf631f8d0d KMD 0271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328 0.1 +``` + + + + + +Step Two: Broadcast using `sendrawtransction`: + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000020e2778e5c0917b00a995ffd0e027ac896492b70b2004ca0096d5309bc1d695ce0000000048473044022072bd3e74c1fb6a56111fc34caab1d605cedfbcb0a9dcd1a4c8d0dae9db61d43902205ccea739077b3374559353af3392e637b7c462ca699f9b9dba786b5398491b4201ffffffff8425c1bf730444ceac45a47376164d66a156e6c2a48116ec14cd17a88f8ab8e5010000007b4c79a276a072a26ba067a565802102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9d814051e39b89bace8226f3ca1779b754f2b57ee480e9636b16322bb36a89ec22de967ea66cdc906debb5f6b7c26a51ac2d089966aeb92d07aacc43507b1555c02313a100af038001f1a10001ffffffff058096980000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401cc102700000000000023210271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328ac1027000000000000302ea22c802091abda62a548f9c7f5beb19d16f01714ae3d4e526f3266fc8d347d6123f3d77b8103120c008203000401ccd02a724e18090000232102d389e879ca68809794c0ef29869b23b4dd8e22122fcc4e8b69adb1d33752dd9dac0000000000000000536a4c50f157bff603b64f309e344e34b10fd2053db59788909914f8488a7f73ddddc2165d31034b4d44210271bc6b553f5f763ca7f64457710f8a0b3f5273b2941edc5091ca41cec39b7328809698000000000000000000 +``` + + + + + + +# Heir + +## Introduction + +The Heir Fluidity module allows cryptocurrency funds to be passed on as an inheritance. + +The module functions by the means of a special `1of2` Fluidity address. In this type of address there are two private keys that are capable of spending funds from the address. However, only the first private key may spend funds by default. + +This first private key belongs to the owner of the `1of2` Fluidity address. The owner may use this key to freely spend funds and also to add more funds to the address. + +Should the owner fail to interact with the `1of2` Fluidity address for a specified period of time (`inactivitytime`), the address automatically unlocks to the second key. This second key is owned by the heir. Once unlocked, both the creator and the heir may freely spend funds from the address. + +The [heiradd](../customconsensus/heir.html#heiradd) method allows anyone, including users who are neither the owner nor the heir, to add funds to the address. These additions are considered donations and they do not affect the `inactivitytime` calculations that can unlock the funds for the heir. The `heiradd` method warns the user that they are making a donation if the method detects that the user is neither the owner nor the heir. + +The Heir Fluidity module accepts both coins and tokens. These can be the base coin of the asset chain, on-chain tokens created via the [Tokens](../customconsensus/tokens.html) Fluidity module that represent on-chain assets, or even tokens that are formed via the [Gateways](../customconsensus/gateways.html) module to represent off-chain assets or other cryptocurrencies. + +#### Heir Module Flow + +- Anyone can create a new Heir Fluidity address using [heirfund](../customconsensus/heir.html#heirfund) +- The owner of this address can add more funds using [heiradd](../customconsensus/heir.html#heiradd) +- Any other user, including the heir, can add donations using [heiradd](../customconsensus/heir.html#heiradd) +- The owner can claim funds at any time using [heirclaim](../customconsensus/heir.html#heirclaim) +- Once `inactivitytime` period is reached, the heir can also claim funds using [heirclaim](../customconsensus/heir.html#heirclaim) +- To retrieve the details of a particular funding plan, use [heirinfo](../customconsensus/heir.html#heirinfo) +- To retrieve a list of all funding plans on the asset chain, use [heirlist](../customconsensus/heir.html#heirlist) +- To output Heir Fluidity addresses, use [heiraddress](../customconsensus/heir.html#heiraddress) + +
+ + + +
+ +::: warning + +If an owner of an Heir Fluidity address seeking to add funds to their account avoids the normal methods (the RPC provided) and instead manually creates a utxo contribution, this utxo will not follow the normal patterns. Specifically, if the owner manually creates a contribution utxo that derives from both the owner pubkey and also from another pubkey, this utxo will not affect the `inactivitytime` calculation. Instead of resetting the `inactivitytime`, the utxo will count only as a donation. + +::: + +## heiradd + +**heiradd txfee amount fundingtxid** + +The `heiradd` method adds more funds to the Heir plan. + +When the owner uses the `heiradd` method the `inactivitytime` calculations are reset, thus renewing the owner's sole access to the funds. + +When anyone other than the owner uses the `heiradd` method to add funds, these funds are considered to be donations and won't affect the calculation of the elapsed `inactivitytime`. The method also sends a warning to the contributor to ensure they agree to submit the given funds as a donation. + +For each transaction using `heiradd`, the funds may be sent either from the owner's pubkey, or from a non-owner's pubkey. Funds cannot be sent from both owner and non-owner pubkeys at the same time. This can cause confusion for the owner if the funds available in their wallet are held partially in the owner's declared pubkey for this Heir account, and partially in other pubkeys. Therefore, the owner should ensure that all funds they desire to add to the account are within their declared Heir Fluidity pubkey before attempting to use `heiradd`. + +::: tip +Use the [heirlist](../customconsensus/heir.html#heirlist) method to find a fundingtxid. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| txfee | (number) | the transaction fee (in satoshis); when set to `0`, the default value is 10000 satoshis | +| amount | (number) | the amount of funds to be added; this amount will be withdrawn from the contributor's coins or tokens, as determined by the `tokenid` parameter used when the `heirfund` method was executed | +| fundingtxid | (string) | the transaction id returned from the original [heirfund](../customconsensus/heir.html#heirfund) transaction | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +##### Step 1: Create a raw transaction (in coins) and get the HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD heiradd 0 5 b8b5fa46b545548fbab3baeb5adeaafedd80494006af1b04007fb9f7379ce1f0 +``` + + + + + +##### Step 2: Broadcast raw transaction + +```bash + ./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0400008085202f8902f0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b80200000049483045022100a37d7b5929af0928f1dad10ddd686a8e2e47503c96ba5485e982c72d6fb3dfb00220304b039011774652f89eb3e7b6bf187e441ed4a82339623d5d8f058816e2f43a01fffffffff0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b80300000049483045022100c9297262cc12d300ef068d4de7a3d8e6006b87002e4c7a5c8b262be8d87da86102203f73e991704ef492ae57550a3c3cbb57494299d5ef2b3b64b6d88a1fff36a19d01ffffffff050065cd1d00000000302ea22c8020fa433cc47b98f7d1eed7441a529eaa6a91425abdda9b28306a9f19e5fda64ab481031210008203000401cc1027000000000000232102f0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b8ace0303e36020000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eace0144a8a040000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eac0000000000000000256a23ea41b8b5fa46b545548fbab3baeb5adeaafedd80494006af1b04007fb9f7379ce1f00000000000620000000000000000000000000000 +``` + + + + + +##### Step 3: Decode raw transaction to ensure values are sane (optional) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 0400008085202f8902f0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b80200000049483045022100a37d7b5929af0928f1dad10ddd686a8e2e47503c96ba5485e982c72d6fb3dfb00220304b039011774652f89eb3e7b6bf187e441ed4a82339623d5d8f058816e2f43a01fffffffff0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b80300000049483045022100c9297262cc12d300ef068d4de7a3d8e6006b87002e4c7a5c8b262be8d87da86102203f73e991704ef492ae57550a3c3cbb57494299d5ef2b3b64b6d88a1fff36a19d01ffffffff050065cd1d00000000302ea22c8020fa433cc47b98f7d1eed7441a529eaa6a91425abdda9b28306a9f19e5fda64ab481031210008203000401cc1027000000000000232102f0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b8ace0303e36020000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eace0144a8a040000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eac0000000000000000256a23ea41b8b5fa46b545548fbab3baeb5adeaafedd80494006af1b04007fb9f7379ce1f00000000000620000000000000000000000000000 +``` + + + + + +## heiraddress + +**heiraddress pubkey** + +The `heiraddress` method shows the owner's addresses and balances for the Heir plan. + +::: warning + +- The functionality of this method is only applicable when executed on a daemon that was launched using the pubkey of the owner of the relevant Heir plan. For all other daemons, the method is available, but has no functional purpose. +- The argument of this method is the **heir's** pubkey. + +::: + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ---------------------------------- | +| pubkey | (string) | the heir's pubkey (in hexademical) | + +### Response + +| Name | Type | Description | +| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the method executed successfully | +| HeirCCaddress | (string) | taking the module's EVAL code as a modifier, this is the public address that corresponds to the module's privkey | +| CCbalance | (number) | the unspent amount in the HeirCCaddress | +| HeirNormalAddress | (string) | the unmodified normal public address generated from the module's privkey, used for markers | +| HeirCC`1of2`Address | (string) | the address for storing funds in **coins** spendable by either the owner or the heir (funds address) | +| HeirCC`1of2`TokensAddress | (string) | the address for storing funds in **tokens** spendable by either the owner or the heir (token funds address) | +| myCCaddress(Heir) | (string) | taking the module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the **heir** | +| myaddress | (string) | the unmodified normal public address of the pubkey [used to launch the daemon.](../customconsensus/custom-consensus-instructions.html#creating-and-launching-with-a-pubkey) This is the normal address used to withdraw funds in coins from from HeirCC`1of2`Address. This property is applicable to any user who wants to use the Heir plan (owner or heir) | +| mybalance | (number) | the balance of myaddress in coins | +| MyTokenAddress | (string) | the user's address to withdraw funds in tokens from HeirCC`1of2`TokensAddress (in development) | + +#### :pushpin: Example + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD heiraddress 036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562e +``` + + + + + +## heirclaim + +**heirclaim txfee amount fundingtxid** + +The `heirclaim` method allows the owner to claim funds from the plan. + +After the `inactivitytime` period has elapsed, the `heirclaim` method also allows the heir to claim funds. + +::: tip +Use the [heirlist](../customconsensus/heir.html#heirlist) method to find a fundingtxid. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| txfee | (number) | the transaction fee (in satoshis); when set to `0`, the default value is 10000 satoshis | +| amount | (number) | the amount of funds to be added; this amount will be withdrawn from the contributor's coins or tokens, as determined by the `tokenid` parameter used when the `heirfund` method was executed | +| fundingtxid | (string) | the transaction id returned from the original [heirfund](../customconsensus/heir.html#heirfund) transaction | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +##### Step 1 Create a raw transaction (in coins) and get the HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD heirclaim 0 7 b8b5fa46b545548fbab3baeb5adeaafedd80494006af1b04007fb9f7379ce1f0 +``` + + + + + +##### Step 2: Broadcast raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0400008085202f8903b32125402e373f500a85a2e276f09628a1b0585e8e43d8514a55e23985f5b8e70200000049483045022100f3805c1424472626ee89e2f4c5ab4f7c310d37774604eb97860200d1dfb120d102202a0ffcc6e5c1f8893dde1ab3a67eafa554ac1af17dce14cf0580a55f5b9fdc6e01ffffffffb32125402e373f500a85a2e276f09628a1b0585e8e43d8514a55e23985f5b8e700000000a74ca5a281a1a0819ca28194a067a5658021036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562e81404827886fbbd2c8d3337dabfa69e69e5af03151a00fa1c7d3b6f33b68e36974f2228bf0aac209eaa55d16e8c2cdcb9c3993590e47c3e524a29a223db7042b7fa1a129a52780201011d4a0870dff12319f1b00e9a537fb9ddda81d2bba8b0d492cc6b4e9f7b1c98103020000af038001eaa10001fffffffff0e19c37f7b97f00041baf06404980ddfeaade5aebbab3ba8f5445b546fab5b800000000a74ca5a281a1a0819ca28194a067a5658021036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562e8140bb6e5c5c6b1e3a97d99e5dd1cf8e30942069260f8a482f7004d7638b4f5a53dd4d592d4a1d099cc7c0d6b79fcaeec262606d38c56abd7d13cea0753e73a3985aa129a52780201011d4a0870dff12319f1b00e9a537fb9ddda81d2bba8b0d492cc6b4e9f7b1c98103020000af038001eaa10001ffffffff040027b929000000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eac00a3e11100000000302ea22c8020fa433cc47b98f7d1eed7441a529eaa6a91425abdda9b28306a9f19e5fda64ab481031210008203000401ccd0093e36020000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eac0000000000000000256a23ea43b8b5fa46b545548fbab3baeb5adeaafedd80494006af1b04007fb9f7379ce1f00000000000680000000000000000000000000000 +``` + + + + + +## heirfund + +**heirfund txfee amount name heirpubkey inactivitytime memo ( tokenid )** + +The `heirfund` method creates a new Heir funding plan. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| txfee | (number) | the transaction fee in satoshis, defaults to 10000 satoshis when set to `0` | +| amount | (number) | the initial funding amount, in coins or tokens (this parameter is considered to be the amount of tokens if the (tokenid) parameter is present) | +| name | (string) | the name of the heir funding plan (arbitrary) | +| heirpubkey | (string) | the heir's public key (in hexademical) | +| inactivitytime | (number) | the time (in seconds) that must pass without the owner executing an `heiradd` or `heirclaim` method, after which the address unlocks to the heir | +| memo | (string) | a store for arbitrary data; for example, this can hold a digital copy of a physical will or other relevant documents | +| tokenid | (string, optional) | the token id in hexademical; if set, the funds contributed to this address must be of the variety specified by the tokenid | + +::: warning + +- All data for this transaction, including the memo field, must be less than or equal to 10000 bytes +- To store documents of large sizes, include a [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) in the memo field which links to such a document on the World Wide Web and its hash for verification. + +::: + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +##### Step 1: Create a raw transaction (in coins) and get the HEX value + +::: tip +The following example demonstrates Heir usage when utilizing coins, instead of tokens. When instead using tokens, create the tokens first with the [tokencreate](../customconsensus/tokens.html#tokencreate) method and pass the `tokenid` as the last parameter of [heirfund.](../customconsensus/heir.html#heirfund) +::: + +```bash +./komodo-cli -ac_name=HELLOWORLD heirfund 0 5 MyDogHeir 037736c263991316c6a23397a982a1f8c18ae8642e944448162a93a824c31f9299 100 'http://billionaire.com/mywill md5=5385639869' +``` + + + + + +##### Step 2: Broadcast raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0400008085202f8902bbc0db728486b88284ac9fc4580a32869009f0ceabc659c5929d1ca5fac0a9a1010000006a47304402202e9e6a63905789547c35d3be0d0c6e022d954ba55efede20b81334e805a6e31902201a72890bfa4fff37ddf9c87c9cb567d70e89b35a82709ea14332481c860a91c10121036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562effffffffdbc39ae947682e4c3c835d9326fc32a6f7e64dde869a93c9b17a9c97f5b4aeb5010000006a473044022001b04d40674eb7f309dc17ccd822a6362ade310eb37024303a110731870ccb2702204fd975db4a21995487fac94f49da90901a0c3047ac1a22cf161cacff2a256ab80121036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562effffffff050065cd1d00000000302ea22c8020fa433cc47b98f7d1eed7441a529eaa6a91425abdda9b28306a9f19e5fda64ab481031210008203000401cc1027000000000000302ea22c8020286b36b233cc03c91652560f4ecf9404bcf10b61033916d67edf4a216c92cf758103120c008203000401cc00634a8a040000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eace0950b54020000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eac0000000000000000886a4c85ea4621036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562e21037736c263991316c6a23397a982a1f8c18ae8642e944448162a93a824c31f92996400000000000000094d79446f67486569722c687474703a2f2f62696c6c696f6e616972652e636f6d2f6d7977696c6c206d64353d3533383536333938363900000000570000000000000000000000000000 +``` + + + + + +This transaction id is the funding transaction id of this Heir plan. Copy and save this to a safe location. + +Wait until the transaction is confirmed. + +##### Step 3: Decode the raw transaction to ensure the values are sane (optional) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 0400008085202f8902d47a3327514aedd15ba54f8a7a46cf47f54abc7af8ab816afae87c1b5db683420100000049483045022100a363ff9049cb6178bd0f328f4b99daf4e9ea4135a1a9cc95dc06423807d7fa2b0220402e51e3ca9db0377b3a4975aacc59b7249ee9154c95a0a3500c101ca6ccc68301fffffffffc9f94352e0215037cced1d2b888687afa841310e4451bb0f97dd3303704d8d90200000049483045022100deee8e926637e91cec15d695f6b2a178ef74a3f50c9a31dd2d64f045087e46f5022049e19c838249e1ae9945cac652b3bbb10c05071e3aaab0771f7d75815135a46901ffffffff040065cd1d00000000302ea22c8020fa433cc47b98f7d1eed7441a529eaa6a91425abdda9b28306a9f19e5fda64ab481031210008203000401cc1027000000000000302ea22c8020286b36b233cc03c91652560f4ecf9404bcf10b61033916d67edf4a216c92cf758103120c008203000401cce4a79216000000002321036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562eac0000000000000000886a4c85ea4621036a2ec9095b7c2abb748548e6cec53e0c462121aa6037fd83a01ce1b2affa562e21037736c263991316c6a23397a982a1f8c18ae8642e944448162a93a824c31f92996400000000000000094d79446f67486569722c687474703a2f2f62696c6c696f6e616972652e636f6d2f6d7977696c6c206d64353d3533383536333938363900000000e60000000000000000000000000000 +``` + + + + + +## heirinfo + +**heirinfo fundingtxid** + +The `heirinfo` method returns detailed information about the funding plan. + +::: tip +Use the [heirlist](../customconsensus/heir.html#heirlist) method to find a fundingtxid. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | --------------------------------------------------------------------------------------------------------------- | +| fundingtxid | (string) | the transaction id returned from the original [heirfund](../customconsensus/heir.html#heirfund) transaction | + +### Response + +| Name | Type | Description | +| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| fundingtxid | (string) | the id of the funding plan, the txid of [heirfund](../customconsensus/heir.html#heirfund) transaction | +| name | (string) | the name of the heir plan | +| tokenid | (string) | `token id`, if applicable | +| owner | (string) | the owner's public key | +| heir | (string) | the heir's public key | +| type | (string) | the type of this funding plan (coins or tokens) | +| lifetime | (number) | the total amount contributed to this plan since inception, given in the relevant currency (coins or tokens) | +| available | (number) | the amount available, given in the relevant currency (coins or tokens) | +| OwnerRemainderTokens | (number) | the amount of funds remaining in the account that were contributed by the owner | +| InactivityTimeSetting | (number) | the `inactivitytime` (in secs) that is required to elapse without owner activity before the plan is automatically unlocked to the heir | +| IsHeirSpendingAllowed | (boolean) | a boolean flag that indicates whether the heir is allowed to claim funds | +| InactivityTime | (number) | the owner's real inactivity time (in seconds) | +| memo | (string) | a store for arbitrary data; for example, this can hold a digital copy of a physical will or other relevant documents | +| result: | (string) | whether the command succeeded | + +#### :pushpin: Example + +```bash +./komodo-cli -ac_name=HELLOWORLD heirinfo b8b5fa46b545548fbab3baeb5adeaafedd80494006af1b04007fb9f7379ce1f0 +``` + + + + + +## heirlist + +**heirlist** + +The `heirlist` method outputs a list of all available `fundingtxid`'s on the asset chain. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | ---- | ---- | + +### Response + +| Name | Type | Description | +| ----------- | ------------------ | ---------------------------------------------------------- | +| fundingtxid | (array of strings) | an array containing all `fundingtxid`'s on the asset chain | + +#### :pushpin: Example + +```bash +./komodo-cli -ac_name=HELLOWORLD heirlist +``` + + + + + + +# MuSig + +## Introduction + +::: tip Notice + +The MuSig module is an experimental feature. It is provided as a demonstration of Antara capabilities and of the MuSig concept. If you would like to use MuSig on a production-level asset chain, please reach out to the Komodo team on [Discord.](https://komodoplatform.com/discord) + +::: + +The MuSig Antara module implements a new type of multi-signature functionality. MuSig allows a blockchain to process multi-signature transactions in a more data-efficient manner. MuSig also keeps private the number of signers partaking in a multi-signature transaction. + +This functionality is facilitated by MuSig's implementation of Schnorr Signature technology. Schnorr Signatures are unique in that each signature is 64 bytes in size, regardless of the number of signers in a transaction. Also, a multi-signature Schnorr Signature can be processed in one verification. + +Schnorr Signatures differs from the existing multi-signature method (ECDSA), as the ECDSA method requires each signer of a transaction to be verified separately. Also, with the ECDSA method each set of signers must be collected into a final verification. The size of the ECDSA multi-signature transaction can vary according to the number of signers in the set, and this can disclose information that would otherwise remain private. + +Therefore, Schnorr Signatures greatly reduce verification time and data-storage requirements, and enhance user privacy. + +For further information, see this [article.](https://blockstream.com/2019/02/18/musig-a-new-multisignature-standard/) Also, the reader may refer to the comments in the following core `komodod` files, [File 1](https://github.com/jl777/komodo/blob/jl777/src/secp256k1/include/secp256k1_musig.h) and [File 2.](https://github.com/jl777/komodo/blob/jl777/src/secp256k1/src/modules/musig/example.c) + +#### MuSig Module Flow + +- Create a combined pubkey using the [combine](../customconsensus/musig.html#combine) method + - From the response, take note of the `combined_pk` and `pkhash` values +- Send coins to `combined_pk` using the [send](../customconsensus/musig.html#send) method + - Decode the returned raw transaction using [getrawtransaction](../komodo-api/rawtransactions.html#getrawtransaction) + - From the decoded raw transaction, take note of the `sendtxid` value +- Calculate the message that needs to be signed using the [calcmsg](../customconsensus/musig.html#calcmsg) method + - From the response, take note of `msg` + - This `msg` needs to be signed by all participating pubkeys +- On each node create a session using the [session](../customconsensus/musig.html#session) method + - From the response on each node take note of the `commitment` value + - Transfer each node's `commitment` value to each other node + - Do not stop the `komodod` daemon on any node from this point forward + - The `komodod` daemon stores the `commitment` value as a part of a `global data structure` + - Should any `komodod` daemon be stopped, the MuSig workflow must be restarted from the beginning + - Also, execute the `sessions` method only once on each node +- On each node use the [commit](../customconsensus/musig.html#commit) method + - Transfer each node's `nonce` value to each other node +- On each node use the [nonce](../customconsensus/musig.html#nonce) method + - Transfer each node's `partialsig` value to each other node +- On each node execute the [partialsig](../customconsensus/musig.html#partialsig) method + - Verify that the `combinedsig` value of each node is the same as each other node by transferring one `combinedsig` value on one node to all other nodes +- On at least one node execute the [verify](../customconsensus/musig.html#verify) method + - Use the returned output to verify that the `combinedsig` value will be able to successfully execute the `spend` method for the desired `msg` +- On one node execute the [spend](../customconsensus/musig.html#spend) method and broadcast the returned raw transaction + +## Musig Tutorial Availability + +The Antara Tutorials section features a full installation and walkthrough tutorial of the Musig module. + +[Link to Musig Module Tutorial](../../../basic-docs/antara/antara-tutorials/musig-module-tutorial.md) + +## calcmsg + +**cclib calcmsg 18 '["sendtxid", "scriptPubKey"]'** + +The `calcmsg` method can be used by any one of the signers to initiate a `spend` transaction. + +To calculate the `msg` value, this method requires a `sendtxid` and a `scriptPubKey`. + +- The `sendtxid` is the id of a transaction that added funds to the `combined_pk` through the [send](../customconsensus/musig.html#send) method. +- The `scriptPubKey` expected here is of the type [p2pk](http://learnmeabitcoin.com/glossary/p2pk) in `hex` form. + +To create a `scriptPubkey` from a normal `pubkey`, add the characters `21` to the beginning of the `pubkey` string and the characters `ac` to the end of the string: + +```bash +scriptPubkey = 21 + pubkey + ac +``` + +For example: + +- The `pubkey` is: `02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e` +- The associated `scriptPubkey` is: `2102f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193eac` + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| sendtxid | (string) | the transaction id of the transaction created by the [send](../customconsensus/musig.html#send) method that was executed to fund the MuSig address; only the funds in the `vout0` of the `sendtxid` are spent | +| scriptPubKey | (string) | a modified form of a pubkey; this is the pubkey that will receive the spent funds | + +#### Response + +| Name | Type | Description | +| ------ | -------- | ------------------------------------------------------------------------------------------------------------------------ | +| msg | (string) | the message that must be signed by all the signers for the final [spend](../customconsensus/musig.html#spend) to succeed | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib calcmsg 18 '["09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293","210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac"]' +``` + + + +## combine + +**cclib combine 18 '[ "pubkey1", "pubkey2", .....]'** + +The `combine` method produces the combined pubkey ( `combined_pk` ) from all pubkeys provided. + +Usage of this method depends upon the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ---------------------- | -------- | --------------------------------------------------- | +| pubkey1, pubkey2, .... | (string) | the pubkeys of all the signers of the MuSig address | + +#### Response + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------- | +| pkhash | (string) | the 32-byte hash of the original public keys | +| combined_pk | (string) | the combined pubkey of all the signers | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib combine 18 '["0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a","02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567"]' +``` + + + +## commit + +**cclib commit 18 '["pkhash", ind, "commitment"]'** + +The `commit` method produces a `nonce` for each set of `index` and `commitment` values provided. + +The returned `nonce` must be shared with all corresponding nodes. + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ---------- | ---------------- | --------------------------------------------------------------------------------------- | +| pkhash | (string) | the 32-byte hash of the original public keys | +| ind | (decimal number) | the index of the node, whose `commitment` is being added to the `global data structure` | +| commitment | (string) | the `commitment` value produced by the node with index `ind` | + +#### Response + +| Name | Type | Description | +| ----------- | ---------------- | ----------------------------------------------------------------------- | +| added_index | (decimal number) | the index of the node whose `commitment` is added | +| myind | (decimal number) | the index of the node on which this method is executed | +| nonce | (string) | the `nonce` value produced by the node on which this method is executed | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib commit 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"2854473733147ebdbf2fb70b956c8086c9d7659ca0093627fe0371098f8bc003"]' +``` + + + +## nonce + +**cclib nonce 18 '["pkhash", ind, "nonce"]'** + +The `nonce` method produces a `partialsig` for each set of `index` and `nonce` value provided. + +The returned `partialsig` must be shared with all corresponding nodes. + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ------ | ---------------- | ---------------------------------------------------------------------------------- | +| pkhash | (string) | the 32-byte hash of the original public keys | +| ind | (decimal number) | the index of the node, whose `nonce` is being added to the `global data structure` | +| nonce | (string) | the `nonce` value produced by the node with index `ind` | + +#### Response + +| Name | Type | Description | +| ----------- | ---------------- | ---------------------------------------------------------------------------- | +| added_index | (decimal number) | the index of the node whose `nonce` is added | +| myind | (decimal number) | the index of the node on which this method is executed | +| partialsig | (string) | the `partialsig` value produced by the node on which this method is executed | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib nonce 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"02402fe26abd7ed2cf22d872a6b22ced4309aac8ec273b9c89e0f8f5b77f1574db"]' +``` + + + +## partialsig + +**cclib partialsig 18 '["pkhash", ind, "partialsig"]'** + +The `partialsig` method produces a `combinedsig` for each set of `index` and `nonce` values provided. + +The returned `combinedsig` must be shared with all corresponding nodes. + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ---------- | ---------------- | ------------------------------------------------------------------------------------- | +| pkhash | (string) | the 32-byte hash of the original public keys | +| ind | (decimal number) | the index of the node, whose `partialsig` is now added to the `global data structure` | +| partialsig | (string) | the `partialsig` value produced by the node with index `ind` | + +#### Response + +| Name | Type | Description | +| ----------- | ---------------- | ----------------------------------------------------------------------------- | +| added_index | (decimal number) | the index of the node whose `partialsig` is added | +| myind | (decimal number) | the index of the node on which this method is executed | +| combinedsig | (string) | the `combinedsig` value produced by the node on which this method is executed | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib partialsig 18 '["8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9",1,"9e964dfd402f973ea1e9407e19918b1c3897ff6544d60dcdb19cfb0e5bc4c0c1"]' +``` + + + +## send + +**cclib send 18 '["combined_pk", amount]'** + +The `send` method allows any node on the network to fund the `combined_pk` with the specified `amount` . + +The returned transaction id is called the `sendtxid`. It is used as a parameter for the methods [calcmsg](../customconsensus/musig.html#calcmsg) and [spend.](../customconsensus/musig.html#spend) + +Usage of this method depends upon the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ----------- | -------- | --------------------------------------------------- | +| combined_pk | (string) | the combined pubkey of all the signers | +| amount | (number) | the amount of coins to be sent to the `combined_pk` | + +#### Response + +| Name | Type | Description | +| ------ | -------- | ----------------------------------------------------------------------- | +| hex | (string) | the send_transaction in raw-transaction format, provided in hexadecimal | +| txid | (string) | the transaction id of the send transaction | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib send 18 '["03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",1]' +``` + + + +## session + +**cclib session 18 '["myindex", "numsigners", "combined_pk", "pkhash", "msg"]'** + +The `session` method creates a `global data structure` on each node on which the method is executed. The method also adds a `commitment` to sign the `msg` message provided. + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ----------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| myindex | (decimal number) | the index of the node that is running this method; each node must be assigned a unique index from the set: {0,1,2,3, ... , (`numsigners` - 1)} | +| numsigners | (decimal number) | the total number of signers participating | +| combined_pk | (string) | the combined pubkey of all the signers | +| pkhash | (string) | the 32-byte hash of the original public keys | +| msg | (string) | the message that needs to be signed by all the signers for the final [spend](../customconsensus/musig.html#spend) to succeed | + +#### Response + +| Name | Type | Description | +| ---------- | ---------------- | ------------------------------------------------------------------------ | +| myind | (decimal number) | the index of the node on which this method is executed | +| numsigners | (decimal number) | the total number of signers participating | +| commitment | (string) | the `commitment` value produced by the node for this `msg` and `session` | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib session 18 '[0,2,"03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","8897e150bfb07d3f967ffadb4b0f3c84ea73a94c0d715c4b7e6d9c816c5113a9","3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603"]' +``` + + + +## spend + +**cclib spend 18 '["sendtxid", "combinedsig", "scriptPubKey"]'** + +The `spend` method spends coins to the indicated `scriptPubKey`. + +The `scriptPubKey` expected here is of the type [p2pk](http://learnmeabitcoin.com/glossary/p2pk) in `hex` form. + +To create a `scriptPubkey` from a normal `pubkey`, add the characters `21` to the beginning of the `pubkey` string and the characters `ac` to the end of the string: + +```bash +scriptPubkey = 21 + pubkey + ac +``` + +For example: + +- The `pubkey` is: `02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e` +- The associated `scriptPubkey` is: `2102f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193eac` + +The method generates a raw transaction which must then be broadcast using [sendrawtransaction.](../komodo-api/rawtransactions.html#sendrawtransaction) + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| sendtxid | (string) | the transaction id of the transaction created by the [send](../customconsensus/musig.html#send) method used to fund the MuSig address; only the funds in the `vout0` of the `sendtxid` are spent | +| combinedsig | (string) | the combined signature produced by all the signers | +| scriptPubKey | (string) | a modified form of a pubkey to which funds are to be spent | + +#### Response + +| Name | Type | Description | +| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| msg | (string) | the message that needs to be signed by all the signers for the final [spend](../customconsensus/musig.html#spend) to succeed | +| combined_pk | (string) | the combined pubkey of all the signers | +| combinedsig | (string) | the combined signature produced by all the signers | +| hex | (string) | the `spend` transaction in raw-transaction format, provided in hexadecimal | +| txid | (string) | the transaction id of the spend transaction | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib spend 18 '["09daa45cb6e17028f9568347291a993cbf29c152a527b53e9ac0925d4900c293","210225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270aac","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' +``` + + + +## verify + +**cclib verify 18 '["msg", "combined_pk", "combinedsig"]'** + +The `verify` method verifies that the `combinedsig` is able to spend the funds owned by `combined_pk`. The funds in question are those which were referenced in the creation of the `msg` value. + +Usage of this method depends on the [cclib](../komodo-api/cclib.html#cclib) method. The `EVALCODE` is `18`. + +#### Arguments + +| Name | Type | Description | +| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| msg | (string) | the message that needs to be signed by all the signers for the final [spend](../customconsensus/musig.html#spend) to succeed | +| combined_pk | (string) | the combined pubkey of all the signers | +| combinedsig | (string) | the `combinedsig` value produced by the node on which this method is executed | + +#### Response + +| Name | Type | Description | +| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| msg | (string) | the message that needs to be signed by all the signers for the final [spend](../customconsensus/musig.html#spend) to succeed | +| combinedsig | (string) | the `combinedsig` value produced by the node on which this method is executed | +| combined_pk | (string) | the combined pubkey of all the signers | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib verify 18 '["3ef43614242afd3c57e02a75a3bc99342fea7c731f6190b791c0f99826789603","03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a","4b3a9b2b162802bc6c2cca2d22e70ab1cf738a9d4f5692f4f881d0cce0319c137b27889bb562602c94e163729c4168120a4ab41a8e936909e832e6af09e758f2"]' +``` + + + + +# Oracles + +## Introduction + +The Oracles Fluidity module allows a user to make off-chain data available on-chain. This enables developers to create and use software that responds to off-chain information and events. + +Those who publish data to an oracle are called publishers. There is a fee-based model to serve as an incentive for publishers. + +### Oracles Module Flow + +- Create an Oracle using [oraclescreate](../customconsensus/oracles.html#oraclescreate) +- Register as a data publisher for the oracle using the [oraclesregister](../customconsensus/oracles.html#oraclesregister) method; at this stage, the publisher indicates the fee for their data updates + - Anyone can register as a publisher for any oracle; users subscribe only to the publishers they desire +- The [oracleslist](../customconsensus/oracles.html#oraclelist), [oraclesinfo](../customconsensus/oracles.html#oraclesinfo), and [oraclessamples](../customconsensus/oracles.html#oraclessamples) methods allow the user to find oracles and publishers, find more information about a specific oracle and publisher, and discover samples of an existing publisher, respectively +- Anyone can subscribe to any specific publisher of any oracle using the [oraclessubscribe](../customconsensus/oracles.html#oraclessubscribe) method +- A publisher can publish data using [oraclesdata](../customconsensus/oracles.html#oraclesdata), and thereby collect their fee from their subscribers + +## oraclelist + +**oracleslist** + +The `oraclelist` method lists all available oracle contracts on the Smart Chain. + +### Arguments + +| Name | Type | Description | +| ------ | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------------------ | +| oracletxid | (array of strings) | the unique identifying oracletxid(s) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oracleslist +``` + + + +## oraclesaddress + +**oraclesaddress (pubkey)** + +The `oraclesaddress` method displays the oracle address for a specific pubkey. + +### Arguments + +| Name | Type | Description | +| ------ | ------------------ | -------------------------------------------------------------------------------------- | +| pubkey | (string, optional) | the pubkey of the requested info; by default it is the pubkey used to launch the chain | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the method executed successfully | +| OraclesCCaddress | (string) | taking the module's EVAL code as a modifier, this is the public address that corresponds to the contract's privkey | +| Oraclesmarker | (string) | the unmodified public address generated from the contract's privkey | +| GatewaysPubkey | (string) | the pubkey for the gateways cc | +| OraclesCCassets | (string) | this property is used for development purposes only and can otherwise be ignored | +| CCaddress | (string) | taking the module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myCCaddress | (string) | taking the module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myaddress | (string) | the public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesaddress 03810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5 +``` + + + +## oraclescreate + +**oraclescreate name description format** + +The `oraclescreate` method creates a new oracle. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | +| name | (string) | the desired name of the oracle contract | +| description | (string) | the description of the oracle | +| format | (string) | an indication of what format of data is accepted into this contract; use the list of characters provided below for this property | + +The various formats of data that can be registered for an oracle and their symbols are as follows: + +- `s` -> `char string; size < 256 bytes` +- `S` -> `char string; size < 65536 bytes` +- `d` -> `binary data; size < 256 bytes` +- `D` -> `binary data; size < 65536 bytes` +- `c` -> `1 byte signed little endian number, 'C' if unsigned` +- `t` -> `2 byte signed little endian number, 'T' if unsigned` +- `i` -> `4 byte signed little endian number, 'I' if unsigned` +- `l` -> `8 byte signed little endian number, 'L' if unsigned` +- `h` -> `32 byte hash` + +::: warning + +- Even though the formats `S` and `D` specify that the data size can be up to `65536` bytes, the combination of the transaction size and the data size cannot exceed the limit of `10000` bytes. +- Although the formats `d` and `D` are for raw binary data, they are preferable to the `s` and `S` human-readable formats. This is because the `s` and `S` formats occupy twice the size of data on the blockchain, and yet their only advantage is their ability to show human-readable output in the [oraclessamples](../customconsensus/oracles.html#oraclessamples) method. + +::: + +::: tip +If data to be submitted is larger than `8KB`, break it into chunks of size `8KB` or lower. +::: + +### Response + +| Name | Type | Description | +| ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command succeeded | +| hex | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create a customized oracle contract and get the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclescreate "NYWTHR" "Weather in NYC" "L" +``` + + + +Step 2: Send raw transaction / broadcast the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000185b76ed0fbdb9ee2bdb5693f491b6ea23de6498f42c6e83f9f36c1eaf411dd990200000049483045022100aa198a2ae959ee191e1359df48867480bf5a1a5bd4fa76b4398481c89ff3095102205034824dcd56b312183acd65c27a002a13dae84f5d22c767f1efaae09ef63a5c01ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aac378740a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000001c6a1aec43064e5957544852014c0e5765617468657220696e204e594300000000 +# This will output an unique txid which will be refered as oracletxid or transaction ID of the oracle. +``` + + + +(Use `./komodo-cli -ac_name=HELLOWORLD getrawmempool` to ensure that the transaction receives confirmation.) + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000185b76ed0fbdb9ee2bdb5693f491b6ea23de6498f42c6e83f9f36c1eaf411dd990200000049483045022100aa198a2ae959ee191e1359df48867480bf5a1a5bd4fa76b4398481c89ff3095102205034824dcd56b312183acd65c27a002a13dae84f5d22c767f1efaae09ef63a5c01ffffffff0310270000000000002321038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691aac378740a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000001c6a1aec43064e5957544852014c0e5765617468657220696e204e594300000000 +``` + + + +## oraclesdata + +**oraclesdata oracletxid hexstr** + +The `oraclesdata` method publishes data to an oracle. + +A publisher cannot successfully execute this command until they have at least one subscriber. A publisher may create their own subscriber account for this purpose. See [oraclessubscribe.](../customconsensus/oracles.html#oraclessubscribe) + +Data is submitted using the `hexstr` property. The first bytes of the `hexstr` property must be the length of the data being submitted in hexadecimal format; this sets the string length for the rest of the data. The second portion of the `hexstr` property is the data itself. + +The `oraclesdata` method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method outputs a unique `txid`, called `oraclesdatatxid`, which is the unique identifier for this data sample. + +The following script converts data entered in a normal-text form to a format accepted by an Oracle with the following characteristics. The oracle is of type: `S`, and the first two bytes of data are the length, given in **Little Endian** format. + + + +::: tip Note + +- for submitting data of the types `s` and `d`, where the size is less than 256 bytes, the first byte denotes the length +- for submitting data of the types `S` and `D`, where the size is less than 65536 bytes, the first two bytes denotes the length in **Little Endian** format + +::: + +#### :pushpin: Examples for data submission + +##### Example A + +- The objective: to submit a `10` character string, `"teststring"`, to an oracle of the format `s` +- The data to meet this objective is as follows: `0a74657374737472696e67` + - Notice the first byte, `0a` + - This is the hexadecimal representation of the decimal number `10` + - `10` is the byte size of this `10` character string, because each character requires `1 byte` of space + - Notice the remaining bytes, `74657374737472696e67` + - Each two characters is a byte representing a character + - `74` = `t` + - `65` = `e` + - `73` = `s` + - `74` = `t` etc. + +##### Example B + +- The objective: to submit the `10` character string, `"teststring"`, to an oracle of the format `S` +- The data to meet this objective is as follows: `0a0074657374737472696e67` + - Notice the first two bytes, `0a` and `00` + - These are the hexadecimal representations of the decimal number `10`, written to fill `2 bytes` and in **Little Endian** format + - The remaining data, `74657374737472696e67`, is the same as Example A + +### Arguments + +| Name | Type | Description | +| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| oracletxid | (string) | the unique identifying transaction id of the oracle | +| hexstring | (string) | the first half of the string indicates the length of the string in bytes, the second half of the string is the data, typically provided in hex-encoded format | + +### Response + +| Name | Type | Description | +| ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command succeeded | +| hex | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Subscribe to a oracle plan and get the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesdata 0df7c4d844f08dba08abd4bb174558739f17cfe268feb005fb6333b3761d9203 00000000ffffffff +``` + + + +Step 2: Send raw transaction / broadcast the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000359db76b9b8e9cfaa4514dcc198c375f910b9fb7367d1c9d556cd5eb43b5f4d2d02000000484730440220645b49d6d85454b1015d82a53ec51685fc3b8bf1d092696c3c253b88cab3033a02207023511219897a374ad94951dd2af70b14d99eccbb404eaf783120f3170bd5e301ffffffff75a5881417ab6700c089a6083d71abadc8cd74018bded0cfba423e027d513c8f010000007b4c79a276a072a26ba067a5658021035933ab0bd2e2ceb712e7cab393a8c9096ba4be2e3a76f5aaeab72bce4aa61857814047697a246e4442888a3b6ffc4a8c5ae940eec7d19f72053a07b6d8a2968a260626c8001c9138e9fd0e3cfabb811ae71bd8c1c555ca8c8410cb9121ce25860507a100af038001eca10001ffffffff59db76b9b8e9cfaa4514dcc198c375f910b9fb7367d1c9d556cd5eb43b5f4d2d000000007b4c79a276a072a26ba067a565802103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b581404fa0de32bbb96b2e2f61fe823cdba4c3b9fef786ea8c65196f97653a942656812e675e91643ff0ec33853fd2481d40fc48fa51e18c9cbffb49e714c15b47babda100af038001eca10001ffffffff05c09ee60500000000302ea22c802092392e766d63f73dd7c68ff9eaf9f009f13b17c4167472e8aebb00d96be66aa68103120c008203000401cc1027000000000000302ea22c80200648c12e7e058c98f0a5cc288ac271ad08bd493e1fb7de83edeea69789338fc58103120c008203000401cc40420f0000000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5acd7bb49a204000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac0000000000000000706a4c6dec4403921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d75a5881417ab6700c089a6083d71abadc8cd74018bded0cfba423e027d513c8f2103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b50800000000ffffffff00000000 +``` + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000359db76b9b8e9cfaa4514dcc198c375f910b9fb7367d1c9d556cd5eb43b5f4d2d02000000484730440220645b49d6d85454b1015d82a53ec51685fc3b8bf1d092696c3c253b88cab3033a02207023511219897a374ad94951dd2af70b14d99eccbb404eaf783120f3170bd5e301ffffffff75a5881417ab6700c089a6083d71abadc8cd74018bded0cfba423e027d513c8f010000007b4c79a276a072a26ba067a5658021035933ab0bd2e2ceb712e7cab393a8c9096ba4be2e3a76f5aaeab72bce4aa61857814047697a246e4442888a3b6ffc4a8c5ae940eec7d19f72053a07b6d8a2968a260626c8001c9138e9fd0e3cfabb811ae71bd8c1c555ca8c8410cb9121ce25860507a100af038001eca10001ffffffff59db76b9b8e9cfaa4514dcc198c375f910b9fb7367d1c9d556cd5eb43b5f4d2d000000007b4c79a276a072a26ba067a565802103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b581404fa0de32bbb96b2e2f61fe823cdba4c3b9fef786ea8c65196f97653a942656812e675e91643ff0ec33853fd2481d40fc48fa51e18c9cbffb49e714c15b47babda100af038001eca10001ffffffff05c09ee60500000000302ea22c802092392e766d63f73dd7c68ff9eaf9f009f13b17c4167472e8aebb00d96be66aa68103120c008203000401cc1027000000000000302ea22c80200648c12e7e058c98f0a5cc288ac271ad08bd493e1fb7de83edeea69789338fc58103120c008203000401cc40420f0000000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5acd7bb49a204000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac0000000000000000706a4c6dec4403921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d75a5881417ab6700c089a6083d71abadc8cd74018bded0cfba423e027d513c8f2103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b50800000000ffffffff00000000 +``` + + + +## oraclesfund + +**oraclesfund oracletxid** + +The `oraclesfund` method allows a user to register as a publisher on an oracle. + +This method must be executed before the user attempts to use the oraclesregister method. + +### Arguments: + +| Structure | Type | Description | +| ---------- | -------- | --------------------------------------------------- | +| oracletxid | (string) | the unique identifying transaction id of the oracle | + +#### :pushpin: Examples + +Step 1: Create a customized oracle contract and get the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesfund 7b6e7745058ffded423546eecc61dcc05069279b90776384c52692765246b64c +``` + +Response from Step 1: + + + +Step 2: Send raw transaction / broadcast the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0400008085202f890124839445f1cdca84c42563fa87742a562824815729625184117c80dc2a06510e0000000049483045022100c4442ff211289ebc5967da35843f1d210c4a8985d5797a11c42e245aafdf6985022031e7dfb40e3778033f1fb92c0f1175cb4a658bb32749469d69379968fcf92be701ffffffff031027000000000000302ea22c802083071e46d28313148751bdd5e4ffd0509c4234f4770c4c0550cc48b6d45215188103120c008203000401cce0950b5402000000232102c59cc849a87ef401942abb5b5fe81c1a468454fd68c94c849c20b13f5ebd91a5ac00000000000000004f6a4c4cec464cb64652769226c5846377909b276950c0dc61ccee463542edfd8f0545776e7b2102c59cc849a87ef401942abb5b5fe81c1a468454fd68c94c849c20b13f5ebd91a5102700000000000000000000b60700000000000000000000000000 + +# This will output an unique txid which will be refered as oracletxid or transaction ID of the oracle. +``` + +Response from Step 2: + + + +(Use `./komodo-cli -ac_name=HELLOWORLD getrawmempool` to ensure that the transaction receives confirmation.) + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 0400008085202f890124839445f1cdca84c42563fa87742a562824815729625184117c80dc2a06510e0000000049483045022100c4442ff211289ebc5967da35843f1d210c4a8985d5797a11c42e245aafdf6985022031e7dfb40e3778033f1fb92c0f1175cb4a658bb32749469d69379968fcf92be701ffffffff031027000000000000302ea22c802083071e46d28313148751bdd5e4ffd0509c4234f4770c4c0550cc48b6d45215188103120c008203000401cce0950b5402000000232102c59cc849a87ef401942abb5b5fe81c1a468454fd68c94c849c20b13f5ebd91a5ac00000000000000004f6a4c4cec464cb64652769226c5846377909b276950c0dc61ccee463542edfd8f0545776e7b2102c59cc849a87ef401942abb5b5fe81c1a468454fd68c94c849c20b13f5ebd91a5102700000000000000000000b60700000000000000000000000000 +``` + +Response from Step 3: + + + +## oraclesinfo + +**oraclesinfo oracletxid** + +The `oraclesinfo` method displays information about a specific oracle using `oracletxid`. + +For a list of all `oracletxid`'s available on the Smart Chain, see the [oracleslist](../customconsensus/oracles.html#oraclelist) method. + +### Arguments + +| Name | Type | Description | +| ---------- | -------- | --------------------------------------------------- | +| oracletxid | (string) | the unique identifying transaction id of the oracle | + +### Response + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| txid | (string) | the unique txid, or oracletxid, that identifies the oracle | +| name | (string) | the name of the oracle contract | +| description | (string) | the description of the oracle contract | +| format | (string) | a string that identifies the data type accepted for the oracle contract (see [oraclescreate](../customconsensus/oracles.html#oraclescreate)) | +| marker | (string) | the unmodified public address generated from the oracle contract's privkey | +| registered: | (array) | +| publisher | (string) | the unique identifier for the publisher (see [oraclesregister](../customconsensus/oracles.html#oraclesregister)) | +| baton | (string) | the baton address of the publisher, which is a Fluidity address (based on the pubkey of the publisher and the EVAL code of the oracle contract) | +| batontxid | (string) | the most recent baton utxo sent to the baton address; this is the tip of the linked list that connects all data samples for the publisher | +| lifetime | (number) | the length of time since publisher's inception | +| funds | (number) | the funds committed by subscribers to the publisher's account, and which are used for payouts | +| datafee | (number) | the amount a subscriber pays for each data upload | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesinfo 0df7c4d844f08dba08abd4bb174558739f17cfe268feb005fb6333b3761d9203 +``` + + + +## oraclesregister + +**oraclesregister oracletxid datafee** + +A user executes the `oraclesregister` method to register as a data publisher for an existing oracle contract. + +The `datafee` property is set in satoshis, and should be `>=` the chain's default transaction fee. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +::: tip +Use `./komodo-cli -ac_name=YOURNAME getrawmempool` to verify the transaction is confirmed. +::: + +::: tip +After the transaction confirms, use `oraclesinfo` to output registration information about your oracles plan +::: + +### Arguments + +| Name | Type | Description | +| ---------- | --------- | ------------------------------------------------------------------------------------------- | +| oracletxid | (string) | the unique identifying transaction id of the oracle | +| datafee | (numbers) | the fee required of a subscriber for each data point the publisher publishes in this oracle | + +### Response + +| Name | Type | Description | +| ------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Set your parameters to create a raw transaction and get the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclesregister 0df7c4d844f08dba08abd4bb174558739f17cfe268feb005fb6333b3761d9203 1000000 +``` + + + +Step 2: Send/broadcast the raw transaction hex + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000103921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d010000004847304402207241f313ef2fb65d9eb1f870068ceba436f14996ce79d16ff85f2937c75357ee022025f0b888e742546469ad0b7fae9b85cf7c89cddf307170bbcf794e5e90ae28b101ffffffff04102700000000000023210203921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70dac1027000000000000302ea22c80200648c12e7e058c98f0a5cc288ac271ad08bd493e1fb7de83edeea69789338fc58103120c008203000401cc071240a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000004f6a4c4cec5203921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d2103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b540420f000000000000000000 +``` + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000103921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d010000004847304402207241f313ef2fb65d9eb1f870068ceba436f14996ce79d16ff85f2937c75357ee022025f0b888e742546469ad0b7fae9b85cf7c89cddf307170bbcf794e5e90ae28b101ffffffff04102700000000000023210203921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70dac1027000000000000302ea22c80200648c12e7e058c98f0a5cc288ac271ad08bd493e1fb7de83edeea69789338fc58103120c008203000401cc071240a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000004f6a4c4cec5203921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d2103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b540420f000000000000000000 +``` + + + +## oraclessamples + +**oraclessamples oracletxid baton num** + +The `oraclessample` method fetches data samples from a publisher. + +The user indicates the desired publisher by inserting the `batonutxo` by the publisher. Use [oraclesinfo](../customconsensus/oracles.html#oraclesinfo) to find a list of publishers and their current batonutxo's. + +### Arguments + +| Name | Type | Description | +| ------------ | -------- | ------------------------------------------------------------------ | +| oracletxid | (string) | the unique identifying transaction id of the oracle contract | +| batonaddress | (string) | the baton address, which can be found using the oraclesinfo method | +| num | (number) | the number of sample data points required | + +### Response + +| Name | Type | Description | +| ------------- | ------------------ | ----------------------------------------- | +| result | (string) | whether the command executed successfully | +| samples: | (array of strings) | +| "XXXXXXXXXXX" | (string) | a sample data point | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclessamples 7b6e7745058ffded423546eecc61dcc05069279b90776384c52692765246b64c RVerJvoYsXp3avQ3xxe54EhajZgn5xidKB 1 +``` + + + +## oraclessubscribe + +**oraclessubscribe oracletxid publisher amount** + +The user executes `oraclessubscribe` to subscribe to a publisher of an oracle plan. + +Every publisher must have at least one subscriber before the [oraclesdata](../customconsensus/oracles.html#oraclesdata) can successfully execute. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method then returns a unique txid, also called the `oraclesubscriptiontxid`, or the id of the oracle subscription transaction. This can be used for further development purposes. + +::: tip +If the **datafee** is 10 COINS and the `amount` submitted is 1000 COINS, the publisher can publish data 100 times based on this amount. +::: + +### Arguments + +| Name | Type | Description | +| ---------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| oracletxid | (string) | the unique identifying transaction id of the oracle | +| publisher | (string) | the unique publisher id, which can be found using the oraclesinfo method | +| amount | (number) | the total amount of funds the subscriber commits to pay for data upload by the publisher; this amount is immediately withdrawn from the user's wallet | + +### Response + +| Name | Type | Description | +| ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command succeeded | +| hex | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Subscribe to an oracle plan and get the hex value: + +```bash +./komodo-cli -ac_name=HELLOWORLD oraclessubscribe 0df7c4d844f08dba08abd4bb174558739f17cfe268feb005fb6333b3761d9203 03810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5 1 +``` + + + +Step 2: Send raw transaction / broadcast the hex value + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000175a5881417ab6700c089a6083d71abadc8cd74018bded0cfba423e027d513c8f0200000048473044022006449e2f324ba8c262ca73eea4642f77ccf906fee5bab4fdc85bcc8c350ce81b022047d76840076f6e02aebe77ffb59b052974badb8747c7b435fd77351fcfbee95e01ffffffff0400e1f50500000000302ea22c802092392e766d63f73dd7c68ff9eaf9f009f13b17c4167472e8aebb00d96be66aa68103120c008203000401cc102700000000000023210203921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70dace7e249a204000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000004f6a4c4cec5303921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d2103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b500e1f5050000000000000000 +``` + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000175a5881417ab6700c089a6083d71abadc8cd74018bded0cfba423e027d513c8f0200000048473044022006449e2f324ba8c262ca73eea4642f77ccf906fee5bab4fdc85bcc8c350ce81b022047d76840076f6e02aebe77ffb59b052974badb8747c7b435fd77351fcfbee95e01ffffffff0400e1f50500000000302ea22c802092392e766d63f73dd7c68ff9eaf9f009f13b17c4167472e8aebb00d96be66aa68103120c008203000401cc102700000000000023210203921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70dace7e249a204000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000004f6a4c4cec5303921d76b33363fb05b0fe68e2cf179f73584517bbd4ab08ba8df044d8c4f70d2103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b500e1f5050000000000000000 +``` + + + + +# Payments + +## Introduction + +The Payments Module allows a payment to be distributed between multiple recipients in a pre-defined proportion. + +### Payments CC Module Flow + +- Use [paymentstxidopret](#paymentstxidopret) to create as many transactions as there are recipients. Each recipient must have the following data: weight (also called "share"), recipient, destopret (optional; data to be stored in the OP_RETURN of the subsequent payment transaction) in its OP_RETURN, this step is to simply make the data available on the blockchain to be used by a later method. The transaction id is called `paytxnid` and is used as a reference to the data +- Use [paymentscreate](#paymentscreate) to create a new Payment plan. The number of blocks to lock the funds after funding, minimum release amount and the `paytxnid`s are passed as arguments. The `paytxnid`s contain the data about the recipients and their corresponding shares. The transaction id is called `createtxid` and will be the reference for this payment plan used by other methods +- Use [paymentsfund](#paymentsfund) to fund any existing payment plan. The method takes createtxid and amount as arguments +- Use [paymentsrelease](#paymentsrelease) to release payments to a Payments plan refered by the `createtxid` + +## paymentstxidopret + +**paymentstxidopret '[allocation,"scriptPubKey",("destopret")]'** + +### allocation + +`allocation` is the number that defines the share of a payment to the given `scriptPubkey`. + +Example: If a Payments plan has the allocation to `scriptPubkey_1` as the number `n1` and allocation to `scriptPubkey_2` as the number `n2`, then any funds sent to this payment plan are split between `scriptPubkey_1` and `scriptPubkey_2` in the ratio `n1:n2`. If funds sent to the Payments plan has the value N, `scriptPubkey_1` will receive `(N*n1)/(n1+n2)` and `scriptPubkey_1` will receive `(N*n2)/(n1+n2)` + +### scriptPubkey + +`scriptPubkey` is the puzzle that locks coins in a transaction. + +If the recipient is a simple pubkey, the [scriptPubkey](https://learnmeabitcoin.com/glossary/scriptPubKey) can be constructed by sandwiching the pubkey between the strings "21" and "ac". In this case, the privkey corresponding to the pubkey can be used to sign a transaction which will be able to unlock the coins. + +The `scriptPubKey` parameter can belong to any valid type described [here](https://learnmeabitcoin.com/glossary/scriptPubKey), but not limited to them. + +Example: If pubkey is `02d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567` , scriptPubkey will be `2102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567ac` + +If the node that is creating the transaction using the `paymentstxidopret` method has the privkey of an address in its wallet, an address can be used in the place of a scriptPubkey. + +Example: The address `RN727JeeiZ6NXic7PUKTCiHT1HvuBN4RDa` can be used directly without any modifications by a node which has the corresponding privkey in its wallet. + +The `validateaddress` method can be used to verify if an address belongs to the node. It can also be seen that the `pubkey` used to construct the `scriptPubkey` produced this address. + +Using either `RN727JeeiZ6NXic7PUKTCiHT1HvuBN4RDa` or `2102d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567ac` as the argument `scriptPubKey` is equivalent. + +```bash +./komdo-cli -ac_name=HELLOWORLD validateaddress RN727JeeiZ6NXic7PUKTCiHT1HvuBN4RDa +``` + + + +### destopret (optional) + +`destopret` is the data to be stored the OP_RETURN of the transaction that sends funds to the scriptPubkey. + +If the scriptPubkey belongs to a CC module that expects OP_RETURN data in the txn that sends coins to it, then `destopret` will be used by it + +Example: + +If a Payments plan is created which has to send a part of the funds to the Rewards CC module, it needs to add some data to the OP_RETURN of the transaction to specify which rewards plan the payment is funding. + +#### Arguments + +| Name | Type | Description | +| ------------ | ------------------ | ------------------------------------------------------------------------------------------- | +| allocation | (number) | defines the share of a payment to the given `scriptPubkey`. | +| scriptPubKey | (string) | [scriptPubkey](https://learnmeabitcoin.com/glossary/scriptPubKey) of the recipient | +| destopret | (string, optional) | data to be stored in the OP_RETURN of the transaction that sends funds to the scriptPubkey. | + +#### Response + +| Name | Type | Description | +| ------ | -------- | --------------------------------------------------------------------- | +| hex | (string) | the paytransaction in raw-transaction format, provided in hexadecimal | +| txid | (string) | the transaction id of the send transaction | +| result | (string) | whether the call executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD paymentstxidopret '[9,"222102d6f13a8f745921cdb811e32237bb98950af1a5952be7b3d429abd9152f8e388dac"]' +``` + + + +## paymentscreate + +**paymentscreate '[lockedblocks,minamount,"paytxid",...,"paytxidN"]'** + +Locked blocks, is how many blocks must pass before the funds sent to the plan can be released. +Minamount is the minimum amount that can be released. +Paytxids are the txids of all the transactions made in the previous step. + +## paymentsairdrop + +**paymentsairdrop '[lockedblocks,minamount,mintoaddress,top,bottom,fixedFlag,"excludeAddress",...,"excludeAddressN"]** +NOTE: requires -ac_snapshot= to be active to use. +Mintoaddress is the minimum that can be paid to an address, setting to 0 defaults to 10,000 sats. +Top is the top addresses to pay too, it must not be 0 or over 3999 +Bottom is to exclude the top X address from the airdrop. Generally this would always be 0, unless you wanted to exclude all whale addresses from an airdrop. +fixedFlag, set to 0, all addresses in the rich list are paid based on their balance. +Set to 1, the amount paid is fixed, the amount paid is split evenly over all the addresses in range of bottom->top on rich list. Eg 50-1000 on rich list. +Set to 7, activates game mode that changes the values of bottom and top based on the block hash of the block the daily airdrop was taken. + +## payments_airdroptokens + +**payments_airdroptokens '[“tokenid",lockedblocks,minamount,mintoaddress,top,bottom,fixedFlag,"excludePubKey",...,"excludePubKeyN"]'** + +NOT IMPLEMENTED YET. +Tokenid, is the token to base the airdrop on. + +## paymentsfund + +**paymentsfund '[“createtxid",amount(,useopret)]'** + +Createtxid is the txid from paymentscreate, paymentsairdrop or payments_airdroptokens +Amount is the amount to send +Useopret is a flag to tell it to make a ccvout tx to the global payments plan. You use this RPC to get the scriptPubKey you need to fund a payments plan from something else, either coinbase, or another contract. + +## paymentsmerge + +**paymentsmerge '[“createtxid"]'** + +Merges all funds on a payments plan to a single utxo in the plans special address. +Merged funds enforce lockedblocks, but cannot be merged again, for 100 blocks longer than this. This is to stop people merging the funds before they can be released, and preventing payments to happen. It exists because a very large tx cannot have lots of inputs. + +## paymentsrelease + +**paymentsrelease '[“createtxid",amount,(skipminimum)]'** + +Amount is amount to release, it must be above the minimum. +Skipminimum is a flag, if there are address with such low balance minimumtoaddress cannot be paid, this will truncate the rich list off at the first address that is being paid the wrong amount. + +## paymentsinfo + +**paymentsinfo '[“createtxid"]'** + +Shows info about a payments plan. + +## paymentslist + +**paymentslist** + +Lists all payments createtxids. +# Rewards + +## Introduction + +The Rewards Fluidity module creates a master-node like rewards program, giving a user the ability to earn rewards by locking coins. + +It features configurable parameters, such as a customizable APR, minimum deposit, a required holding period,etc. + +There can be many `rewards` plans active at any given time. + +### Rewards CC Module Flow + +- Anyone can create a new plan using [rewardscreatefunding](../customconsensus/rewards.html#rewardscreatefunding) +- Anyone can add funding to the plan using [rewardsaddfunding](../customconsensus/rewards.html#rewardsaddfunding) +- Anyone can query the list of all active plans using [rewardslist](../customconsensus/rewards.html#rewardslist) +- To get the details of a particular plan, use [rewardsinfo](../customconsensus/rewards.html#rewardsinfo) +- After finding a suitable plan, any user can lock funds using [rewardslock](../customconsensus/rewards.html#rewardslock) +- After the minimum lock time is met, the user can use [rewardsunlock](../customconsensus/rewards.html#rewardsunlock) to unlock their funds and receive their rewards + +## rewardsaddfunding + +**rewardsaddfunding name fundingtxid amount** + +The `rewardsaddfunding` method adds funds to a rewards plan. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------- | +| name | (string) | the desired name of your rewards plan | +| fundingtxid | (string) | the txid of the transaction that created and funded this plan | +| amount | (number) | the amount of funds to add to the plan | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create a raw transaction and get the HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardsaddfunding FREE e020151cd81647b20aa45a0e6850216ae52d3e895443bbe1ae97dea3ae6767bd 100 +``` + + + + + +Step 2: Broadcast raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0100000001bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e00200000048473044022050ab254c7498e411ab5360551148405c4afff28d68729e2bd00ba2508ab105d402204067ab95020d606c35d3604d4385dcb97c899a06aa8bf8ce30471fb7868ac7a401ffffffff0300e40b5402000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401ccd05eefb1fe080000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae5414652454500000000bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e000000000 +``` + + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=ATEST decoderawtransaction 0100000001bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e00200000048473044022050ab254c7498e411ab5360551148405c4afff28d68729e2bd00ba2508ab105d402204067ab95020d606c35d3604d4385dcb97c899a06aa8bf8ce30471fb7868ac7a401ffffffff0300e40b5402000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401ccd05eefb1fe080000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae5414652454500000000bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e000000000 +``` + + + + + +## rewardsaddress + +**rewardsaddress (pubkey)** + +The `rewardsaddress` method returns info about the `rewards` plan associated with the given `pubkey`. If no `pubkey` is provided, the `pubkey` used to launch the daemon is used. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | -------------------------------------------------------------------------------------- | +| pubkey | (string, optional) | the pubkey of the requested info; by default it is the pubkey used to launch the chain | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the method executed successfully | +| RewardsCCaddress | (string) | taking the module's EVAL code as a modifier, this is the public address that corresponds to the plan's privkey | +| Rewardsmarker | (string) | the unmodified public address generated from the plan's privkey | +| GatewaysPubkey | (string) | the pubkey for the gateways cc | +| RewardsCCassets | (string) | this property is used for development purposes only and can otherwise be ignored | +| CCaddress | (string) | taking the module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myCCaddress | (string) | taking the module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myaddress | (string) | the public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardsaddress 03810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5 +``` + + + + + +## rewardscreatefunding + +**rewardscreatefunding name amount APR mindays maxdays mindeposit** + +The `rewardscreatefunding` method creates a new `rewards` plan. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +The `sendrawtransaction` method will then return a `txid`. This `txid` is the `fundingtxid` that serves to identify the `rewards` plan. + +::: tip +If you create a plan with mindeposit: 10000, make sure to also add 10000 of your coin and the transaction fees using the rewardsaddfunding call after creating the plan. The rewards module won't allow locking of funds greater than the amount already locked in a single transaction as it needs to assure that it will have the required funds to pay. +::: + +### Arguments + +| Name | Type | Description | +| ---------- | -------- | ----------------------------------------------------------- | +| name | (string) | the desired name of your rewards plan | +| amount | (number) | the amount of seed funds to withdraw from your wallet | +| APR | (number) | the annual percentage of rewards, given in percentage units | +| mindays | (number) | the minimum number of days the funds will be locked | +| maxdays | (number) | the maximum number of days the funds will be locked | +| mindeposit | (number) | the minimum deposit amount for a user to participate | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create raw transaction HEX using your own parameter + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardscreatefunding FREE 1000 5 1 10 10 +``` + + + + + +Step 2: Broadcast/send the raw hex/transaction. This will output the txid which is the fundingtxid, also called the rewards plan id. + +```bash +./komodo-cli -ac_name=ATEST sendrawtransaction 010000000104f2435046f3ad452e76e53ec01429ae4f49d3322e8cc96da96b9e35d6ada70e0000000049483045022100ebd06f60dea0e1fbfc82fdb1f17ca265c63bae51cd2db558946871513f64453902207d4d39b2418a5206bd7ef4efb9130f93f304577e0c84cc79be4e8abe0c8b22fe01ffffffff0400e8764817000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401cc1027000000000000232103da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb9ace069fb0501090000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae54646524545000000000065cd1d000000008051010000000000002f0d000000000000ca9a3b0000000000000000 +``` + + + + + +Step 3: Decode the raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=ATEST decoderawtransaction 010000000104f2435046f3ad452e76e53ec01429ae4f49d3322e8cc96da96b9e35d6ada70e0000000049483045022100ebd06f60dea0e1fbfc82fdb1f17ca265c63bae51cd2db558946871513f64453902207d4d39b2418a5206bd7ef4efb9130f93f304577e0c84cc79be4e8abe0c8b22fe01ffffffff0400e8764817000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401cc1027000000000000232103da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb9ace069fb0501090000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae54646524545000000000065cd1d000000008051010000000000002f0d000000000000ca9a3b0000000000000000 +``` + + + + + +## rewardsinfo + +**rewardsinfo fundingtxid** + +The `rewardsinfo` method returns information about specific `rewards` plan. + +Use [rewardslist](../customconsensus/rewards.html#rewardslist) to see a list of all available `fundingtxid`'s. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------- | +| fundingtxid | (string) | the txid given on the creation of the rewards plan | + +### Response + +| Name | Type | Description | +| ---------- | -------- | --------------------------------------------------------------------------- | +| name | (string) | the name of the rewards plan | +| sbits | (number) | a 64-bit int binary encoding of the first 8 characters of the name property | +| APR | (number) | the annual percentage of rewards, given in percentage units | +| minseconds | (number) | the minimum number of seconds the funds will be locked | +| maxseconds | (number) | the maximum number of seconds the funds will be locked | +| mindeposit | (number) | the minimum deposit amount | +| funding | (number) | the total available funds in the rewards plan | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardsinfo e020151cd81647b20aa45a0e6850216ae52d3e895443bbe1ae97dea3ae6767bd +``` + + + + + +## rewardslist + +**rewardslist** + +The `rewardslist` method lists the `fundingtxid`'s of all the rewards plans available on the Smart Chain. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ------------------------------------------------------------------------- | +| fundingtxid | (string) | the txid of the transaction that created and funded the relevant plan | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardslist + +``` + + + + + +## rewardslock + +**rewardslock name fundingtxid amount** + +The `rewardslock` method commits your desired amount of funds into the specified rewards plan. They remain locked until the minimum number of seconds/days passes. + +The method returns a `hex` value that must be broadcast using [sendrawtransaction.](../komodo-api/rawtransactions.html#sendrawtransaction) + +The `sendrawtransaction` method will then return a `txid`, which is later used in the [rewardsunlock](../customconsensus/rewards.html#rewardsunlock) method. In general, it is best to save this `txid` in a secure location. + +If the final `txid` is lost, it is possible to find it again. See [rewardsunlock](../customconsensus/rewards.html#rewardsunlock) for more information. + +### Arguments + +| Name | Type | Description | +| ----------- | -------- | --------------------------------------------------------------------------- | +| name | (string) | the name of the rewards plan | +| fundingtxid | (string) | the txid that identifies the desired rewards plan | +| amount | (number) | the amount of funds to commit to the plan (must be over the plan's minimum) | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the `diceaddfunds` command | + +#### :pushpin: Examples + +Step 1: Create raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardslock FREE e020151cd81647b20aa45a0e6850216ae52d3e895443bbe1ae97dea3ae6767bd 200 +``` + + + + + +Step 2: Broadcast raw transaction + +```bash +./komodo-cli -ac_name=ATEST sendrawtransaction 010000000180a53d85b02f6f61c5ddf94052c2d46a0161888c029114a9bf8dceeb4ea98c000100000049483045022100cf5581a6729eb0f37d03f0975dd6cfaca79ea08d380dae7df25b2335931bff5d02204feaf188f7f28d90c056a7b2bfa1f8d38fdf242c333470cf1e0cd3534ef1609701ffffffff0400c817a804000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401cc1027000000000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5acb048d709fa080000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae54c4652454500000000bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e000000000 +``` + + + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=ATEST decoderawtransaction 010000000180a53d85b02f6f61c5ddf94052c2d46a0161888c029114a9bf8dceeb4ea98c000100000049483045022100cf5581a6729eb0f37d03f0975dd6cfaca79ea08d380dae7df25b2335931bff5d02204feaf188f7f28d90c056a7b2bfa1f8d38fdf242c333470cf1e0cd3534ef1609701ffffffff0400c817a804000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401cc1027000000000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5acb048d709fa080000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae54c4652454500000000bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e000000000 +``` + + + + + +## rewardsunlock + +**rewardsunlock name fundingtxid (txid)** + +The `rewardsunlock` method unlocks your funds from a specific rewards plan after the minimum lock time is met. If `txid` is not provided, `rewardsunlock` unlocks all funds in the `fundingtxid` plan. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method to complete the command. + +If you attempt to unlock your funds before the minimum period is met, the daemon returns this error: + +The method requires the `txid` that was returned as a result of the original [rewardslock](../customconsensus/rewards.html#rewardslock) method. + +If the original `txid` is lost, it is possible to find it again by either rebroadcasting the original `hex` (if it is available), or by scanning through available utxos using the [getaddressutxos](../komodo-api/address.html#getaddressutxos) method. + +::: tip +{ +"result": "error", +"error": "reward 0 is <= the transaction fee" +} +::: + +An error similar to the one below prints in the console: + +``` +APR 5.00000000 minseconds.86400 maxseconds.864000 mindeposit 10.00000000 + +duration 74628 < minseconds 86400 + +reward 0 is <= the transaction fee + +amount 200.00000000 -> reward 0.00000000 +``` + +### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| name | (string) | the name of the rewards plan | +| fundingtxid | (string) | the txid that identifies the desired rewards plan | +| txid | (string, optional) | the txid that was returned as a result of the original rewardslock command; if `txid` is not provided, `rewardsunlock` unlocks all funds in the `fundingtxid` plan | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the `diceaddfunds` command | + +#### :pushpin: Examples + +Step 1: Create raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD rewardsunlock FREE e020151cd81647b20aa45a0e6850216ae52d3e895443bbe1ae97dea3ae6767bd 494c4e8ab19ab73db9fde0454762e50ff3621d9708170083ea9d925918ec0263 +``` + + + + + +Step 2: Broadcast raw transaction + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000026302ec1859929dea83001708971d62f30fe5624745e0fdb93db79ab18a4e4c49000000007b4c79a276a072a26ba067a565802103da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb98140dd5c7a6e8436748501608056b934a6b6cd54122f9451a1ca76f3d41568cb0e7a08e4d4f9045083425f42a4171e42b2d32f5e331f87d5b45298e006b909c706d2a100af038001e5a10001ffffffff45fc2d61dd7bf709409c3e5b9021ebd6191901a2a43fa7ed2704c03aa0d3a682000000007b4c79a276a072a26ba067a565802103da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb9814011825693143f97dc51d34b47638f314146c20c92b5020673fb7411ab37018c2003870255e17d87d46b7af7d042335579de566ce492fd8c3c4e883253870ba329a100af038001e5a10001ffffffff0349f04c4817000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401cca79841a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae5554652454500000000bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e000000000 +``` + + + + + +Step 3: Decode raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 01000000026302ec1859929dea83001708971d62f30fe5624745e0fdb93db79ab18a4e4c49000000007b4c79a276a072a26ba067a565802103da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb98140dd5c7a6e8436748501608056b934a6b6cd54122f9451a1ca76f3d41568cb0e7a08e4d4f9045083425f42a4171e42b2d32f5e331f87d5b45298e006b909c706d2a100af038001e5a10001ffffffff45fc2d61dd7bf709409c3e5b9021ebd6191901a2a43fa7ed2704c03aa0d3a682000000007b4c79a276a072a26ba067a565802103da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb9814011825693143f97dc51d34b47638f314146c20c92b5020673fb7411ab37018c2003870255e17d87d46b7af7d042335579de566ce492fd8c3c4e883253870ba329a100af038001e5a10001ffffffff0349f04c4817000000302ea22c802065686d47a4049c2c845a71895a915eb84c04445896eec5dc0be40df0b31372da8103120c008203000401cca79841a804000000232103810d28146f60a42090991b044fe630d1664f3f8f46286c61e7420523318047b5ac00000000000000002c6a2ae5554652454500000000bd6767aea3de97aee1bb4354893e2de56a2150680e5aa40ab24716d81c1520e000000000 +``` + + + + +# Rogue + +## Tutorial Availability + +An installation, Rogue API, and gameplay walkthrough is available in the [Fluidity Tutorials section.](../basic-docs/fluidity/fluidity-tutorials/rogue-module-tutorial.html#introduction) + +## bailout + +**cclib bailout 17 '["gametxid"]'** + +The `bailout` method allows a user to withdraw their character from the game. + +This method is only available when the character is still alive. The character must remain alive until the returned `bailout_txid` is mined. + +Also, the character must have more than `0` gold and must have killed at least `1` monster. Otherwise, the `bailout` method will treat the character as dead, regardless of the character's status. + +When the character successfully bails out from the game, all in-game gold the character has captured is converted into `ROGUE` coins. + +The conversion ratio depends upon the mode of gameplay. + +- Single-player mode: +``` +ROGUE_satoshis = gold * gold * dungeon_level_on_exit * 10 +``` + +- Multi-player mode: +``` +ROGUE_satoshis = gold * gold * dungeon_level_on_exit * 20 +``` + +The conversion is facilitated using globally locked `ROGUE` coins. The funds in this global vault automatically accrue through asset-chain activity. In the event that there are not enough globally locked funds at the time the method is executed, the player must simply wait until the funds are generated via automated methods. You can encourage this fund to grow more quickly by encouraging other players and people to transact using ROGUE, as transactions feed the fund. + +The method returns a `hex` value. While most methods in the Komodo API require the user/developer to broadcast the `hex` value using [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction), the Rogue module broadcasts automatically. + +#### Arguments + +| Name | Type | Description | +| -------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| gametxid | (string) | the `gametxid` transaction id that identifies the game for which the user would like to bail out their character | + +#### Response + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| myrogueaddr | (string) | the address on the Smart Chain for the user's `pubkey` | +| gametxid | (string) | the unique `gametxid` transaction id that identifies this game | +| hex | (string) | a `hex` value containing the relevant game data; this value is broadcast automatically | +| txid | (string) | a `playertxid` transaction id that identifies this unique character; this txid can be used in the future with the `register` method to reuse the character from this game | +| result | (string) | whether the command executed successfully | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib bailout 17 '["39b65c12e37f6338b2daf8b7d8d6e1b6c083622590cb7a318daadabc785b73f0"]' +``` + + + + + +## extract + +**cclib extract 17 '["gametxid","pubkey"]'** + +The `extract` method allows the user to extract the complete history of a game. This allows the user to view a replay of the game. + +#### Arguments + +| Name | Type | Description | +| -------- | -------- | -------------------------------------------------------------------------------------------------------- | +| gametxid | (string) | the transaction id that was returned after broadcasting the returned hex value from the `newgame` method | +| pubkey | (string) | the `pubkey` of the player for whom the user desires to extract all relevant game data | + +#### Response + +| Name | Type | Description | +| ---------- | -------- | -------------------------------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| gametxid | (string) | the transaction id that was returned after broadcasting the returned hex value from the `newgame` method | +| rogueaddr | (string) | the address for the `pubkey` | +| status | (string) | whether the command executed successfully | +| keystrokes | (string) | all keyboard strokes concatenated into a single hex string | +| numkeys | (number) | the total number of keystrokes (ASCII symbols) | +| playertxid | (string) | the `playertxid` transaction id that represents the character belonging to the indicated `pubkey` | +| extracted | (string) | the gameplay progress extracted via the `keystrokes` replay feature | +| seed | (decimal number) | the blockchain-generated random seed. This provides the necessary randomization for players to generate the current game's level design. The `seed` value is revealed at the `start` block height. | +| replay | (string) | the complete terminal command that must be executed to begin this game | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib extract 17 '["6bb0efcb14cd5101a4d8d8865c6a93162aa9480c5d3e0ce33902193cebdc4c39","0325151cf0f7321d0cde232898c5adc6b60f32df71b79af3a49d10020d42925ae9"]' +``` + + + + + +## gameinfo + +**cclib gameinfo 17 '["gametxid"]'** + +The `gameinfo` method returns relevant information about the indicated `gametxid` game. + +#### Arguments + +| Name | Type | Description | +| -------- | -------- | -------------------------------------------------------------------------------------------------------- | +| gametxid | (string) | the transaction id that was returned after broadcasting the returned hex value from the `newgame` method | + +#### Response + +| Name | Type | Description | +| ---------- | ------------------ | ---------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| gametxid | (decimal number) | the indicated `gametxid` transaction id | +| result | (string) | whether the command executed successfully | +| gameheight | (decimal number) | the block height at which this `gametxid` was created | +| height | (decimal number) | this value is the same as the `gameheight` value above | +| start | (decimal number) | the block height at which the seed will be revealed | +| starthash | (string) | the hash of the `start` block | +| seed | (decimal number) | the blockchain-generated random seed. This provides the necessary entropy for players to generate the current game's level design. The `seed` value is revealed at the `start` block height. | +| run | (string) | the complete terminal command that must be executed to begin this game | +| alive | (decimal number) | the number of players still alive in the game | +| numplayers | (decimal number) | the total number of players that joined the game | +| maxplayers | (decimal number) | the max number of players the game allows | +| buyin | (number) | the amount of `ROGUE` coins required for a player to join | +| players | (array of strings) | an array containing the identifying transaction ids of each player | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib gameinfo 17 '["b9ab1c3b9a1dceea75d0d87b927a03d8519743d4d64b9be061c40fdd5e4f5026"]' +``` + + + + + +## games + +**cclib games 17** + +The `games` method displays a list of the user's unfinished and finished games. + +#### Arguments + +| Name | Type | Description | +| ------ | ---- | ----------- | +| (none) | | | + +#### Response + +| Name | Type | Description | +| --------- | ------------------ | --------------------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| pastgames | (array of strings) | an array of `gametxid` transaction ids of finished games, from the user's local wallet file | +| games | (array of strings) | an array of `gametxid` transaction ids of unfinished games, from the user's local wallet file | +| numgames | (decimal number) | the total number of games, from the user's local wallet file | + +#### :pushpin: Examples + +Command: + +```bash + ./komodo-cli -ac_name=ROGUE cclib games 17 +``` + + + + + +## highlander + +**cclib highlander 17 '["gametxid"]'** + +The `highlander` method allows a character to exit the game and claim the `buyin` prize funds. + +In single-player mode, the `highlander` method is available after safely retrieving the `amulet` and exiting the dungeon. + +In multi-player mode, the `highlander` method is available either to the character that is the last man standing, or to any character that successfully retrieves the `amulet` and exits the dungeon. + +### Highlander Rewards + +The character that successfully executes the `highlander` method receives an increased ratio of conversion from in-game gold to `ROGUE` coins. The ratio depends upon the mode of gameplay; see below for further details. + +The conversion is facilitated using globally locked `ROGUE` coins. The funds in this global vault automatically accrue through asset-chain activity. In the event that there are not enough globally locked funds at the time the `highlander` method is executed, the player must wait until the funds are generated via automated methods. You can encourage this fund to grow more quickly by encouraging other players and people to transact using ROGUE, as transactions feed the fund. + +#### Rewards in Single-Player Mode + +``` +ROGUE_satoshis = gold * gold * dungeon_level_on_exit * 10 +``` + +#### Rewards in Multi-Player Mode + +``` +ROGUE_satoshis = gold * gold * dungeon_level_on_exit * 20 +``` + +#### Arguments + +| Name | Type | Description | +| -------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| gametxid | (string) | the `gametxid` transaction id that identifies the game for which the user would like to bail out their character | + +#### Response + +| Name | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| myrogueaddr | (string) | the address on the Smart Chain for the user's `pubkey` | +| gametxid | (string) | the unique `gametxid` transaction id that identifies this game | +| txid | (string) | a `playertxid` transaction id that identifies this unique character; this txid can be used in the future with the `register` method to reuse the character from this game | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib highlander 17 '["b94a0c14604df04a994e8fde610af7ddede76a62e1e3d86bbdac18e695662301"]' +``` + + + + + +## keystrokes + +**cclib keystrokes 17 '["gametxid","keystrokes"]'** + +The `keystrokes` method executes the indicated `keystroke` for the indicated `gametxid`. + +The player's keystrokes on the keyboard are recorded in ASCII format. [See this link](https://theasciicode.com.ar/) for a table of ASCII keyboard translations. + +After a game concludes the complete list of keystrokes can be found in the `~/komodo/src/keystrokes.log` file. + +#### Arguments + +| Name | Type | Description | +| ---------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| gametxid | (string) | the `gametxid` transaction id that identifies the game for which the user would like to bail out their character | +| keystrokes | (string) | the desired keystrokes, provided in ASCII format and concatenated into a single string | + +#### Response + +| Name | Type | Description | +| ------ | ---- | ----------- | +| result | (string) | whether the command executed successfully | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| gametxid | (string) | the unique `gametxid` transaction id that identifies this game | +| keystrokes | (string) | the desired keystrokes, provided in ASCII format and concatenated into a single string | +| batontxid | (string) | the unique `batontxid` transaction id; this value is useful for tracing the route of a utxo/token through the blockchain database | +| playertxid | (string) | the unique identifying transaction id of this player | +| hex | (string) | a `hex` value containing the relevant game data; this value is broadcast automatically | +| txid | (string) | a unique transaction id for the `keystrokes` transaction | +| result | (string) | whether the command executed successfully | +| error | (string) | error messages are returned here | +| id | (string) | the returned value here, `jl777`, is constant and can be ignored | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib keystrokes 17 '["777ba510824b467e9ddfb00a075e9cd5c6f73d1fa6f772b1a22563502def25ee","6a68686868686866686820686868682068686868206868666868686c6c6c6c6a6a6a6a6a6a6a6a6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6c6a6a6a68666b"]' +``` + + + + + +## newgame + +**cclib newgame 17 '[maxplayers, buyin]'** + +The `newgame` method creates a new game. + +The `buyin` argument is required for multi-player games. The coins contributed via `buyin` become a winner-takes-all pot. Either the first player to claim the `amulet` and return from the dungeon, or the last player standing; may claim this prize using the [highlander](../customconsensus/rogue.html#highlander) method. + +#### Arguments + +| Name | Type | Description | +| ---------- | ---------------------------------------- | ----------------------------------------------------------------------------------- | +| maxplayers | (decimal number) | the max number of players; if set to `1`, the game begins in single-player mode | +| buyin | (number, required if `maxplayers` > `1`) | the required amount to contribute per player; the winner receives all `buyin` coins | + +#### Response + +| Name | Type | Description | +| ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| maxplayers | (decimal number) | the max number of players for this game | +| buyin | (number) | the required amount to contribute per player; the winner receives all `buyin` coins | +| type | (string) | the level of difficulty for this game | +| hex | (string) | a `hex` value containing the relevant game data; this value is broadcast automatically | +| txid | (string) | a transaction id that represents the `gametxid` | +| result | (string) | whether the command executed successfully | + +#### :pushpin: Examples + +Command for a single-player training game: + +```bash +./komodo-cli -ac_name=ROGUE cclib newgame 17 "[1]" +``` + + + + + +## pending + +**cclib pending 17** + +The `pending` method displays a list of unfinished games on the Smart Chain. + +#### Arguments + +| Name | Type | Description | +| ------ | ---- | ----------- | +| (none) | | | + +#### Response + +| Name | Type | Description | +| ---------- | ------------------ | --------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| pending | (array of strings) | an array of `gametxid`'s that represent unfinished games on the Smart Chain | +| numpending | (decimal number) | the total number of unfinished games on the Smart Chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib pending 17 +``` + + + + + +## playerinfo + +**cclib playerinfo 17 '["playertxid"]'** + +The `playerinfo` method displays information about the currently active character. + +##### Tips on Finding Character Information + +There are occasions where the developer may wish to start with the `tokentxid` of a character(s) and from there find the most up-to-date `playertxid`. + +The following is one solution: + +- If necessary, obtain a list of all `tokens` on the Smart Chain via the [tokenlist](../customconsensus/tokens.html#tokenlist) method. +- For each item in the response, execute an iterative function that executes the [playerinfo](../customconsensus/rogue.html#playerinfo) method on the individual `token`. + - If the method responds with an error, this means that the supplied `token` does not represent a character. Rather, it represents another on-chain asset, and therefore the token can be ignored. +- For each response from the `playerinfo` method check two elements: whether the data contains a `batontxid`; whether the character is alive. + - If there is a `batontxid`, the `playertxid` has been used in a game and is no longer valid. Therefore, this `playertxid` can be ignored. + - Likewise, if the character is no longer alive, it can be ignored. +- Each `token` that has a valid response, no `batontxid`, and represents a living character can be considered the correct `tokentxid` for the discovered `playertxid`. + +#### Arguments + +| Name | Type | Description | +| -------- | -------- | ---------------------------------------------------------------------------------------------------------------- | +| gametxid | (string) | the `gametxid` transaction id that identifies the game for which the user would like to bail out their character | + +#### Response + +| Name | Type | Description | +| ------------ | ------------------ | ------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| player | (json object) | a json object containing relevant player data | +| playertxid | (string) | the unique identifying transaction id of this player | +| tokenid | (string) | the unique transaction id that represents this character as a non-fungible asset for on-chain trading using the [Tokens CC](../customconsensus/tokens.html#introduction) module | +| data | (string) | the character-state information in hex form | +| pack | (array of strings) | an array containing the items in the character's pack | +| packsize | (number) | the number of items in the character's pack | +| hitpoints | (number) | see [this linked manual](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) for further information | +| strength | (number) | see [this linked manual](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) for further information | +| level | (number) | see [this linked manual](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) for further information | +| experience | (number) | see [this linked manual](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) for further information | +| dungeonlevel | (number) | see [this linked manual](https://docs.freebsd.org/44doc/usd/30.rogue/paper.pdf) for further information | +| chain | (string) | the name of the Smart Chain on which this game is occurring | +| pname | (string) | the name of the user's currently active character | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib playerinfo 17 '["cf2ae0997e24f100aa9da3cda747105e3134a102da69630d6d1683a6f0f7b0ab"]' +``` + + + + + +## players + +**cclib players 17** + +The `players` method displays a list of all `playertxid` transaction ids held in the user's current `pubkey`. + +#### Arguments + +| Name | Type | Description | +| ------ | ---- | ----------- | +| (none) | | | + +#### Response + +| Name | Type | Description | +| ------------- | ------------------ | ------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| playerdata | (array of strings) | an array containing all `playertxid` transaction ids in the user's local wallet | +| numplayerdata | (decimal number) | the number of `playertxid` transaction ids in the `playerdata` array | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib players 17 +``` + + + + + +## register + +**cclib register 17 '["gametxid"(,"playertxid")]'** + +The `register` method registers your character for a game. + +The optional `playertxid` allows the user to reuse a character that survived a previous game. + +For the `playertxid` argument to properly call an existing character, the user's daemon must be set to the `pubkey` that owns the `playertxid`. This can be accomplished either through the [pubkey](../installations/common-runtime-parameters.html#pubkey) launch parameter or through the [setpubkey](..) method. + +#### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | ----------------------------------------------------------------------------- | +| gametxid | (string) | the `gametxid` of the game the user desires to join | +| playertxid | (string, optional) | the `playertxid` of an existing character the user owns and would like to use | + +#### Response + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------------------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| maxplayers | (decimal number) | the max number of players allowed in this game | +| buyin | (number) | the required `buyin` amount of `ROGUE` coins to enter the game | +| type | (string) | the level of difficulty for this game | +| hex | (string) | a `hex` value of registration data; this value is broadcast automatically | +| txid | (string) | a transaction id that indicates the `playertxid` for this character | +| result | (string) | whether the command executed successfully | + +#### :pushpin: Examples + +Command (registration without player): + +```bash +./komodo-cli -ac_name=ROGUE cclib register 17 '["b9ab1c3b9a1dceea75d0d87b927a03d8519743d4d64b9be061c40fdd5e4f5026"]' +``` + + + + + +## setname + +**cclib setname 17 '["pname"]'** + +The `setname` method sets the name of a character. + +A character may receive a `name` at any point, but the character's name may be set only once. It is not possible to rename a character. + +#### Arguments + +| Name | Type | Description | +| ------------------ | -------- | ---------------------------------------------------------- | +| pname | (string) | the desired name for the user's currently active character | + +#### Response + +| Name | Type | Description | +| ------------------ | -------- | ---------------------------------------------------------- | +| name | (string) | the name of the module | +| method | (string) | the name of the method | +| result | (string) | whether the command executed successfully | +| pname | (string) | the desired name for the user's currently active character | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib setname 17 '["SuperMegaWarrior"]' +``` + + + + +# Sudoku + +## Introduction + +The Sudoku Antara Module serves as a proof-of-concept to demonstrate Antara's capabilities as a blockchain-based gaming technology. + +The Sudoku module is based on the classic game, Sudoku. To learn more about how Sudoku is played, read the associated Wikipedia article: + +[Link to Sudoku Wikipedia article](https://en.wikipedia.org/wiki/Sudoku) + +The procedures to launch and finish a game require the execution of various Remote Procedure Calls (RPCs). By design, the Sudoku module assumes the user relies on the associated Sudoku GUI software. The GUI is required because the UNIX timestamp for each gameplay event must pass trough the Sudoku RPC captcha protection, as this deters bots. + +The following installation and walkthrough tutorials can assist the reader in setting up and playing the Sudoku game. For more information, please reach out to our community on [Discord](https://komodoplatform.com/discord). The #cc-sudoku channel is available for questions and assistance. + +#### Sudoku Module Flow + +- Create a puzzle using the [gen](../customconsensus/sudoku.html#gen) method + - commit the amount of `SUDOKU` coins that will serve as a bounty for the first node to complete this puzzle +- Find a puzzle to solve using the [pending](../customconsensus/sudoku.html#pending) method +- Gather additional information about any puzzle using the [txidinfo](../customconsensus/sudoku.html#txidinfo) method +- Propose a solution for a puzzle using the [solution](../customconsensus/sudoku.html#solution) method + +## Installation + +### Requirements + +Sudoku is currently playable on Linux machines. + +OSX and Windows compatible bundles will be ready as soon as possible. Please ask on our #cc-sudoku channel on [Discord](https://komodoplatform.com/discord) for updates. + +The Komodo Sudoku software bundle (also called "Komodoku") for Ubunutu Linux comes complete with all necessary software. To download the bundle, please visit the link below: + +[Link to "Komodoku" Software Bundle](https://github.com/tonymorony/Komodoku/releases) + +To manually compile the software, follow the instructions below. + +### Install Dependencies + +#### Linux + +```bash +sudo apt-get update && sudo apt-get upgrade -y +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libgtest-dev libqt4-dev libqrencode-dev libdb++-dev ntp ntpdate software-properties-common curl libcurl4-gnutls-dev cmake clang libsodium-dev -y +``` + + +### Clone & Compile Komodo + +#### Linux + +```bash +cd ~ +git clone https://github.com/jl777/komodo +cd komodo +git checkout FSM +make clean +./zcutil/fetch-params.sh +./zcutil/build.sh -j$(nproc) +``` + +Wait for the build process to finish, and then continue with the following commands: + +```bash +cd src/cc +./makecclib +cp sudokucc.so ../libcc.so +cd ../.. +make -j$(nproc) +``` + + +### Update `komodod` + +```bash +cd ~/komodo +git checkout FSM +git pull +make clean +./zcutil/build.sh -j$(nproc) +``` + +Wait for the build process to finish, and then continue with the following commands: + +```bash +cd src/cc +./makecclib +cd ../.. +make -j$(nproc) +``` + +### Set `pubkey` value + +Ensure the working directory is correct: + +```bash +cd ~/komodo/src +``` + +#### Step 1 - Start the chain + +Start the SUDOKU chain with the following command in a terminal window and wait for the daemon to sync. Keep this terminal open and the daemon running for the duration of your Sudoku gameplay. + +```bash +./komodod -ac_name=SUDOKU -ac_supply=1000000 -addnode=5.9.102.210 -gen -genproclimit=1 -ac_cclib=sudoku -ac_perc=10000000 -ac_reward=100000000 -ac_cc=60000 -ac_script=2ea22c80203d1579313abe7d8ea85f48c65ea66fc512c878c0d0e6f6d54036669de940febf8103120c008203000401cc & +``` + +#### Step 2 + +Open a new terminal. This terminal can be used to execute all remaining installation and gameplay commands. + +```bash +./komodo-cli -ac_name=SUDOKU getnewaddress +``` + +The returned value is a SUDOKU address. We need to find the associated pubkey for this address. + +#### Step 3 + +Use the `validateaddress` method with the address. + +```bash +./komodo-cli -ac_name=SUDOKU validateaddress insert_address_here +``` + +The `validateaddress` method will return information similar to the following: + +```json +{ + "isvalid": true, + "address": "RPCeZmqW4Aam52DFLmMraWtu5CuXPxqk92", + "scriptPubKey": "76a91498b5caa42ffe9868844c51ba6e085e5e7e92fc2588ac", + "segid": 13, + "ismine": true, + "iswatchonly": false, + "isscript": false, + "pubkey": "02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2", + "iscompressed": true, + "account": "" +} +``` + +Look for the `pubkey` value: + +```bash +"pubkey": "02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2", +``` + +This is the `pubkey` for our address. + +#### Step 4 + +Set the pubkey for the SUDOKU asset chain. + +```bash +./komodo-cli -ac_name=SUDOKU setpubkey 02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2 +``` + + + + + +The pubkey is now set. + +To reuse this pubkey in the future, include the pubkey as a [pubkey](../installations/common-runtime-parameters.html#pubkey) launch parameter. + +For example: + +```bash +./komodod -ac_name=SUDOKU -ac_supply=1000000 -pubkey=02f183a71e93dfa7672ce7212187e45eabcf4077fed575348504b20295751ab1a2 -addnode=5.9.102.210 -gen -genproclimit=1 -ac_cclib=sudoku -ac_perc=10000000 -ac_reward=100000000 -ac_cc=60000 -ac_script=2ea22c80203d1579313abe7d8ea85f48c65ea66fc512c878c0d0e6f6d54036669de940febf8103120c008203000401cc & +``` + +### Install Sudoku Graphical User Interface (GUI) + +The Komodo team offers an unofficial graphical user interface (GUI) to assist the user with Sudoku-puzzle solving visualization. By design, the Sudoku module assumes the user relies on the associated Sudoku GUI software. The GUI is required because the UNIX timestamp for each gameplay event must pass trough the Sudoku RPC captcha protection, as this deters bots. + +Download the portable GUI bundle from the following link: + +[Link to GUI Software Bundle](https://github.com/tonymorony/Komodoku/releases) + +To manually compile the GUI from source code, follow the steps below. Please note that the GUI is based on `python2`. + +#### Linux + +##### Install Dependencies + +```bash +sudo apt-get install python-pygame libgnutls28-dev +pip install requests wheel slick-bitcoinrpc pygame +``` + +##### Install the GUI + +```bash +git clone https://github.com/tonymorony/Komodoku +cd Komodoku +``` + +#### Start Sudoku GUI + +```bash +python Sudoku.py +``` + + + +## gen + +**cclib gen 17** + +The generate method creates a new Sudoku puzzle. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +#### Arguments + +| Name | Type | Description | +| ---- | ---- | ----------- | +| (none) | | | + +#### Response + +Daemon `stdout`: + +| Name | Type | Description | +| ---- | ---- | ----------- | +| (solved Sudoku puzzle, visualized) | (string, multi-line) | an ASCII-character representation of the generated Sudoku puzzle, with all solutions in place | +| (unsolved Sudoku puzzle, visualized) | (string, multi-line) | an ASCII-character representation of the generated Sudoku puzzle, with numbers removed for gameplay | +| (numbers remaining) | (string) | a description of how many numbers are remaining to solve in the Sudoku puzzle | +| (Sudoku Puzzle - integer) | (number, multi-line) | a multi-line number-based representation of the solved Sudoku puzzle; no visual embellishments | +| solve | (number) | a number-based concatenated representation of the unsolved Sudoku puzzle; `0`'s represent empty spaces in the puzzle | +| score | (string) | `score` returns three values: the difficulty of the puzzle calculated by the generator, the solution in concatenated format, the number of numbers left to fill | + +JSON output: + +| Name | Type | Description | +| ---- | ---- | ----------- | +| result | (string) | whether the command executed successfully | +| name | (string) | name of the module | +| method | (string) | name of the method | +| srand | (number) | the seed of the non-blockchain based puzzle that is creating RNG | +| amount | (number) | the reward provided to the first node to submit the correct solution | +| hex | (string) | a `hex` value representing the encoded data; this must be broadcast using `sendrawtransaction` | +| txid | (string) | a transaction id representing the generation of this Sudoku puzzle, also called the `puzzle_txid` | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=SUDOKU cclib gen 17 +``` + + + + + + + + + +## pending + +**cclib pending 17** + +The `pending` method returns a complete list of all unsolved puzzles on the asset chain. + +#### Arguments + +| Name | Type | Description | +| ---- | ---- | ----------- | +| (none) | | | + +#### Response + +| Name | Type | Description | +| ---------- | ----------------------- | ------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| name | (string) | name of the module | +| method | (string) | name of the method | +| pending | (array of json objects) | an array of json objects, each containing information about an unsolved puzzle on the chain | +| height | (number) | the block height at which the puzzle was generated | +| amount | (number) | the reward provided to the first node to submit the correct solution | +| txid | (string) | a transaction id representing the generation of this puzzle, also called the `puzzle_txid` | +| numpending | (number) | the total number of on-chain unsolved puzzles | +| total | (number) | the collective value of all outstanding bounties for unsolved puzzles | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=SUDOKU cclib pending 17 +``` + + + + + +## solution + +**cclib solution 17 '["puzzle_txid","solution",t0,t1,t2,...]'** + +The `solution` method submits the proposed `solution` to the blockchain for the indicated `puzzle_txid` puzzle. + +The `t0...` values represent the timestamp at which the solution was found for each number. Pre-filled cells have an automated timestamp of `tX=0`, where `X` is the index of the puzzle number. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +#### Arguments + +| Name | Type | Description | +| ---- | ---- | ----------- | +| txid | (string) | a transaction id representing the generation of this puzzle, also called the `puzzle_txid` | +| solution | (numeric string) | the proposed solution, provided in a concatenated format | +| tX... | (81 UNIX timestamps separated by comma) | there are `81` total `t...` arguments. `X` is the index of the indicated argument. The argument is a timestamp representing the time at which `X` number was input. Timestamp value should be 0 for numbers which were already known | + +#### Response + +JSON output: + +| Name | Type | Description | +| ---- | ---- | ----------- | +| name | (string) | name of the module | +| hex | (string) | a `hex` value representing the encoded data; this must be broadcast using `sendrawtransaction` | +| txid | (string) | a transaction id representing the generation of this Sudoku puzzle, also called the `puzzle_txid` | +| amount | (number) | the reward provided to the first node to submit the correct solution | +| result | (string) | whether the command executed successfully | +| sudokuaddr | (string) | the Antara address that owns this puzzle reward and will distribute the reward | +| method | (string) | name of the method | + +Daemon `stdout`: + +| Name | Type | Description | +| ---- | ---- | ----------- | +| solved | (string) | this returns three values: the block height at which the puzzle was solved, the amount of coins rewarded, the solution txid | +| solution | (number) | this contains three values: a number-based concatenated representation of the solved puzzle; a string representing the concatenated unsolved puzzle; the total score for solving this puzzle | +| statistics | (string) | information which helps this module developer to detect was puzzle solved by robot or human | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=ROGUE cclib solution 17 [%22b5d7e2b50ace182e0ab7b5a18875818fa8e56b937689376bc5bdc8727b78ad52%22,%22157392864829461357436587129795634218381279645642815973978146532563728491214953786%22,1552297383,1552297384,1552297386,0,1552297387,0,0,1552297389,1552297389,1552297391,0,1552297392,1552297394,1552297396,1552297396,1552297397,1552297398,1552297399,1552297401,1552297402,1552297403,1552297404,1552297405,1552297407,1552297408,1552297409,1552297410,1552297412,1552297413,0,1552297415,1552297416,1552297417,0,0,1552297419,0,1552297422,1552297423,1552297424,1552297429,0,1552297431,0,1552297432,1552297435,1552297436,1552297437,1552297439,0,1552297440,1552297441,1552297443,0,1552297445,0,0,1552297446,1552297447,0,1552297449,0,1552297451,0,1552297453,0,1552297455,0,0,0,1552297457,0,1552297458,1552297459,0,0,1552297460,0,1552297462,1552297462,0] +``` + + + + + + + + + +## txidinfo + +**cclib txidinfo 17 '["puzzle_txid"]'** + +The `txidinfo` method returns information about the indicated `puzzle_txid` puzzle. + +#### Arguments + +| Name | Type | Description | +| ---- | ---- | ----------- | +| puzzle_txid | (string) | the unique transaction id of the requested puzzle, as returned from the broadcast hex of the [gen](../customconsensus/sudoku.html#gen) method | + +#### Response + +| Name | Type | Description | +| ---- | ---- | ----------- | +| result | (string) | whether the command executed successfully | +| txid | (string) | a transaction id representing the generation of this Sudoku puzzle, also called the `puzzle_txid` | +| result | (string) | whether the command executed successfully | +| height | (number) | the block height at which the puzzle was generated | +| sudokuaddr | (string) | the Antara address that owns this puzzle funds and will distribute the reward | +| amount | (number) | the reward provided to the first node to submit the correct solution | +| unsolved | (string) | the unsolved puzzle, provided in concatenated form, filling playing field from left to right horizontally, and from top to bottom vertically | +| name | (string) | name of the module | +| method | (string) | name of the method | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=SUDOKU cclib txidinfo 17 \%220aaa8fdc83aa9111b1f1d143ca7baf5730cd68c02f1422b3f8cf4186959db6ff%22\" +``` + + + + +# Tokens + +## Introduction + +The Tokens Module enables support for the on-chain creation of colored coins, also called tokens. This module enables the basic functionality, such as creation, transfer and balance validation. The created tokens are typically used with another module that supports operations on tokens. For example, the Assets Module provides buy/sell operations for `tokens`. + +Functionality for this module is facilitated by utxo technology. Tokens can be generated on any chain where the [ac_cc](../installations/asset-chain-parameters.html#ac-cc) customization is enabled + +Each token is identified by its unique token id. + +The `tokens` module requires locking a proportional amount of satoshis of the native coins. These satoshis create the supply for the token. + +For example, if you desire to create a non-fungible token, use 1 satoshi in its creation. + +Each non-fungible token has the amount of 1 and contains an additional array of data describing its corresponding asset. The data has an eval code which binds this non-fungible token to an Antara Module responsible for validation. The `tokeninfo` method outputs data for non-fungible tokens. + +## tokenaddress + +**tokenaddress (pubkey)** + +The `tokenaddress` method returns information about a token address according to a specific `pubkey`. If no `pubkey` is provided, the `pubkey` used to launch the daemon is the default. + +### Arguments + +| Name | Type | Description | +| ------ | ------------------ | --------------------------------- | +| pubkey | (string, optional) | the pubkey of the desired address | + +### Response + +| Name | Type | Description | +| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| AssetsCCaddress | (string) | taking the token module's EVAL code as a modifier, this is the public address that corresponds to the token contract's privkey | +| Assetsmarker | (string) | the unmodified public address generated from the token contract's privkey | +| CCaddress | (string) | taking the token module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myCCaddress | (string) | taking the token module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| myaddress | (string) | the public address of the pubkey used to launch the chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenaddress 028702e30d8465d6aa85f35d2f58c06a6ee17f23f376b56044dadf7b793f2c12b9 +``` + + + +## tokenask + +**tokenask numtokens tokenid price** + +The `tokenask` method posts a public ask order. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------ | +| numtokens | (number) | the number of tokens to request in the order | +| tokenid | (string) | the txid that identifies the token | +| price | (number) | the price to pay for each token (units are in coins of the parent Smart Chain) | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenask 1000 c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 1 +``` + + + + + +Step 2: Use sendrawtransaction to broadcast the order + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000248403cd63777a2086206592c096ddfa1d4ba2647673b330610968eace2cf7b540200000049483045022100bde9eaf43a43fe252530bcf346be3e336e86f0171b817977d38d6ebd4bb0756e0220735f3292ef012fd56f7476700f5649b23aacf2387f4fa5a537e1b6c6daa6c1d101ffffffff4f2016d356282fca9d8278aa04fbdbed98ac6af0bf7a479959c5bb91f95e8ef5020000007b4c79a276a072a26ba067a5658021028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e278140fe6a2cd6fdb5a359d5d6eea9bcf34e5b7d8e2def612afe9c01af1129b006e68344d8f9905ea5f226cdb1556659df0c8741e8e3def1238761721b66718dabe92ca100af038001e3a10001ffffffff03e803000000000000302ea22c80201ab400e039122028345520ba041ac3e6ec81ad28d8415e78d760d55f41097dd58103120c008203000401cc5087b00e000000002321028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e27ac00000000000000004f6a4c4ce373c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b5900e876481700000021028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e2700000000 +``` + + + + +## tokenbalance + +**tokenbalance tokenid (pubkey)** + +The `tokenbalance` method checks the token balance according to a provided `pubkey`. If no `pubkey` is provided, the `pubkey` used the launch the daemon is the default. + +### Arguments + +| Name | Type | Description | +| ------- | -------- | -------------------------------------------------------------------------------------------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| pubkey | (string) | the pubkey for which to examine the balance; if no pubkey is provided, the pubkey used to launch the daemon is the default | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| CCaddress | (string) | taking the token module's EVAL code as a modifier, this is the Fluidity address from the pubkey of the user | +| tokenid | (string) | the txid that identifies the token | +| balance | (number) | the balance of the address that corresponds to the pubkey | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenbalance c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 +``` + + + +Check the token balance of a specific pubkey + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenbalance c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e27 +``` + + + +## tokenbid + +**tokenbid numtokens tokenid price** + +The `tokenbid` method posts a public bid order. + +To fill the order, the parent chain's coin must be used. + +The method returns a raw hex, which must be broadcast using [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) to complete the command. + +The `sendrawtransaction` method then returns a `txid`, which is the identification method of the bid order, and should be saved for future use. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------ | +| numtokens | (number) | the number of tokens to request in the order | +| tokenid | (string) | the txid that identifies the token | +| price | (number) | the price to pay for each token (units are in coins of the parent Smart Chain) | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenbid 1000 c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 1 +``` + + + + + +Use `sendrawtransaction` to publish order + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 0100000001484256677a6417030dd99716a47b8c9cb06fba6e57ff4617e9932a6cde2972830100000049483045022100fc1926401b27ba044bbf17c36f36030adae52a188594efc75fe42861ab0b997802205e729d6f5587e5a5296b5649a154ce1fe3c581078fac7ae4e2b4577978c05c8901ffffffff0300e8764817000000302ea22c80201ab400e039122028345520ba041ac3e6ec81ad28d8415e78d760d55f41097dd58103120c008203000401cc10d262684a0300002321028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e27ac00000000000000004f6a4c4ce362c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59e80300000000000021028bb4ae66aa4f1960a4aa822907e800eb688d9ab2605c8067a34b421748c67e2700000000 +``` + + + + + +## tokencancelask + +**tokencancelask tokenid asktxid** + +The `tokencancelask` method cancels a specific `ask`/`sell` order that you created. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| asktxid | (string) | the txid that identifies the original ask request | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Issue the call and get your raw transaction HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencancelask 9217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e 7194ae293330af80fdbe4b4b2c8b51194f12e334b4a0489288288c1b7336a65c +``` + + + + + +Step 2: Broadcast using `sendrawtransaction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + + + +Step 3 (optional): Decode the raw transaction (check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + + + +## tokencancelbid + +**tokencancelbid tokenid bidtxid** + +The `tokencancelbid` method cancels a specific `bid`/`buy` order that you created. + +The method returns a hex value which must then be broadcast using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------- | +| tokenid | (string) | the txid that identifies the token | +| bidtxid | (string) | the txid that identifies the original bid request | + +### Response + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------------------------------------------------------- | +| result: | (string) | whether the command succeeded | +| hex: | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Issue the call and get your raw transaction HEX value + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencancelbid 9217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e 7194ae293330af80fdbe4b4b2c8b51194f12e334b4a0489288288c1b7336a65c +``` + + + + + +Step 2: Send raw transaction / broadcast the HEX value from above + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + + + +Step 3: Decode the raw transaction (optional to check if the values are sane) + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 010000000234c335a46dadea8e42420b0e284f5577cfbcb7764a8d5c3b61312b71c5b14d0800000000494830450221009f365d429d03df66b34cad764368092498ebd7340587c558ea19c4248202317b0220531524ef076f9e5b26ec5aa38b3078c041f8d0603b85552177ef14d00b0e499601ffffffff5ca636731b8c28889248a0b434e3124f19518b2c4b4bbefd80af303329ae9471000000007b4c79a276a072a26ba067a565802102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702814066f6a9d580da0ac901ada8c61922d93da005e92c9e419a44c1bcbf9ec8ad43790dfc8ca71b5c21b79a58aa173fb71e1ab0b82c590dc883359de60f743fabda16a100af038001e3a10001ffffffff030a00000000000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401ccf078724e18090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e3789217014eae0a83a0b64632f379c1b474859794f9eaf1cf1eecf5804ed6124a5e00000000 +``` + + + + +## tokencreate + +**tokencreate name supply description** + +The `tokencreate` method creates a new token. + +For every token created, the method requires one satoshi of the parent blockchain's coins. For example, `1 COIN` of the blockchain provides `100000000` tokens. + +The method returns a hex-encoded transaction which should then be broadcast using `sendrawtransaction`. + +`sendrawtransaction` then returns a `txid`, which is your `tokenid`. + +::: tip +Tokens that can be divided and transferred in fractional amounts can be created too. If you consider 10 tokens as a single unit, then this unit can be named anything and it will be divisible to a single decimal place. This can be handled on the application side as it is just a change in the way of interpreting the numbers. +::: + +### Arguments + +| Name | Type | Description | +| ------------- | -------- | ------------------------------------------------ | +| name | (string) | the proposed name of the token | +| supply | (number) | the intended supply of the token, given in coins | +| "description" | (string) | the description of the token | + +### Response + +| Name | Type | Description | +| ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command succeeded | +| hex | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokencreate TAK 10 "Testing phase." +``` + + + +Step 2: Broadcast the raw transaction hex + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000012c223cfc9c3349aed24ca89e44af6fcdb030150443bd6ac55e2080ce4b097c300200000049483045022100dc83b88f5ed1f01aab7dee8bd8f2b3c0bf83537c9b3cbb0c6ea78ebafdf4c6f60220518440e7f43d24c5733531a8d5a825dbb90e716f7ba20c0d469e7004c1fcc5aa01ffffffff0400ca9a3b00000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc1027000000000000232102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702acc055cbbe15090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000396a37e3632103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc0354414b0e54657374696e672070686173652e00000000 +``` + + + +Step 3 (Optional): Use decoderawtransaction to verify the output is sane + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 01000000012c223cfc9c3349aed24ca89e44af6fcdb030150443bd6ac55e2080ce4b097c300200000049483045022100dc83b88f5ed1f01aab7dee8bd8f2b3c0bf83537c9b3cbb0c6ea78ebafdf4c6f60220518440e7f43d24c5733531a8d5a825dbb90e716f7ba20c0d469e7004c1fcc5aa01ffffffff0400ca9a3b00000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc1027000000000000232102adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702acc055cbbe15090000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000396a37e3632103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc0354414b0e54657374696e672070686173652e00000000 +``` + + + +## tokeninfo + +**tokeninfo tokenid** + +The `tokeninfo` method reveals information about any token. + +### Arguments + +| Name | Type | Description | +| ------- | -------- | ---------------------------------- | +| tokenid | (string) | the txid that identifies the token | + +### Response + +| Name | Type | Description | +| ------------- | ----------------- | ---------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| tokenid | (string) | the identifying txid for the token id | +| owner | (string) | the identifying pubkey of the token creator | +| name | (string) | the name of the token | +| supply | (number) | the total supply of the token | +| description | (string) | the token description provided by the owner at token creation | +| data | (string,optional) | the data related to the non-fungible token, in hex | +| IsImported | (string,optional) | if 'yes' this token was imported from another chain | +| sourceChain | (string,optional) | the name of the imported token's source chain | +| sourceTokenId | (string,optional) | for an imported token, the `tokenid` of the source token on the source chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokeninfo 43850dfce744581ef44775086625745adecd628993c5ff4c1c786cfd21009add +``` + + + +## tokenlist + +**tokenlist** + +The `tokenlist` method lists all available tokens on the Smart Chain. + +### Arguments + +| Name | Type | Description | +| ------ | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ------- | ------------------ | ------------------------------------- | +| tokenid | (array of strings) | the identifying txid for the token id | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenlist +``` + + + +## tokenorders + +**tokenorders (tokenid)** + +The `tokenorders` method displays the public on-chain orderbook for a specific token. If no `tokenid` is provided, it displays the on-chain orderbook for all available tokens. + +Information about the `funcid` property: + +- A lowercase `b` describes an bid offer. + +- An uppercase `B` describes a bid fill. + +- A lowercase `s` describes an ask offer. + +- An uppercase `S` describes the ask fill. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------------------------- | +| tokenid | (string, optional) | the identifying txid for the token id | + +### Response + +| Name | Type | Description | +| ------------------- | -------------------------- | ------------------------------------------------------------------------------ | +| funcid | (string) | describes either a bid ask `b`, a bid fill `B`, an ask `s`, or an ask fill `S` | +| txid | (string) | the txid of the identifying order or fill | +| vout | (number) | the vout value | +| amount | (number) | the amount remaining in the bid/ask request | +| bidamount/askamount | (number) | the total amount of the relevant bid or ask request | +| origaddress | (string) | the address that made the original bid `b` or ask `s` | +| tokenid | (string) | the tokenid for the relevant bid/ask request/fill | +| totalrequired | (number, `b` and `s` only) | the total amount available in the original big/ask request/fill | +| price | (number, `b` and `s` only) | the price per token, units are in the parent Smart Chain's coin | + +#### :pushpin: Examples + +Show all available orders + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenorders +``` + + + + + +Show orders for specific token + +```bash +./komodo-cli -ac_name=HELLOWORLD tokenorders c5bbc34e6517c483afc910a3b0585c40da5c09b7c5d2d9757c5c5075e2d41b59 +``` + + + + +## tokentransfer + +**tokentransfer tokenid destpubkey amount** + +The `tokentransfer` method transfers tokens from one cc address to another. + +It is similar to the [sendmany](../komodo-api/wallet.html#sendmany) method used to send coins on the parent chain. + +The method returns a raw hex, which must be broadcast using [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) to complete the command. + +::: tip +The source `txid/vout` needs to be specified as it is critical to match outputs with inputs. +::: + +::: tip +A token may be burned by using `tokentransfer` to send to a burn address. +::: + +### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------------------------ | +| tokenid | (string, optional) | the identifying txid for the token id | +| destpubkey | (string) | the pubkey where the tokens should be sent | +| amount | (number) | the number of tokens to send | + +### Response + +| Name | Type | Description | +| ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command succeeded | +| hex | (string) | a raw transaction in hex-encoded format; you must broadcast this transaction to complete the command | + +#### :pushpin: Examples + +Step 1: Create the rawtransaction + +```bash +./komodo-cli -ac_name=HELLOWORLD tokentransfer e4895451cae47f8f10303c3594888b739f044f7c778623318d877e8df365cc66 02ebc786cb83de8dc3922ab83c21f3f8a2f3216940c3bf9da43ce39e2a3a882c92 500000 +``` + + + +Step 2: Broadcast using `sendrawtransaction` + +```bash +./komodo-cli -ac_name=HELLOWORLD sendrawtransaction 01000000023b61e44ce3cedf536b52d8da11faacd041494a078e971551ed4e2bd496bc8da1000000006a4730440220111c67172740c0c2556979fdf84639ba299ff22586ebd220f25aa301f029003f02203da97a2575c0ed1b309774309f5dc952ee305a46cd83e95eae99e3564a1772f6012103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcffffffff66cc65f38d7e878d312386777c4f049f738b8894353c30108f7fe4ca515489e4000000007b4c79a276a072a26ba067a565802103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc8140c875a14edcbece61a6c18721398c927dc1e4509863e075b3922a8e3a2da6848e037142436e9102b529ee93a9ec618a4c67b63c52790d71812bb94179056913bba100af038001e3a10001ffffffff0420a1070000000000302ea22c8020541be9f843b476373fc18d8c8fab59c98c2c009f49c07fa66b7b431e4142feae8103120c008203000401cce028933b00000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc28b9486cb2430000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e374e4895451cae47f8f10303c3594888b739f044f7c778623318d877e8df365cc6600000000 +``` + + + +Step 3: Decode the raw transaction and check against the following if the data is sane + +```bash +./komodo-cli -ac_name=HELLOWORLD decoderawtransaction 01000000023b61e44ce3cedf536b52d8da11faacd041494a078e971551ed4e2bd496bc8da1000000006a4730440220111c67172740c0c2556979fdf84639ba299ff22586ebd220f25aa301f029003f02203da97a2575c0ed1b309774309f5dc952ee305a46cd83e95eae99e3564a1772f6012103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcffffffff66cc65f38d7e878d312386777c4f049f738b8894353c30108f7fe4ca515489e4000000007b4c79a276a072a26ba067a565802103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abc8140c875a14edcbece61a6c18721398c927dc1e4509863e075b3922a8e3a2da6848e037142436e9102b529ee93a9ec618a4c67b63c52790d71812bb94179056913bba100af038001e3a10001ffffffff0420a1070000000000302ea22c8020541be9f843b476373fc18d8c8fab59c98c2c009f49c07fa66b7b431e4142feae8103120c008203000401cce028933b00000000302ea22c8020bc485b86ffd067abe520c078b74961f6b25e4efca6388c6bfd599ca3f53d8dae8103120c008203000401cc28b9486cb2430000232103fe754763c176e1339a3f62ee6b9484720e17ee4646b65a119e9f6370c7004abcac0000000000000000246a22e374e4895451cae47f8f10303c3594888b739f044f7c778623318d877e8df365cc6600000000 +``` + + +# Smart Chain Customizations + +Smart Chains offer various default customizations. The desired combination of parameters should be included with the `komodod` execution every time the Smart Chain daemon is launched. + +Changing these customizations at a later time is possible, but this typically requires a hard-fork of your Smart Chain. In general, it is best to have your Smart Chain's parameters finalized before decentralizing the ownership of your coin. Should you discover a need to change these parameters after the fact, please reach out to our development team for assistance. + +## ac_algo + +::: warning +This parameter is in its final testing stages. Please reach out to us if you would like to use it on a production chain. +::: + +The `ac_algo` parameter changes the chain's mining algorithm from the default equihash to the verushash. + +To enable this feature, set `-ac_algo=verushash`. + +This activates verushash1.0. More recent versions of verushash are not yet supported. + +The verushash feature serves as a proof of concept for adding support for additional mining algorithms. + +The Komodo team is currently testing methods to support compatibility for `ac_staked`, but this feature is not yet recommended for external testing. + +## ac_blocktime + +This parameter sets the average time (in seconds) by which a new block should be mined. + +If this parameter is not included, the default value is `ac_blocktime=60`. + +When the value of `ac_blocktime` is less than `60`, the Smart Chain's block time will stabilize within less than twelve hours after launch. If the Smart Chain's `ac_blocktime` value is greater than `60`, the Smart Chain's block time can require several days to stabilize. + +When the value of `ac_blocktime` is less than `12` seconds (a high speed Smart Chain), the variances in network quality between consensus nodes (miners and stakers) can create difficulties in achieving a stable blockchain consensus. High-speed Smart Chains may function effectively on a LAN or other stable network, but Komodo recommends caution when attempting to manage a high-speed Smart Chain on the public Internet. + +#### :pushpin: Examples + + + +## ac_cc + +::: warning Notice +This parameter is still in testing. +::: + +The `ac_cc` parameter sets the network cluster on which the chain can interact with other chains via Antara modules and MoMoM technology. + +Once activated, the `ac_cc` parameter can allow features such as cross-chain fungibility -- coins on one Smart Chain can be directly transferred to any other Smart Chain that has the same `ac_cc` setting and the same set of notary nodes (same set of `notary pubkeys`) . + +Most functionalities enabled by `ac_cc` can function with or without Komodo's notarization service. However, cross-chain transaction validation and its dependent features, including cross-chain fungibility, require notarization. + +### ac_cc=0 + +Setting `ac_cc=0` disables Antara on the Smart Chain entirely. + +::: tip +It is better to NOT use `ac_cc=0` for a Smart Chain where Antara should not be enabled. Omitting the `ac_cc` parameter altogether will achieve the same result. +::: + +### ac_cc=1 + +Setting `ac_cc=1` permits Antara on the Smart Chain, but will not allow the Smart Chain to interact in cross-chain Antara functionality with other Smart Chains. + +### ac_cc=2 to 99 + +The values of `2` through `99` (inclusive) indicate Smart Chains that can validate transactions that occur on other Smart Chains on the same cluster (i.e. the same `ac_cc` value), but their coins are not fungible. + +However, coins are not fungible, and therefore cannot be transferred between blockchains. + +### ac_cc=100 to 9999 + +Setting the value of `ac_cc` to any value greater than or equal to `100` will permit cross-chain interaction with any Smart Chain that has the same `ac_cc` value and is secured by notary nodes with the same `pubkey`. + +All Smart Chains that have the same `ac_cc (>= 100)` value form a cluster, where the base tokens of all the chains in the cluster are fungible via the burn protocol. + +For example, a Smart Chain set to `ac_cc=201` in its parameters can interact with other Smart Chains with `ac_cc=201` on the same notary-node network, but cannot interact with a Smart Chain set to `ac_cc=301`. + +### Summary of `ac_cc` + +::: tip Consider a chain with -ac_cc=N + +- If N = 0, Antara is disabled +- If N > 0, Antara is enabled +- If N = 1, on-chain Antara is active, cross-chain validation is disabled +- If N >= 2 and <= 99, the chain allows for cross-chain contracts between all other chains bearing the same N value. The base coins in each Smart Chain are non-fungible across chains. +- If N >= 100, the chain can form a cluster with all other chains with the same N value and on the same dPoW notarization network. The base coins of all chains in the cluster are fungible via the burn protocol. + ::: + +#### :pushpin: Examples + + + +## ac_ccactivate + +**-ac_ccactivate=block_height** + +The `ac_ccactivate` launch parameter allows for the activation of Antara on an existing Komodo-based Smart Chain wherein Antara was not originally enabled. + +Add the `ac_ccactivate` parameter to the existing launch command for the Smart Chain and set the value equal to a future block height. When this block height is reached, Antara will be available on the Smart Chain. + +This change requires a hard fork of the Smart Chain. If the Smart Chain is receiving Komodo's dPoW security service, the notary nodes must relaunch their Smart Chain daemons with the new launch parameter. All nodes must also update their daemons in the same manner. + +By default, `ac_ccactivate` uses the default `ac_cc` value of `ac_cc=2`. It is not necessary to further specify `ac_cc` in the launch parameters, unless a value other than `2` is required. + +#### :pushpin: Examples + + + +## ac_ccenable + +::: warning +This parameter is at the end of the beta development phase and is prepared for public testing. If you are interested in adopting this feature for a production Smart Chain, please reach out to us so that we can assist you. +::: + +The `ac_ccenable` parameter restricts the Smart Chain so that only indicated Antara modules can be enabled. `ac_ccenable` requires [ac_cc](../installations/asset-chain-parameters.html#ac-cc) to be active. + +To indicate which Antara modules should be available, insert each module's eval code in decimal and separated by commas. + +The following table presents an abbreviated list of EVAL codes. For more information, please see [this linked content](https://github.com/jl777/komodo/blob/master/src/cc/eval.h). + +| Name of the module | EvalCode | +| ------------------ | -------- | +| ASSETS | 227 | +| FAUCET | 228 | +| REWARDS | 229 | +| DICE | 230 | +| FSM | 231 | +| AUCTION | 232 | +| LOTTO | 233 | +| HEIR | 234 | +| CHANNELS | 235 | +| ORACLES | 236 | +| PRICES | 237 | +| PEGS | 238 | +| TRIGGERS | 239 | +| PAYMENTS | 240 | +| GATEWAYS | 241 | + +For example, the following parameters create a Smart Chain where only the `faucet` and `rewards` modules are active: + +```bash +./komodod -ac_name=EXAMPLE -ac_supply=0 -ac_reward=100000000 -ac_cc=2 -ac_ccenable=228,229 +``` + +When `-ac_cc` is set, but `-ac_ccenable` is not, all Antara modules are enabled. + +::: warning +`ac_ccenable` disables spending utxos that are created under a non-enabled Antara module. We have also implemented additional functionality that disables API functions. This prevents the user from creating a utxo that `ac_ccenable` would render unspendable. It is still possible to create raw transactions that bypass this security feature, and thus create utxos that are unspendable. A normal user or developer relying on our API functionality should not be concerned with this. However, those who experiment with raw transactions should be cautious. +::: + +::: warning +If the developer is also using a new feature that has yet to be documented here, `ac_cclib`, the eval codes in the `libcc.so` will not disable Antara API calls. Therefore, there remains a risk that a disabled API call can still be used to create a utxo, which will then be non-spendable. +::: + +## ac_cclib + +The `ac_cclib` parameter is used in conjunction with various Antara modules. + +Typically, the Smart Chain that uses the `ac_cclib` parameter will have a unique build process. This is described as a part of each Antara module in question. Once the Smart Chain is properly built, the terminal command to launch the chain will include the `ac_cclib` parameter in a manner similar to the following: + +```bash +-ac_cclib=desired_CC_module +``` + +Each Antara module uses the `ac_cclib` parameter differently, and therefore the reader should refer to the desired Antara module for further instructions. + +## ac_decay + +This is the percentage which determines the block reward decrease on each block-reward "halving". + +This parameter will have no effect if [ac_reward](../installations/asset-chain-parameters.html#ac-reward) is not set. + +This is the formula that `ac_decay` follows: + +```bash +block_reward_after = block_reward_before * ac_decay / 100000000; +``` + +For example, if this parameter is set to `75000000`, at each "halving" the block reward will drop to 75% of its previous value. + +#### :pushpin: Examples + + + +## ac_end + +This is the block height at which block rewards will end. Every block after this height will have 0 block reward (this means that, assuming all other settings are default, the only incentive to mine a new block will be transaction fees). + +#### :pushpin: Examples + + + +## ac_eras + +The `ac_eras` parameter allows the value of a chain's block reward to vary over time. + +Each different time interval is called an "era" and a chain can have at most three eras. + +When active, `ac_eras` changes the behavior of coinbase coins (i.e. the coins that are created as a result of mining). `ac_eras` forces the `COINBASE_MATURITY` value of coinbase coins to be `100` instead of the normal value of `1`. Therefore, coinbase coins become spendable after `100` confirmations. + +The `ac_eras` parameter accepts only one value (`1`, `2`, or `3`). When activated, it allows certain other Smart Chain parameters to accept multiple values. + +The principle parameter that is affected by `ac_eras` is [ac_reward](../installations/asset-chain-parameters.html#ac-reward), and it must receive at least one value. + +Also, [ac_decay](../installations/asset-chain-parameters.html#ac-decay), [ac_halving](../installations/asset-chain-parameters.html#ac-halving), and [ac_end](../installations/asset-chain-parameters.html#ac-end) can each receive multiple values and thereby affect reward functionality. + +For every era, there must be a corresponding value in `ac_end` that indicates the block height at which this era ends. To set the final era to last indefinitely, set the `ac_end` value of that era to `0`; the `0` setting should only be used for the last era. + +In all parameters receiving multiple values, the values for the second and third eras must be preceded by a comma. + +For example: + +```bash +./komodod -ac_name=HELLOWORLD -ac_supply=777777 -ac_eras=3 -ac_reward=5000000000,7000000000,4000000000 -ac_end=1000,10000,0 +``` + +In this Smart Chain, the first era will have a reward of 5000000000, the second will have 7000000000, and the third will have 4000000000. The reward for the first era ends at block 1000, for the second era at block 10000, and the third era lasts indefinitely. + +If any of the relevant parameters has fewer distinct values than eras, the parameter's final value will carry through the remaining eras. + +For example: + +```bash +-ac_eras=2 -ac_reward=100000000,200000000 -ac_halving=100 -ac_end=10000,0 +``` + +In this Smart Chain, the `ac_halving` value for both eras is `100`. + +One more feature of `ac_eras` is the ability to transition from one era to the next with a linear progression, rather than a direct switch. To achieve this effect, in the initial era (the point at which the linear progression should begin) set the `ac_decay` value to `100000000` and the `ac_halving` value to `1`. + +For example, the following parameters create a Smart Chain with a "slow start" reward: + +```bash +./komodod -ac_name=HELLOWORLD -ac_reward=0,10000000000 -ac_eras=2 -ac_end=1000,0 -ac_decay=100000000,100000000 -ac_halving=1 +``` + +This chain's block reward will grow linearly from 0 to 100 over 1000 blocks, then stay at 100 indefinitely. + +::: tip +Use the [getblocksubsidy](../komodo-api/mining.html#getblocksubsidy) API method to verify your Smart Chain will work as expected at each relevant height: `./komodo-cli -ac_name=HELLOWORLD getblocksubsidy ` +::: + +## ac_founders + +The `ac_founders` parameter creates a "founder's reward." + +This parameter requires [ac_perc](../installations/asset-chain-parameters.html#ac-perc). If the `ac_perc` value is not declared, the `ac_founders` value defaults to `35%`. Also, either [ac_pubkey](../installations/asset-chain-parameters.html#ac-pubkey) OR [ac_script](../installations/asset-chain-parameters.html#ac-script) must be set. + +The `ac_perc` value determines the percentage of block rewards paid to the founder. These rewards are not paid out immediately, but rather according to the `ac_founders` setting. + +`ac_founders` determines the frequency at which the founder's reward is paid. + +For example: + +```bash +-ac_reward=100000000 -ac_perc=10000000 -ac_founders=100 +``` + +The above parameters result in mining rewards of 100000000 satoshis (1 coin) per block, with a difference on every 100th block. On the 100th block exception, 1000000000 additional satoshis (10 coins) are paid to the founder's address. + +The coins rewarded to the founder are created at the moment of payment, thus increasing the overall coin supply. See [ac_perc](../installations/asset-chain-parameters.html#ac-perc) for more details. + +Use `ac_pubkey` to send the founder's reward to a normal address. + +Use `ac_script` to send the founder's reward to a multi-signature address. + +Set `ac_founders=1` to stay compatible with most stratum implementations. Any other value requires team member @blackjok3r's fork of knomp using the [disable-cb feature](https://github.com/blackjok3rtt/knomp#disable-coinbase-mode). Please reach out to our team on [discord](https://komodoplatform.com/discord) if you have further questions about how to set up a stratum. + +## ac_halving + +This is the number of blocks between each block reward halving. This parameter will have no effect if [ac_reward](../installations/asset-chain-parameters.html#ac-reward) is not set. The lowest possible value is `1440` (~1 day). If this parameter is set, but [ac_decay](../installations/asset-chain-parameters.html#ac-decay) is not, the reward will decrease by 50% each halving. + +#### :pushpin: Examples + + + +## ac_name + +::: warning +All Smart Chains are required to set ac_name. +::: + +This is the ticker symbol for the coin you wish to create. We recommended it consist only of numbers and uppercase letters. + +#### :pushpin: Examples + + + +## ac_perc + +The `ac_perc` parameter has two different functionalities depending on the configuration of the chain parameters. + +#### ac_perc without ac_founders + +When `ac_perc` is used without [-ac_founders](../installations/asset-chain-parameters.html#ac-founders) the chain will follow an inflation tax model. In this model, the `-ac_perc` parameter is the percentage added to the block reward, and the transactions that allocate these rewards are sent to the `-ac_pubkey` address. Naturally, for this configuration to function the `-ac_pubkey` parameter must be included. + +For example, if `-ac_reward=100000000` and `-ac_perc=10000000`, for each block mined the miner receives 100000000 satoshis (1 coin), and the owner of the `-ac_pubkey` address receives 10000000 satoshis (0.1 coin, which is 10% of the miner's reward). The amount sent to the pubkey is not taken from the user, rather it is created at this point. Therefore, each transaction inflates the overall coin supply. + +The maximum amount of coins created via this method across all transactions per block is capped at `(1000000 * )`. + +::: tip +Vout 1 of each coinbase transaction must be the correct amount sent to the corresponding pubkey. This only affects a miner trying to use a stratum. Team member, [Blackjok3r](https://github.com/blackjok3rtt/), developed a coinbase-override method for this purpose. Please see [this repo](https://github.com/blackjok3rtt/knomp#disable-coinbase-mode) for details. +::: + +#### ac_perc with ac_founders + +Please see the [-ac_founders](../installations/asset-chain-parameters.html#ac-founders) documentation for this functionality. + +#### :pushpin: Examples + + + + + +## ac_pubkey + +The `ac_pubkey` parameter designates a pubkey for receiving payments from the network. These payments can come in the genesis block, in all blocks mined thereafter, and from every transaction on the network. + +This parameter is not intended for isolated use. It should only be activated on chains that also use at least one of the following parameters: `ac_perc`, `ac_founders`, or `ac_import=PUBKEY`. + +The `pubkey` must be a 66 character string (a compressed pubkey). You can find this pubkey for any address by using the [validateaddress](../komodo-api/util.html#validateaddress) command, and searching for the returned `pubkey` property. The first two digits of a compressed `pubkey` are only either `02` or `03`. (The corresponding `private key` must be present/imported to the wallet before using `validateaddress`.) + +#### :pushpin: Examples + + + +## ac_public + +If `ac_public` is set to `1`, zk-SNARKs are disabled, and all z address functionality is disabled. Therefore, all transactions on the blockchain are public. + +#### :pushpin: Examples + + + +## ac_reward + +::: warning +Komodo recommends that this parameter be included on all Smart Chains. Please see below for additional notes. +::: + +This is the block reward for each mined block, given in satoshis. + +If both `ac_reward` and `ac_staked` are not set, the default block reward will be `10000` satoshis and blocks will be on-demand after block `127` (a new block will not be mined unless there is a transaction in the mempool). + +Komodo recommends that `ac_reward` be included in all Smart Chains. This prevents the Smart Chain from becoming an on-demand blockchain, and therefore this increases the Smart Chain's security. + +To make a Smart Chain that has no block reward and is not on-demand, include the parameters: `-ac_reward=1 -ac_end=1`. The Smart Chain's first block will reward only the `-ac_supply` value, after which the `ac_reward` value will be `0`. + +#### :pushpin: Examples + + + +## ac_sapling + +The `ac_sapling` parameter adjusts the block height of a Smart Chain's default sapling activation. (Sapling is an upstream privacy technology provided by [Zcash](https://z.cash/), of which Komodo is a fork.) + +By default, sapling will activate at block 61 on a newly created Smart Chain. + +This can also be used to activate sapling prior to block 61. (Activating sapling prior to block 61 should not be done on a chain intended for production use.) + +To delay sapling activation, set `ac_sapling` to a block height far in the future. For example, `-ac_sapling=5000000` will delay sapling activation to block `5000000`. At block `5000000` sapling will be activated. + +## ac_script + +The `ac_script` parameter enables the `ac_founders` reward to be sent to a multi-signature address or any p2sh address. If this parameter is used, block 1 (the "premine") will be mined to the `ac_script` address. + +This parameter requires that `ac_founders` also be active. If `ac_script` is set, `ac_pubkey` must not be. + +`ac_script` should be set to the `"hex"` value of `"scriptPubKey"`. + +#### Finding the scriptPubKey + +To find the `"scriptPubKey"` value, first create a multi-signature address with the [createmultisig](../komodo-api/util.html#createmultisig) command. + +##### Command + +```bash +./komodo-cli -ac_name=EXAMPLE createmultisig 2 "[\"RMnZJpfLbFHUxMS3HM5gkvtFKeduhr96Ec\",\"RW2Yx4Tk9WGfUvhbJTXGFiRhr7PKcVtrm5\",\"RQ1uqBj9yk94BcxEZodbeNqb3jWv8pLeA4\"]" +``` + +##### Response + +```json +{ + "address": "bGHcUFb7KsVbSFiwcBxRufkFiSuhqTnAaV", + "redeemScript": "522102040ce30d52ff1faae7a673c2994ed0a2c4115a40fa220ce055d9b85e8f9311ef2102a2ba4606206c032914dd48390c15f5bf996d91bf9dbd07614d972f39d93a511321026014ef4194f6c7406a475a605d6a393ae2d7a2b12a6964587299bae84172fff053ae" +} +``` + +On a test chain, send coins to the `bGHcUFb7KsVbSFiwcBxRufkFiSuhqTnAaV` address. + +##### Command + +```bash +./komodo-cli -ac_name=EXAMPLE sendtoaddress bGHcUFb7KsVbSFiwcBxRufkFiSuhqTnAaV 10 +``` + +##### Response (txid) + +```bash +ef0d05f14ea2a5bfa1c99142c2e3d78c851223d7476ed2e57b61b6e07f741f0f +``` + +Observe the resulting transaction with `getrawtransaction 1`. + +##### Command + +```bash +./komodo-cli -ac_name=EXAMPLE getrawtransaction ef0d05f14ea2a5bfa1c99142c2e3d78c851223d7476ed2e57b61b6e07f741f0f 1 +``` + +##### Response + +```json +{ + "value": 10.00000000, + "valueSat": 1000000000, + "n": 1, + "scriptPubKey": { + "asm": "OP_HASH160 2706324daaac92c93420e985f55d88ea20e22ae1 OP_EQUAL", + "hex": "a9142706324daaac92c93420e985f55d88ea20e22ae187", + "reqSigs": 1, + "type": "scripthash", + "addresses": [ + "bGHcUFb7KsVbSFiwcBxRufkFiSuhqTnAaV" + ] + } +} +``` + +Set `ac_script` to the `"hex"` value from the returned json object. + +##### Command + +```bash +-ac_script=a9142706324daaac92c93420e985f55d88ea20e22ae187 +``` + +## ac_staked + +`ac_staked` indicates the percentage of blocks the chain will aim to mine via Proof of Stake (PoS), with the remainder via Proof of Work (PoW). For example, an `ac_staked=90` chain will have ~90% PoS blocks and ~10% PoW blocks. + +Measurements of the `PoS:PoW` ratio are approximate; the PoW difficulty will automatically adjust based on the overall percentage of PoW-mined blocks to adhere to the approximate `PoS` value. + +When creating a chain with the `ac_staked` parameter, the creation process is slightly different. + +- Start both the first and second nodes **without** `-gen -genproclimit=0`. +- Once both are connected, execute `setgenerate true 1` on the node that should receive the pre-mine. +- Observe the debug.log by executing `tail -f ~/.komodo//debug.log` +- Wait for the Smart Chain to mine two blocks +- Execute `setgenerate false` to stop mining +- All of the coins (including the pre-mine) are now located on the node that mined two blocks. Do not split them with a normal transaction. Rather, split them using this tool: [link](https://github.com/KMDLabs/pos64staker). +- On the first node use 'setgenerate true 0' to enable staking. +- On the second node use 'setgenerate true 1' (or use a desired processor number instead '1') to enable mining. +- Use the [getbalance64](../komodo-api/wallet.html#getbalance64) method to ensure that there are coins staking in all 64 segids before block 10. The utxos may appear on any list, including both staking and nonstaking. + +Following the above instructions will ensure that the Smart Chain is stable. + +::: warning + +On a chain using a high percentage for PoS, it's vital to have coins staking by block 100. If too many PoW blocks are mined consecutively at the start of the chain, the PoW difficulty may increase enough to stop the chain entirely. This can prevent users from sending transactions to staking nodes. + +::: + +::: warning + +Set [ac_reward](../installations/asset-chain-parameters.html#ac-reward) parameter to any desired value for staking to function properly. +::: + +::: warning + +It is vital to stake coins in all 64 segids. You can use the genaddresses.py script in [this repository](https://github.com/KMDLabs/pos64staker) to generate an address for each segid. This functionality will soon be integrated directly into the daemon. + +::: + +::: tip +The first 100 blocks will allow PoW regardless of the ac_staked value. +::: + +::: tip +It is not possible to both PoW mine and stake on the same node. Therefore, when the chain's consensus mechanism allows both PoS and PoW, the chain creator needs a minimum of two nodes mining/staking to keep the blockchain moving. +::: + +### Notes on How ac_staked Functions + +Once staking is active, utxos available in the `wallet.dat` file will stake automatically. + +On an `ac_staked` Smart Chain there are 64 global segments (`segid`'s) to which all addresses and the corresponding utxos belong. These 64 `segid`'s become eligible to stake blocks in turns. The segment a utxo belongs to is determined automatically, according to the address in which the utxo resides. + +You can see which segment an address belongs to by using the [validateaddress](../komodo-api/util.html#validateaddress) API command. You can use the [getbalance64](../komodo-api/wallet.html#getbalance64) API command to observe how your staked coins are distributed across the separate segids. + +Each staked block will have an additional transaction added to the end of the block in which the coins that staked the block are sent back to the same address. This is used to verify which coins staked the block, and this allows for compatibility with existing Komodo infrastructure. + +There are additional considerations when `ac_staked` is used in conjunction with [ac_perc](../installations/asset-chain-parameters.html#ac-perc) and [ac_pubkey](../installations/asset-chain-parameters.html#ac-pubkey). The coins used to stake will be included in the `ac_perc` calculations until the Smart Chain reaches block height `1000000`. Therefore, the [ac_pubkey](../installations/asset-chain-parameters.html#ac-pubkey) address will receive more coins for each staked block compared to a mined block. After block `1000000`, `ac_perc` will no longer include the coins used for staking, and therefore the amount of coins sent to the `ac_pubkey` address will normalize. + +### Rules for Staking a Block + +The following are the (current) rules for staking a block: + +- Block timestamps are used as the monotonically increasing on-chain clock. It is important to have a synced system clock. Use the following sequence to sync your clock:`sudo apt-get install chrony`, `sudo systemctl restart chrony.service`, then check `timedatectl` for `NTP syncronized: Yes` + +- A utxo is not eligible for staking until a certain amount of time has passed after its creation. By default, between blocks `1` and `2000` the amount of time required for a utxo to be eligibile is `blockheight * 3 seconds`. After block `2000`, the required amount of time is 6000 seconds. More precisely, after block `2000` a utxo is not eligible for staking until `100 * the expected blocktime (i.e. 1 minute)`. For example, utxos on a one-minute block-time Smart Chain would be eligible for staking one-hundred minutes after their creation. + +- The `segid`s rotate through a queue to determine which `segid` has the most likely chance to stake a new block. The formula that determines this is based on the block height: `(height % 64) = the segid0 for this height`. For each block, the eligibility to stake a new block begins with `segid[0]`, and then the eligibility expands to the next segment in queue at every two-second interval until the block is staked. For example, if `segid[0]` has not mined a new block within two seconds, the consensus mechanism opens up the priority to include the second, `segid[1]`. This continues either until the block is staked, or all 64 `segid`'s are eligible to stake a new block. Once a block is staked, the `height` of the blockchain changes, pushing the `segid[0]` segment to the end of the queue, etc. + +- By internal design, a utxo is more likely to win a block within a `segid` based on age of the utxo and amount of coins. Regarding the age eligibiility, the maximum maturity level is one month (e.g. after reaching one month of age, a utxo's likelihood of staking a coin does not further increase). The age of the utxo is set by the `nlocktime` property of the utxo, or if `nlocktime` is not set, the age is determined by the utxo's `blocktime` property. + +#### :pushpin: Examples + + + +## ac_supply + +This is the amount of pre-mined coins you would like the chain to have. + +The node that sets [gen](../installations/common-runtime-parameters.html#gen) during the creation process will mine these coins in the genesis block. + +If `ac_supply` is not set, [ac_reward](../installations/asset-chain-parameters.html#ac-reward) must be set, and a default value of 10 coins will be used in the genesis block. If [ac_founders](../installations/asset-chain-parameters.html#ac-founders) is set, the pre-mined coins will be mined to the founder's reward address. + +The `ac_supply` parameter should be set to a whole number without any decimals places. It should also be set to less than `2000000000` to avoid 64-bit overflows. + +::: tip +An additional fraction of a coin will be added to the initial supply based on the Smart Chain's parameters. This is used by nodes to verify the genesis block. For example, the DEX chain's `ac_supply` parameter is set to `999999`, but in reality the genesis block was `999999.13521376`. When using `ac_staked`, the additional amount may be more than a full coin, and can add up to two digits left of the decimal point. +::: + +#### :pushpin: Examples + + + +## ac_timelock... + +**-ac_timeunlockgte=satoshis -ac_timelockfrom=height -ac_timelockto=height** + +The `ac_timelock...` parameters enforce "coinbase locking". + +In coinbase locking, the Smart Chain's block-reward feature behaves in a different manner compared to a default Smart Chain. Any block reward that is greater than or equal to the `ac_timeunlockgte` satoshi amount is temporarily locked. It will be unlocked (and therefore spendable) on a random block between the `ac_timelockfrom` and `ac_timelockto` heights. + +The random unlock time for each reward is independent of the unlock time of other rewards. + +For example: + +```bash +./komodod -ac_name=HELLOWORLD -ac_supply=0 -ac_reward=10000000000 -ac_halving=10000 -ac_timelockgte=10000000000 -ac_timeunlockfrom=10000 -ac_timeunlockto=100000 +``` + +For the first 10000 blocks, any rewards that are greater than or equal to 10000000000 are locked until a random block between 10000 and 100000. + +## ac_txpow + +::: warning +This parameter is in its final testing stages. Please reach out to us if you would like to use it on a production chain. +::: + +Setting `-ac_txpow=1` enforces a transaction-rate limiter. This can help to prevent spam transactions on a Smart Chain. + +`ac_txpow` forces all transactions (other than coinbase transactions) to have a txid starting and ending with `00`. + +This parameter is currently a proof of concept. Many of the traditional API commands, such as `sendtoaddress` or `sendmany`, are not currently supported. Instead, use [createrawtransaction](../komodo-api/rawtransactions.html#createrawtransaction) and [signrawtransaction](../komodo-api/rawtransactions.html#signrawtransaction). + +## ac_veruspos + +::: warning +This parameter is in its final testing stages. Please reach out to us if you would like to use it on a production chain. +::: + +The `ac_veruspos` parameter is an alternative to [ac_staked](../installations/asset-chain-parameters.html#ac-staked). + +When activated, the chain uses [Verus](http://veruscoin.io/)'s proof of stake implementation instead. + +The only valid value for this parameter is `-ac_veruspos=50`. (`ac_veruspos` does not have the same segid mechanism as `-ac_staked`.) + +# Introduction to Antara + +Welcome to the Antara technical documentation. + +#### About the Antara Section + +This documentation is intended for developers learning about, building, and interacting with the Antara framework. + +Users who are not interested in these activities, but are searching for documentation assistance, can find support in the Komodo Support Center. + +[Link to Komodo Support Center](https://support.komodoplatform.com/support/home) + +#### Conceptual Overview + +A brief conceptual overview of the Antara framework can be found in the Start Here > Product Introductions > Smart Chains & Antara section. + +[Link to "Smart Chains & Antara" Introduction](../basic-docs/start-here/about-komodo-platform/product-introductions.html#smart-chains-fluidity) + +The [Antara Tutorials](../basic-docs/fluidity/fluidity-tutorials/introduction-to-fluidity-tutorials.md) section contains more thorough conceptual explanations of Antara. + +Please consult our [Learning Path Outlines](../basic-docs/start-here/learning-launchpad/learning-path-outlines.html#type-b-developers-smart-chains) section for more details on approaches to learning Antara from both a conceptual and technical perspective. + +#### About Antara Setup + +The Antara Setup section contains basic information about setting up and using an Antara-enabled environment. Example topics include: + +- [Understanding Antara Addresses](../basic-docs/fluidity/fluidity-setup/fluidity-instructions.html#understanding-the-types-of-addresses) +- [Antara Customizations Available for Smart Chains During Creation and Hard Forks ](../basic-docs/smart-chains/smart-chain-setup/smart-chain-customizations.html#smart-chain-customizations) + +#### About Antara Tutorials + +The Antara Tutorials section contains various tutorials that provide instruction for Antara usage and creation. + +For a walkthrough covering multiple tutorials in a targeted fashion, please see the [Learning Launchpad](../basic-docs/start-here/learning-launchpad/learning-path-outlines.html) section. + +#### About Antara API + +The Antara API section contains all available API commands for all default Antara modules. + +These API commands can also be called Remote Procedure Calls, or RPCs. + + +
+ +
+ + + +
+ +

Introduction

+ +
+ +

Welcome to Komodo's Developer Documentation.

+ +
+ + + +
+ +
+ +
+ +Komodo's blockchain technology enables developers to create fully independent blockchains in a secure and highly competitive environment. + +Each independent blockchain built on the Komodo framework has a wide range of capabilities, including: + +* Bitcoin-hash rate supported security + +* Enterprise-level scalability + +* Consensus customization + +* Blockchain clustering + +* ...and more! + +Because a Komodo-based blockchain is independently managed, the developer has complete freedom, so long as the essential connections to the Komodo ecosystem remain. + + +[Get Started →](./basic-docs/start-here/about-komodo-platform/about-komodo-platform.html) + + +### Komodo Platform Overview + +After years of innovation and development, Komodo's multi-chain architecture overcomes the challenges faced by other smart-contract platforms. + +The philosophy behind Komodo's multi-chain architecture relies on four pillars. + +- Security +- Scalability +- Interoperability +- Adaptability + +With these four pillars in place, users of all types will find powerful, customizable solutions that will set your blockchain creativity free. + +
+ + + +
+ +
+ +### Security + +#### Enjoy the Protection of the Bitcoin Hash Rate + +Secure your project with the power of the Bitcoin network via Komodo’s delayed proof of work security mechanism. Don’t waste time worrying about attackers. + +
+ +
+ +- Approximately every half hour, a hash of the developers blockchain is notarized to Bitcoin +- All transactions included in the hash are considered to have achieved finality +- For the consensus mechanism, arbitrarily choose between a mixture of Proof-of-Work and Proof-of-Stake + +
+ +
+ + + +
+ +
+ +### Scalability + +#### Have a Blockchain All To Yourself. Want More Than One? No Problem. + +Developers and their users have a full Smart Chain all to themselves, and can combine any number of Smart Chains together into one cluster. + +
+ +
+ +- Developers and their users can securely own a full Smart Chain +- Each Smart Chain is completely autonomous +- If your project grows beyond the capacity of a single chain, simply add more +- Scale your maximum transaction-per-second throughput into the millions, if desired +- No gas fees. All transaction fees are paid in your Smart Chain’s coin + +
+ +
+ + + +
+ +
+ +### Interoperability + +#### Link Your Smart Chain to Other Chains + +Your project is interoperable with all others in the Komodo ecosystem, plus connected with over 99% of coins and tokens through Komodo’s industry-leading atomic-swap technology. + +
+ +
+ +- Komodo’s Multi-Chain Syncing feature allows you to scale out linearly on demand +- Smart Chains can verify and update local state based on the activity of compatible Smart Chains +- Transfer assets and tokens between compatible Smart Chains +- Use Komodo's atomic-swap DEX software to trade your Smart Chain assets with Non-Smart assets. + +
+ +
+ + + +
+ +
+ +### Adaptability + +#### Develop Your Smart Chain at Will + +Adapt your blockchain to create a purpose-built solution that fits your individual needs. Receive all new features developed by Komodo to ensure your project is future-proofed. + +
+ +
+ +- Twenty-four different launch parameters are available to customize the functionality of your Smart Chain +- Rely on the Antara framework to fully customize your Smart Chain with unique and arbitrary code within the consensus mechanism +- Share and adopt code in Komodo's open-source community +- Dispose of Smart Chains that become data-weight heavy, or transfer them to fresh Smart Chains for ease of use +- No need for a virtual machine (VM) nor a VM-based programming language + +
+ +#### Together, the Komodo Platform is Unlike Anything Else + +With the Komodo architecture at your command, you are prepared to lift your Smart Chain software to levels never before seen in the blockchain industry. + +### Komodo's White-Label Software Brings Your Innovation to Market Faster + +The Komodo Platform offers many free white-label applications that can help you bring your innovation to market faster. + +- Atomic-Swap Decentralized Exchange & Multi-Asset Wallet +- Decentralized-Crowdfunding App +- Custom Block Explorers +- SPV Electrum Server Integration +- Core Antara Modules + +### Installing, Using, and Testing Komodo Software is Free + +The best way to learn about Komodo is to use it for yourself. + + +# Documentation Orientation + +The following section answers common questions a newcomer may have, and prepares the new reader for the installation procedure. + +### Intended Audience of this Technical Documentation Website + +This website is targeted for developers in the Komodo ecosystem. + +Users who are not interested in developing Komodo-based software, but only in using existing software, should instead turn to the Komodo Support website for questions and answers. + +[Link to Komodo Support Website](https://support.komodoplatform.com) + +### Assumptions for this Documentation + +To limit the scope of what we cover on the technical-documentation website, we list the following prerequisite knowledge. + +#### Familiarity with the Concept of Blockchain Technology + +The reader should be generally familiar with the basic concept of blockchain technology and why it matters. If you're not yet familiar, we recommend that you first read our Core Technology Discussion regarding our Delayed Proof of Work consensus mechanism. + +[Link to Core Technology Discussion: Delayed Proof of Work](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html) + +#### Simple Programming Skills + +Much of the content on this site will be more understandable for the reader who has a rudimentary understanding of a mainstream programming language. + +Beginner-level knowledge should be sufficient for the majority of the site. For example, the reader should be able to: + +- Execute commands on the command line +- Utilize an Application Programming Interface (API) +- Write and execute a rudimentary script in any mainstream language + +If you do not have these prerequisite experiences, we encourage you to reach out to our community on [Discord.](https://komodoplatform.com/discord) There are thousands of free tutorials online that can help you quickly cover these topics. We will be happy to help you in your search. + +### A Note Regarding Komodo Language Compatability + +Komodo is a highly capable blockchain technology, and it is designed for compatability with essentially all mainstream programming languages. However, not all developers will need to use its most advanced aspects. + +#### A Normal Developer in the Komodo Ecosystem + +A typical developer in the Komodo ecosystem will build all their application logic in a separate application that runs outside of their Smart Chain daemon. + +The developer's software will send API requests to their Smart Chain's daemon to update the blockchain state and take advantage of Komodo's default Antara Modules. (Antara Modules provide functionality similar to the "smart contracts" that are common on other platforms. However, we argue that Antara Modules are dramatically more powerful.) + +For this developer, any programming language that is capable of sending API requests to the software daemon is compatible. + +#### An Advanced Antara Developer + +A highly advanced developer may be interested to take advantage of the full potential of Komodo technology. + +This developer can utilize Komodo's Antara Framework to add arbitrary code to the consensus mechanism of their autonomous Smart Chain. + +Although the Antara Framework can be compatible with essentially all mainstream programming languages, at this time we encourage developers to stay close to the C/C++ languages. + +### The Cost of a Smart Chain + +#### Installation and Testing is Free + +Creating and experimenting with Komodo Smart Chains is completely free. + +#### Production Smart Chains Typically Require Komodo's Security Services + +In nearly all circumstances, a Smart Chain is only secure once it receives the Komodo dPoW Security Service. + +Please reach out to our third-party service providers for a cost quote. + +Our third-party providers are available on our [Discord](https://komodoplatform.com/discord) live-chat server. Their usernames are: + +- @siu +- @ptyx +- @bitcoinbenny +- @TwilightPunkster. + +::: tip +We have a limited supply of early-adopter discounts. Please inquire while supply last. +::: + +### The Cost of Using AtomicDEX Software + +Currently, there are no additional costs for AtomicDEX beyond the fees listed for each trade. + + + +### Differences between KMD and a Smart Chain + +The main KMD blockchain runs on the same underlying framework as all Smart Chains in the ecosystem, but not all features are active on the KMD blockchain. + +The KMD chain's active features include Bitcoin-hash rate supported security and the ability to execute Antara Modules. Other features, such as zero-knowledge privacy, are disabled. + +This limitation is intentional. The KMD chain holds all the meta data of the ecosystem. By keeping the functionality limited, Komodo discourages rapid data growth on this central blockchain. + +All other Smart Chains in the ecosystem are fully customizable. + + + +# Product Introductions + +## Smart Chains & Antara + +Komodo's Smart Chain technology allows you to create secure and fully autonomous blockchains that are designed for a specific purpose. + + + +#### Smart Chains Rely on the Next Step in Blockchain Evolution: The Antara Framework + +The Antara framework allows you to customize your Smart Chain and add arbitrary code to the consensus mechanism. + +This blockchain evolution allows innovators to better meet the demands of your customers. + +#### Comparing a Smart Chain to a Smart-Contract Platform + +| Layer | Branded Terminology | Universally Defined As: | Smart-Contract Comparison | +| ----- | ------------------- | ----------------------- | ------------------------- | +| Application Layer | Antara Apps | Smart-Chain Apps | dApps | +| API Layer | Antara API | Smart-Chain API | - | +| Service Layer | Antara Module | Smart-Chain Module | Smart Contract | +| Blockchain Layer | Antara Smart Chains | Smart Chains | (Shared Chain) | +| Platform Layer | Komodo Platform | Smart-Chain Platform | Smart-Contract Platform | + +### Smart Chains and Antara Create a Convenient Development Workflow + +For developers, the unique combination of Smart Chain technology and Antara simplifies the adoption of blockchain technology. + +- Start by creating a new Smart Chain that will serve your specific application +- Use the library of existing Antara modules to craft application-specific functionality +- Optionally, use Antara to add arbitrary code to your consensus mechanism +- When your Smart Chain becomes popular, scale into a cluster of Smart Chains +- Link your Smart Chain to other Smart Chains using Antara and Komodo technology +- Trade your assets with essentially any blockchain token using Komodo's AtomicDEX +- Stay up-to-date with the latest industry innovations through no-cost updates + +[Link to Antara content]() + +### The Architecture of Antara-Powered Smart Chains + +
+ + + +
+ +-------------------------------------- +
+ + + +
+ +
+ +#### Antara API + +Produced by Antara Modules + +- Open API +- Permissionless Innovation +- Language Agnostic + +
+ +-------------------------------------- +
+ + + +
+ +
+ +#### Antara Modules + +Attached to the chain daemon. + +- Pluggable Modules +- Growing Module Library +- Build Your Own + +
+ +-------------------------------------- +
+ + + +
+ +
+ +#### Antara Smart Chains + +Purpose-built blockchains + +- Autonomous & Sovereign +- Customizable Parameters +- Atomic Swap Compatible + +
+ +-------------------------------------- +
+ + + +
+ +
+ +#### Komodo Platform + +Composable & Open + +- Connect to the Bitcoin Hash Rate +- Composable Architecture +- Open-Source Innovation + +
+ +-------------------------------------- + +### Advantages of the Antara Framework + +#### Programmable Daemon + +Arbitrary code is added directly into the blockchain daemon. This stands apart from the traditional smart-contract platforms, which abstract a smart contract on top of a virtual machine. + +#### Modular Design + +Smart Chains are composed of independent and autonomous modules that are decoupled from the underlying blockchain consensus mechanism. + +#### Autonomous & Sovereign + +Smart Chains are not child chains, nor are they dependent on other blockchains. + +#### Turing-Complete + +The Antara framework supports C/C++, and in the future it will also support other languages. Therefore, Antara allows for Turing-complete code. With Antara, any program or software can be coded to run within your blockchain daemon. + +#### No Gas Fees + +There are no gas fees with Antara. Regardless of how many processes an Antara module requires, running an instance of the module will only need a single transaction fee, paid in your blockchain’s coin. + +#### Antara Module Library + +The Antara framework already hosts a library of plug-and-play modules. Each module can add special conditions that affect the nature of transaction consensus on your Smart Chain. + +#### Create Your Own Modules + +Experienced developers can write custom modules, creating the building blocks and RPC calls they need to build more advanced blockchain-based software. + +[Link to smart chain section]() + +## AtomicDEX + +Komodo provides open-source atomic-swap software for trading seamlessly between essentially any blockchain asset in existence. + +
+ + + +
+ +#### Enjoy All the Benefits of the Old System, and of the New + +Everything that was possible in the old centralized-exchange system is also possible in the new atomic-swap system. + +High-speed trading is easy, the DEX API allows you to create atomic-swap powered apps and trading bots, and you can even trade on your mobile phone. + +Our DEX software is not bound to Komodo-based blockchain assets. If a blockchain asset can trade on a centralized exchange, odds are you can atomically swap this asset on our DEX software. + +#### Skip the Centralized Middleman and Trade Directly with Your Trading Partner + +In an atomic swap, there is no need to lend your money to a third party for temporary holding. This keeps security in the hands of the user, reduces the cost of fees, and prevents the users from coalescing their funds into a large target for hackers. + +#### Keep Your Private Keys Private, At All Times + +Unlike a centralized exchange, users maintain ownership over their blockchain assets at all times, right up until the moment when their assets are atomically swapped. + +#### Join the Crowd, or Start a New One + +Users create their own liquidity pools for trading between assets. You can use a pool that is already established, or start your own pool. + +#### No Off-Chain Settlements Required + +The Komodo software uses atomic-swap technology, pioneered by Tier Nolan and our very own JL777, to ensure that a trade either happens, or it doesn't. If a trade stalls or fails halfway through the process, blockchain software ensures that these funds automatically reappear in the users' wallets. + +#### Integrate Your Smart-Chain Asset with Our Software + +Integration requires only a few simple steps, and once up and running, you are free to trade your new blockchain-based asset with whomever you decide. + +You are free to discover your own audience. + +[Link to AtomicDEX]() + + +# Simple Installations + +## Smart Chain Installation + +#### Installing Basic Komodo Software + +To install the Komodo daemon, `komodod`, and its necessary counterpart, `komodo-cli`, the simplest method is to download pre-compiled binaries. + +Downloadable packages are available for Linux, MacOS, and Windows. + +[Download and unzip the pre-compiled executables found here.](https://github.com/KomodoPlatform/komodo/releases) + +Once unzipped, the executables do not require installation. Simply find `komodod` and `komodo-cli` in the directory where you unzipped the files. + +You may also build `komodod` and `komodo-cli` from source. This is not required, but it is considered the best practice. Building from source enables you to receive the latest patches and security upgrades the moment they are pushed to the `komodod` source. + +#### See the Smart Chains Documentation for Further Details + +Please see the full [Smart Chains]() technical documentation for full software explanations. + +You will find [a walkthrough on building from source here.](https://docs.komodoplatform.com/komodo/installation.html) + +## AtomicDEX Installation + +#### Installing AtomicDEX Software + +The following links contain downloadable AtomicDEX software. Simply download the files appropriate for your operating system, extract them to your desired location, and double click the application to begin. + +[Link to AtomicDEX Software - Simple Installations](http://195.201.0.6/mm2/) + +#### Additional AtomicDEX Documentation + +Please see the following links for further details regarding AtomicDEX software. + +[Link to Source Code Installation Methods](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) + +[Link to AtomicDEX API](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) +# Learning Path Outline + +## Introduction + +Welcome to the educational center for Komodo technology. This section provides a descriptive outline for new developers in the Komodo ecosystem. + +The content first familiarizes the developer with basic blockchain principles, and then narrows down on principles that are unique to Komodo. + +Once the developer is comfortable on a conceptual level, the content leads the developer into the process of utilizing the Komodo software itself in a development environment. + +Using Komodo software is about as difficult as using any other programming framework. The developer needs to first understand how the software functions on a conceptual level, and then the developer learns the vocabulary necessary to integrate Komodo software into their personal creative endeavors. + +This process can take anywhere from a single full day to a few weeks, depending upon the skill level of the developer. Each step of the journey provides a time estimate based on a normal developer that has a few years' experience in a mainstream programming language. + +## A Description of Our Intended Audience + +As mentioned in the [Documentation Orientation](../../../basic-docs/start-here/about-komodo-platform/orientation.html) section, this website is intended for readers who are already familiar with a mainstream programming language. + +Now, we divide readers further into two categories. + +##### The Normal Komodo Developer + +The first is a developer who intends to utilize Komodo technology only as it is provided to them. This is the most common type of developer we expect in the Komodo ecosystem. + +This developer likely intends to utilize Komodo software to release a blockchain product that either stands alone, or compliments another software product the developer is creating. + +For example, this developer could be involved with the creation of a blockchain-based asset for a business they are building. This developer expects an audience to purchase and trade these assets, and the audience may utilize Komodo's white-label software for asset management. + +As another example, this type of developer could be building a web application that integrates with blockchain technology. The developer could be utilizing Antara Modules, such as [Oracles,](../../../basic-docs/antara/antara-api/oracles.html#introduction) to securely record data that is relevant to or even created by their audience. Once the data is recorded, the developer could display this information on their website, for simple gameplay enhancements or data-driven storytelling. + +##### The Advanced Komodo Developer + +The advanced Komodo developer intends both to use the Komodo software as it is provided to them, and also to add in their own customized functionality beyond the scope of the default software. This developer is highly skilled in a mainstream programming language, such as C/C++, and is prepared to thoroughly understand and manipulate blockchain software. + +For example, this developer may intend to build customized Antara Modules to add to the consensus mechanism of their Smart Chain. These customized modules could create unique and fully playable blockchain-based games of a complexity level similar to [this Komodo-based Roguelike game](../../../basic-docs/antara/antara-tutorials/rogue-module-tutorial.html#introduction), or [this Komodo-based version of Sudoku.](../../../basic-docs/antara/antara-api/sudoku.html) + +#### How Each Type of Developer Should Approach the Educational Outlines + +Both types of developers should begin at the beginning. + +The Normal Developer should proceed until they reach the content with a difficulty level labeled `Advanced` and then stop, while the Advanced Developer there should proceed. + +We recommend that developers complete steps with a priority label of `Recommended`. There are also a few sections labeled `Optional` that may be skipped, although the developer who completes them will, hopefully, find them worth the while as these sections contain short cuts and other recommended best practices. + +## Step 0: Install Komodo Software + +Priority: Recommended + +Difficulty: Normal + +Time: 10 Minutes + +------- + +Access to Komodo software allows the developer to immediately begin learning through direct experimentation. + +We recommend that all developers install Komodo software not by using pre-built binaries, but rather by installing and compiling from source code. + +This allows the developer to later have instant access to Komodo security patches, feature enhancements, and upgrades. + +[Link to Komodo Source Code Installation Methods](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html) + +[Link to AtomicDEX Source Code Installation Methods](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) + +## Step 1: Reach Out to Our Community on Discord + +Priority: Recommended + +Difficulty: Normal + +Time: 5 Minutes + +------- + +Discovering Komodo is best accomplished with a friend. + +Komodo utilizes a third-party chat service called Discord. + +[Reach out to us on Discord at this link.](https://komodoplatform.com/discord) + +Once you are logged in to the Komodo Discord server, you will see a list of channels on the left side of your browser. All channels begin with a `#` hashtag. + +Say hello in channels such as `#arrivals`, `#start-here`, or `#introductions`. + +The `#community-support` channel is a good place to ask for basic support with Komodo software. + +To find fellow developers, head to the `#dev-general` channel. All channels that begin with `dev` are created for developers. + +We look forward to meeting you there! + +## Step 2: Begin a Conceptual Understanding of Komodo's Software + +Priority: Recommended + +Difficulty: Normal + +Time: 10 Minutes + +------- + +With the Komodo software installed and a connection made to our community, you are prepared to begin learning about Komodo on a conceptual level. + +These conceptual concepts must be grasped first, before attempting to manipulate blockchain assets and software. The concepts help to orient you in your development process. + +##### Platform Overview + +The Platform Overview section provides the broadest conceptual understanding of the Komodo Platform. + +[Link to Platform Overview.](../../../basic-docs/start-here/about-komodo-platform/about-komodo-platform.html) + +##### Product Introductions + +The Production Introductions section contains simplified introductions to Komodo software products and their architecture. + +[Link to Product Introductions](../../../basic-docs/start-here/about-komodo-platform/product-introductions.html) + +##### Doc Orientation + +The Doc Orientation section gives the reader an understanding of the nature of this documentation website. + +[Doc Orientation](../../../basic-docs/start-here/about-komodo-platform/orientation.html) + +## Step 3: Read the Core Technology Discussions Section + +Priority: Recommended + +Difficulty: Normal + +Time: 1 - 5 Hours + +----------- + +The Core Technology Discussions section provides a thorough explanation of blockchain technology and Komodo. The principles explained herein are crucial in later stages. + +##### Introduction + +The Introduction section presents a broad overview of the nature of the Komodo ecosystem and the philosophy and goals that drive this community. + +[Link to Introduction Section](../../../basic-docs/start-here/core-technology-discussions/introduction.html) + +##### Delayed Proof of Work + +The Delayed Proof of Work section explains to the reader the fundamental aspects of blockchain technology that apply to members of the Komodo ecosystem. The primary aspects that a developer should understand here are the value of the consensus mechanism and the nature of Komodo notarization. + +[Link to Delayed Proof of Work Section](../../../basic-docs/start-here/core-technology-discussions/delayed-proof-of-work.html) + +##### Creating and Distributing a New Komodo Smart Chain + +This section helps the reader to understand the basic process an entrepreneur and developer goes through in releasing a new blockchain-based product. This can be called a "Decentralized Initial Coin Offering," or dICO for brevity. + +This also helps the reader to understand how Komodo uses runtime forks to allow each Komodo developer to create their own blockchain that can be connected to the rest of the ecosystem. + +[Link to Creating and Distributing a New Komodo Smart Chain Section](../../../basic-docs/start-here/core-technology-discussions/creating-and-distributing-a-new-komodo-smart-chain.html) + +##### The Antara Framework + +The Antara Framework section explains to the reader the basic concepts of the Antara Framework. This framework is a key aspect of the Komodo development process. The framework provides functionality that can be compared to "smart contracts" found on other blockchain platforms. + +[Link to Antara Framework Section](../../../basic-docs/start-here/core-technology-discussions/antara.html) + +##### AtomicDEX and Atomic Swaps + +As a developer gains understanding of blockchain technology, and as your audience grows, you will likely seek to make atomic swaps available to your users. The AtomicDEX software is our signature method for conducting atomic swaps. + +This section helps the reader to understand why atomic swaps are a key to the future of cryptocurrency trading and how they work. + +[Link to AtomicDEX and Atomic Swaps Section](../../../basic-docs/start-here/core-technology-discussions/atomicdex.html) + +##### Miscellaneous + +The Miscellaneous section explains a few leftover concepts that we recommend the reader understand. For example, a developer will no doubt encounter a "Utxo," or the developer may be curious about privacy on a Komodo Smart Chain, and this section provides preparation. + +[Link to Miscellaneous Section](../../../basic-docs/start-here/core-technology-discussions/miscellaneous.html) + +## Step 4: Complete the Beginner Series in the Antara Tutorials Section + +Priority: Recommended + +Difficulty: Normal + +Time: 1 Hour + +------------ + +The Beginner Series tutorials provide the reader with an easy pathway into the process of using Komodo technology. + +Many of the technical aspects of using Komodo software are simplified here, to allow you to familiarize yourself with the nature of blockchain commands and responses without having to encounter everything all at once. + +As a part of this tutorial, you will download a separate piece of software (a Docker-based image) in which you will enter your first commands. + +Towards the end of the series, we then walk you through the process of interacting with Komodo Smart Chains in the terminal. + +[Link to Beginner Series Tutorial - Part 0 - Preparation](../../../basic-docs/antara/antara-tutorials/beginner-series-part-0.html) + +## Step 5: Familiarize Yourself with Smart Chain API Basics + +Priority: Recommended + +Difficulty: Normal + +Time: < 1 Hour + +-------------- + +Having completed the Beginner Series, the reader is now prepared to use the terminal more frequently while interacting with Komodo Smart Chains. + +The Smart Chain API Basics tutorial walks the reader through many of the common commands and Remote Procedure Calls (RPCs) and assists the reader in becoming comfortable in the Komodo environment. + +[Link to Smart Chain API Basics Tutorial](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) + +## Step 6: Enhance Your Development Environment and Experience + +Priority: Optional + +Difficulty: Normal + +Time: 1 - 5 Hours + +---------------- + +At this point, the Normal Developer should be generally comfortable with the basic concepts of utilizing the default Komodo Smart Chain software. + +The following tutorials are optional, but we still recommend that the developer explore the concepts contained herein. You may find short cuts and solutions that will help you avoid common pitfalls in the development process. + +##### Basic Environment Setup for Linux VPS + +Many, if not most, developers in the Komodo ecosystem use a Linux-based Virtual Private Server (VPS) to build software. Working on a VPS simplifies many aspects of the development process, as the VPS grants the developer a disposable and rapidly customizable environment for troubleshooting. + +There are free VPS services available and links are provided. + +[Link to Basic Environment Setup for Linux](../../../basic-docs/smart-chains/smart-chain-tutorials/basic-environment-setup-for-linux-vps.html#introduction) + +##### Creating Komodo Smart Chains + +Up to this point in the outline, the developer has either relied on tutorial software to provide a Smart Chain, or the developer has relied on a `regtest` chain. + +Now, it is time to try creating your own Smart Chain. + +[Link to Creating a Default Smart Chain](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html#creating-a-new-smart-chain) + +##### Creating a Smart Chain on a Single Node + +Sometimes in the development process, the developer may find convenience in having a Smart Chain running on a single node. This is not the way that blockchain software is intended to function, but single-node blockchains are useful, nonetheless. + +[Link to Creating a Smart Chain on a Single Node](../../../basic-docs/smart-chains/smart-chain-tutorials/creating-a-smart-chain-on-a-single-node.html) + +##### Running Komodo Software in Debug Mode + +Debug Mode allows a developer to access the last lines of code executed by the daemon before the software crashes. + +A Normal Developer will likely only use this when communicating with a support agent, in the unlikely event of a malfunction in the default software. An Advanced Developer, on the other hand, may use Debug Mode frequently. + +[Link to Running Komodo Software in Debug Mode](../../../basic-docs/smart-chains/smart-chain-tutorials/running-komodo-software-in-debug-mode.html) + +##### Updating Smart Chain Software From Source Code + +As the developer installs their software from source code, updating frequently is easy and recommended. Read the following section to become familiarized. + +[Link to Updating Smart Chain Software From Source Code](../../../basic-docs/smart-chains/smart-chain-setup/updating-from-source.html) + +##### Ecosystem Launch Parameters + +The developer is likely to encounter an opportunity to interact with members of another Smart Chain community in the Komodo ecosystem. + +At some future point, you may also be interested in having your own Smart Chain added to this list by purchasing Komodo's dPoW security services. + +The list of launch parameters for all Smart Chains supported by the Komodo notary nodes can be found here. + +[Link to Ecosystem Launch Parameters](../../../basic-docs/smart-chains/smart-chain-setup/ecosystem-launch-parameters.html) + +##### Learn How to Manually Delete Blockchain Data + +Sometimes, a developer will need to delete their synced blockchain data and re-sync with the network. The following section teaches the safe way to conduct this process. + +[Link to Smart Chain Maintenance Section](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html) + +##### Common Runtime Parameters + +As Komodo Smart Chain software is based on the Bitcoin protocol, we inherit many runtime parameters that are useful in creating a secure and efficient blockchain network. + +We recommend that the developer search through our abbreviated list of popular runtime parameters and experiment with one or two, to gain a conceptual understanding. This can help to expand your growing awareness of the potential of blockchain technology and how it is superior to fiat-based currency systems. + +[Link to Common Runtime Parameters](../../../basic-docs/smart-chains/smart-chain-setup/common-runtime-parameters.html) + +## Step 7: Experiment with Antara Customizations + +Priority: Recommended + +Difficulty: Normal + +Time: 20 - 60 Minutes + +------------ + +The most basic aspect of Komodo's Antara Framework is the ability to customize your Smart Chain. These customizations are provided by Komodo as enhancements to the default Bitcoin/Zcash protocol. + +We recommend that you scan through the list of enhancements, read the basic descriptions, and experiment with one or two that interest you. + +[Link to Antara Customizations](../../../basic-docs/antara/antara-setup/antara-customizations.html#smart-chain-customizations) + +## Step 8: Read the Overview of Antara Modules - Part I + +Priority: Recommended + +Difficulty: Normal + +Time: 30 Minutes + +--------------- + +Antara Modules are where the power of the Komodo Smart Chain and the Antara Framework begin to come into full display. Antara Modules allow the developer to expand blockchain potential far beyond the limits by which many other blockchain ecosystems are bound. + +The Overview Part I provides a more thorough discussion about how the framework overcomes many problems faced by the blockchain industry. + +[Link to Overview of Antara Modules - Part I](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-i.html#introduction) + +## Step 9: Read the Overview of Antara Modules - Part II + +Priority: Recommended + +Difficulty: Normal + +Time: 30 Minutes + +---------- + +Part II of this discussion delves more deeply into the underlying methods by which Antara allows developers to solve problems. + +[Link to Overview of Antara Modules - Part II](../../../basic-docs/antara/antara-tutorials/overview-of-antara-modules-part-ii.html) + +## Step 10: Understand Antara Addresses + +Priority: Recommended + +Difficulty: Normal + +Time: 5 Minutes + +--------------- + +At this point, the developer is likely familiar with common blockchain addresses. + +However, Antara requires the user to manage additional addresses for Antara-based currency. The passphrase for these addresses can all be the same, but the public address will not be. + +These addresses keep funds separate between difficult modules on a Smart Chain, and assist in maintaining token scarcity, among other uses. + +[Understanding Antara Addresses](../../../basic-docs/antara/antara-tutorials/understanding-antara-addresses.html) + +## Step 11: Experiment With the Default Heir Antara Module + +Priority: Recommended + +Difficult: Normal + +Time: 15 Minutes + +------------- + +A simple application of the Antara Framework is the Heir Antara Module. This simple module allows a user to designate an inheritor of their funds, should the user become inactive on a Smart Chain. + +Read the introductory section to gain a more thorough understanding, and then try executing each command found in the Heir Module Flow section. + +The Heir Antara Module is active on the MORTY Smart Chain that serves as a test chain in the Komodo ecosystem. + +```bash +./komodod -pubkey=$pubkey -ac_name=MORTY -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 & +. +``` + +Funds are freely available on this chain. Use the following [faucetget](../../../basic-docs/antara/antara-api/faucet.html#faucetget) RPC to tap the community faucet and receive `0.1` coins. This should be enough for the Heir Module Flow experiment. + +```bash +./komodo -ac_name=MORTY faucetget +``` + +Copy the returned hex value and broadcast it using the [sendrawtransaction](../../../basic-docs/smart-chains/smart-chain-api/rawtransactions.html#sendrawtransaction) RPC. + +[Link to Heir Module Introduction](../../../basic-docs/antara/antara-api/heir.html#introduction) + +[Link to Heir Module Flow](../../../basic-docs/antara/antara-api/heir.html#heir-module-flow) + +## Step 12: Experiment with the Tokens Antara Module + +Priority: Recommended + +Difficulty: Normal + +Time: 15 Minutes + +-------------- + +The Tokens Antara Module is often useful as it allows the developer to quickly and easily mint new currencies on their Smart Chain. + +Use the `tokenscreate` RPC method to create your own tokens, and then experiment with other RPCs. This module is also available on the MORTY Smart Chain. Make sure to save the returned `txid` after broadcasting your raw transaction. (See the Examples section for a demonstration of the token creation method.) + +[Link to Tokens Antara Module - tokenscreate RPC](../../../basic-docs/antara/antara-api/tokens.html#tokencreate) + +Use the `tokensinfo` RPC method to view your new tokens. + +[Link to Tokens Antara Module - tokensinfo RPC](../../../basic-docs/antara/antara-api/tokens.html#tokeninfo) + +## Step 13: Read the Introduction to AtomicDEX + +Priority: Optional + +Difficulty: Normal + +Time: 15 Minutes + +------------ + +The Normal Developer is now nearly finished with a grand tour of the Komodo software. The key remaining target is AtomicDEX, our signature method for exchanging cryptocurrencies using atomic swaps. Be one of the first people in the history of mankind to exchange assets with an anonymous person over the Internet without any middleman whatsoever. + +This introductory discussion covers some of the same concepts that the reader encountered in the Core Technology Discussions section, but with several useful additional details. + +[Link to Introduction to AtomicDEX](../../../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.html#why-is-atomicdex-special) + +## Step 14: Experiment with Atomic Swaps + +Priority: Recommended + +Difficulty: Normal + +Time: 1 Hour + +----------- + +Follow this walkthrough to perform your first atomic swaps. + +[Link to AtomicDEX Walkthrough](../../../basic-docs/atomicdex/atomicdex-tutorials/atomicdex-walkthrough.html#setting-up-the-coin-list) + +(If you still need to install AtomicDEX software, [click here for instructions on installing from source code.)](../../../basic-docs/atomicdex/atomicdex-setup/get-started-atomicdex.html) + +For those Normal Developers who make it this far, congratulations! You have completed the grand tour of the Komodo software suite. + +Going forward, we recommend that you experiment with individual RPCs and customizations throughout the documentation, until you feel fluent in utilizing Komodo technology. + +Please keep in touch with our community on [Discord.](https://komodoplatform.com/discord) We are excited to see what you create! + +## Step 15: Begin the Advanced Development Tutorial + +Priority: Recommended + +Difficulty: Advanced + +Time: 5 - 15 Hours + +--------- + +Advanced Developers should now be familiar enough with the nature of Komodo technology to begin a more thorough approach to manipulating blockchain technology. + +The following tutorial series walks the developer through the initial development process. The tutorial will first explain several integral aspects of blockchain technology that blockchain engineers are required to understand. Then, the series walks the reader through the process of creating a simplified version of the Heir Antara Module. + +This tutorial series expects that you are comfortable with downloading a Github repository and manually inspecting the source code to determine the nature of the source code's functionality. + +Once you complete this tutorial, you are among the most advanced of community developers. You may feel prepared to offer your services to businesses that would like to use your skills to commission customized Antara Modules for their unique business purposes and competitive-advantage desires. + +[Link to Advanced Series - Part 0 - Introduction](../../../basic-docs/antara/antara-tutorials/advanced-series-introduction.html#introduction) + +## Step 16: Inspect Komodo Community Bounties + +Priority: Optional + +Difficulty: Advanced + +Time: ~ + +---------- + +Now that you are comfortable building new Antara Modules, it's time to put your skills to use and build something for the community. + +The Komodo team is looking for talented C/C++ developers to build new Antara Modules that can be included with Komodo's default suite of modules. + +Creating a new default module can take up to a month's worth of time, and we try to make sure the value of the bounties is worth your while. + +[Link to Komodo Bounties]() + +Alternatively, reach out to the Komodo development team on the `#dev-general` channel on [Discord](https://komodoplatform.com/discord) and ask where help is needed. + +We look forward to working with you! +# The Antara Framework + +## Introduction + +Antara is an adaptable framework for end-to-end blockchain development. This framework allows developers to build blockchain-based applications in a more simple, quick, and less resource intensive manner than ever before. The framework reduces the barriers to adopting blockchain technology and opens up a universe of possibilities. + +#### The Three Layers of the Antara Framework + +There are three layers to Komodo’s Antara Framework. + +##### Generating Customizable Smart Chains + +The first layer allows for the generation of a customized, independent chain called a Smart Chain. + +##### Core-Level Antara Modules + +Modules are inserted into the consensus mechanism of a Smart Chain that allow the developer to change the nature of the chain. + +##### Antara Application Programmable Interface + +The third layer is the technology that integrates a Komodo Smart chain with other software. This includes an open API for language-agnostic, blockchain-based application development, an atomic-swap powered DEX, and more. + +### Antara Smart Chains + +Chains launched with Antara are not ordinary blockchains. They’re “Smart Chains.” They’re smart because they’re customizable, completely independent, scalable, and modular. + +Smart Chains are customizable along 18 different parameters, allowing for customization of block time, block rewards, consensus rules, algorithm, privacy settings, and much more. + +Smart Chains are also infinitely scalable, as multiple Smart Chains can be clustered together to function as one. Moreover, each Smart Chain comes with built-in modules that accelerate development. This leads us to the second layer of the Antara Framework. + +### Antara Modules + +Each Smart Chain comes with a library of powerful modules built-in. These modules include features like tokens, oracles, stablecoins, quantum security, lightning payments, and more. + +Antara Modules are activated prior to launch to meet the unique needs of every project that builds with Komodo’s Antara Framework. They provide an enormous boost in performance and drastically reduce the workload for a new project, ultimately leading to a faster product launch. + +Advanced developers can optionally program new modules, giving the developer complete freedom over their Smart Chain's behavior. + +### Antara Integration Layer + +The third layer of the Antara Framework is the Integration Layer. The Integration Layer offers a series of white label products, including a multi-coin wallet, a fully decentralized exchange, a decentralized crowdfunding application, custom block explorers, and SPV server integration. + +The Antara Integration Layer also provides an open API that can be used to write blockchain-based applications and software in any programming language. All custom-built apps and software run natively and at the consensus level of each individual Smart Chain. + +## Antara Smart Chains + +Antara Smart Chains are completely independent and sovereign. + +Each Smart Chain has its own consensus rules, decentralized network, and currency. The consensus rules are decided prior to launch and the network validates transactions and blocks according to those rules. Transaction fees are always paid in each Smart Chain’s coin, not in the Komodo Platform’s native currency. Smart Chains never pay any gas fees to the platform. + +While multi-chain platforms are on the rise, many of Komodo’s competitors do not offer true sovereignty. The chains offered on other prominent multi-chain platforms are “child chains” or “side chains." Those types of chains are almost always forced to rely upon the platform’s parent chain in some way. + +Antara Smart Chains never depend on the Komodo Platform, the Komodo blockchain, or the KMD coin. Komodo believes that this open model is the only way to create an ecosystem in which blockchain startups can thrive. Further, a forced dependence on the Komodo blockchain or the KMD coin may provide short-term demand but is sure to be self-defeating in the long run. + +In addition, Smart Chains can also choose to participate in delayed Proof of Work (dPoW) security and Platform Synchronizations to enable interoperability and scalability features. + +Antara Smart Chains are customizable along 18 different parameters, offering hundreds of billions of different configurations to all projects that build with Komodo’s Antara Framework. + +| Customization | Description | +| ------------- | ----------- | +| Name | the name of the Smart Chain and the ticker symbol for the chain’s coin | +| Block Time | the number of seconds that elapse between block generation | +| Consensus Rules | Proof of Work (PoW) or Proof of Stake (PoS) or a combination | +| PoS Implementation | VerusPoS rules or PoS64 rules | +| PoW Hashing Algorithm | Equihash or VerusHash | +| Privacy Settings | mandatory privacy, optional privacy, or complete transparency | +| Interoperability Settings | choose which chains your Smart Chain will communicate with | +| Pre-Mine Supply | the number of coins mined in the first block of the Smart Chain | +| Block Rewards | the number of coins awarded to a miner or staker for finding a block | +| Reward Reductions | the number of blocks between reductions in block rewards | +| Block Reward Decay | percentage by which block rewards decline at each reduction +| Reward Eras | an optional feature to fully customize a chain’s coin emission schedule | +| Time Locking | the option to make block rewards frozen for a set number of blocks | +| Taxation | an optional, inflationary feature that generates a small tax for all transactions | +| Founder’s Bonus | optional feature that makes periodic payouts to the chain’s founder | +| Pub Key | designate the address to which pre-mine supply, tax, and bonuses are paid | +| Multi-Signature | the option to designate a multi-sig address to receive pub key payouts | +| Antara Modules | choose which Antara Modules that you would like to activate | + +## Antara Modules + +Antara Modules act as the foundation upon which advanced blockchain-based applications and software can be built. They offer an enormous level of functionality and cut down on the amount of time a new blockchain project needs to spend on development before going to market. + +As they run natively on every individual Smart Chain, Antara Modules are faster and more secure than traditional smart contracts. They also run at the consensus level, meaning every module is verified by every node in the network upon each use. + +In addition, Antara Modules are written in the C and C++ programming languages so they are Turing complete and can be coded to perform any functions that any existing software performs. + +Significantly, Antara Modules do not require any gas fees. Instead, a single use of a module requires just one ordinary transaction fee, which is always paid in each respective Smart Chain’s coin. This makes it far more practical and profitable to build and run a complex blockchain-based applications on Komodo than on any other multi-chain platform in existence. + +All Smart Chains come with a library of powerful, built-in modules to choose from. + +| Module | Description | +| ------ | ----------- | +| Tokens | create tokens (fungible or non-fungible) on your own Smart Chain | +| Oracles | use an aggregated data oracles solution to bring off-chain data on chain | +| Proxy Token DEX | trade tokenized representations of foreign blockchain assets | +| Instant Micropayments | a channel for secure and instant micropayments | +| Funds Recovery | allow users to designate a backup address to safeguard funds | +| Stablecoins | an algorithmic stablecoin solution with optional digital asset backing | +| Trustless Price Feeds | bring price data on-chain in a trustless, decentralized manner | +| Rewards | give users the option to earn rewards by locking coins for a set time | +| Quantum Security | make all transactions on your Smart Chain quantum secure | +| MuSig Payments | enable private, fast, low-data multi-signature payments | +| Faucet | an automated crypto faucet feature with built-in spam prevention | + +The option to code custom modules is also available to all Smart Chain projects. While coding custom modules is an advanced development task, it offers an unparalleled degree of flexibility and customization. Any processes imaginable can be coded into an Antara Module, which will then run natively and at the consensus level of a project’s Smart Chain. + + +## Antara Integration Layer + +The third and final layer of Komodo’s Antara Framework is the Integration Layer, which consists of an open API and a selection of white label applications to accelerate development. + +Each Antara Module activated on a Smart Chain provides a number of remote procedure calls (RPC). Each individual call executes a different process and offers a unique functionality. Together, these RPCs from all of the the Antara Modules make up the open API. + +The Antara open API is language agnostic so developers can use it to code blockchain-based applications in the programming language of their choosing. This makes Komodo’s Antara Framework the fastest, easiest, and most cost effective way to adopt blockchain technology. + +Further still, the Antara Integration Layer comes with a series of white label products, available to every Smart Chain project. + +- A multi-coin wallet that offers storage of more than 250 different digital assets +- A peer-to-peer crowdfunding app that allows every project to choose which digital assets they would like to accept in the fund raise. New coins are distributed immediately. +- A decentralized exchange powered by Komodo’s industry-leading atomic swap technology. This product allows peer-to-peer trading with unrestricted trading pairs. +- A custom block explorer to make your Smart Chain’s ledger publicly visible. +Integration to SPV servers, which allows users to access their assets on mobile devices. + +These products can be adjusted to fit any project’s branding, accelerating a go-to-market. + +# AtomicDEX and Atomic Swaps + +## Introduction + +Komodo’s decentralized exchange, AtomicDEX, allows people to trade cryptocurrency coins without a counterparty risk. The protocol is open source and trading is available for any coin that any developers choose to connect to AtomicDEX. + +Our service fully realizes decentralized order matching and trade clearing. The order-matching aspect relies on a peer-to-peer network to build public orderbooks, and the trade clearing is executed through an atomic cross-chain protocol, also called an "atomic swap." + +## Current Problems in Cryptocurrency Exchange + +#### Centralized Exchanges are Popular, but Limited + +The current, most practical method for cryptocurrency exchange requires the use of centralized exchange services. + +These centralized solutions require vouchers to perform the exchange, wherein the user sends their funds into the care of a corporate entity and receives "I Owe You" (IOU) statements in return. The user then uses these IOUs to trade within a controlled environment and, when finished, returns their IOUs to the corporate entity for reimbursement. + +Centralized exchanges carry great risk. Among many dangers present in this system, users are under the constant risk of their assets being stolen either by an inside theft or an outside hack. Furthermore, the operators of centralized exchanges are under intense legal and social pressure, as the operators are responsible both for the safety of thousands of users' funds and for the users' behaviors on their platforms. + +To eliminate such dangers and limitations requires the creation of a decentralized alternative, wherein either the entity holding the funds during the trading process is not centralized, or the users are allowed to trade directly without middleman involvement. + +### The Beginnings and Travails of Decentralized Exchanges + +A decentralized exchange (DEX) allows users to trade funds within an environment that is at least partially decentralized. + +Decentralization of an exchange can take many forms. For example, in 2014 Komodo began one of the earliest instances of a decentralized exchange, called "The MultiGateway." + +In this DEX, users sent their blockchain coins not to a centralized entity, but rather to a decentralized "gateway." The gateway was owned and controlled by several cooperating entities who were chosen from the online community. The gateway automatically distributed IOUs (called "proxy tokens") to the users, who then traded within the partially decentralized environment. + +When finished, users sent their proxy tokens back to the gateway, and the gateway managers collectively signed for the release of the users' blockchain funds. The underlying technology of this solution is still in use by many blockchain platforms, and is sometimes referred to as a proxy-token protocol. + +This form of a DEX is too limited to compete with centralized exchanges. Among many drawbacks, a proxy-token decentralized exchange must still have a storage center to hold the external cryptocurrencies represented by the proxy tokens. At best, this storage center is only distributed across several authority figures, and therefore users must still surrender control over their assets for the duration of the trading process. + +As of today, no decentralized exchange has successfully replaced any of their centralized counterparts. + +## AtomicDEX — A Complete Solution + +We now present a fully functional, new decentralized technology that makes a competitive decentralized exchange possible. We call our technology AtomicDEX, and it allows people to freely and safely exchange cryptocurrency coins from one person to another. + +The AtomicDEX decentralized exchange creates a competitive method for bartering cryptocurrencies, combining the key components of order matching and trade clearing. + +These components are combined into a single integrated system that allows users to make a request to trade their coins, find a suitable trading partner, and complete the trade using an "atomic swap." + +Unlike previous DEXs, AtomicDEX does not require users to send funds to either a centralized or decentralized party during the trading process. Rather, users maintain full control over the private keys of their funds at all times. + +## The Decentralized Orderbook + +The first component of AtomicDEX is Order Matching. This is the process of pairing a user’s offer to buy with another user’s offer to sell. The data of these offers form an orderbook. + +The process of matching orders is not the actual trade itself, but is only a digitally created promise between users stating that they will perform their parts of the trade. + +AtomicDEX features several technologies to facilitate order matching, including a peer-to-peer network, a decentralized orderbook, and a multicoin passphrase. + +##### Order Matching with Full-Relay and Non-Relay Nodes + +To create a decentralized orderbook, AtomicDEX creates a custom peer-to-peer (P2P) network. + +In this network, when a node places an order, other nodes on the network collaborate to distribute the data until all nodes are informed. Each node utilizes the data to build the orderbook locally. No centralized server is required. + +To manage this P2P network, AtomicDEX utilizes two separate types of nodes: a full-relay node and a non-relay node. + +The difference between a full-relay node and a non-relay node is that the former is typically a high-volume trader who provides liquidity to the network in exchange for being a trading hub on the network. This puts the trader in the position of being able to complete trades more quickly than their competitors. + +The latter type of node (non-relay) is the more common user, and these nodes rely on the full-relay nodes. A non-relay node has all the same available trading options. We expect that most nodes joining the network will be non-relay nodes. + + +There are no requirements or payments necessary to become either type of node, and so anyone desiring to become a high-volume full-relay node will find no restrictions. + +##### One Passphrase, Many Addresses + +As a part of order matching, AtomicDEX features a specialty wallet that can manage and trade among a multiplicity of different blockchain coins. In this technology, the user creates a single passphrase and uses this to unlock all public addresses associated with their desired coins. + +The complexities of this process are managed by Komodo's Iguana Core technology. + +## Atomic Swaps + +For trade clearing, AtomicDEX implements our own unique variation of atomic swaps. + +An atomic swap is a technology that allows two users to trade cryptocurrencies across two separate blockchains without requiring an intermediary third party. + +The original concept of an atomic swap was created in 2013 by Tier Nolan and many other Bitcoin enthusiasts on the Bitcointalk.org chat forum. In 2014, this conversation inspired members of the Komodo development team to experiment with atomic swaps, and they have remained a key technology in our strategy ever since. + +#### The Value of the Atomic Swap + +To understand why the atomic-swap protocol is necessary, one must first recall that computer code is executed in linear fashion. Even if we were to assume that both parties in a trade may be honest, on a computer the process of taking money from each digital wallet and pulling the money into the open must happen one wallet at a time. + +Therefore, one person must release control over their money first. The atomic-swap protocol protects that person from vulnerability. Without the atomic swap, any malicious party involved would be able to destroy the fairness of the trade. + +A key aspect of a proper atomic swap is that at each stage of the trade-clearing process, each user has incentives to proceed to the next step in the proper manner and disincentives to avoid abandoning the procedure. With this structure in place, regardless of a failure by either user to complete the protocol, each user receives a proper reward. + +#### AtomicDEX Manages a Public Trading Profile for Bob and Alice + +In addition to the atomic-swap protocol, AtomicDEX also allows users to track the behavior of trading partners on the network via a Trust API. + +The Trust API is not based on personal identity, but rather on behavior as associated with public addresses. + +As a user practices good behavior on the network while maintaining a consistent public address, their network trust can increase, thus improving their odds of a willing trading partner. + +Use of the Trust API is optional for all users. + +#### Introducing Alice and Bob + +There are two parties in an atomic swap: the liquidity provider and the liquidity receiver. We call the provider "Bob" and the receiver "Alice." + +##### Alice Makes a Request + +The process of an atomic swap begins with the person who makes the initial request. Typically, this is Alice. + +Alice will need two transactions to perform her swap. One transaction will cover the protocol fee, which is roughly 1/777th the size of her desired order. We call this fee the ``, and its primary purpose is to serve as a disincentive to Alice from spamming the network with rapid requests. + +The second transaction required of Alice sends the actual amount she intends to swap. AtomicDEX first verifies that she has these funds, but for the moment she retains these funds in the safety of her own digital wallet. + +##### Bob Answers Alice + +On the other side of the atomic swap, we have the liquidity provider—we call this person "Bob." Bob sees the request on the network for Alice’s atomic swap and decides to accept the trade. Now his part of the process begins. + +To complete the trade, he must also perform two transactions, but with one important difference. + +The first transaction sends to the AtomicDEX network an amount equal to 112.5% of the amount that Alice requested. This acts as a security deposit. The network’s encryption holds the deposit safely in view, but untouchable. We call this transaction, ``. + +When Bob completes his side of the bargain in full, or should Alice’s request for a swap time out, Bob will receive `` in return from the network. + +The second transaction Bob makes will be worth 100% of what he and Alice intend to actually trade. The second transaction does yet take place, however, but waits for Alice to continue with her part. + +Note that Bob must hold liquidity of 212.5% of the total amount of the currency that he and Alice intend to trade. + +#### Alice and Bob Are Committed + +Assuming Alice and Bob are successfully connected, the process from this point forward becomes quite simple: + +A summary of the procedure, starting from the beginning. + +1. Alice requests a swap and sends the `` to the AtomicDEX full-relay nodes. + + - The full-relay nodes receive her request and publish it to the network + +2. Bob sees the request on the network, accepts it, and sends out `` + + - `` enters a state of limbo on the AtomicDEX network, held safely by encryption, awaiting either Alice to proceed, or for the swap to time out + + - If the latter occurs, `` is automatically refunded to Bob via the AtomicDEX protocol + +3. Alice now sends her `` to Bob + + - She does not send the payment to Bob directly, but rather into a temporary holding wallet on the AtomicDEX exchange + + - Only Bob has access to this wallet, via the set of private keys that only he owns + + - However, the AtomicDEX code does not yet allow Bob to unlock this temporary holding wallet; he must continue his end of the bargain first + + - The `` will remain in Bob’s temporary holding wallet for a limited amount of time, giving him the opportunity to proceed + +4. Bob now sends his `` to Alice + + - Again, this is not sent to Alice directly, but rather into yet another temporary holding wallet + + - Likewise, only Alice has access to the necessary private keys for this wallet + + - The `` will automatically be refunded if she does not complete her part of the process + +5. Alice now "spends" the `` + + - By the word "spends," we simply mean that she activates her private keys and moves all the funds to another wallet—most likely to her own personal address + + - AtomicDEX registers that Alice’s temporary holding wallet successfully "spent" the funds + +6. Bob "spends" the `` + + - Likewise, Bob simply moves the entirety of the `` into a wallet of his own—again, it will most typically be his own address + + - AtomicDEX now knows that Bob also successfully received his money + +7. Seeing both temporary holding wallets now empty, the AtomicDEX protocol recognizes that the atomic swap was a complete success. + + - AtomicDEX now refunds `` back to Bob and the process is complete + +While it may seem inefficient to have seven transactions for a swap that could be done with two, the complexity of this process provides us with the requisite "trustless-ness" to maintain user safety. + +### Incentives and Disincentives to Maintain Good Behavior + +As we will now explain, at every step along the way there are incentives for each side to proceed, and there are various financial protections in place should one side fail. + +Also, because payments are sent to these "temporary holding wallets" that exist within the AtomicDEX protocol, the protocol itself can assist in the process of moving money at the appropriate steps. + +Let us now examine what is happening after each step. + +#### 1 - Alice Sends `` + +If Bob accepts the offer to trade, but does not send ``, Alice only stands to lose her ``. This is only 1/777th of the entire transaction amount, so she loses very little. + +Bob, on the other hand, stands to lose more. Since Bob did not follow through with his end of the bargain, the AtomicDEX network indicates on his public AtomicDEX trading profile that he failed in a commitment, thus decreasing his profile’s reputation. If Bob continues this behavior as a habit, he may find it difficult to discover trading partners. + +So long as the frequency of "Bobs" failing is low, the occasional extra `` paid by an Alice is a minor issue. However, if there is a sudden spike in misbehavior, the AtomicDEX code has in-built contingency plans which can provide refunds to Alice(s). + +#### 2 - Bob Successfully Sends `` + +If Alice does not follow with her next step, the ``, then Alice loses not only the ``, but she also receives a mark on her public AtomicDEX profile. She gains nothing, and Bob has no reason to fear as `` will automatically return to him via the AtomicDEX protocol. + +#### 3 - Alice Successfully Sends `` + +If Bob does not proceed with his next step, the ``, then after 4 hours Alice can simply activate an AtomicDEX protocol that will allow her to claim ``. + +Recall that `` is 112.5% of the original intended trade; Bob has every incentive therefore to continue with his end of the bargain, and Alice has nothing to fear should Bob fail. She even stands to gain a 12.5% bonus, at Bob’s expense. + +#### 4 - Bob Sends `` + +Now, if Alice does not follow by claiming the ``, then after 2 hours Bob can activate an AtomicDEX protocol that allows him to reclaim his ``. Furthermore, four hours later Bob may activate a refund of ``. + +For Alice, the AtomicDEX protocol allows Alice to reclaim her `` after Bob reclaims both of his payments. + +At this integral stage of the process, every step of the path is intricately interconnected and maintains various levels of protection. + +#### 5 - Alice Spends `` + +At this point, Alice is entirely through with any risk to her reputation, her `` payment, or of the loss of her time. + +If Bob does not follow by also "spending" the ``, it is of no concern to Alice because she has already received her funds. If Bob is simply sleeping and forgets to spend the ``, he can only hurt himself. + +Naturally, for Bob this is slightly dangerous. Bob’s best course of action is to remain alert and spend the `` once it is received. + +If after four hours, Bob is still sleeping, Alice can still activate the protocol that allows her to claim ``. In this scenario, she receives both the `` and ``, at only the costs of the `` and ``. + +Bob can still make a later claim for the `` when he regains his awareness. + +#### 6 - Bob Spends `` + +Assuming all has gone according to plan, and having spent the ``, Bob may now reclaim ``. Just as before, if Bob does not refund his own deposit, it is his loss; in four hours Alice will be able to activate a claim on ``. + +#### 7 - Bob Reclaims `` + +The process is complete. Alice received the ``. Bob received the ``. Bob has `` back in his own possession. The entire process only cost Alice the original ``. + +At each step along the way, the side that needs to take the next step is motivated to do so, with greater and greater urgency until the process is complete. + +## Additional Details + +#### Always Manage Risk Appropriately + +Naturally, users must understand that outside forces can disable the process and thereby damage one of the users. For instance, an Internet outage for Bob could be particularly dangerous. Therefore, users are advised only to trade manageable sums that they are willing to put at risk, and only with nodes that have reliable reputations. + +#### The Connection is the True Challenge of an Atomic Swap + +Performing a successful connection between Bob and Alice, and verifying their funds, is the most complex and difficult aspect of creating the AtomicDEX network. + +Myriad factors are involved in a successful attempt for Bob and Alice to connect: human motivation; the experience level of the users; economics; connection technology; user hardware setups; normal variations within Internet connections; etc. + +We emphasize to users here that the process of performing these actions over a peer-to-peer network has almost an artistic element to it. An attempt to successfully connect Bob and Alice can be thought of more like fishing, where we must simply cast and recast our line until we successfully connect with our target. + +If a user attempts a trade and no response returns from the network, the user should slightly adjust the parameters of their offer and try again. As AtomicDEX continues to iterate and improve, and as the number of users increases, we expect any required effort to lessen for users, the network, and the AtomicDEX GUI apps. + +#### The DEX Fee + +People will notice that there is a small `` required as part of the AtomicDEX protocol. This is 1/777 of the transaction amount and it is calibrated to make spam attacks impractical. The 1/777 fee is about equal to 0.1287% of the ``. + +By forcing a would-be attacker to spend real money, attacking the network becomes costly. Without this spam prevention, the AtomicDEX could otherwise be attacked at the protocol level by any person performing a plethora of trade requests. + +It is possible that some atomic swaps can initiate, and then fail to complete, which raises questions about what happens to the `` in this scenario. The `` is the first charge in the protocol; in this sense, there is a `` charged for these failed atomic swaps. + +However, this failure should not be looked upon in isolation. The AtomicDEX protocol is based on statistics. Statistically speaking, there will be some percentage of atomic swaps that start and will not complete. + +Let us suppose a 15% failure rate at this stage of the atomic swap (15% is three times higher than the rate of failure we currently observe in our testing). Even in this scenario, the effective `` cost is still only 0.15% to all Alice-side requests across the entire network. + +If you experience the loss of a `` transaction for an atomic swap that fails to complete, know that this is all part of the statistical process. If you find yourself paying more than 0.15% of your completed trades in fees, please let us know. + +As an organization, when speaking generally to our audience online, we state that the `` is just 0.15%. In this manner, we hope to create the expectation that 0.15% is normal; if the network performs perfectly, on the other hand, users will get a blessing in the form of a lower fee, 0.1287%. + +#### Dealing with Confirmations + +Since AtomicDEX is trading permanently on blockchains — as opposed to updating an internal database of vouchers — both sides of the trading pair need to wait and watch as miners on the respective blockchains calculate transaction confirmations. + +Because the payments that occur on one blockchain will proceed regardless of the actions on the other blockchain — a confirmation failure on one chain will not stop with the other blockchain performing its duties as normal — it is therefore important that the AtomicDEX protocol observe and adjust as necessary. + +Each side of the AtomicDEX protocol (Bob-side and Alice-side) watches and attempts to provide a level of protection for the human users. AtomicDEX achieves this protection by an array of `` API calls, which gives each side the option to specify how many confirmations they expect before the automated process should be satisfied on behalf of the human users’ interests. + +If the users have differing preferences for the total `` they prefer, the AtomicDEX protocol automatically sets the larger of the two preferences as the requirement for both parties. + +Furthermore, this feature also includes a `` value to prevent one side from specifying an unreasonable or malicious number of required confirmations. + +#### Zero Confirmations + +AtomicDEX also supports a high-speed trading mode. Using this feature, a user can activate an extremely fast mode of trading: ``. This initiates a form of atomic-swap trading that does not wait for any confirmations at all. When using this feature, atomic swaps can be completed in as little as three seconds. This is a high-risk endeavor, naturally, and users should exercise extreme caution when implementing it. + +#### AtomicDEX is Entirely Experimental, and Should Be Treated As Such + +We should warn our readers, nevertheless. Every element of the Komodo ecosystem is still considered to be highly experimental. We provide no investment advice, nor any guarantees of any funds utilized on our network. Use our products only at your own risk. + +#### The AtomicDEX API + +We created an API model that is generally the same for all coins. + +For more information, [please turn to the AtomicDEX documentation.](../../../basic-docs/atomicdex/introduction-to-atomicdex.html) + +# Creating and Distributing a New Komodo Smart Chain + +## Abstract + +There lies a great power in the idea that any person, regardless of nationality, creed, or background, can obtain funding to innovate and prosper. An integral tenet of blockchain technology is "decentralization." By decentralizing systems, we reduce the number of control points that can be compromised and manipulated. + +Decentralization plays a more common role in our new cryptocurrency economy, but there is one area of the market that remains centralized and vulnerable: the initial coin offering (ICO). The cryptocurrency industry needs a solution, and Komodo presents an answer with our decentralized initial coin offering (dICO). + +In today’s common ICO model, the high level of centralization creates many problems. Third-parties can block or manipulate entrepreneurs’ efforts to innovate and prosper. The centralized location of releasing the ICO blockchain product is vulnerable, allowing whales, hackers, and human error to corrupt or destroy an entrepreneur’s efforts. The negative experience of users in these situations can also impact the perception and adoption of cryptocurrency. Furthermore, the traceable nature of an ICO prevents society from crowdsourcing and purchasing within our inherent right to barter in private. + +The dICO model, as created by the Komodo project, overcomes these challenges. It provides the necessary technology to create and release a blockchain product to the world with the full power of decentralization. + +Entrepreneurs building on our platform begin by creating a Smart Chain, and our technology simplifies this process. One need only install the necessary software, execute a few commands on a command prompt, and then establish a connection between two or more Komodo-enabled devices. Komodo’s core technology will do the rest of the work necessary to create a fully independent blockchain, empowered with an array of Komodo features. + +Our dPoW technology is a key feature. dPoW provides the necessary security to protect the integrity of the blockchain. Use of dPoW is optional, and since Smart Chains in the Komodo ecosystem are independent by nature, entrepreneurs can discontinue dPoW services at will. + +Having thus created the blockchain, the entrepreneur then uses our software to release the project to the world. Our decentralized exchange, AtomicDEX, is a useful software solution to conduct their decentralized initial coin offering. Because AtomicDEX relies on "atomic swaps," no third-party manipulators can prevent the entrepreneur from their crowdsourcing and innovative endeavors. + +Through [the privacy technology](../../../basic-docs/antara/antara-tutorials/jumblr.html#abstract) available on Komodo Smart Chains, dICO participants can purchase the product within their inherent right to barter in private. + +## The Challenges in Current ICO Platforms + +#### Specific Weaknesses in the Centralized ICO Model + +There are many weaknesses present in today’s Initial Coin Offering (ICO) model. Several notable weaknesses include third-party discrimination, the vulnerability to theft and human error, and a lack of privacy. + +##### Third-Party Discrimination + +An entrepreneur seeking to serve their intended audience may experience adverse intervention from a third party. The antagonists may display personal and malicious intent, regardless of the value of the entrepreneur’s innovation. + +##### Centralization of Technology: Theft and Human Error + +Today’s ICOs are typically conducted in escrow, where the purchasers must transfer money to one location for holding. This typically occurs through a single website, and the cryptocurrency funds are held on a centralized collection of server(s). + +The user must wait while the ICO administrators first verify the transactions and distribute the coins. During this time the funding is centralized, and therefore vulnerable to thieves and human error. + +##### Lack of Privacy + +Because ICO transactions are highly traceable it is difficult, if not impossible, to perform ICOs within our right to barter in private. + +#### Third-Party Discrimination via the Centralized ICO + +One weakness of the ICO process is, paradoxically, rooted in a great strength of blockchain technology: its borderless nature. A key power of any blockchain is that any human capable of accessing the technology can activate the blockchain, regardless of their geographical location or social status. Thus, anyone can provide yet another verifiable record of the transaction history, and this decentralization provides a crucial element of security to the blockchain. + +An ICO innovator, therefore, may prefer to use a blockchain platform that transcends man-made barriers, to protect their innovation. Circumventing man-made barriers could be integral to the blockchain’s survival, because the element of decentralization prevents malicious actors from creating subjective borders around the blockchain records and then using authority to falsify and manipulate. + +This creates a conundrum, however. As a human race, we also find strength and empowerment in subjectively defining our own demographics for various reasons, whether they be to form companies, cultures, communities, etc. + +While we find the ability to create subjective demographics useful, it contrasts with the borderless nature of blockchain technology. Members of one demographic may desire to participate in a specific ICO, but another demographic may find this unfavorable. Therefore, the second party might try to forestall progress. The paradox lies in the fact that for the underlying blockchain product to maintain its integrity, it must serve both communities without regard to any man-made barrier between them. + +The problem compounds even further as we observe that on a decentralized blockchain platform, a new ICO product is capable of functioning anywhere there is access to the underlying technology. On a decentralized platform, once a new blockchain product is released any person from either demographic is now able to utilize it. The sentiment of either demographic is irrelevant. The problem becomes most pronounced if members of a competing group attempt to even maliciously prevent an innovation out of selfish reasons. Thus, it is imperative that the innovator have the option of protection against would-be malicious competitors. + +The overall centralized nature of today’s ICO process, therefore, presents a problem. Entrepreneurs who are not able to navigate the adverse effects of an inhibiting third party may be unable to realize their creative potential. + +#### Centralization of ICO Technology: Hackers and Human Error + +Yet another issue plaguing ICOs is that the technology upon which an ICO is released is also centralized. This presents a vulnerability to human foibles. + +##### Hackers and Human Error + +Because all coins of an ICO typically process through one centralized point during the purchasing period, the entire supply is vulnerable to any person with access to the node. Therefore, both malicious and clumsy human agents can destroy an ICO. The data holding the cryptocurrency can be damaged, stolen, or simply lost through incompetence. + +An entrepreneur can also consider that in today’s ICO model both the funding provided by the purchasers, as well as the actual ICO coins that the entrepreneur intends to sell, remain on the centralized node for a long period of time. It is not just one side of the crowdsourcing endeavor that is at risk, but both. + +This central point of failure can be catastrophic for all participants. + +##### The Right to Barter in Private + +Finally, the lack of current privacy options in the ICO process inhibits blockchain participants from purchasing within our right to barter in private. This right to privately exchange goods and services extends further into history than the written word. We have, as a species, utilized this right to organize into communities, institutions, and even nations. + +Many of humanity’s most meaningful advancements in art, technology, and other human endeavors began in situations where the creator had the security of privacy in which to explore, to discover, to make mistakes, and to learn thereby. + +The right to barter in private, however, is under modern threat as the recent monumental and historical phenomenon, "The Internet of Information," permits many kinds of people to quietly and without inhibition; monitor other people’s shopping and bartering behavior. This is a dangerous development, as it destroys the privacy that empowers much of humanity’s personal growth. We must reserve our right to barter in private, for we observe that there are myriad ways in which a common person may explore personal growth in an economic environment. + +Yet, the highly traceable nature of today’s centralized ICO model is in direct contradiction to this human need. + +#### The Blockchain Industry Needs a Solution, and Komodo Presents an Answer + +Together, these issues show that the current state of the ICO market is plagued with limitations that inhibit freedom, security, entrepreneurship, and even human growth. The cryptocurrency industry needs a solution to these problems, and Komodo presents an answer. + +## The Decentralized Initial Coin Offering + +The Komodo ecosystem presents a solution, the decentralized initial coin offering (dICO), that solves these issues and even adds new possibilities to the cryptocurrency market. + +The decentralized nature of the dICO enables the entrepreneur to release a blockchain product beyond the reach of a malicious third-party influencer. + +Furthermore, through our decentralized exchange, AtomicDEX, the dICO allows an entrepreneur to release their product in a manner that mitigates and even eliminates many of the issues regarding hackers and human error. + +With the advantage of Komodo’s privacy technology, the participants in a dICO are empowered with their right to barter in private. + +## The Process of Creating a New Blockchain in the Komodo Ecosystem + +Formerly, coding and generating the blockchain itself were a most difficult aspect of the development process. Now, the Komodo team has simplified the process into easy steps. Through Komodo’s Iguana Core technology (introduced in Part I), the entrepreneur can create a new independent blockchain by entering just two simple commands in the command prompt of their computer. + +The following steps rely on one of Komodo’s underlying software processes that run in the background on a user’s computer. The name of this software is the "Komodo daemon," or `komodod`, for short. `komodod` is rooted in Iguana Core technology. + +#### The First Command to Create a New Coin + +```bash +./komodod -ac_name=[ENTREPRENEUR'S COIN] -ac_supply=[TOTAL COIN SUPPLY] -gen +``` + +The first part of the command, `./komodod`, initiates a new instance of Komodod. + +By default, the initial `./komodod` command executed alone would launch the Komodo main chain, KMD, on the user’s computer. However, the next part of the command tells komodod to behave differently. + +```bash +-ac_name=[ENTREPRENEUR'S COIN] +``` + +This command tells komodod to look for a coin with the inserted name. + +```bash +-ac_supply=[TOTAL COIN SUPPLY] +``` + +This tells komodod how many total coins there should be in this chain. + +```bash +-gen +``` + +This tells komodod that the user desires to mine this network. + +The underlying code of Iguana Core can now make several decisions. First, it will check its connection to the Komodo ecosystem to see if there is a coin with the given name and supply. If no similar coin is found, komodod will assume that the user is attempting to create a new coin, and the `-gen` command tells komodod that the user wants to mine it. + +Komodod now begins the automated process of creating a new Smart Chain in the Komodo ecosystem. Komodod will first make a fresh and empty clone of the KMD main chain (though it will not yet generate the actual coins), with only a few differences to the underlying nature of the chain. + +#### The Features of the New Smart Chain + +There are several primary differences between a Smart Chain and the main Komodo chain. For example, the Smart Chain will not automatically generate 5.1% rewards for all wallet addresses holding coins, unlike the main chain. Furthermore, the Smart Chain’s dPoW consensus mechanism is built to notarize to the KMD main chain. + +Some of the differences reveal strong advantages held by members of the Komodo ecosystem. By design, this Smart Chain is capable of automatically adopting any updates that the Komodo core development team add to the framework. The Smart Chain also has a built-in capacity within the framework to allow the entrepreneur to code new rules. + +For example, the entrepreneur may decide not to use a PoW consensus mechanism, but may instead prefer PoS. Other changes can also be made, according to the entrepreneur’s imagination and developer knowledge. So long as the new code that the entrepreneur adds to the Smart Chain does not interfere with the overall framework, the Smart Chain will smoothly integrate with the rest of the Komodo ecosystem. + +For the purposes of our discussion, this new Smart Chain is otherwise the same as the Komodo main chain, including the features to communicate natively with other blockchains via AtomicDEX. The reader may note that this new Komodo Smart Chain is not a colored-token running on top of a parent blockchain, as is often the case in other blockchain ecosystems (consider the ERC20 token of the Ethereum platform). Instead, this Smart Chain is an entirely unique and independent blockchain unto itself. + +This empowers the entrepreneur with significant advantages over other blockchain ecosystems. The Smart Chain can run on its own nodes, act according to whatever rules the entrepreneur can imagine, and can scale according to its own audience. Should a Smart Chain in the Komodo network experience a sudden explosion of activity, the sudden change will not negatively impact the overall Komodo ecosystem. This independence grants a significant competitive advantage in the form of overall security, speed, and ease of use. + +Consider the advantage of developing an entrepreneurial product as a fully independent blockchain. Should the entrepreneur desire at a future point to leave the Komodo ecosystem for any reason, they are free to take their blockchain product with them. + +#### Generating and Mining the New Coins + +Let us return now to the moment after the entrepreneur executes the first command in the command prompt, and Komodod creates a fresh and empty clone of the Komodo main chain. While the instance of the Komodod program (running on the entrepreneur’s local computer device) will create the necessary code for the new Smart Chain, Komodod will not yet generate the coin supply itself. Komodod instead will wait for the next few steps to occur. + +The reason for the wait is that a blockchain’s essence depends upon existing not in isolation, but in a network of multiple devices. This is the nature of decentralization. Komodod will wait until it receives a signal from another device, thus indicating that it has a peer with which to form the Smart Chain network. + +##### The Entire Coin Supply is Distributed in the Genesis Block + +Typically, the entire coin supply for the dICO is created and distributed immediately to the device that mines the first block, the Genesis Block. The code performs this distribution as a one-time reward for discovering the first valid block hash. + +Having established a secure connection with a second device, the entrepreneur will enter the following command on the second device. + +```bash +./komodod -ac_name=[ENTREPRENUER'S COIN] -ac_supply=[TOTAL COIN SUPPLY] -addnode=[INSERT IP ADDRESS OF FIRST DEVICE] +``` + +Note that the first three elements of the command, `./komodod`, `-ac_name`, and `-ac_supply`, are the same. It is important that the parameters inserted into these commands match exactly. Otherwise, the instances of Komodod running on the separate devices will ignore each other, and the coin will not be mined. + +::: tip Note + +In the second VPS, the -gen command is not present. In this circumstance, we are assuming that the entrepreneur wants to capture the entire coin supply on the first device. Technically speaking, assuming the entrepreneur has ownership over both devices, it does not matter if both devices initiate the -gen command. Both devices will attempt to mine the first block and the superior device will receive the coin supply. + +::: + +There is another key difference in the command. + +```bash +-addnode=[INSERT IP ADDRESS OF FIRST DEVICE] +``` + +With the execution of the IP address command, the second device knows to look across the available connection (the Internet, VPS service, etc.) for the first device, which is already running an instance of Komodod and the new coin. The command here simply tells the computer the proper IP address of the first device. + +As soon as these two devices connect, having all the proper Komodod software running and set in place, the mining begins. One of the devices will mine the first block and instantly receive the total coin supply of the entire blockchain into the user’s chosen wallet. + +Both devices sync this information to each other, and the `ENTREPRENEUR’S COIN` now exists in the world. The entrepreneur can also add more and more devices to the network. + +#### Notarizing to the Komodo Main Chain + +To receive the security of the dPoW consensus mechanism, the entrepreneur simply needs to have the elected notary nodes add the `ENTREPENEUR’S COIN` to their internal list of coins to notarize. This will empower the entrepreneur’s product with the same verifiable and decentralized security of the Komodo parent chain. + +The process of adding a new notarization service can be executed by the notary nodes with just a simple command. While we are at this early stage of development, this sign-up process for new dICO products is not yet automated. In the future, we intend to automate as much of this process as possible. + +There is a fee for receiving notarization services. This helps to cover the business costs associated with notarization (recall that all notarizations are financial transactions, by nature). + +Entrepreneurs are thus able to use the Smart Chain’s native dPoW consensus mechanism to notarize to the Komodo main chain to create a secure backup of the coin’s history. Even in the event of an attack at this early state of existence the entrepreneur can rest assured that their product will survive, so long as one copy of the blockchain’s history exists. + +Everything is set on the backend for the entrepreneur, and they are now fully prepared to begin the dICO process. Naturally, we understand that for many potential entrepreneurs in the Komodo ecosystem, this process is unfamiliar territory. We encourage interested entrepreneurs to reach out to our team for guidance during development. + +## The Distribution of Coins + +#### The Trials and Travails of the Centralized ICO Method + +Previously, the entrepreneur at this point would have been required to go through a centralized ICO process. + +This could have required several cumbersome and possibly dangerous steps. For example, the entrepreneur would begin gathering cryptocurrencies from their audience to personally hold in escrow while the process of matching purchases to the new blockchain coin were verified. + +To distribute these coins, the entrepreneur had two primary options. They could have created and distributed a digital software wallet capable of holding the entrepreneur’s coins. This would require their audience to download the software. The entrepreneur would then have to send all the appropriate coins to each wallet address, according to the process they established during their ICO. + +Or, the entrepreneur would have to make formal arrangements with another service to manage this process, such as with a centralized exchange. This would require a successful negotiation with this third party, likely paying fees as a part of the agreement. + +The entrepreneur would then be required to act within the centralized exchange’s arbitrary framework. + +The centralized ICO process can be arduous and, at times, disastrous. + +#### Enter the dICO + +##### Powered by Komodo’s AtomicDEX & Privacy Technology + +The Komodo dICO model is an extension of Komodo’s AtomicDEX technology. AtomicDEX is an atomic-swap powered, decentralized exchange. It enables users to directly exchange cryptocurrencies from one person to another without third-party involvement (i.e. no centralized exchanges, escrow services, vouchers, etc.). Furthermore, as the dICO model is entirely decentralized, anyone can use it at will. There are no centralized authority figures capable of creating artificial control points that can be manipulated at the expense of the users + +To begin the distribution process, the entrepreneur first chooses how many nodes they would like to use for the distribution. Nodes can be any type of machine capable of connecting to AtomicDEX. Typically, a small-business entrepreneur may choose to use server machines. Server capacity can be rented online, and the servers can be distributed geographically throughout the world, if desired. + +While renting a multiplicity of servers may be the method of choice for an established small-business, it is not a requirement. An owner of an even smaller business, operating on a low budget, can simply use their own computer(s), geographically stationed nearby for convenience. On the other hand, a large corporation could use the server capacity they already own. The number and strength of the machines is a choice made by the entrepreneur. + +Having decided the method of distribution, the entrepreneur will then prepare the total supply of coins. (We are assuming the coins are still located on the first device that mined the entrepreneur’s Genesis Block.) The entrepreneur will first break down the total collection of coins into smaller digital pouches. These small bags of coins are ultimately what will be traded on AtomicDEX with their audience. + +The size of the bags is chosen by the entrepreneur, and therefore the entrepreneur can choose a size that is agreeable to their outlook on any KYC legal requirements. + +Having created these bags of coins, the entrepreneur then sends them to all chosen nodes throughout the AtomicDEX network. Coins are distributed to each node’s wallet(s) by a normal transaction. With the coins distributed as desired, the entrepreneur sets the time and date when each bag of coins will be available for purchase. When a bag of coins becomes available on AtomicDEX for trading, members of the Komodo ecosystem simply purchase the coins. + +##### The Many Solutions of the dICO Model: Security, Privacy, Decentralization, and Freedom + +This method of conducting a decentralized initial coin offering mitigates and circumvents the issues found in a centralized ICO. The entire process is conducted in a decentralized manner. The dICO entrepreneur has direct access to their audience, as there are no centralized human authorities acting as middlemen. + +Concerning theft, the dICO provides solutions to both methods of theft in the centralized ICO. Unlike the centralized ICO, once the distribution of the bags takes place the effect of their distribution adds a layer of security from a would-be hacker. The hacker can only steal funds at the node they manage to penetrate. Were the hacker to steal coins before the actual dICO, the entrepreneur would have the option to simply create a `NEW ENTREPRENEUR’S COIN` again, without losing any personal wealth. + +Furthermore, since the trades happen instantaneously with each bag available for sale, the entrepreneur is only in possession of either their own `ENTREPRENEUR’S COIN`, or the cryptocurrency funds provided by the dICO participants—but not both. The entrepreneur is never at risk of losing both their own funds and the funds of their audience, which is a strong advantage over today’s ICO model. + +Regarding human error, should one of the node’s databases be corrupted by accident or hardware failure, only one node’s coin supply is lost. + +Since the coins are immediately available on the AtomicDEX exchange for trading, the entrepreneur’s audience has an immediate trading market. This stands in contrast to today’s ICO model, where users often wait weeks or even months before liquidity for their ICO product arises in a centralized exchange. + +Finally, through Komodo's [inherent zero-knowledge technology](), participants have the option of privacy when purchasing the dICO product. This enables them to support the crowdsourcing efforts of the entrepreneur within their inherent right to barter in private. + +Upon conclusion of the distribution of the dICO coin supply the entrepreneur has successfully and immediately completed all the crowdsourcing-related steps that could have taken months in today’s typical ICO model. + +Komodo’s dICO model is significantly easier, freer from manipulation, more flexible, and more secure. + +# Delayed Proof of Work + +## A Foundational Discussion of Blockchain Security + +Komodo’s form of providing security is called Delayed Proof of Work technology (dPoW). It builds on the most advanced form of blockchain security in existence, Proof of Work technology (PoW). The latter form of security is the method that the Bitcoin network utilizes. + +To understand the value of Komodo’s dPoW security, we must first explain how PoW works and why it is the most secure method of maintaining a decentralized blockchain. We must also examine PoW’s shortcomings, so that we may understand the need for Komodo’s dPoW method and the advantages it provides to the blockchain community. + +To understand how PoW technology functions, we begin by explaining the roots that make the Bitcoin protocol a viable means of securely transferring value. + +## What Is A Consensus Mechanism? + +#### The "Double Spend" Problem + +The creation of blockchain technology stems from the early mathematical studies of encryption using computer technology. + +One such example is related to the information-encoding device, "Enigma," invented by the Germans at the end of World War I. Alan Turing, a British Intelligence agent, famously beat the Enigma device by inventing the world’s first "digital computer." This provided enough computing power to break [Enigma’s](https://en.wikipedia.org/wiki/Enigma_machine) encryption and discover German secret communications. + +This early affair with encryption set off a race throughout the world to develop myriad forms of securely transferring information from one party to another via computer technology. While each new form of computer encryption provided more advantages, there remained one problem that prevented encryption from being useful as a means of transferring not just information, but also financial value. + +This challenge is known as the "Double Spend" problem. The issue lies in the ability of computers to endlessly duplicate information. In the case of financial value, there are three important things to record: who owns a specific value; the time at which the person owns this value; the wallet address in which the value resides. When transferring financial value from one person to another, it is essential that if Person A sends money to Person B, Person A should not be able to duplicate the same money and send it again to Person C. + +The [Bitcoin protocol](https://en.wikipedia.org/wiki/Bitcoin_network), invented by an anonymous person (or persons) claiming the name of Satoshi Nakamoto, solved the Double Spend problem. The underlying math and computer code is both highly complex and innovative. For the purposes of this paper we need only focus on the one aspect of the Bitcoin protocol that solves the Double Spend problem: the consensus mechanism. + +#### The Consensus Mechanism Provides Security Against a "Double Spend" + +The consensus mechanism created by Nakamoto is perhaps one of the most powerful innovations of the twenty-first century. His invention allows individual devices to work together, using high levels of encryption, to securely and accurately track ownership of digital value (be it financial resources, digital real estate, etc.). It performs this in a manner that does not allow anyone on the same network (i.e. the Internet) to spend the same value twice. + +Let us suppose a user, Alice, indicates in her digital wallet that she wants to send cryptocurrency money to a friend. Alice’s computer now gathers several pieces of information, including any necessary permissions and passwords, the amount that Alice wants to spend, and the receiving address of her friend’s wallet. All this information is gathered into a packet of data, called a "transaction," and Alice’s device sends the transaction to the Internet. + +There are several types of devices that will interact with Alice’s transaction on the Internet. These devices will share the transaction information with other devices supporting the cryptocurrency network. For this discussion, we need only focus on one type of device: a cryptocurrency miner. + +::: tip Note + +The following descriptions are simplified explanations of a truly complex process. There are many other strategies cryptocurrency miners devise to out-mine their competition, and those strategies can vary widely. + +::: + +#### A Miner Competes to Add Blocks to the Network’s History, in Exchange for a Reward + +##### Step One: Preparing the Preliminary Information + +This device is performing an activity called cryptocurrency "mining." Let us focus now on a mining device that captures Alice’s raw transaction data. This device is owned by a tech-savvy miner, named Bob, who wants to add Alice’s transaction to the permanent history of the Bitcoin network. + +If Bob is the first person to properly process Alice’s transaction he will receive a financial reward. One key part of this reward is a percentage-based fee, taken from Alice’s total transaction amount. + +##### The Mempool is the Collection of All Raw Transactions Waiting to be Processed + +Furthermore, Bob does not have just one transaction alone to mine. Rather, he has an entire pool of raw transactions, created by many people across the Internet. The raw data for each of these transactions sits in the local memory bank of each miner’s mining device, awaiting the miner’s commands. Miners call this pool of transactions, the "mempool." Most miners have automated systems to determine the transaction-selection process, based on estimated profit. + +##### Creating Transaction Hashes + +After Bob makes his choices about which transactions he will attempt to mine (and we assume that he includes Alice’s transaction), Bob’s mining device then begins a series of calculations. + +His device will first take each individual transaction’s raw data and use mathematical formulas to compress the transaction into a smaller, more manageable form. This new form is called a "transaction hash." For instance, Alice’s transaction hash could look like this: + +```bash +b1fea52486ce0c62bb442b530a3f0132b826c74e473d1f2c220bfa78111c5082 +``` + +Bob will prepare potentially hundreds of transaction hashes before proceeding to the next step. One important thing to understand about the compression of data in the Bitcoin protocol, including the transaction hash above, is that calculations herein obey a principle called, The Cascade Effect. + +##### The Cascade Effect: Changing One Bit of Data Changes the Entire Result + +The Cascade Effect simply means that were Bob to attempt to change even the smallest bit in the raw data—whether from a desire to cheat, or by mistake, or for any other reason—the entire transaction hash would dramatically change. In this way, the mathematical formulas in the Bitcoin protocol ensure that Bob cannot create an improper history. + +Were Bob to attempt to create an incorrect transaction hash, other miners on the network could use the raw transaction data from Alice, perform the proper mathematical formulas in the Bitcoin protocol, and immediately discover that Bob’s hashes are incorrect. Thus, all the devices on the network would reject Bob’s incorrect attempts and prevent him from claiming rewards. + +##### Step One Continued: Finishing the Preliminary Calculations + +Now, using more mathematical formulas, Bob takes the transaction hashes he is attempting to process and compresses them into a new manageable piece of data. + +This is called, "the merkle root." It represents all the transactions that Bob hopes to process, and from which he hopes to gain a reward. Bob’s merkle root could look like this: + +```bash +7dac2c5666815c17a3b36427de37bb9d2e2c5ccec3f8633eb91a4205cb4c10ff +``` + +Finally, Bob will gather information provided from the last miner that successfully added to the permanent blockchain history. This information is called, "the block header." It contains a large amount of complex data, and we won’t go into all the details. The one important element to note is that the block header gives Bob clues about how to properly add the next piece of information to the permanent Bitcoin history. One of these hints could look like this: + +```bash +"difficulty" : 1.00000000 +``` + +We will return to this clue further on. + +Having all this information, Bob is nearly prepared. His next step is where the real challenge begins. + +##### Step Two: The Race to Finish First + +Bob’s computer is going to gather all the above information and collect it into a set of data called a "block." Mining this block and adding it to the list of blocks that came before is the process of creating a "chain" of blocks—hence the industry title, "blockchain." + +However, adding blocks to the blockchain is not so easy. While Bob may have everything up to this point correctly prepared, the Bitcoin protocol does not yet give Bob the right to add his proposed block to the chain. + +The consensus mechanism is designed to force the miners to compete for this right. By requiring the miners to work for the right to mine a new valid block, competition spreads across the network. This provides many benefits, including time for the trans- actions of users (like Alice) to disseminate around the world, thus providing a level of decentralization to the network. + +Therefore, although Bob would prefer to immediately create a new valid block and collect his reward, he cannot. He must win the competition by performing the proper work first. This is the source of the title of the Bitcoin-protocol consensus mechanism, "Proof of Work" (PoW). + +The competition that Bob must win is to be the first person to find an answer to a simple mathematical puzzle, designed by Satoshi Nakamoto. To solve the puzzle, Bob guesses at random numbers until he discovers a correct number. The correct number is determined by the internal complex formulas of the consensus mechanism and cannot be discovered by any means other than guessing. Bitcoin miners call this number a "nonce," which is short for "a ‘number’ you use ‘once.’" + +Bob’s mining device will make random guesses at the nonce, one after another, until a correct nonce is found. With each attempt, Bob will first insert the proposed nonce into the rest of his block. To find out if his guess is correct, he will next use mathematical formulas (like those he used earlier) to compress his attempt into a "block hash." A block hash is a small and manageable form of data that represents the entire history of the Bitcoin blockchain and all the information in Bob’s proposed block. A block hash can look like this: + +```bash +000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f +``` + +Recall now The Cascade Effect, and how it states that changing one small number in the data before performing the mathematical computations creates a vastly different outcome. Since Bob is continually including new guesses at the nonce with each computation of a block hash, each block-hash attempt will produce a widely different sequence of numbers. Miners on the Bitcoin network know when a miner, such as Bob, solves the puzzle; by observing the clues that were provided earlier. Recall that the last time a miner successfully added data to the blockchain, they provided these clues in their block header. One of the clues from the previous block header can look like this: + +```bash +"difficulty" : 1.00000000 +``` + +This detail, "difficulty," simply tells miners how many zeros should be at the front of the next valid block hash. When the difficulty setting is the level displayed above, it tells miners that there should be exactly ten zeros. Observe Bob’s attempted block hash once again, which he created after making a guess at a nonce, adding this proposed nonce into his block, and performing the mathematical formulas: + +```bash +000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f +``` + +The block hash above has ten zeros at the beginning, which matches the number of zeros in the difficulty level. Therefore, the hash that Bob proposed is correct. This must mean that he guessed a correct nonce. All the miners on the network can prove for themselves that Bob was correct by taking all the same information from their mempools, adding Bob’s nonce, and performing the mathematical calculations. They will receive the same result, and therefore Bob is the winner of this round. + +On the other hand, due to the Cascade Effect, if Bob’s attempted nonce had produced a block hash with the incorrect number of zeros at the front, his block hash would be invalid. The network would not afford him the right to add an incorrect block hash to the network, and all the miners would continue searching. + +##### Step Three: Bob Finds the Nonce + +Once a miner discovers a nonce that produces a valid block hash, the miner has "found a new block," and can send the signal across the Internet. The consensus mechanism running on every other mining device can verify for themselves the calculations. Once verified, the consensus mechanism grants the miner the right both to add the proposed block to the blockchain, and to receive the reward. + +Let us return to Bob’s machine, having just guessed a correct nonce, and thus holding a valid block hash. Bob’s machine instantly sends out the winning information across the Internet, and Bob collects his reward from the Bitcoin network. All the other miners must readjust. Earlier, they were searching for the correct nonce based off the information from the previous block header. However, Bob’s new valid block includes a new block header. All the other miners on the network abandon their current work, adopt Bob’s new block header, make many recalculations in their underlying data, and begin their search for the next nonce. + +There is no sympathy in the Bitcoin protocol for any miner’s wasted efforts. Suppose another machine on the network was also trying to mine Alice’s transaction, and lost to Bob in the race. Only Bob earns the reward from Alice’s transaction, and the other miner receives nothing in return for their costs and time. + +For Alice, this process seems simple. She first indicated the wallet address of her friend and sent cryptocurrency. After a certain amount of time, her friend received the money. Alice can ignore the byzantine process of the miners that occurred between these two events. Alice may not realize it, but the PoW consensus mechanism provides the foundation of security upon which she relies. + +## The Dominance of the Proof-of-Work Consensus Mechanism + +#### Proof of Work (PoW) Fosters Ever Increasing Security + +There are several reasons why PoW networks, especially Bitcoin, continue to dominate in terms of security and blockchain success. + +A simple, preliminary reason is that PoW networks foster ever-increasing speed and computer power. Miners must constantly update and innovate above their competitors to continue earning rewards. + +##### Speed and Power are of the Essence + +Among miners, having a faster and more powerful computer can mean earning rewards more frequently. For miners seeking to maximize profit, competition requires constant upgrades to machinery and to a miner’s customized underlying code. + +The frequency at which a device can create proposed block hashes is called "hash power." The more hash power a collective PoW network has across all miners mining the blockchain, the more secure the network. This competitive pressure provides one important advantage in security to PoW networks, when compared to alternate consensus mechanisms. + +##### The Network Effect: Bitcoin’s Ability to Dominate Begins + +A high level of security fosters a sense of trust among users, and this can grow a PoW network’s audience. As the audience grows, both the number of transactions and the price of the coin increase. This attracts more miners. The rising level of miners provides greater overall hash rate to the network, which in turn fosters a stronger sense of trust. This increased sense of security can raise the number of users on the network, which can increase the number of miners, and the cycle repeats. + +In economics, this is classified as a "Network Effect," where a cycle of behavior encourages more of the same behavior, with compounding interest. Due to the Network Effect, and the fact that Bitcoin is the oldest PoW network, Bitcoin is increasing its security at a rate faster than the rate of other PoW networks. + +Furthermore, consider the effect caused when the price of a PoW-blockchain coin rises. Before the rise, assume the blockchain coin is worth one dollar. A miner is justified in spending the necessary money (on equipment, upgrades, and electrical costs, etc.) to justify one dollar’s worth of hash rate. If the price shifts upwards to two dollars, the miner must upgrade their entire business to justify two dollars’ worth of a matching hash rate. If the miner does not upgrade, their competitor will, and then the miner will no longer be able to compete for rewards. + +#### The Longest Chain Rule: The True "Secret Sauce" of Pow Domination + +There are many more reasons why PoW networks continue to dominate in security. Yet, for our discussion, there is one element that rises above all others. It is called, "The Longest Chain Rule," and some blockchain developers may argue that it is "the secret sauce" that fuels PoW’s strength. + +The Longest Chain Rule is the determining factor whenever two competing versions of the blockchain history arise on the network. The rule simply states that whichever of the two versions grows longer first, wins. The other version is overwritten, and therefore all transactions and rewards on that version are erased. The simplicity of this rule is a key to understanding why PoW consensus mechanisms continue to outperform their competition. + +##### The Simple Effects of The Longest Chain Rule + +On a surface level, this rule prevents a double spend by a network user. For instance, consider a husband and wife accidentally attempting to spend the same money at the exact same time, while each person is traveling in a different part of the world. + +::: tip Note + +For the sake of the discussion, we are oversimplifying the following actions so that they take place within only a few milliseconds. We also oversimplify the technical details, for clarity. The full explanation of this process is provided in the [Bitcoin wiki](https://en.bitcoin.it/wiki/Main_Page), for those who would like to gain a deeper understanding. + +::: + +##### A Tale of Two Blockchains + +Let us suppose that the husband is in Asia and the wife is in the Americas. Both are purchasing a car. The husband uses all the funds from the family Bitcoin wallet to purchase a car at precisely 8:00 PM (UTC). The wife makes her purchase at the exact same moment, for a similar amount. + +After making his purchase, the husband’s transaction hash is immediately sent to a mining device in China, where it is held in the miner’s local mempool (recall that a mempool is a collection of all raw transaction data across the network). + +Let us suppose that the husband’s transaction arrives in the Chinese miner’s mempool at the exact moment that the Chinese mining equipment finds a correct nonce and a valid block hash. The Chinese miner declares the winning information, mines a new block, and collects a reward. All the miners in his local (Asian) vicinity (who receive the winning information faster than in the Americas, due to proximity) complete the block verification process, increase the length of the blockchain, and begin searching for the next valid block hash. + +On the opposite side of the world, essentially the exact same actions happen. The wife’s transaction is sent to the nearest miner, this time located in Washington state of the United States. Just as the transaction enters the Washington state miner’s mempool, the miner discovers a valid block hash. He sends out the signal, mines a new block, and also collects the reward (this is the same reward that the Chinese miner is attempting to claim). All the miners in the local (US) vicinity verify the information immediately and begin searching for a new valid block hash based on the Washington state miner’s recent block. + +##### An Internal Conflict of Interest Arises Within the Bitcoin Network + +Note the paradox here. There are now two versions of the Bitcoin history that are valid, yet different. + +These two versions make their way across the Internet, around the world, each to the other side. When the competing messages arrive, the Bitcoin protocol sees that there is a conflict: the same money was spent twice. + +Consider how on each side of the world the miners are spending their financial and temporal resources to further their own interests. There is no economic incentive for either side to submit to the other, by nature. Therefore, there is a conflict of interest within the Bitcoin network itself. The Bitcoin network would swiftly fail, were it not for The Longest Chain Rule. + +##### The Longest Chain Rule: The History Which is Longer First, Wins + +The Longest Chain Rule simply declares that whichever of the two competing blockchains grows longer first, wins. The consensus mechanism erases the other version. + +Let us suppose that the Chinese mining equipment is superior in this instance, and the Chinese miner manages to discover the next valid block hash and send out the signal before the Washington state miner can do likewise. Across the world, the moment the information arrives that the Chinese miner completed yet another valid block, the Bitcoin protocol erases the Washington state miner’s version of the Bitcoin history. + +There is no sympathy for any wasted efforts, nor for any misunderstandings between the wife and her car dealer. The Bitcoin protocol’s consensus mechanism simply presses forward. The Washington state miner’s rewards disappear, as though they never occurred. The wife’s purchase of a car likewise evaporates. + +_(Typically, a normal and prepared car dealer utilizing cryptocurrency would not consider a customer’s transactions acceptable until several new blocks were added to the blockchain. In this manner,cryptocurrency users can ensure that a transaction is beyond contestation before the customer can, for example, drive a new car off the lot.)_ + +The Washington state miner gets a raw deal in this scenario, but the network benefits as a whole. The Longest Chain Rule provides the necessary security to prevent a Double Spend. The network accurately recorded one family member’s purchase of a car, prevented the mistaken double spend, and ensured that the most competitive miner received a just reward. + +This example illuminates the importance of The Longest Chain Rule. However, there is a dark side to this rule for the unsuspecting and unprepared blockchain developer. + +## The 51% Attack + +Here’s where intrigue enters the picture. The "easiest" way to steal money on a PoW blockchain (such as Bitcoin) is to perform a 51% Attack. + +In this attack, the malicious actor first spends cryptocurrency in exchange for something of value, which they take from their victim. Next, the malicious actor creates an alternate version of the PoW network’s history wherein those transactions never took place. Using advanced mining equipment, the malicious actor then "attacks" the PoW network by mining blocks to this "false" history faster than the rate at which other miners on the PoW network can mine blocks to the "true" history. + +Assuming the malicious actor has a sufficient hash rate, as this "false" history grows longer than the "true" history, the Longest Chain Rule will cause the consensus mechanism to overwrite the "true" version. The earlier transactions the malicious actor made would be as though they never occurred. Therefore, the malicious actor would keep both their original funds and whatever item of value they exacted from their victim. + +This is known as the 51% Attack. The number 51% derives from the fact that to successfully perform this attack, the attacker must add enough hashing power to the overall PoW network to form a majority of the hash rate. + +##### Size is Yet Another Reason Behind Bitcoin’s Current Success Among PoW Networks + +Today, Bitcoin’s overall hash rate is enormous. The collective of computers around the world mining Bitcoin is effectively the largest supercomputer ever created by man. As of the writing of this paper, some estimate that [the Bitcoin network consumes more electricity than the entire country of Denmark](https://arstechnica.com/tech-policy/2017/12/bitcoins-insane-energy-consumption-explained/), and the number of miners continues to grow. + +Therefore, to attempt a 51% Attack against the Bitcoin network could cost millions, if not billions of dollars in computer hardware. It would also require a sustained consumption of electricity that is likely unfeasible for a single geographical location, and would be expensive even for a decentralized-hardware network. So long as the miners of Bitcoin remain interested in the Bitcoin network, therefore, Bitcoin has a level of security that is nigh impenetrable. + +_We will return to the proposition of the miners’ ability to choose a different network to mine later in our discussion._ + +## The Genesis Attack + +##### A Genesis Attack on the Bitcoin Network + +Recall that according to the original version of the Bitcoin protocol, sometimes called the ["vanilla" version,](https://www.worldcryptoindex.com/bitcoin-scaling-problem-explained/) the Longest Chain Rule only requires that the blocks in the longest chain all be properly mined. Furthermore, recall that computers can endlessly duplicate code. + +Finally, note that during our explanation, when describing a malicious actor’s attempt to create an empty, meaningless blockchain history, we use quotation marks when employing the word, "false." Likewise, when describing the blockchain history trusted by the people on the network, we include the word "true" in quotations. + +We do this because at the core level, the consensus mechanism is purposefully blind regarding any human user’s preference between "truth" and "false." The code only sees "truth" in terms of properly mined blocks, and overall blockchain length. Nothing more. + +Now suppose the existence of a supercomputer a thousand times more powerful than the entirety of the Bitcoin-miner network. This supercomputer could, in theory, stealthily re-create and execute the initial code that spawned the very first block of the Bitcoin blockchain—the "Genesis Block." The supercomputer could then grind out block hashes, one-by-one, mining meaningless blocks and adding them to this empty, "false" version of the Bitcoin history. + +Once this meaningless blockchain’s length sufficiently exceed the so-called "true" blockchain used today, the supercomputer could then release its "false" version to the Internet. + +Throughout the world, (assuming the vanilla protocol) the Bitcoin network would automatically recognize the "false" blockchain as the correct blockchain! This would all be according to the code. The so-called "false" blocks would be properly mined, and the length would be longer than the chain that users currently trust. The vanilla protocol would, in theory, replace the so-called "true" history with the empty variant. + +It might seem to users like a virus being uploaded to the Internet. It could destroy all human trust in the current version of the Bitcoin protocol, wreaking financial havoc throughout the cryptocurrency realm. While users of the Bitcoin protocol would naturally protest, the entire operation would be entirely in agreement with the underlying code. + +When observing Bitcoin’s current hash power, the creation of such an anti-Bitcoin supercomputer is clearly not feasible in the immediate future. Assuming Bitcoin miners remain interested in the Bitcoin network, the risk of a Genesis Attack on Bitcoin is essentially non-existent. + +However, consider the implications of the Genesis Attack on unsuspecting or underprepared smaller PoW blockchain projects. + +##### The More Realistic Dangers of The Genesis Attack + +Let us assume a naïve blockchain entrepreneur building a new product. They are generally aware that malicious actors throughout the world are likely to attack their blockchain, stealing funds and otherwise causing trouble. Therefore, the naïve entrepreneur decides to implement what they believe is the most secure method of a blockchain consensus mechanism, PoW, and they offer ample financial rewards to miners to incentivize a secure network. + +The entrepreneur and their entire audience may not realize it, but so long as their network’s overall hash rate remains below the threshold of an attack by even an average supercomputer, their entire blockchain history is vulnerable to complete annihilation. A technically astute competitor, seeing the vulnerability, and possessing ownership of the requisite computer hardware, would be able to create an empty and longer version of the same blockchain code and vaporize their competitor’s financial records. + +The cryptocurrency industry is young, and few but the most advanced of developers understand the many ways in which blockchain competition can be technically eliminated. Therefore, we have seen but a few serious cases of the Genesis Attack. + +One notable instance occurred when an original Bitcoin developer, Luke-jr, used a variation of the attack to destroy a blockchain project called Coiledcoin. Luke-jr performed this attack out of a belief that Coiledcoin was a [disingenuous project.](https://bitcointalk.org/index.php?topic=56675.msg678006#msg678006) Setting aside any human sentiment on either side of the event, the fact stands that Luke-jr’s variation of the Genesis Attack was the end of the Coiledcoin network. + +The complexity in establishing a secure PoW blockchain remains a challenge for would-be entrepreneurs. Furthermore, there are existing PoW developers that are not fully aware of their vulnerability. Likewise, there are would-be malicious actors that have yet to realize the many methods available to cause frustration. The potential danger surrounding the issue of the Genesis Attack shows the relative youthfulness of the cryptocurrency industry. + +For a PoW blockchain network to maintain Bitcoin-level security, therefore, it must maintain a hash rate that is high enough to constantly mine blocks faster than a potential competitor could either perform the 51% Attack (destroying the most recent of transactions), or the deadly Genesis Attack (complete annihilation). + +## The Financial and Eco-Unfriendly Problems With All PoW Networks + +The problems with young PoW networks do not stop there, and furthermore, even Bitcoin’s PoW network has issues: the security of a PoW network comes at a high cost to the environment, and miners have no obligation to mine any particular network. + +#### PoW Networks Are Expensive + +Some estimate that by 2020, the Bitcoin network alone will consume more electricity than the entire world currently consumes (as of [2017.](https://arstechnica.com/tech-policy/2017/12/bitcoins-insane-energy-consumption-explained/)) Having just one PoW network in existence, therefore, is already strain enough on our environment. It is also a burden on our infrastructure and our worldwide economy. + +On the one hand, adding additional PoW blockchains to the world can serve the purpose of forcing free-market competition on the Bitcoin developers, encouraging ethical and innovative behavior. Therefore, some competition among PoW networks is likely useful. + +However, as a human species, we can consider that there are more financially sound and eco-friendly methods of innovating with blockchain technology without always directly competing with Bitcoin PoW security. Our innovation, delayed Proof of Work, is one response to this fact, as we will soon discuss. + +#### Miners are Free to Mine Other Networks + +Another inherent weakness of the PoW consensus mechanism to discuss is the ability of miners to choose alternate networks. + +In November of 2017, for a few hours the majority of Bitcoin network miners switched their hash power to a competitor’s PoW network, the "[Bitcoin Cash](https://www.coinwarz.com/network-hashrate-charts/bitcoincash-network-hashrate-chart)" network. This switch was the result of clever software engineering on the part of the Bitcoin Cash team. + +The team recognized that most miners on the Bitcoin network are set to automatically mine whichever network is most profitable. Therefore, the team conducted a calculated change in their underlying protocol that caused the profitability of the Bitcoin Cash network to dramatically increase. The majority of the world’s Bitcoin mining equipment, running via automation, recognized the higher profitability and switched to the Bitcoin Cash network automatically. + +While Bitcoin Cash’s play for a majority hash rate proved effective only for a matter of hours, their accomplishment raised awareness to a tacit principle in the network: Bitcoin’s hash rate is not bound to Bitcoin. The hardware is free to serve any compatible network the miners choose. + +At the time of the writing of this paper, between Bitcoin and Bitcoin Cash, ~80% of the available hash rate is aligned with the former, and ~20% with the latter. There is speculation in the industry that if the Bitcoin Cash network creates a more favorable position, the balance of hashing power could change on a long-term basis. Furthermore, there are many other blockchain competitors who may gain the attention of Bitcoin’s miners in the future. + +Were a shift in the balance of hash rate to occur, Bitcoin would no longer be the leader of security in the cryptocurrency realm. The price of Bitcoin would likely drop as users realized the resulting lack of security leadership. This might cause more miners to switch to a more profitable network to cover the cost of operating their expensive hardware. As miners abandon Bitcoin, and as users continue to leave, the situation becomes a reversal of the Network Effect. The Bitcoin network would come crashing downwards at an ever-compounding rate. + +This is all theoretical, but it raises yet another concern that we need to illuminate: the security of a blockchain depends on many things, including the potentially fickle support of human blockchain miners. Our innovation, delayed Proof of Work (dPoW), takes this fact into account as we empower members of the Komodo ecosystem with Bitcoin-level security. Before we finally turn to our own solution, we must discuss the primary competitor to the PoW consensus mechanism, Proof of Stake (PoS). + +#### The Primary Alternative: Proof of Stake + +Perhaps the most popular alternative consensus mechanism is Proof of Stake (PoS). In this mechanism, blocks are mined not by miners performing work, but rather by any user "staking" their coins on the open network for the right to mine blocks. + +The meaning of "staking" has different variations depending on the specific rules set forth by the developers of the unique variant of the PoS consensus mechanism. In general, staking one’s coins means placing them as collateral on the open network in exchange for the right to mine new blocks. + +Users who stake their coins, thereby, can periodically extract a portion of the mempool, mine new blocks, and earn rewards. There is no need to perform any hardware-expensive proof-of-work calculations, as the user’s incentive to be honest is encouraged by the fact that their own wealth hangs in the balance. + +#### The Security Risks and Shortcomings of PoS + +The downside to PoS is that a user who simply leaves a large portion of wealth staked (and therefore continually claims rewards) gradually becomes a centralized point of wealth through the power of compound interest. On PoS networks, monopolies are a constant danger. The owner of a monopoly has power over the well-being of the network. + +Once a majority of the supply is obtained, the owner gains a position known as "Nothing at Stake." The owner can mine "false" blocks to the PoS blockchain and use their own majority supply over the network to declare these "false" blocks valid. All other stakeholders on the network must adopt these "false" blocks, lest the majority holder use their strength to declare competing blockchain versions as invalid. + +If a non-majority holder attempts to challenge the monopoly holder’s version, the non-majority holder can achieve little more than the loss of coins they placed at stake. Compare this with non-majority holder in a PoW system: the question over the "truth" of the blockchain history depends not upon ownership of wealth, but upon the miner’s innovation and performance. PoW-based systems do not suffer from the risk of monopolies, therefore, as majority stakeholders gain no unique control over the mining of new blocks. + +Variations of PoS, including the popular Delegated Proof of Stake (DPoS) and Delegated Byzantine Fault Tolerance (DBFT) systems, do not resolve the underlying issue of monopoly ownership and centralized manipulation. In a vanilla PoS system, the malicious actor needs only to purchase a majority supply of the coin to mine "false" blocks. In a DPoS/DBFT type system, wherein the ecosystem stakeholders elect and endow delegates with the responsibility to mine new blocks, the malicious actor has only to compromise most of the delegates. Thereafter, the compromised delegates can mine "false" blocks, and the users of the ecosystem have no direct means to retaliate, beyond abandoning the network. + +This is not to say that PoS and its variants have no use cases. Indeed, there are scenarios in which PoS can be useful for entrepreneurs. In the Komodo ecosystem, our dPoW consensus mechanism can provide security to networks that use either type of consensus mechanism. + +After the following section summary, we finally turn our attention to our dPoW consensus mechanism. + +## A Summary of the PoW Consensus Mechanism + +In short, the PoW consensus mechanism, as designed by Satoshi Nakamoto, is currently the soundest method of blockchain security. It solves the Double Spend problem and creates a secure network, capable of transferring financial value. Furthermore, competition among miners and the Longest Chain Rule create fairness on the blockchain. The combination of features provides a high level of defense against two of the most dangerous methods of blockchain destruction—the 51% Attack and the Genesis Attack—assuming a strong overall hash rate on the network. + +New PoW blockchains can opt to compete directly with Bitcoin’s hash rate, and some level of competition is good for the ethical values and innovative power of the cryptocurrency industry. However, it is not necessary, cost-effective, nor eco-friendly that every new blockchain innovation requiring security should attempt to compete directly with Bitcoin. Not only is this unsustainable, but it is also unreliable, as it depends on the arbitrary choices of the decentralized network of miners around the world. + +## The Komodo Solution: Delayed Proof Of Work (dPOW) + +Komodo presents a technology, the delayed Proof of Work consensus mechanism, that solves the problems described above. Komodo’s unique consensus mechanism provides the same level of security as the strongest PoW network, without attempting direct competition. Instead, Komodo’s consensus mechanism uses the chosen PoW network as a storage space for "backups" of Komodo transactions. By this method, in the event of an attempted attack on Komodo’s blockchain history, even a single surviving copy of the Komodo main chain will allow the entire ecosystem to overwrite and overrule any of the attacker’s attempted changes. + +In a key difference separating Komodo from regular PoW networks, our dPoW consensus mechanism does not recognize the Longest Chain Rule for any transactions that are older than the most recent "backup" of the Komodo blockchain. For conflicts that may arise which refer to transactions that are older than the most recent "backup," our consensus mechanism looks to the backups in the chosen PoW blockchain to find the accurate record. + +Furthermore, entrepreneurs who build independent blockchains (Smart Chains) in the Komodo ecosystem can likewise elect to have backups of their own records inserted into the Komodo main chain. In this manner, the records of the entrepreneur’s chain are then included in the backup that is pushed into the protective hash rate of the main PoW blockchain (Bitcoin). Thus, entrepreneurs and developers in the Komodo ecosystem can have their independent blockchains protected by the chosen PoW network’s hash rate. + +Therefore, to destroy even the smallest Smart Chain that is employing Komodo’s dPoW security, the attacker would have to destroy: a) all existing copies of the Smart Chain; b) all copies of the Komodo main chain; c) the accompanying PoW security network into which the dPoW backups are inserted (Bitcoin). This endows the Komodo ecosystem with higher than Bitcoin-level security, while avoiding the excessive financial and eco-unfriendly costs. + +In addition, the dPoW security provided by Komodo is not only greater than Bitcoin, but is also more flexible. The Komodo security services are performed by notary nodes, chosen through a stake-weighted vote. Notary nodes have the freedom to switch notarization to another PoW network. Reasons the notary nodes might elect to switch networks could include an event where worldwide miners’ hashing power changes to another PoW network, or the cost of notarization to the current PoW network becomes more than necessary. Through this flexibility, the Komodo ecosystem maintains both a superior level of security and a more flexible and adaptive nature than Bitcoin itself. + +#### A Note About Komodo’s Iguana Core Technology + +All the following processes are supported by a deeper Komodo technology called Iguana Core. Readers of this entire section of documentation will note that Iguana Core is featured in each section. This is because Iguana Core is the heart of the underlying technology that enables the vast Komodo ecosystem to work together. The Iguana Core code itself is complex and to fully explain would require a separate whitepaper. + +In short, Iguana Core is a collection of code that serves many purposes. One function of Iguana Core is to empower the blockchain technologies Komodo either builds or adopts to act in coordination with each other. Often, Iguana Core can advance their initial capabilities beyond original expectations. In the case of dPoW, the code that underlies notary-node functionality spawned from Iguana Core technology. + +Iguana Core is coded in the C programming language—the language of choice of our lead developer, JL777. The C language is designed to enable computers to process high volumes of information in a secure manner at high speed. This aligns with Komodo’s directives to provide security and scalability to our users. + +#### A Brief Discussion on the Security Provided by the Notary Nodes + +Security is the foundational aspect of the Komodo ecosystem. Therefore, for the reader, we must first discuss the nature of the security the notary nodes provide. More detailed explanations on individual components will follow. + +The Komodo ecosystem uses a stake-weighted vote to elect parties who will run sixty-four separate "notary nodes." These notary nodes perform the "backup" process via automation provided by the Iguana Core software that runs at the heart of our system. These backups are called "notarizations." Each notarization performed by the notary nodes acts as a marker of the "true" history for the Komodo ecosystem, and this marker’s accuracy is secured by the hash power of the chosen PoW network. + +The notary nodes work together in a decentralized and trustless manner both to create each notarization and to write it to the chosen PoW network (Bitcoin). Frequency varies between two to six notarizations per hour, and the yearly cost to perform this service is ~180 BTC. Funds for this service were raised as a part of our initial Komodo ICO, and our holdings allow us to continue this method for many years before we will be required to implement a business model to replenish our reserves. + +With our dPoW mechanism, each confirmation on the chosen PoW network is also a confirmation of the entire Komodo ecosystem’s history. The only sacrifice that is made is the time it takes to push the Komodo ecosystem’s records into the protection of the main hash rate. For this reason, we name our consensus mechanism, "delayed Proof of Work" (dPoW). + +Our consensus mechanism is designed to keep the advantages provided by the PoW system, circumvent the excessive financial and eco-unfriendly overhead costs, and avoid the security risks found in a PoS system. We accomplish these measures by several means. The most important measure is that all actions a notary node takes are publicly verifiable, and the Iguana Core software running on the users’ machines verifies notary nodes’ actions. The notary nodes themselves are not arbiters of "truth." + +Therefore, the only type of "false" behavior a malicious notary node can perform is to withhold notarization. There are sixty-four notary nodes. The minimum number of notary nodes required to maintain the Komodo ecosystem is thirteen. Thus, a malicious actor would have to compromise fifty-one notary nodes to shut down the Komodo ecosystem. Such an action would be uneconomic, as this would be destroying the access to the financial rewards a notary node receives for performing its duties. By this design, notary nodes have only one economically favorable position: to properly transfer the records of the Komodo ecosystem into a secure location and to increase Komodo’s market share and value. + +For the average user, when performing a trade of goods and services where security is desired, the user simply needs to wait until the notarization process is complete. After the notary nodes are finished, the only way to break the security protecting their transaction history requires breaking the security of the chosen PoW network (Bitcoin). The Iguana Core code running in the main Komodo software automates the verification process. Entrepreneurs and developers should be aware of this information as they design business models and services for their users. + +Thus, Komodo’s dPoW consensus mechanism maintains the security innovated by Satoshi Nakamoto, and because it enables the Bitcoin hash rate to serve more independent blockchains than just the single Bitcoin blockchain, dPoW even expands on Nakamoto’s original design. + +## The Notarization Process + +#### Step One: Gathering the Appropriate Data + +The process of notarization is simple. Roughly every ten to twenty-five minutes, notary nodes perform a special block hash mined on the Komodo blockchain and take note of the overall Komodo blockchain "height" (i.e. the number of total blocks in the Komodo blockchain since inception). The notary nodes process this specific block in such a manner that their signatures are cryptographically included within the content of the notarized data. + +[All examples herein are estimated based off an actual KMD notarization to the BTC network, linked here.](https://www.blocktrail.com/BTC/tx/313031a1ed2dbe12a20706dff48d3dffb0e39d15e3e4ff936d01f091fb3b8556#tx_messages) + +The pieces going into the notarization process could look like this: + +##### The Block Hash + +```bash +0a88371cc63969d29492110592189f839557e606db6f2b418ecfe8af24451c07 +``` + +This is the "block hash" from the KMD blockchain—mined and cryptographically signed by the notary nodes + +##### Block 607240 + +This is the blockchain "height" of the Komodo blockchain at the time of notarization (i.e. the total number of KMD blocks ever created) + +##### KMD + +The letters "KMD" are added into the notarization mixture to indicate the name of the blockchain to which this notarization belongs + + +#### Creating a Notarization + +The notary nodes will take these three pieces of information and compress them into a format that is more computer-friendly. The result will look like this: + +```bash +6a28071c4524afe8cf8e412b6fdb06e65795839f189205119294d26939c61c37880a084409004b4d4400 +``` + +The above number can be said to be a cryptographic representation of all that has happened on the Komodo blockchain up to this point in time. According to the Cascade Effect, were an attacker to attempt to go back in the history of the Komodo blockchain and change even a single character of data, and then perform the same hashing formulas in the Komodo code, the number above would dramatically change. + +This makes the notary nodes’ notarization a useful backup, assuming this number is in a safe location where anyone on the Internet can view and verify it. It enables a single surviving copy of the "true" Komodo main chain to identify itself to the rest of the Komodo network, as only the "true" data can produce the same result. + +On the other hand, an incorrect history of the Komodo network will not be able to produce the same notarization. Through the automation in the Iguana Core software that underlies the Komodo ecosystem, all users will align with the "true" blockchain history and ignore any malicious actors’ "false" attempts. + +#### Step Two: Notarizing the Data to a Secure Location + +Naturally, for security purposes this number cannot simply be saved to one person’s local computer, or be written down on a piece of paper. Were the number to be in such a centralized location, a would-be attacker could simply destroy the backup, or replace it with a "false" version. + +For the number to be useful, it must be placed in a secure and decentralized location. Here is where Komodo adopts security from another network: Komodo will perform a simple transaction in which it writes the above number into the data history of the strongest PoW blockchain (currently Bitcoin). This location is as secure as the miners’ hash rate makes it, and the location is decentralized, by nature. + +To place this information in the accompanying PoW network, the notary nodes will use a feature that exists at the core of the Bitcoin protocol when making a transaction. The feature is called "OP_RETURN," and it allows for a message to be added to the blockchain, permanently, as a part of performing a transaction. + +A notable use of the ability to write messages to a PoW blockchain is found in the first actions of Satoshi Nakamoto himself (themselves). In the first Bitcoin block ever mined, Satoshi used a feature like OP_RETURN to include this [message](https://en.bitcoin.it/wiki/Genesis_block): + +```bash +03-Jan-2009 Chancellor on brink of second bailout for banks +``` + +::: tip + +Nakamoto used a feature called "coinbase," which is similar to OP_RETURN. A primary difference between coinbase and OP_RETURN is that coinbase is used by miners when mining a block, whereas OP_RETURN can be used by any user when performing transactions. + +::: + +Readers who have downloaded the Bitcoin blockchain to their local computer, and who possess the knowledge necessary to inspect the raw Bitcoin data, can discover these very words written to their own hard drive. The important thing to understand for our discussion is that any message written to a secure and decentralized PoW blockchain is viewable and verifiable to all. + +The permanence and security of OP_RETURN messages are a core aspect of dPoW’s security. In the event of a powerful attack on the Komodo network, there need be no argument over the correct notarized marker upon which the ecosystem members should rely. The Iguana Core code running at the heart of each user’s Komodo software can continue securing, decentralizing, and distributing the accurate version of the Komodo history as though the attack never occurred. + +#### Step Three: Notarizing the PoW Network Information Back to the KMD Main Chain + +One final step remains to complete the loop of security between the KMD main chain and the chosen PoW network. The KMD blockchain must record within its own records the specific location where it placed this backup into the PoW blockchain. This enables the Iguana Core software to identify the location of the most recent notarization. + +To create this reminder, the notary nodes will now gather one more piece of information, this time drawn from the accompanying PoW network: the transaction hash (txid) identifying the location of the first notarization. This information could look like this: + +```bash +313031a1ed2dbe12a20706dff48d3dffb0e39d15e3e4ff936d01f091fb3b8556 +``` + +The notary nodes will combine it with all the information that has come before. The result will be transformed, again, into a computer-friendly version: + +```bash +6a28071c4524afe8cf8e412b6fdb06e65795839f189205119294d26939c61c37880a0844090056853bfb91f0016d93ffe4e3159de3b0ff3d8df4df0607a212be2deda13130314b4d4400 +``` + +This number is a compressed cryptographic representation of everything that has happened in the Komodo ecosystem up to this point in time. The notarization is placed as a transaction message directly into the KMD main chain itself. It enables the Komodo ecosystem to know how to find a reference of its own history. + +As each notarization is built upon all the notarizations that came before, Iguana Core does not need to monitor each notarization. Rather, it only needs to observe the most recent iteration. This is favorable for Komodo security, as there is always a possibility that the chosen PoW network (Bitcoin) could fail. In this event, the notary nodes would place their next notarization in a competing PoW network (such as Bitcoin Cash) and the entire Komodo ecosystem would remain secure. The notarizations in the failing PoW network would no longer be required to verify ecosystem accuracy. + +## Understanding Security and Economic Incentives + +The nature of mining in the Komodo ecosystem serves as an incentive to motivate the notary nodes to perform their job well. This setup is also a principle method by which the Komodo ecosystem dramatically reduces the overhead costs necessary to function. Portions of the mining rewards are available not just to the notary nodes, but also to all members of the Komodo ecosystem, through various means. + +The Komodo network on a surface-level is a minable network, like other PoW networks. Any technically savvy user can activate a device capable of mining the Komodo network, and thereby process users’ transactions, mine blocks, and receive rewards. For these miners, the Komodo protocol functions in almost the exact same manner as the Bitcoin blockchain’s mining rewards function. + +Understanding the similarities will explain to the reader the motivations for the notary nodes and other Komodo miners to secure the Komodo network. The differences, on the other hand, are explained in [Part V](./chapter8.md) of this paper. (See the section regarding the 5.1% rewards allocated to all users who hold at least 10 KMD in their wallet address. This 5.1% reward is given to users out of the funds that would normally be given to a Bitcoin miner as a method of minting new Bitcoin coins.) + +#### "Easy Difficulty" in dPoW: The Key to Notary Nodes’ Financial Incentives + +The foundational similarity to understand is that with each block header, clues are provided for miners to find the next valid block hash. The specific clue, "difficulty," changes with each block header. + +Under normal circumstances on a PoW blockchain, with each block header the difficulty level can change. The Bitcoin protocol itself decides what the difficulty for the next valid block should be. + +The difficulty is decided based on the amount of overall hash power mining the network. If many miners are active, then the hash rate is high, and the Bitcoin protocol sets the difficulty to a higher number. On the other hand, if the hash rate is low, then the protocol sets the difficulty to a lower number. + +Recall that the "difficulty" level determines the number of zeros at the beginning of the next valid block hash. The more zeros at the beginning of a valid block hash, the more unlikely each attempt at finding a valid block hash will be. + +When the Bitcoin protocol was in its infancy, the difficulty setting was easy. In fact, the block hash we used earlier as an example is, in truth, the very first block hash ever created—by Satoshi Nakamoto himself (themselves). + +```bash +000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f +``` + +He (they) designed the difficulty setting to encourage the network to find new block hashes once every ten minutes, on average. + +For a computer, to guess within ten minutes a nonce that will produce a block hash beginning with ten zeros is relatively easy. It is so simple, in fact, no special computer is required. Early Bitcoin miners could use nothing more than the average desktop machine, having the CPU—the small heart of the computer—performing the calculations. + +As more miners joined the network, however, the Bitcoin protocol automatically increased the difficulty. This maintained the speed at which the pool of all miners discovered new blocks, despite the increased size of the pool. Stabilizing the speed created several benefits, including an amount of economic predictability upon which users can rely. + +Today, at Bitcoin’s current level of overall hash power, a valid block hash requires a much higher level of difficulty. Here is a recent successful block hash: + +```bash +0000000000000000002d08398d6f21f038019600266b419bad5ab88add5b638d +``` + +There are seventeen zeros, and to find a valid block hash at this level requires a prodigious effort. + +In the race to win blockchain rewards, miners all over the world have built entire farms of specialized equipment for mining. The small CPU of a desktop is no longer useful, and the time of "easy difficulty" on Bitcoin has passed. + +#### The dPoW System has Sixty-Four Elected Notary Nodes + +Here is where our dPoW consensus mechanism diverges from the Bitcoin protocol’s limitations. In addition to performing the notarizations of the Komodo ecosystem, notary nodes are also a special type of blockchain miner. They have a certain feature in their underlying code that both enables them to maintain an effective and cost-efficient blockchain ecosystem and provides the notary nodes with a financial incentive. The combination of benefits prevents the Komodo ecosystem from falling into the trap of directly competing with other PoW networks for hash-rate security status. + +#### Each Notary Node Gets One Chance Per Every Sixty-Five Blocks to Mine on Easy + +Each individual node periodically receives the privilege to mine a block on "easy difficulty." In other words, while the rest of the miners in the Komodo ecosystem are mining at a calculated difficulty level, the notary nodes occasionally receive the chance to mine as though they are alone on the network. + +The notary nodes’ "easy difficulty" setting operates in a cyclical manner, with each notary node on its own cycle. At the start of the cycle the notary node holds the "easy difficulty" ability until it mines one "easy" block. Then the Iguana Core code removes the ability for the next sixty-four blocks. After the sixty-four-block period passes, the notary node can once again attempt to capture a block on "easy difficulty." + +Therefore, while everyone else on the network mines at an adjustable level of difficulty according to the normal PoW consensus mechanism (which keeps the overall speed of the Komodo network stable) the notary nodes have a chance to step outside the normal rules. For every sixty-five-block period on the Komodo blockchain, the odds that a block will be mined by a notary node, as opposed to a normal miner, are essentially 3:1. + +Since the rest of the miners have an adjustable difficulty ratio, it does not matter how many more miners attempt to mine Komodo. Most of the valid blocks will always be found by the sixty-four elected notary nodes, even were the entire hash power of the Bitcoin network to switch all its attention to mining Komodo. + +The mining rewards that a notary node receives through this feature are ~50 KMD per day. This reward occurs regardless of KMD’s popularity, market value, or even of the competition from normal KMD miners. The reward notary nodes receive creates an economic incentive for each party controlling a notary node to support and protect the Komodo ecosystem, and to increase the relative value of this daily ~50 KMD reward. + +## Komodo’s Protective Measures in Action + +There are myriad ways that an attacker can assail a blockchain project, and the Komodo ecosystem is well prepared. In this foundational paper, we only discuss two of the most crucial attacks—the 51% Attack and the Genesis Attack. + +In a separate technical whitepaper, written by our lead developer, we provide several more discussions on how Komodo responds to many other forms of attack. + +Some mentioned therein include the Sybil Attack, the Eclipse Attack, and more. We encourage any reader searching for information about the deepest levels of Komodo security not only to read the accompanying whitepaper, but also to reach out to our team directly. + +::: tip Note (2019) + +The whitepaper referred to above was written in ~2016 and is now obsolete, and therefore is no longer posted here. Please reach out to our team directly for a copy, if interested. + +::: + +#### Notarizations Provide a Defense Against Both the 51% Attack and the Genesis Attack + +By relying on the notarizations in the chosen PoW network’s hash rate (Bitcoin), users in the Komodo ecosystem are well protected from both the 51% Attack and the Genesis Attack. Recall that in a 51% Attack, the attacker first makes a transaction and then erases it by providing 51% of the total hash rate to a "false" blockchain where the transaction never occurred. In the Genesis Attack, the attacker recreates the genesis block of a blockchain and mines an entirely false history. For either of these attacks to play any part in the Komodo ecosystem, the successful attack would have to destroy every transaction at every level it is recorded. + +First, let us consider the implications of the notarization process provided against the Genesis Attack. Once an independent blockchain has even just a single transaction pushed through the notarization process into the chosen PoW network, that notarization protects against the Genesis Attack. To successfully complete a Genesis Attack against a Komodo-built blockchain, the attacker would have to destroy the chosen PoW network’s records from that moment going forward. The attacker would also have to destroy the KMD main chain from that moment forward, and the entire independent Smart Chain. The likelihood of achieving this task is effectively as probable as performing a Genesis Attack on the chosen PoW network itself. + +The Komodo ecosystem is also well protected against the 51% Attack, so long as users wait for a desirable number of notarizations. Consider a transaction that is recently performed on a Smart Chain in the Komodo ecosystem. While the notary nodes have not yet notarized the transaction into the KMD main chain, then it is plausible that during this approximately ten-minute period an attacker could successfully perform a 51% Attack on this transaction. The attacker would simply make a transaction, and then provide 51% of the total hash rate to a "false" version of the independent Smart Chain to erase the transaction. Therefore, users should always wait until they receive at least one notarization to the KMD main chain before considering any transaction final. + +::: tip Update 2019 + +Additionally, Komodo's new (2019) Antara Framework provides additional options that allow Smart Chain users to greatly reduce the required wait time for notarizations. In some instances, the wait time can be effectively eliminated. + +An introduction to the Antara Framework is discussed [in this linked Core Technology Discussion section.](../../../basic-docs/start-here/core-technology-discussions/antara.html#introduction) + +On the other hand, for the full Antara documentation, [click here](../../../basic-docs/antara/introduction-to-antara.html) + +::: + +Once the transaction reaches the KMD main chain, at this point, the attacker would have to successfully perform the 51% Attack against both the KMD main chain and the independent Smart Chain. This is already quite difficult to achieve, as it would require overcoming the notary nodes and other KMD miners, while simultaneously attacking the independent chain. Entrepreneurs, developers, and users should decide for themselves how much trust they wish to place in the system at this point of the notarization process. + +When considering large sums of money, the need for protection grows. A large sum of money can be both a single large transaction, or it can be the collective value of many small and normal-sized transactions that build up over hours, days, and years. These transaction histories need protection against the sophisticated blockchain attacker. It is for this reason that the notarization process exists. + +Once the notary nodes have pushed the most recent version of the Komodo ecosystem’s history into the chosen PoW network (Bitcoin), the entire ecosystem relies only on that notarization as the arbiter of truth. All transaction records that have been pushed into the chosen PoW network can only be rescinded by altering the chosen PoW network itself (while simultaneously altering the histories of the KMD main chain and the independent Smart Chain). Accomplishing such a task is highly improbable (though we warn the reader never to consider any attack impossible). + +Therefore, any record that has been on the Komodo main chain for at least one notarization has a fortress of hash rate and other security measures at its guard. So long as users and developers are mindful to wait for the desired number of notarizations to secure their payments, both the 51% Attack and the Genesis Attack are highly unlikely either to be successful, or to provide economic value to the would-be malicious actor. + +Nevertheless, we remind all users of our ecosystem to consider their own vigilance and mindfulness as the most effective protection against the would-be attacker. Users, entrepreneurs, and developers utilize all aspects of the Komodo network at their own risk. + +#### Considering an Attack on the Notarization Process + +To create a notarization for the KMD main chain, the minimum number of notary nodes required is 13. If the notary nodes themselves come under attack and must work to maintain access to the Internet, just 13 of the full 64 are required for the Komodo ecosystem to continue its operations. + +In the possible event of a disconnect from the minimum number of notary nodes, chains in the Komodo ecosystem should simply be on the alert. Users, developers, and entrepreneurs would simply need to wait for the notary nodes to regain access to the Internet and resume the notarization process before considering any transaction final. + +For this reason, the position of a notary node is held with high importance, and the parties which gain these positions are measured foremost by their Information Technology experience and capabilities. Komodo stakeholders are responsible to vote for candidates that are the most qualified to perform in the notary-node duties. + +## The dPOW Consensus Mechanism is Inherent in all Komodo Smart Chains + +These security features extend to any Smart Chain relying on the notarization process. The primary difference between a Smart Chain and the main chain is that the main chain notarizes to an exterior PoW network (Bitcoin), whereas the Smart Chain notarizes to the KMD main chain. + +The notarization for the Smart Chain is performed by the notary nodes as a service to the independent developer and entrepreneur. Notary nodes create a notarization of the Smart Chain and write it into the KMD main chain. Then they write their actions into the Smart Chain itself. This allows Iguana Core (running at the heart of the Smart Chain) to identify where its most recent notarization can be found. The notarization process cycles every ten minutes, assuming the Smart Chain’s network is consistently active. If the network has periods of inactivity, the notary nodes halt the process (to save against unnecessary notarization costs) and reactivate as soon as new transaction activity appears on the Smart Chain’s network. + +There is also a difference in the number of notary nodes required to notarize a Smart Chain as compared to the KMD main chain. Whereas with the KMD main chain 13 notary nodes are required, only 11 notary nodes are required to notarize a Smart Chain. This difference is based on the underlying math that ensures that the number of Smart Chains in the Komodo ecosystem can scale into the tens of thousands. + +We invite the reader to consider the fact as each Smart Chain can support thousands of transactions per minute, this makes the combined ecosystem capable of supporting millions of transactions per minute. This includes cross-blockchain interoperability, via our atomic-swap powered technology and our Antara Framework. This makes Komodo among the most scalable of financial-technology solutions in existence, and capable of competing with the transaction volumes of fiat networks. + +Naturally, as each level of notarization takes time to perform, there is an additional delay for Smart Chains as compared to the KMD main chain. A Smart Chain’s history is notarized into the KMD main chain approximately every ten minutes, assuming constant activity. This notarization will then be pushed through the notarization process into the chosen PoW network (Bitcoin). We estimate that a transaction performed on a Smart Chain will receive the KMD main chain’s protection within approximately ten minutes, and will receive the Bitcoin hash rate’s protection in approximately twenty to thirty minutes. + +Another difference between the KMD main chain and a Smart Chain is that the notary nodes only mine the KMD main chain. Asset-chain developers are responsible to create any required network of miners to process their Smart Chain’s transactions. This does not need to be a full network of mining farms, such as those in Bitcoin. Rather, it only needs to be enough computing power to process transactions, and to provide any desired level of hash-rate security to cover the ten-minute waiting period. For a small business with intermittent periods of transaction activity, a single, dedicated, full-time server may be enough. Larger businesses can scale as desired and can also work to attract a network of freelance miners. + +It is also possible that a network of freelance miners will naturally arise within the Komodo ecosystem, to observe and manage transaction-processing services wherever and whenever they are required, through automation. + +This setup dramatically reduces the overhead costs and effort the entrepreneur and developer would otherwise have to allocate to a network of high-hash rate miners. These freed resources of the entrepreneur and developer can therefore be allocated to other uses in their business models. + +The total yearly cost for the Komodo notary nodes to notarize the KMD main chain into the currently chosen PoW chain, Bitcoin, is approximately ~180 BTC/year (a value of ~\$1.5M USD at the time of the writing of this paper). Funding for the notary nodes to perform this service was raised during the Komodo ICO, and current BTC holdings give us many years to come before we will be required to implement any business models to replenish our BTC funds. + +On the other hand, the total cost for the Smart Chain developer to notarize their independent chain into the KMD main chain is but a fraction of the cost. This security mechanism is not limited to Smart Chains created within the Komodo ecosystem. In fact, Komodo’s Blockchain Security Services are available to any existing blockchain. With Komodo, any blockchain can be protected with the power of the Bitcoin hash rate for a tiny percentage of the cost. + +Thus, an entrepreneur in our ecosystem can have their own independent blockchain that is backed up by the hash rate of the Bitcoin mining network, at only a fraction of the cost. In the following sections, we discuss the formation of a new Komodo Smart Chain, the method of distribution and trading using our atomic-swap technology, AtomicDEX, and our "smart contract" like technology, the Antara Framework. + +# Introduction + +----------------- + +
+ +Advanced Blockchain Technology, Focused On Freedom + +
+ +----------------- + +The Komodo project focuses on empowering users with Freedom through +blockchain technology. There are many forms of Freedom that Komodo can provide, and we currently focus on empowering two types of users: the blockchain entrepreneur, and the average cryptocurrency investor. Together, our community of entrepreneurs, investors, and other users form an economic ecosystem. + +The foundational pillar of the Komodo ecosystem is security. Komodo provides a unique and innovative form of security that is as strong as the Bitcoin network, yet does not require the incredible cost. Every member of the Komodo ecosystem receives the benefits of this security. The investor relies on it for everyday use. The entrepreneur relies on it to protect their blockchain innovation at a cost that is affordable even to small businesses and startups. + +Another of Komodo’s powerful technologies is a new method of trading cryptocurrencies directly from one person to another. It is a new kind of "decentralized exchange." Our decentralized exchange removes all forms of middlemen, vouchers, and escrow services. It relies on an underlying concept called the "atomic swap", and we are the leaders in this technology. + +Our atomic-swap powered decentralized exchange serves both the investor and the blockchain entrepreneur. + +For the investor, they can trade cryptocurrencies without having to pass through a centralized exchange, which can be an arduous and even dangerous process. They also do not have to use an escrow service, voucher, nor even an intermediary coin—not even Bitcoin. Furthermore, there is no registration process required, nor are there any withdrawal limits. We currently support approximately 95% of the cryptocurrencies in existence, including Bitcoin-protocol based coins, Ethereum, and Ethereum-based ERC20 tokens. + +For the entrepreneur, our decentralized exchange enables the release of new products to the world without middleman involvement. Furthermore, even entrepreneurs who have previously built other blockchain projects outside our ecosystem can easily feature their coin on our decentralized exchange. The only requirement is that the blockchain product have the proper security elements in the core of the blockchain’s code. + +Komodo also has powerful privacy features built into our platform. When activated, these features allow the investor to trade and purchase goods and services within their right to privacy. This also allows the entrepreneur to release their product, and to crowdsource funds, from an audience that may prefer to maintain this privacy. + +There are many other technologies and features in the Komodo ecosystem, and we are experiencing a rapid growth of both entrepreneurs and investors. + +The documentation in the Core Technology Discussion section provides an in-depth discussion about Komodo’s unique security features, our decentralized exchange, the method of releasing new products on it, and our native privacy features. + +We welcome feedback from our readers. If you have any questions or concerns over the course of reading this material, please reach out to our team directly. You may find our contact information on our accompanying website: [https://komodoplatform.com](https://komodoplatform.com) + +#### Note on Changes Since Whitepaper Creation (cr. 2019) + +The documentation in this section is based on the Komodo whitepaper that was written in 2017. The content was updated in July 2019 to ensure technical accuracy. We recommend that all newcomers read this documentation to enhance their understanding of the nature and design of Komodo. + +Since 2017, the Komodo team has greatly advanced the technologies on the Komodo Platform, and these new technologies are discussed in other areas of the technical-documentation website. + +Also, the Jumblr feature and zero-knowledge transactions are still available on Komodo-based blockchains, but they are no longer available on the KMD main chain. This change was made largely in response to community feedback and industry developments. +# Miscellaneous + +## Details Regarding KMD Main Chain + + +| Circulating Coin Supply: | \~100000000 | +|-------------------------------|-------------| +| Total Coin Supply (yr. 2030): | \~200000000 | + +The foundational coin of the Komodo ecosystem is named after the ecosystem itself, Komodo (KMD). + +#### Rewards + +Those who hold KMD may earn rewards of up to 5.1% annually. Any wallet address that holds at least 10 KMD is eligible. KMD holders must simply move their KMD once a month—even if the funds are sent back to the same address from which they originated—in order to earn their reward. This reward is built into the core code of Komodo. + +The reward comes from an opportunity provided by our unique security system, dPoW. The nature of the reward is rooted in the financial incentive that is typically given to miners on a normal PoW chain. On a normal PoW, when a miner mines a new block, the blockchain mints new coins and delivers them to the miner’s indicated wallet. For instance, on the Bitcoin blockchain, the reward for mining a new block is currently ~12.5 BTC. In dPoW, we do not need to allocate such a high incentive to miners, as we already maintain access to the hash rate of our chosen PoW network, Bitcoin. Therefore, when we created the KMD main chain, we recoded this coin-minting reward to distribute 5.1% annual rewards to all holders of at least 10 KMD. + +To earn rewards in the full amount of 5.1%, users must move their funds on the blockchain at least once per month. The reward is calculated as a part of the utxo transfer process. The KMD code only calculates rewards for utxos up to one month, and then stops. By simply sending the full balance of a wallet to the same receiving address, a user can generate a new utxo. In this manner, the user can claim their current rewards, and continue receiving them for at least one month. + +The KMD 5.1% reward will continue for a period of approximately twelve to fourteen years. When Komodo’s overall coin supply reaches ~200M, this reward will also discontinue. Specifically, the reward will cease when the KMD chain reaches a block height of 7777777. + +Note that no one is forced into using KMD in our ecosystem. We are often asked why we chose this route, as the free nature of the Komodo ecosystem can be in direct contrast to the philosophies of many other ecosystems and exchanges. Other ecosystems often require users to use the developer’s coin. + +The reason why we follow a more open practice is that we strive to adhere to the guiding principles of decentralization and open-source technology. We want to create a blockchain platform where people are free to use whatever is most useful for them in their entrepreneurial endeavors. Keeping KMD as an optional element empowers the members of the Komodo ecosystem with freedom. + +## The Nature of Privacy Features in the Komodo Ecosystem + +##### The Option of Privacy is Essential + +One primary goal of the Komodo ecosystem is to provide our users with the highest levels of security. The option to enable oneself with privacy is an inherent part of a strong security system. Privacy empowers users with the ability to make choices without being directly controlled or observed by a third-party actor. + +Many of humanity’s most meaningful advancements in art, technology, and other human endeavors began in situations where the creator had the security of privacy in which to explore, to discover, to make mistakes, and to learn thereby. + +##### Privacy Issues in Popular Privacy-Centric Blockchains + +Across the entire cryptocurrency industry, current pathways to obtain privacy in the blockchain industry have many problems. + +One of the most popular methods to obtain privacy is the use of a centralized mixing service. In this process, users send their cryptocurrencies to service providers, who then mix all the participants’ coins together, and return the coins according to the relevant contributions. With this method, the most dangerous issue, among many, is that for the duration of the mixing period users lose control over their currency. The funds, therefore, are subject to theft and human error. + +Other decentralized coin-mixing methods, such as the [coin shuffle,](https://bitcoinmagazine.com/articles/shuffling-coins-to-protect-privacy-and-fungibility-a-new-take-on-traditional-mixing-1465934826/) require coordinating with other human parties. This also introduces the potential for the same issues of theft and human error, and adds yet another risk: the coordination between human parties can result in the disclosure of a user’s privacy. + +Some cryptocurrencies support mixing as a part of the normal transaction process out of a desire to provide constant anonymization. Varying methods for randomizing these transaction-mixing patterns exist among the many different brands of relevant cryptocurrencies, and each feature strengths and weaknesses in their approach. + +#### Komodo's Approach to Privacy Technologies + +The roots of the Komodo ecosystem stem from the seminal work of Satoshi Nakamoto and his Bitcoin protocol. One of the key challenges in this technology is that the original protocol does not make any account for privacy. Therefore, Komodo began not as a fork of the vanilla Bitcoin protocol, but rather as a fork of Zcash. The latter is a privacy-centric fork of Bitcoin, and therefore Komodo inherits technology from both Bitcoin and Zcash by this action. + +The Komodo Smart Chain software, komodod, retains the inherent privacy features of Zcash. These primarily consist of the ability to convert money from a transparent address to a private address, and then to transfer money from one private address to another. When sending money that is already private to an address that is also private, Zcash technology allows the funds to move without leaving a public data trail for later analysis. + +This is one of the most powerful forms of blockchain privacy in existence, as the provided privacy is effectively permanent. + +##### Private and Non-Private Addresses + +On any privacy-enabled Smart Chain, there are two types of addresses. One is transparent, the other is private. + + +##### Transparent Addresses + +We call a transparent address a "T address." These are fully accessible to the user, and they are the means of conducting normal transactions. All currency entering and leaving a T address is fully visible to the network. + +The user must use these addresses for most interactions on-chain, including most, if not all, of the Antara Module transactions, and when using AtomicDEX. + +##### Private Addresses + +We call a privacy-enabled address a "Z address," as they utilize the Zcash parameters and zk-SNARK technology. + +Z addresses often have RPCs that are separate from the RPCs used for T address. For example, [z_gettotalbalance](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-gettotalbalance) is separate from [getbalance.](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#getbalance) + +The cost of interacting with Z addresses is often higher than the cost of interacting with a T address. This is due to the fact that Z transactions require more block space, due to their demands for increased levels of encryption. + +### Method of Moving Funds Privately + +There are three types of transactions that can take place in respect to privacy technology. + + +#### Transparent to Private + +------- + +
+ +T -> Z + +
+ +------ + +A user uses the [z_sendmany](../../../basic-docs/smart-chains/smart-chain-api/wallet.html#z-sendmany) RPC to send funds from a T address to a Z address. + +This is not a private transaction. An observer of the blockchain can observe both the T address from which the funds are consumed and the Z address to which the funds are sent. + +#### Private to Private + +------ + +
+ +Z -> Z + +
+ +------ + +This is a private transaction. Using zk-SNARK technology inherited from Zcash, this transaction moves funds from one address without leaving any data available in the public domain for later observation. + +So long as the user does not reveal any information regarding this transaction, no other party may ever know the amount, specific time, or destination of funds in this transaction. The user may also consider enhancing their privacy through services such as [Tor](https://www.torproject.org/). + +All privacy from zk-SNARK technology is derived solely as a part of this type of transaction. + +#### Private to Transparent + +------ + +
+ +Z -> T + +
+ +------ + +This is not a private transaction. Rather, this is the transaction wherein funds again become public, and therefore usable for services such as a typical Antara Module or an AtomicDEX exchange. + +Observers on the blockchain can observe both the Z address from which the funds are consumed and the T address to which the funds are sent. + +### Additional Privacy Considerations + +Although the anonymization process provides a measure of privacy and may appear to be sufficient, there are still more precautions a user must take. Two main attacks are available to a would-be sleuth. + +#### The Timing Attack + +In this attack, the sleuth simply studies the time the funds disappear from a T address and looks for funds to appear in another T address soon thereafter. If the privacy-user persistently chooses predictable timing for initiating and completing their transfer of funds from a T address, through a series of Z addresses, and back to a public T address, a determined sleuth may deduce the user's trail of funds. + +For effective privacy, the user should wait for other users on the Smart Chain to exercise privacy transactions, and thereby conceal their own privacy behavior. The more users using privacy features, the more private the transactions become. + +#### The Knapsack Attack + +The Knapsack Attack is similar to the Timing Attack, but as applied to amounts. For example, if there is only one KMD address that sends 1000000 KMD from a T address to a Z address, and later 1000000 KMD emerges from a Z address to a T address, the sleuth can easily discern the user’s trail of funds. + +To protect against the Knapsack Attack, users can vary their amount of funds in both `T -> Z` and `Z -> T` transactions. + +### A Word on Risks Inherent in zk-SNARK Technology + +Zero-knowledge transactions rely on the Zcash parameters as put forth by the Zcash team. The Zcash parameters are a "zero-knowledge" form of technology. This is a powerful form of privacy, and arguably superior to other forms as it is effectively permanent. Relying on the Zcash parameters allows us to turn our creative resources to other blockchain-technology challenges, while still empowering members of the Komodo ecosystem with the option of privacy. + +To create the Zcash parameters, the original Zcash developers had to create a series of keys that, when combined, created a master key that could unlock and lock the parameters. After using the master key to create the parameters, the team destroyed every individual key. The team conducted this endeavor in a public manner. We encourage interested readers to view the "Zcash Ceremony" explanation, and to search for other viewpoints as well. + +To briefly summarize the security measures, the Zcash team used several layers of protection including: multi-party computation, air-gapped compute nodes, hard-copy evidence trails, a uniquely crafted distribution of the Linux operating system, and the physical destruction of each piece of hardware that held an individual key. The resulting layers of defense would be of the highest level of difficulty for an outsider to penetrate. Furthermore, the method of creation and destruction ensured that the internal security of the project was faultless, so long as at least one member of the entire Zcash team was honest. + +By our observation, the team performed this endeavor with sufficient competence and due diligence. Furthermore, given the nature of the project, the longstanding reputation of the Zcash developers, and the modus operandi of their lives’ work, we believe they were properly motivated to perform the creation and destruction in a capable and honest manner. + +Nevertheless, there are privacy advocates in the cryptocurrency industry who maintain a degree of suspicion over any project that requires an element of human trust. This suspicion extends to the Zcash parameters. These observers continually scrutinize the Zcash project, searching for more and more processes by which the creation ceremony could have failed. Yet, while various theories have been put forth, no actual failure in the Zcash parameters has been discovered. + +In adopting the Zcash parameters, we receive frequent questions regarding how they affect Komodo-based currency. The answer is that the privacy in the Komodo ecosystem is permanent, regardless of any potential fault by the Zcash team. Furthermore, we can adopt any updates the Zcash team releases to the parameters. + +In the unlikely event that someone was able to retain a complete copy of the master key, the only power the holder would have, would be the ability to create new private money in the currency of any Smart Chains utilizing zero-knowledge transactions. + +This holder could then shift that value into transparent, spendable money. This could negatively impact any affected Smart Chain's local community, and we would be required to adapt our platform. If a fault in the Zcash parameters were to be discovered, the Komodo team has various contingency methods at our disposal to remove the Zcash parameters and replace them with a new set of parameters. + +Though in Komodo we do not see this as a realistic threat, we nevertheless include the information here in our documentation to provide complete transparency for any user who seeks to invest their resources in a privacy-enabled Komodo Smart Chain. + +## The Utxo: An Elusive, Yet Fundamental Concept + +All Bitcoin-based software relies heavily on a technology called the "utxo," short for Unspent Transaction. This technology was invented in the original Bitcoin protocol. Yet despite the technology's age, even the most active of cryptocurrency users rarely know what utxos are or why they exist. + +To better understand utxos, let us first examine the language of a common user when describing how much cryptocurrency money they have and how they perceive those funds. We will therefore need to understand the concept of "satoshis," the way a blockchain handles the collection and distribution of funds, and how we utilize these core technologies when trading on AtomicDEX. + +### Comparing the Utxo to Fiat Money + +Let us assume a cryptocurrency user, whom we name Charlie, has $10,000 in his physical wallet. Naturally, when Charlie thinks about the amount of physical (or "fiat") money he has, he says to himself, "I have $10,000." + +However, there is no such thing as a $10,000-dollar bill. Instead, Charlie actually has a collection of smaller bills stacked together. For instance, he could have a stack of $100-dollar bills, the total of which equals $10,000 dollars. + +If Charlie goes to purchase an item that costs $1, and he only has $100-dollar bills in his wallet, to make his purchase he will take out a single $100-dollar bill and give it to the cashier. The cashier then breaks that $100-dollar bill down into a series of smaller bills. The cost for the item, $1, remains with the cashier, and the cashier then provides change—perhaps in the form of one $50-dollar bill, two $20-dollar bills, one $5-dollar bill, and four $1-dollar bills. + +Charlie now thinks to himself, "I have $9,999." Specifically, however, he has ninety-nine $100-dollar bills, a $50-dollar bill, two $20-dollar bills, one $5-dollar bill, and four $1-dollar bills. + +We emphasize that not only does he not have ten thousand $1-dollar bills, he also does not have one million pennies ($0.01). Furthermore, because pennies are the smallest divisible unit of value in Charlie’s wallet, we could point out that each bill is a collection of its respective units of pennies. For instance, a $1-dollar bill in Charlie’s wallet we could describe as, "a bill that represents a collection of one hundred pennies and their value." + +### Understanding Cryptocurrencies and Their Utxos + +#### A Satoshi is The Smallest Divisible Unit of a Cryptocurrency + +Continuing with our explanation of utxos, we next need to understand the concept of "satoshis." The name "satoshi" is derived in honor of Satoshi Nakamoto, author of the original Bitcoin whitepaper. By convention in the cryptocurrency community, one satoshi is equal to one unit of a coin at the smallest divisible level. For instance, 1 satoshi of Bitcoin is equal to 0.00000001 BTC. + +Let us suppose now that Charlie has 9.99000999 BTC (Bitcoin) in his digital wallet. Assuming Charlie correctly understands the concept of satoshis, Charlie could say to himself, "I have nine hundred and ninety-nine million, nine hundred and ninety-nine satoshis of bitcoin." This is how Charlie might mentally perceive the collection of money that exists in his digital wallet, like he perceives the $9,999 in his fiat wallet. + +#### A Utxo is a Packet of Satoshis, just as a Fiat Dollar Bill is a Packet of Pennies + +Recall now that with fiat money, Charlie did not think about how his original $10,000 was comprised of smaller individual $100-dollar bills. Similarly, Charlie also does not think about how his 9.99000999 BTC could be comprised of smaller collections of satoshis. + +Furthermore, just as Charlie did not carry around fiat money as a collection of pennies, he also is not carrying around a raft of satoshis. Were he to try to carry a million pennies in his physical wallet, the weight of the wallet would be unmanageable. Similarly, if the Bitcoin protocol were to attempt to manage nine hundred and ninety-nine million, nine-hundred and ninety-nine satoshis, the "data weight" would be so heavy, the Bitcoin protocol would be enormous and unmanageable. + +To optimize "data weight," the Bitcoin protocol therefore bundles up the satoshis into something that is like the example of dollar bills earlier, but with one important difference. In fact, here is where the Bitcoin protocol exercises a superiority over fiat money by deviating from the limitations fiat money must obey when bundling smaller values into larger values. + +In fiat money, one hundred pennies are bundled into a one-dollar bill, which can then be bundled into a larger bill, and so on. All the sizes of fiat money are preset and predetermined by the issuer of the fiat money when they print their bills and coins. + +The Bitcoin protocol, however, does not need to pre-plan the sizes of "bills" (i.e. the collections of satoshis) in the owner’s wallet. Bitcoin is freer in this sense; it can shift and change the sizes of its "bills" at will because there is no need to accommodate for the printing of physical coins and paper. + +Instead, the Bitcoin protocol allows for the developer of digital wallets to write code that can optimize how bitcoin satoshis are packaged into "bills," and thus the community of developers can work together to keep the data weight of the blockchain manageable. The better the digital-wallet developer, the more efficient the size of the "bills" (a.k.a. the packets of satoshis). + +The Bitcoin protocol does have one limitation, however: It must keep track of how these satoshis are being collected into larger "bills" in everyone’s digital wallets. After all, a key idea of Bitcoin is that everything happens under the public eye, where it can be verified. + +Because the Bitcoin blockchain must keep track of the sizes of these packets of satoshis, the only time the packets can be assembled or disassembled into larger and smaller sizes is at the moment when the user is spending money on the public blockchain. It is at this time that the user is under the public eye, and therefore his actions can be verified. + +To compare this limitation to fiat money, consider the effect created were Charlie to cut a $100-dollar bill into smaller pieces. The $100-dollar bill would no longer be respected as a valid form of currency. + +As the word, "utxo," is not a sonorous word, some users in the Komodo ecosystem simply refer to utxos as "bills." The concept is effectively the same. However, as the rest of the blockchain industry primarily uses the word "utxo," we frequently must use this word to maintain a common line of communication. The word utxo will be used throughout the rest of this documentation, to keep in line with industry practices. + +The utxo packet can be any size, and the developer of the GUI software decides on this process. Most importantly, and to reiterate, a utxo can only be resized during the process of spending, as this is the moment when the user interacts with the public blockchain. + +To further clarify this, let us return to Charlie’s example with fiat money. Recall that when Charlie went to purchase a $1-dollar item, he only had $100-dollar bills in his wallet. He had to give out one $100-dollar bill, and then receive a broken-down collection of dollar bills in return. + +This is exactly how it works with utxos. Charlie has a collection of utxos in his digital wallet. When he goes to buy something, he will give out utxos until he surpasses how much he owes, and then the extra change from the last utxo used will be broken down and returned to him. + +For example, let us suppose that Charlie’s 9.99000999 BTC is comprised of three utxos worth the following values: +| Utxos in Charlie’s Wallet | Value | +| ------------------------- | -------------- | +| Utxo #1: | 0.50000000 BTC | +| Utxo #2: | 0.49000999 BTC | +| Utxo #3: | 9.00000000 BTC | +| Total | 9.99000999 BTC | + +Charlie now desires to purchase an item that costs 0.60000000 BTC. He will have to hand out enough utxos from his wallet until he covers the costs of this transaction, just as he would if he were using fiat money. The Bitcoin protocol calculates the change from the transaction and then returns his change to him. + +Remember that there is a fee when spending money on a blockchain. Since we are using Bitcoin in this example, the fee would be paid to cryptocurrency miners. Let us imagine that the fee the miners charge Charlie is 999 satoshis. + +We begin by looking at how Charlie would see the process of making the purchase, assuming he does not understand the concept of utxos. For now, Charlie only understands how much is in his wallet at the satoshi level as he conducts his transaction. + +| Value | Description | +| ------------------ | ----------------------------------------------------------------- | +| 9.99000999 BTC | The amount Charlie initially owns | +| (-) 0.60000000 BTC | The amount Charlie sends to the digital cashier for his purchase | +| (-) 0.00000999 BTC | The network fee paid to miners | +| ------------------ | ----------------------------------------------------------------- | +| 9.39000000 BTC | The amount left in his wallet | + +This deduction for his purchase all appears very simple to Charlie—a testament to +the Bitcoin protocol’s effective design. + +In the background, however, the digital wallet handles the utxos and the change process in a manner as determined by the programmer. In Charlie’s example, let us assume that it proceeds this way: + +| Value | Description | +| ------------------------ | ------------------------------------------------------------------------ | +| 0.60000999 BTC | The total amount that Charlie owes to the cashier and network | +| (-) 0.50000000 BTC | The wallet sends the full value of **utxo #1** to the digital cashier | +| ------------------------ | ------------------------------------------------------------------------ | +| 0.10000999 BTC | This is the remaining total amount that Charlie still owes | + +The wallet now brings out utxo #2, which is worth 0.49000999 BTC: + +This utxo is broken down or shattered into smaller pieces. + +| Value | Description | +| -------------------- | ---------------------------------------------------------------------- | +| 0.49000999 BTC | The size of Charlie’s **utxo #2**, now in the process of change | +| (-) 0.10000000 BTC | This shatter of **utxo #2** goes to the cashier (payment fulfilled) | +| (-) 0.00000999 BTC | This shatter of **utxo #2** pays the network fee to the miners | +| -------------------- | ---------------------------------------------------------------------- | +| 0.39000000 BTC | This last shatter now returns to Charlie’s wallet as a new utxo | + +Charlie now has one new utxo in his wallet, and it is worth 0.39000000 BTC: + +| Charlie’s New Wallet State | Value | +| ---------------------------- | ---------------- | +| Utxo #3: | 9.00000000 BTC | +| Utxo #4: | 0.39000000 BTC | +| ---------------------------- | ---------------- | +| Total | 9.39000000 BTC | + +If Charlie wants to buy something later, these utxos will have to be broken up once more, according to the costs and programming of the digital wallet. Again, whatever is left over from his last utxo comes back to his own wallet as a new utxo. + +Now let us suppose that Charlie receives 0.4 BTC from someone else. In Charlie’s wallet, he will see a total of 9.79 BTC. However, in his wallet there are now actually three utxos: + +| Charlie’s New Wallet State | Value | +| -------------------------- | -------------- | +| Utxo #3: | 9.00000000 BTC | +| Utxo #4: | 0.39000000 BTC | +| Utxo #5: | 0.4000000 BTC | +| Total | 9.79000000 BTC | + +As a result, the number and sizes of utxos in Charlie’s wallet will vary over time. He may have many smaller utxos that make up his full balance, or sometimes he might just have one large utxo that comprises all of it. For Charlie, it is normally possible to ignore this since the wallet developer could handle everything automatically. + +However, a developer in the Komodo ecosystem will likely encounter the concept of utxos in the course of software development, and therefore we encourage developers to practice their understanding. + +## Conclusion + +This concludes a thorough explanation of the foundational technologies of the Komodo ecosystem. We are working diligently to improve the user experience. While some may say that the cryptocurrency industry is but a bubble, at Komodo we believe we have not yet begun the fight. We hope that the innovations we provide will be a meaningful contribution to the remarkable advent of blockchain, decentralization, and open-source technologies. +# Acknowledgements and References + +- BarterDEX – A Practical Native DEX ( [https://github.com/SuperNETorg/komodo/wiki/barterDEX-Whitepaper-v2](https://github.com/SuperNETorg/komodo/wiki/barterDEX-Whitepaper-v2) ) +- Nakamoto Satoshi (2008): Bitcoin: A peer-to-peer electronic cash system. ( [http://www.bitcoin.org/bitcoin.pdf](http://www.bitcoin.org/bitcoin.pdf) ) +- Mtchl (2014): The math of Nxt forging ( [https://www.docdroid.net/ahms/forging0-4-1.pdf.html](https://www.docdroid.net/ahms/forging0-4-1.pdf.html) ) +- King Sunny, Nadal Scott (2012): PPCoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake ( [https://peercoin.net/assets/paper/peercoin-paper.pdf](https://peercoin.net/assets/paper/peercoin-paper.pdf) ) +- Delegated Proof-of-Stake Consensus ( [https://bitshares.org/technology/delegated-proof-of-stake-consensus/](https://bitshares.org/technology/delegated-proof-of-stake-consensus/) ) +- Miers Ian, Garman Christina, Green Matthew, Rubin Aviel: Zerocoin: Anonymous Distributed E-Cash from Bitcoin ( [https://isi.jhu.edu/~mgreen/ZerocoinOakland.pdf](https://isi.jhu.edu/~mgreen/ZerocoinOakland.pdf) ) +- Ben-Sasson Eli, Chiesa Alessandro, Garman Christina, Green Matthew, Miers Ian, Troer Eran, Virza Madars (2014): Zerocash: Decentralized Anonymous Payments from Bitcoin ( [http://zerocash-project.org/media/pdf/zerocash-extended-20140518.pdf](http://zerocash-project.org/media/pdf/zerocash-extended-20140518.pdf) ) +- Ben-Sasson Eli, Chiesa Alessandro, Green Matthew, Tromer Eran, Virza Madars (2015): Secure Sampling of Public Parameters for Succinct Zero Knowledge Proofs ( [https://www.ieee-security.org/TC/SP2015/papers-archived/6949a287.pdf](https://www.ieee-security.org/TC/SP2015/papers-archived/6949a287.pdf) ) +- NXT Community: NXT White paper ( [http://wiki.nxtcrypto.org/wiki/Whitepaper:Nxt](http://wiki.nxtcrypto.org/wiki/Whitepaper:Nxt) ) +- Larimer Daniel, Scott Ned, Zavgorodnev Valentine, Johnson Benjamin, Calfee James, Vandeberg +- Michael (March 2016): Steem, An incentivized, blockchain-based social media platform.( [https://steem.io/SteemWhitePaper.pdf](https://steem.io/SteemWhitePaper.pdf) ) +- BitFury Group (Sep 13, 2015): Proof of Stake versus Proof of Work White Paper ( [http://bitfury.com/content/5-white-papers-research/pos-vs-pow-1.0.2.pdf](http://bitfury.com/content/5-white-papers-research/pos-vs-pow-1.0.2.pdf) ) +# Introduction to Smart Chain Documentation + +Welcome to the Smart Chain technical documentation. + +#### About the Smart Chain Section + +This documentation is intended for developers learning about, building, and interacting with Smart Chain products. + +Users who are not interested in these activities, but are searching for assistance, can find support in the Komodo Support Center. + +[Link to Komodo Support Center](https://support.komodoplatform.com/support/home) + +[Link to Simple Installation Procedure](../../basic-docs/start-here/about-komodo-platform/simple-installations.html#simple-installations) + +#### Conceptual Overview + +A conceptual overview of Smart Chain technology can be found in the Start Here > Product Introductions section. + +[Link to Smart Chain Product Introduction](../basic-docs/start-here/about-komodo-platform/product-introductions.html#smart-chains-fluidity) + +Also, the reader may turn to the Komodo Whitepaper for a thorough explanation. + +[Link to Komodo Whitepaper](https://komodoplatform.com/whitepaper) + +#### About Smart Chain Setup + +The Smart Chain Setup section contains basic information about Smart Chains and their creation. Topics include the following: + +- [Installing Smart Chain Software from Source Code](../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#installing-smart-chain-software-from-source-code) +- [Interacting with Smart Chains](../basic-docs/smart-chains/smart-chain-setup/interacting-with-smart-chains.html) +- [Smart Chain Launch Parameters Common to Most Blockchain Software](../basic-docs/smart-chains/smart-chain-setup/basic-launch-parameters.html#accessing-the-coin-daemon-remotely) + +#### About Smart Chain Tutorials + +The Smart Chain Tutorials section contains various tutorials that provide instruction in Smart Chain creation and usage. + +For a walkthrough covering multiple tutorials in a targeted fashion, please see the [Learning Launchpad](../basic-docs/start-here/learning-launchpad/learning-path-outlines.html) section. + +#### About Smart Chain API + +The Smart Chain API section contains all available API commands for a default Smart Chain daemon. + +These API commands can also be called Remote Procedure Calls, or RPCs. + +The API section does not include commands that are unique to Antara modules, as Antara modules are not active by default on a Smart Chain daemon. Please see the Antara section for further information. +# Address Index + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## getaddressbalance + +**getaddressbalance '{ "addresses" : [ "address" , ... ] }'** + +The `getaddressbalance` method returns the confirmed balance for an address, or addresses. It requires [addressindex](../installations/common-runtime-parameters.html#addressindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ----------- | +| "address" | (string) | the address | + +### Response + +| Name | Type | Description | +| ---------- | -------- | ------------------------------------------------------------------ | +| "balance" | (number) | the current confirmed balance in satoshis | +| "received" | (number) | the total confirmed number of satoshis received (including change) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaddressbalance '{"addresses":["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressbalance", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaddressdeltas + +**getaddressdeltas '{ "addresses" : [ "address" , ... ] }'** + +**getaddressdeltas '{ "addresses" : [ "address" , ... ] , "start": start, "end": end, "chainInfo": boolean }'** + +The `getaddressdeltas` method returns all confirmed balance changes of an address. The user can optionally limit the response to a given interval of blocks. The method requires [addressindex](../installations/common-runtime-parameters.html#addressindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| ----------- | --------- | ----------------------------------------------------------------------- | +| "address" | (string) | the address | +| "start" | (number) | the start block height | +| "end" | (number) | the end block height | +| "chainInfo" | (boolean) | include chain info in results (only applies if start and end specified) | + +### Response + +| Name | Type | Description | +| ---------- | -------- | --------------------------------- | +| "satoshis" | (number) | the difference in satoshis | +| "txid" | (string) | the related transaction id | +| "index" | (number) | the related input or output index | +| "height" | (number) | the block height | +| "address" | (string) | the address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaddressdeltas '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' +``` + + + + + +Command: + +```bash +./komodo-cli getaddressdeltas '{"addresses":["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"],"start":1,"end":200,"chainInfo":true}' +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"],"start":1,"end":200,"chainInfo":true}]}' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaddressmempool + +**getaddressmempool '{ "addresses" : [ "address" , ... ] }'** + +The `getaddressmempool` method returns all mempool deltas for an address, or addresses. It requires [addressindex](../installations/common-runtime-parameters.html#addressindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ----------- | +| "address" | (string) | the address | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ------------------------------------------------------ | +| "address" | (string) | the address | +| "txid" | (string) | the related txid | +| "index" | (number) | the related input or output index | +| "satoshis" | (number) | the difference in satoshis | +| "timestamp" | (number) | the time the transaction entered the mempool (seconds) | +| "prevtxid" | (string) | the previous txid (if spending) | +| "prevout" | (string) | the previous transaction output index (if spending) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaddressmempool '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressmempool", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaddresstxids + +**getaddresstxids '{ "addresses" : [ "address" , ... ] }'** + +The `getaddresstxids` method returns the txids for an address, or addresses. It requires [addressindex](../installations/common-runtime-parameters.html#addressindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ---------------------- | +| "address" | (string) | the address | +| "start" | (number) | the start block height | +| "end" | (number) | the end block height | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | ------------------ | +| "transaction_id" | (string) | the transaction id | + +#### :pushpin: Examples + +Command: + +```bash + komodo-cli getaddresstxids '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb","RQUAkqRiRMqxcNrB29B4duTK4qkqfV9HVJ"]}' +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddresstxids", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaddressutxos + +**getaddressutxos '{ "addresses" : [ "address" , ... ], "chaininfo" }'** + +The `getaddressutxos` method returns all unspent outputs for an address. It requires [addressindex](../installations/common-runtime-parameters.html#addressindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| ----------- | --------- | ------------------------------- | +| "address" | (string) | the address | +| "chainInfo" | (boolean) | include chain info with results | + +### Response + +| Name | Type | Description | +| ------------- | -------- | ------------------------------------ | +| "address" | (string) | the address | +| "txid" | (string) | the output txid | +| "height" | (number) | the block height | +| "outputIndex" | (number) | the output index | +| "script" | (string) | the script hex encoded | +| "satoshis" | (number) | the number of satoshis of the output | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaddressutxos '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}' +``` + + + + + +Command: + +```bash +./komodo-cli getaddressutxos '{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"], "chainInfo": true}' + +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["RTTg3izdeVnqkTTxjzsPFrdUQexgqCy1qb"], "chainInfo": true}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getsnapshot + +**getsnapshot top** + +The `getsnapshot` method returns a snapshot of addresses and their amounts at the asset chain's current height. + +The method requires [addressindex](../installations/common-runtime-parameters.html#addressindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ---------------------------------------------------- | +| "top" | (number, optional) | Only return this many addresses, i.e. top N rich list | + +### Response + +| Name | Type | Description | +| ----------------- | ---------------- | --------------------------------------------------- | +| "addresses" | (array of jsons) | the array containing the address and amount details | +| "addr" | (string) | an address | +| "amount" | (number) | the amount of coins in the above address | +| "total" | (numeric) | the total amount in snapshot | +| "average" | (numeric) | the average amount in each address | +| "utxos" | (number) | the total number of utxos in snapshot | +| "total_addresses" | (number) | the total number of addresses in snapshot, | +| "start_height" | (number) | the block height snapshot began | +| "ending_height" | (number) | the block height snapshot finished, | +| "start_time" | (number) | the unix epoch time snapshot started | +| "end_time" | (number) | the unix epoch time snapshot finished | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getsnapshot 5 +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsnapshot", "params": ["5"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + +# Blockchain + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## coinsupply + +**coinsupply height** + +The `coinsupply` method returns the coin supply information for the indicated block `height`. If no height is given, the method defaults to the blockchain's current height. + +::: tip +To use this method for large block heights, first execute the method for a small block height, such as `1000`. Then execute the method for an incrementally higher block height, such as `10000`. Continue increasing the height until reaching the desired height. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | ------------------------ | +| "height" | (integer, optional) | the desired block height | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------------------------------------------------- | +| "result" | (string) | whether the request was successful | +| "coin" | (string) | the ticker symbol of the coin for asset chains, otherwise KMD | +| "height" | (integer) | the height of this coin supply data | +| "supply" | (float) | the transparent coin supply | +| "zfunds" | (float) | the shielded coin supply (in `z`addrs) | +| "sprout" | (float) | the sprout coin supply (in `zc`addrs) | +| "total" | (float) | the total coin supply, i.e. `sum of supply + zfunds` | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli coinsupply 80000 +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "coinsupply", "params": ["80000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getbestblockhash + +**getbestblockhash** + +The `getbestblockhash` method returns the hash of the best (tip) block in the longest block chain. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------------------- | +| "hex" | (string) | the block hash, hex encoded | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getbestblockhash +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getblock + +**getblock hash|height ( verbose )** + +The `getblock` method returns the block's relevant state information. + +The verbose input is optional. The default value is true, and it will return a json object with information about the indicated block. If verbose is `false`, the command returns a string that is serialized hex-encoded data for the indicated block. + +### Arguments + +| Name | Type | Description | +| ---------------- | --------------------------------- | ---------------------------------------------------------- | +| hash `OR` height | string `OR` number, respectively | the block hash `OR` the block height | +| verbose | (boolean, optional, default=true) | true returns a json object, false returns hex-encoded data | + +### Response (verbose = true) + +| Name | Type | Description | +| ------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- | +| "hash" | (string) | the block hash (same as provided hash) | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this block); the returned value is `-1` if the block is not on the main chain | +| "size" | (numeric) | the block size | +| "height" | (numeric) | the block height or index (same as provided height) | +| "version" | (numeric) | the block version | +| "merkleroot" | (string) | the merkle root | +| "tx" : [ "transaction_id" ,...] | (array of strings) | +| "time" | (numeric) | the block time in seconds since epoch (Jan 1 1970 GMT) | +| "nonce" | (numeric) | the nonce | +| "bits" | (string) | the bits | +| "difficulty" | (numeric) | the difficulty | +| "previousblockhash" | (string) | the hash of the previous block | +| "nextblockhash" | (string) | the hash of the next block | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------------------------------------------------------------- | +| "data" | (string) | a string that is serialized, hex-encoded data for the indicated block | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblock "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" +``` + + + + + +Command: + +```bash +./komodo-cli getblock "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" false +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320", false] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +Command: + +```bash +./komodo-cli getblock 120 +``` + + + + + +Command: + +```bash +./komodo-cli getblock 120 false +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["120"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["120", false] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getblockchaininfo + +**getblockchaininfo** + +The `getblockchaininfo` method returns a json object containing state information about blockchain processing. + +::: tip +When the chain tip is at the last block before a network upgrade activation, the consensus.chaintip value is not equal to the consensus.nextblock value. +::: + +[getblockchaininfo](../komodo-api/blockchain.html#getblockchaininfo) now returns a new size_on_disk key, which is the size of the blockchain, on disk, in bytes. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| "chain" | (string) | the current network name, as defined in BIP70 (main, test, regtest) | +| "blocks" | (numeric) | the current number of blocks processed in the server | +| "headers" | (numeric) | the current number of headers we have validated | +| "bestblockhash" | (string) | the hash of the currently best block | +| "difficulty" | (numeric) | the current difficulty | +| "verificationprogress" | (numeric) | an estimate of verification progress [0..1] | +| "chainwork" | (string) | the total amount of work in the active chain, in hexadecimal | +| "pruned" | (bool) | whether the current state is in pruning mode; if true, the blockchain will not keep all transaction and block information, to preserve disk space | +| "size_on_disk" | (numeric) | the size of the blockchain on disk, measured in bytes | +| "commitments" | (numeric) | the current number of note commitments in the commitment tree | +| "softforks": { ..... } | (array) | the status of softforks in progress | +| "id" | (string) | the name of the softfork | +| "version" | (numeric) | the block version | +| "enforce": { ... } | (object) | the progress toward enforcing the softfork rules for blocks of the new version | +| "status" | (boolean) | true if threshold reached | +| "found" | (numeric) | the number of blocks with the new version found | +| "required" | (numeric) | the number of blocks required to trigger | +| "window" | (numeric) | the maximum size of the examined window of recent blocks | +| "reject": { ... } | (object) | the progress toward rejecting pre-softfork blocks (same fields as "enforce") | +| "upgrades": | (object) | the status of network upgrades | +| "xxxxxxxxx_string": | (string) | the branch ID of the upgrade | +| "name" | (string) | the name of upgrade | +| "activationheight" | (numeric) | the block height of activation | +| "status" | (string) | the status of the upgrade | +| "info" | (string) | additional information about the upgrade | +| "consensus": { ..... } | (object) | branch IDs of the current and upcoming consensus rules | +| "chaintip" | (string) | branch ID used to validate the current chain tip | +| "nextblock" | (string) | branch ID under which the next block will be validated | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblockchaininfo +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getblockcount + +**getblockcount** + +The `getblockcount` method returns the number of blocks in the best valid block chain. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | --------- | ----------------------- | +| data | (numeric) | the current block count | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblockcount +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getblockhash + +**getblockhash index** + +The `getblockhash` method returns the hash of the indicated block index, according to the best blockchain at the time provided. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | --------------- | +| index | (numeric, required) | the block index | + +### Response + +| Name | Type | Description | +| --------- | -------- | -------------- | +| "hash" | (string) | the block hash | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblockhash 100 +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getblockhashes + +**getblockhashes high low '{"noOrphans": bool, "logicalTimes": bool}'** + +The `getblockhashes` method returns an array of hashes of blocks within the timestamp range provided. + +The method requires [timestampindex](../installations/common-runtime-parameters.html#timestampindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------- | ------------------------------------------------------------------------------------------ | +| high | (numeric, required) | the newer block timestamp | +| low | (numeric, required) | the older block timestamp | +| options | (string, required) | a json object | +| "noOrphans" | (boolean) | a value of `true` implies that the method will only include blocks on the main chain | +| "logicalTimes" | (boolean) | a value of `true` implies that the method will only include logical timestamps with hashes | + +### Response + +| Name | Type | Description | +| ----------- | --------- | --------------------- | +| "hash" | (string) | the block hash | +| "blockhash" | (string) | the block hash | +| "logicalts" | (numeric) | the logical timestamp | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblockhashes 1531614698 1531614498 +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +``` +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhashes", "params": [1531614698, 1531614498] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +Command: + +```bash +./komodo-cli getblockhashes 1531614698 1531614498 '{"noOrphans":false, "logicalTimes":true}' +``` + + + + + +## getblockheader + +**getblockheader "hash" ( verbose )** + +The `getblockheader` method returns information about the indicated block. + +The verbose input is optional. If verbose is false, the method returns a string that is serialized, hex-encoded data for the indicated blockheader. If verbose is true, the method returns a json object with information about the indicated blockheader. + +### Arguments + +| Name | Type | Description | +| --------- | --------------------------------- | ---------------------------------------------------------- | +| "hash" | (string, required) | the block hash | +| verbose | (boolean, optional, default=true) | true returns a json object, false returns hex-encoded data | + +### Response (verbose = `true`) + +| Name | Type | Description | +| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- | +| "hash" | (string) | the block hash (same as provided) | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this block); if the block is not on the main chain, a value of `-1` is returned | +| "height" | (numeric) | the block height or index | +| "version" | (numeric) | the block version | +| "merkleroot" | (string) | the merkle root | +| "time" | (numeric) | the block time in seconds since epoch (Jan 1 1970 GMT) | +| "nonce" | (numeric) | the nonce | +| "bits" | (string) | the bits | +| "difficulty" | (numeric) | the difficulty | +| "previousblockhash" | (string) | the hash of the previous block | +| "nextblockhash" | (string) | the hash of the next block | + +### Response (verbose = `false`) + +| Name | Type | Description | +| --------- | -------- | -------------------------------------------------------------------- | +| "data" | (string) | a string that is serialized hex-encoded data for the indicated block | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblockheader "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" +``` + + + + + +Command: + +```bash +./komodo-cli getblockheader "0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320" false +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheader", "params": ["0d060c88dd55c48a0e1ae663ca400d2edba709c8484ef84a727cabfbb950c320"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getchaintips + +**getchaintips** + +The `getchaintips` method returns information about all known tips in the block tree, including the main chain and any orphaned branches. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ----------- | --------- | ------------------------------------------------------------- | +| "height" | (numeric) | the height of the chain tip | +| "hash" | (string) | the block hash of the tip | +| "branchlen" | (numeric) | `0` for main chain | +| "status" | (string) | `"active"` for the main chain | +| "height" | (numeric) | the height of the branch tip | +| "hash" | (string) | the blockhash of the branch tip | +| "branchlen" | (numeric) | the length of the branch connecting the tip to the main chain | +| "status" | (string) | the status of the chain | + +### Possible values for the returned status property + +| Status | Description | +| --------------- | ----------------------------------------------------------------------------- | +| "invalid" | this branch contains at least one invalid block | +| "headers-only" | not all blocks for this branch are available, but the headers are valid | +| "valid-headers" | all blocks are available for this branch, but they were never fully validated | +| "valid-fork" | this branch is not part of the active chain, but is fully validated | +| "active" | this is the tip of the active main chain, which is certainly valid | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getchaintips +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintips", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getchaintxstats + +**getchaintxstats nblocks blockhash** + +The method `getchaintxstats` returns statistics about the total number and rate of transactions in the chain. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | --------------------------------------------- | +| nblocks | (numeric, optional) | the number of blocks in the averaging window. | +| blockhash | (string, optional) | the hash of the block which ends the window | + +### Response + +| Name | Type | Description | +| ------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------- | +| "time" | (numeric) | the timestamp for the final block in the window in UNIX format | +| "txcount" | (numeric) | the total number of transactions in the chain up to this point | +| "window_final_block_hash" | (string) | the hash of the final block in the window | +| "window_block_count" | (numeric) | the size of the window in the number of blocks | +| "window_tx_count" | (numeric) | the number of transactions in the window; this value is only returned if `window_block_count` is > 0. | +| "window_interval" | (numeric) | the elapsed time in the window in seconds; this value is only returned if `window_block_count` is > 0. | +| "txrate" | (numeric) | the average rate of transactions per second in the window; this value is only returned if `window_interval` is > 0. | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getchaintxstats +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintxstats", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getdifficulty + +**getdifficulty** + +The `getdifficulty` method returns the proof-of-work difficulty as a multiple of the minimum difficulty. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | --------- | -------------------------------------------------------------------- | +| number | (numeric) | the proof-of-work difficulty as a multiple of the minimum difficulty | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getdifficulty +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getlastsegidstakes + +**getlastsegidstakes depth** + +The `getlastsegidstakes` method returns an object containing the number of blocks staked by each segid in the last `X` number of blocks, where the value of `X` is equal to the indicated `depth`. + +::: tip Note +Only applies to `-ac_staked` asset chains +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | ------------------------------------------------------------------------------------ | +| depth | (numeric, required) | the number of blocks to scan, starting from the current height and working backwards | + +### Response + +| Name | Type | Description | +| --------- | ------------- | ---------------------------------------------------------------------------------------------------------- | +| "NotSet" | (numeric) | the number of blocks that have no `SegId` set | +| "PoW" | (numeric) | the number of blocks created through `PoW` | +| "PoSPerc" | (numeric) | the percentage of blocks created through `PoS` | +| "SegIds" | (json object) | the json containing the data of number of blocks in each `SegId` | +| "n" | (numeric) | the number of blocks staked from `SegId n` in the last X blocks, where X is equal to the indicated `depth` | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getlastsegidstakes 1000 +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```json +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getlastsegidstakes", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getmempoolinfo + +**getmempoolinfo** + +The `getmempoolinfo` method returns details on the active state of the transaction memory pool. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +### Response + +| Name | Type | Description | +| --------- | --------- | -------------------------------------- | +| "size" | (numeric) | the current transaction count | +| "bytes" | (numeric) | the sum of all transaction sizes | +| "usage" | (numeric) | the total memory usage for the mempool | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getmempoolinfo +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getrawmempool + +**getrawmempool ( verbose )** + +The `getrawmempool` method returns all transaction ids in the memory pool as a json array of transaction ids. + +The verbose input is optional and is false by default. When it is true, the method instead returns a json object with various related data. + +### Arguments + +| Name | Type | Description | +| --------- | ---------------------------------- | ----------------------------------------------------------------- | +| verbose | (boolean, optional, default=false) | true for a json object, false for a json array of transaction ids | + +### Response (verbose = `false`) + +| Name | Type | Description | +| ---------------- | -------- | ------------------ | +| "transaction_id" | (string) | the transaction id | + +### Response (verbose = `true`) + +| Name | Type | Description | +| -------------------------- | ------------- | ----------------------------------------------------------------------- | +| "transaction_id": { .... } | (json object) | +| "size" | (numeric) | the transaction size in bytes | +| "fee" | (numeric) | the transaction fee | +| "time" | (numeric) | the local time transaction entered pool in seconds since 1 Jan 1970 GMT | +| "height" | (numeric) | the block height wherein the transaction entered the mempool | +| "startingpriority" | (numeric) | the priority when the transaction entered the mempool | +| "currentpriority" | (numeric) | the transaction priority at the current height | +| "depends": { ... } | (array) | unconfirmed transactions used as inputs for this transaction | +| "transaction_id" | (string) | the parent transaction id | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getrawmempool true +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawmempool", "params": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getspentinfo + +**getspentinfo '{"txid": "txid_string", "index"}'** + +The `getspentinfo` method returns the transaction id and index where the given output is spent. + +The method requires [spentindex](../installations/common-runtime-parameters.html#spentindex) to be enabled. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------------ | +| "txid" | (string) | the hex string of the transaction id | +| "index" | (number) | the output's index | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------ | +| "txid" | (string) | the transaction id | +| "index" | (number) | the spending input index | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getspentinfo '{"txid": "4479f2c05ba22adf2333db724f247a09effcc9edea8c079da0da05d3a0451064", "index": 0}' +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getspentinfo", "params": [{"txid": "4479f2c05ba22adf2333db724f247a09effcc9edea8c079da0da05d3a0451064", "index": 0}] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## gettxout + +**gettxout "txid_string" vout_number ( includemempool_bool )** + +The `gettxout` method returns details about an unspent transaction output. + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------- | ------------------------------ | +| "txid" | (string, required) | the transaction id | +| vout | (numeric, required) | the vout value | +| includemempool | (boolean, optional) | whether to include the mempool | + +### Response + +| Name | Type | Description | +| ------------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- | +| "bestblock" | (string) | the block hash | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this block with this transaction) | +| "value" | (numeric) | the transaction value | +| "scriptPubKey": | (json object) | | +| "asm" | (string) | `scriptPubKey` in assembly format | +| "hex" | (string) | `scriptPubKey` in hex format | +| "reqSigs" | (numeric) | the number of required signatures | +| "type" | (string) | the type, e.g. pubkeyhash | +| "addresses" | (array of strings) | an array of Komodo addresses | +| "address" | (string) | the blockchain address | +| "version" | (numeric) | the version | +| "coinbase" | (boolean) | whether this is a coinbase transaction | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli gettxout "d7f9b34ad3e86f48fce55dbec1f2925b8dcbd15199977fd75d224254db9ae80d" 1 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxout", "params": ["d7f9b34ad3e86f48fce55dbec1f2925b8dcbd15199977fd75d224254db9ae80d", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## gettxoutproof + +**gettxoutproof '["transaction_id", ... ]' ( "blockhash_string" )** + +The `gettxoutproof` method returns a hex-encoded proof showing that the indicated transaction was included in a block. + +::: tip +The gettxoutproof method relies on the txindex runtime parameter. This parameter is enabled by default on all KMD-based blockchains, and should never be disabled. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | --------------------------------------------------------------------------------- | +| "txid" | (string) | a transaction hash | +| "blockhash" | (string, optional) | if specified, the method looks for the relevant transaction id in this block hash | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------- | +| "data" | (string) | a string that is a serialized, hex-encoded data for the proof | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli gettxoutproof '["c71f4a2ebf87bdd588e3aa168917933ee4be1661245ebf52d5708a8339cf9d7a"]' "0a28e2fb630b282138bf23bb79f597b11acff6f57c8d9c1c10fa54770035c813" +``` + + + + + +## gettxoutsetinfo + +**gettxoutsetinfo** + +The `gettxoutsetinfo` method returns statistics about the unspent transaction output set. + +::: tip +Note this call may take a long time to complete, depending on the state of your blockchain. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ------------------ | --------- | --------------------------------- | +| "height" | (numeric) | the current block height (index) | +| "bestblock" | (string) | the best block hash hex | +| "transactions" | (numeric) | the number of transactions | +| "txouts" | (numeric) | the number of output transactions | +| "bytes_serialized" | (numeric) | the serialized size | +| "hash_serialized" | (string) | the serialized hash | +| "total_amount" | (numeric) | the total amount | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli gettxoutsetinfo +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutsetinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## kvsearch + +**kvsearch "key_string"** + +The `kvsearch` method searches for a key stored via the [kvupdate](../komodo-api/blockchain.html#kvupdate) command. + +::: tip +This feature is only available for asset chains. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------------------------------------------ | +| key | (string, required) | the key for which the user desires to search the chain | + +### Response + +| Name | Type | Description | +| --------------- | --------- | --------------------------------------------------------- | +| "coin" | (string) | the chain on which the key is stored | +| "currentheight" | (numeric) | the current height of the chain | +| "key" | (string) | the key | +| "keylen" | (string) | the length of the key | +| "owner" | (string) | a hex string representing the owner of the key | +| "height" | (numeric) | the height at which the key was stored | +| "expiration" | (numeric) | the height at which the key will expire | +| "flags" | (numeric) | `1` if the key was created with a password; `0` otherwise | +| "value" | (string) | the stored value | +| "valuesize" | (string) | the amount of characters stored | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli kvsearch examplekey +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "kvsearch", "params": ["examplekey"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## kvupdate + +**kvupdate "key_string" "value_string" days "passphrase_string"** + +The `kvupdate` method stores a key/value pair via OP_RETURN. + +::: tip +This feature is available only for asset chains. The maximum value memory size is 8kB. +::: + +### Arguments + +| Name | Type | Description | +| ------------ | ------------------- | ---------------------------------------------------------------------- | +| "key" | (string, required) | key (should be unique) | +| "value" | (string, required) | value | +| "days" | (numeric, required) | amount of days before the key expires (1440 blocks/day); minimum 1 day | +| "passphrase" | (string, optional) | passphrase required to update this key | + +### Response + +| Name | Type | Description | +| ------------ | --------- | ----------------------------------------- | +| "coin" | (string) | the chain on which the key is stored | +| "height" | (numeric) | the height at which the key was stored | +| "expiration" | (numeric) | the height at which the key will expire | +| "flags" | (string) | the amount of days the key will be stored | +| "key" | (numeric) | the stored key | +| "keylen" | (numeric) | the length of the key | +| "value" | (numeric) | the stored value | +| "valuesize" | (string) | the length of the stored value | +| "fee" | (string) | the transaction fee paid to store the key | +| "txid" | (string) | the transaction id | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli kvupdate "examplekey" "examplevalue" 2 "examplepassphrase" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "kvupdate", "params": ["examplekey", "examplevalue", "2", "examplepassphrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:9801 +``` + + + + + +## minerids + +**minerids height** + +The `minerids` method returns information about the notary nodes and external miners at a specific block height. The response will calculate results according to the 2000 blocks proceeding the indicated "height" block. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------ | +| heights | (number) | the block height for the query | + +### Response + +| Name | Type | Description | +| ------------ | -------- | ----------------------------------------- | +| "mined": | | +| "notaryid" | (number) | the id of the specific notary node | +| "kmdaddress" | (string) | the KMD address of the notary node | +| "pubkey" | (string) | the public signing key of the notary node | +| "blocks" | (number) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli minerids 1000000 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "minerids", "params": ["1000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## notaries + +**notaries height timestamp** + +**notaries height** + +**notaries timestamp** + +The `notaries` method returns the public key, BTC address, and KMD address for each Komodo notary node. + +Either or both of the height and timestamp parameters will suffice. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------ | +| height | (number) | the block height desired for the query | +| timestamp | (number) | the timestamp of the block desired for the query | + +### Response + +| Name | Type | Description | +| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| "notaries": [ ... ] | (array) | +| "pubkey" | (string) | the public signing key of the indicated notary node, used on the KMD network to create notary-node authorized transactions | +| "BTCaddress" | (string) | the public BTC address the notary node uses on the BTC blockchain to create notarizations | +| "KMDaddress" | (string) | the public KMD address the notary node uses on the KMD blockchain to create notarizations | +| "numnotaries" | (number) | the number of notary nodes; typically this value is 64, but the value may vary on rare circumstances, such as during election seasons | +| "height" | (number) | the block height number at which the notary-node information applies | +| "timestamp" | (number) | the timestamp at which the notary-node information applies | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli notaries 1536365515 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "notaries", "params": ["1000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## verifychain + +**verifychain ( checklevel numblocks )** + +The `verifychain` method verifies the coin daemon's blockchain database. + +::: tip +Depending on the state of your blockchain database and daemon, this call can take a prolonged period of time to complete. +::: + +### Arguments + +| Name | Type | Description | +| ---------- | --------------------------------------- | ------------------------------------------------ | +| checklevel | (numeric, optional, 0-4, default=3) | indicates the thoroughness of block verification | +| numblocks | (numeric, optional, default=288, 0=all) | indicates the number of blocks to verify | + +### Response + +| Name | Type | Description | +| ---------- | --------- | --------------------------------------- | +| true/false | (boolean) | whether the verification was successful | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli verifychain +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifychain", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## verifytxoutproof + +**verifytxoutproof "proof_string"** + +The `verifytxoutproof` method verifies that a proof points to a transaction in a block. It returns the transaction to which the proof is committed, or it will throw an RPC error if the block is not in the current best chain. + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------ | ------------------------------------------------ | +| "proof_string" | (string, required) | the hex-encoded proof generated by gettxoutproof | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------ | +| "txid" | (string) | the transaction ids to which the proof commits; the array is empty if the proof is invalid | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli verifytxoutproof "040000004cd8bd98c66020496d0b34a5f5412400146ba10d6c7ab4286f84f7008d8d390e9ca9575183f60906e293e9766997396bec59f1c0b966085de3d17f8ac3c9d5280000000000000000000000000000000000000000000000000000000000000000da05975bf50e0f202d004b81fcc388cfd411d8c7c59a548e070b5affe938ce8ce830f10b298b00002402939a9a31df1305b40d26d9748283b102c708258717248d0d63f01d2957d8e3dcf56f6e03000000022e4babc29707fbdd8da2e4277b7c8b8b09e837f409eb047c936904d75fc8e6267a9dcf39838a70d552bf5e246116bee43e93178916aae388d5bd87bf2e4a1fc7010d" +``` + + + + + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifytxoutproof", "params": ["040000004cd8bd98c66020496d0b34a5f5412400146ba10d6c7ab4286f84f7008d8d390e9ca9575183f60906e293e9766997396bec59f1c0b966085de3d17f8ac3c9d5280000000000000000000000000000000000000000000000000000000000000000da05975bf50e0f202d004b81fcc388cfd411d8c7c59a548e070b5affe938ce8ce830f10b298b00002402939a9a31df1305b40d26d9748283b102c708258717248d0d63f01d2957d8e3dcf56f6e03000000022e4babc29707fbdd8da2e4277b7c8b8b09e837f409eb047c936904d75fc8e6267a9dcf39838a70d552bf5e246116bee43e93178916aae388d5bd87bf2e4a1fc7010d"] }' -H 'content-type: text/plain;' http://127.0.0.1:9801 +``` + + + + +# CC Lib + +The following methods interact with Custom Consensus modules that make use of the `-ac_cclib` parameter. + +## cclib + +**cclib insert_method insert_evalcode \\"[%22json_string%22, json_integer, ... ]\\"** + +The `cclib` method allows the user to interact with the dynamic Custom Consensus module associated with `evalcode`. + +Each `evalcode` module has unique methods and json parameters associated, as well as unique responses. + +#### cclib formatting + +Arguments for `cclib` methods are supplied as arrays. When executed in the terminal, the values for the array can be added in a normal fashion. However, when `cclib` methods are executed as a part of a script, the shell cannot parse the arrays without additional formatting. + +##### Array Formatting for Terminal + +In the terminal, the array is bound by `''` single-quotation characters and strings are bound by `""` double-quotation characters. + +Terminal format: + +```bash +./komodo-cli -ac_name=MUSIG cclib send 18 '["03d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a",1]' +``` + +##### Array Formatting for Bash Scripts + +In a bash-script, the array is bound by `\"\"` escaped double-quotation characters and strings within the array are bound by `%22 %22` characters. (`0x22` is the ASCII encoding for `"`.) + +This format can be used in a terminal directly or in shell scripts, and therefore some developers may default to it, although the format is not always necessary. + +Script format: + +```bash +./komodo-cli -ac_name=MUSIG cclib send 18 \"[%2203d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a%22,1]\" +``` + +::: tip +The [cclibinfo](../komodo-api/cclib.html#cclibinfo) method returns a complete list of available methods and their parameters for each unique `evalcode`. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | ---------------- | ----------------------------------------------------------------- | +| method | (string) | the unique name of the method | +| evalcode | (decimal number) | the `EVALCODE` of the module of interest | +| json_params | (array) | the parameters to be supplied to the method, provided as an array | + +### Response + +| Name | Type | Description | +| --------------------------- | ---- | ----------- | +| (each `EVALCODE` is unique) | | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclib combine 18 \"[%220225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a%22,%2202d3431950c2f0f9654217b6ce3d44468d3a9ca7255741767fdeee7c5ec6b47567%22]\" +``` + + + + + +## cclibaddress + +**cclibaddress evalcode pubkey** + +The `cclibaddress` method returns information about the addresses related to the specified `pubkey`, and according to the Custom Consensus module associated with the specified `evalcode`. If no `pubkey` is provided, the `pubkey` used to the launch the daemon is the default. + +### Arguments + +| Name | Type | Description | +| -------- | ------------------ | ----------------------------------------------------------- | +| evalcode | (decimal number) | the `EVALCODE` of the module of interest | +| pubkey | (string, optional) | the public key related to the requested address information | + +### Response + +| Name | Type | Description | +| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| CClibCCAddress | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the Custom Consensus module's privkey | +| CCbalance | (number) | the amount of coins in the `CClibCCAddress` | +| CClibNormalAddress | (string) | the unmodified public address generated from the Custom Consensus module's privkey | +| CClibCCTokensAddress | (string) | this property is used for development purposes only and can otherwise be ignored | +| myAddress | (string) | the normal address generated from the `pubkey` | +| myCCAddress(CClib) | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the `pubkey` | +| PubkeyCCaddress(CClib) | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the `pubkey` | +| myCCaddress | (string) | taking the parameter `evalcode` as a modifier, this is the public address that corresponds to the `pubkey` | +| myCCbalance | (number) | the amount of coins in `myCCaddress` | +| mybalance | (number) | the amount of coins in `myAddress` | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclibaddress 18 0225f1cbbda1a0c406bb8f6dc7a589d88b2f9e28cd4fdb3f59139f8aff1f5d270a +``` + + + + + +## cclibinfo + +**cclibinfo** + +The `cclibinfo` method displays all the methods of all the modules that are available in the current library. + +The library is loaded at runtime using the [-ac_cclib](../installations/asset-chain-parameters.html#ac-cclib) parameter. + +### Arguments + +| Name | Type | Description | +| ------ | ---- | ----------- | +| (none) | | | + +### Response + +| Name | Type | Description | +| --------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| result | (string) | whether the command executed successfully | +| CClib | (string) | the name of the given CClibrary | +| methods | (array of json objects) | an array containing json objects, each of which describe a method of a module | +| evalcode | (decimal number) | the `EVALCODE` of the given Custom Consensus module | +| funcid | (character) | this value is a mnemonic in the `OP_RETURN` for all generated transactions; if the provided method does not generate a transaction, this value is a single character that has no relevant meaning | +| name | (string) | the name of the Custom Consensus module | +| method | (string) | the name of the method | +| help | (string) | help for the method, including a description of the method's arguments | +| params_required | (decimal number) | the number of parameters that are required for the method to succeed | +| params_max | (decimal number) | the maximum number of parameters the method can accept | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=MUSIG cclibinfo +``` + + + + +# Control + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + + + +## getinfo + +**getinfo** + +The `getinfo` method returns an object containing various state info. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ----------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | +| "version" | (numeric) | the server version | +| "protocolversion" | (numeric) | the protocol version | +| "walletversion" | (numeric) | the wallet version | +| "balance" | (numeric) | the total balance of the wallet | +| "blocks" | (numeric) | the current number of blocks processed in the server | +| "timeoffset" | (numeric) | the time offset | +| "connections" | (numeric) | the number of connections | +| "proxy" | (string, optional) | the proxy used by the server | +| "difficulty" | (numeric) | the current difficulty | +| "testnet" | (boolean) | if the server is using testnet or not | +| "keypoololdest" | (numeric) | the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool | +| "keypoolsize" | (numeric) | how many new keys are pre-generated | +| "unlocked_until" | (numeric) | the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked | +| "paytxfee" | (numeric) | the transaction fee set in COIN/kB | +| "relayfee" | (numeric) | minimum relay fee for non-free transactions in COIN/kB | +| "errors" | (string) | any error messages | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getinfo +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## help + +**help ( "command" )** + +The `help` method lists all commands, or all information for a specified command. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | -------------------------------- | +| "command" | (string, optional) | the command requiring assistance | + + +### Response + + +| Name | Type | Description | +| --------- | ------------------ | -------------------------------- | +| "command" | (string, optional) | the command requiring assistance | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli help +``` + + + +Command: + +```bash +./komodo-cli help getaddressbalance +``` + + + + +## stop + +**stop** + +The `stop` method instructs the coin daemon to shut down. + +The amount of time it takes to shut down the chain will vary depending on the chain's current state. + +::: warning +Forcefully stopping the chain should be avoided, as it may cause a corruption in the local database. In the event of a corrupted database, the user will need to resync. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ----------------------------- | ---- | ----------- | +| Komodo server stopping | | +| [COIN] Komodo server stopping | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli stop +``` + + + + +--- +sidebarDepth: 3 +--- + +# Crosschain API + +## Introduction + +The Crosschain API allows a user to transfer (or "migrate") assets from one chain to another. Compatible forms of assets include coins and tokens. + +The fundamental principle of migration is that a specific amount of assets are burned in the source chain and then the same specific amount of assets are created on the destination chain. + +#### Different methods of migration using the Komodo Platform + +- MoMoM notarized migration + - "MoMoM" stands for "Merkle root of Merkle roots of Merkle roots" +- An alternative migration method with notarization of the given burn transaction by notary operators (this is a backup solution to the above MoMoM method) +- Self-managed import + +#### Crosschain API Flow + +- Make an export or burn transaction in the source chain. +- Create an "import" transaction for the burned value. + - This is created on the source chain, but the transaction is sent on the destination chain +- Komodo's validation code checks that for the import transaction there exists a corresponding burn transaction, and that this transaction is not spent more than once. + +#### Requirement + +The source and destination chains should have the same `CCid` parameter ([ac_cc](../installations/asset-chain-parameters.html#ac-cc)). The value of this parameter should be greater than 100; this indicates to the Komodo software that the coins on both chains are fungible with each other. + +:::tip Note + +- In the examples, we use two chains. The source chain is CFEKHOUND and the destination chain is CFEKDRAGON. + +::: + +## MoMoM Notarized Migration + +The MoMoM notarized migration API allows the migration of coin or token value using Komodo's notary network. This facilitates the highly scalable multi-chain architecture of Smart Chains on the Komodo Platform. + +Notary nodes store "fingerprints" of the blocks belonging to the blockchains of the various assets in the main Komodo chain (KMD). The "fingerprints" can also be referred to as MoM, or `merkle root of merkle roots`. + +The fingerprints of fingerprints are delivered back into the blockchain of the assets as back notarizations. To learn more about the notarization process, [please visit this linked article](https://komodoplatform.com/komodo-platforms-new-scalability-tech/). + +### Workflow of the MoMoM value migration + +- On the source chain, the user calls the method [migrate_createburntransaction](./crosschain.html#migrate-createburntransaction) and broadcasts the hex of the returned burn transaction (`BurnTxHex`) using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. The user also receives the `payouts object` from this method +- On the source chain, the user runs [migrate_createimporttransaction](./crosschain.html#migrate-createimporttransaction) with the hex value of the burn transaction and the `payouts object` in hex format as arguments +- On the main Komodo chain (KMD) the user calls [migrate_completeimporttransaction](./crosschain.html#migrate-completeimporttransaction) with the import transaction in hex format which was received from the previous call as an argument. + - As a part of this process, the proof object for the burn transaction inside the import transaction is extended with MoMoM data. This allows verification of the burn transaction on the destination chain by using the standard Komodo notarization process without the need to create additional proof objects + +### migrate_createburntransaction + +**migrate_createburntransaction destChain destAddress amount [tokenid]** + +The `migrate_createburntransaction` method creates a transaction burning a specific amount of coins or tokens. This method also creates a `payouts object` which is later used to create an import transaction for the value corresponding to the burned amount. This method should be called on the source chain. + +The method creates a burn transaction and returns it. This should be broadcast to the source chain using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. After the burn transaction is successfully mined, the user might have to wait for some amount of time for the back notarization to reach the source chain. The back notarization contains the `MoMoM` fingerprints of the mined block that contains the burn transaction. + +The hex value of the burn transaction along with the other returned value `payouts` are used as arguments for the `migrate_createimporttransaction` method. + +#### Arguments + +| Name | Type | Description | +| ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| "destChain" | (string, required) | the name of the destination chain | +| "destAddress" | (string, required) | the address on the destination chain where coins are to be sent; the pubkey if tokens are to be sent | +| "amount" | (numeric, required) | the amount in coins or tokens that should be burned on the source chain and created on the destination chain; if the indicated assets are tokens, the amount can be set only to 1, as only migration of non-fungible tokens are supported at this time | +| "tokenid" | (string, optional) | token id in hex; if set, the software assumes that the user is migrating tokens | + +#### Response + +| Name | Type | Description | +| ----------- | -------- | --------------------------------------------------------------------------------------------------------- | +| "payouts" | (string) | a hex string of the created payouts; this value is passed into the migrate_createimporttransaction method | +| "BurnTxHex" | (string) | a hex string of the returned burn transaction | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND migrate_createburntransaction CFEKDRAGON RBQ1XwmzduHvciRJbXbWY9YBSNtaqZvfC4 7.77 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_createburntransaction", "params": ["CFEKDRAGON","RBQ1XwmzduHvciRJbXbWY9YBSNtaqZvfC4","7.77"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +Broadcast the transaction: + +```bash +./komodo-cli -ac_name=CFEKHOUND sendrawtransaction 0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c00000000000000000000000000 +``` + + + +### migrate_converttoexport + +**migrate_converttoexport rawtx dest_symbol** + +The `migrate_converttoexport` method allows the user to create a customized burn transaction (as opposed to a fully automated burn transaction). This method converts a given transaction to a burn transaction. + +The method adds proof data to the transaction, extracts the transaction vouts, calculates their value, and burns the value by sending it to an opreturn vout. This vout is then added to the created transaction. (An opreturn vout cannot be spent at a later date, and therefore funds sent to an opreturn vout are permanently burnt.) + +The other returned value, `payouts`, is used in the `migrate_createimporttransaction` method. + +The caller of the method bears the responsibility to fund and sign the returned burn transaction using the methods [fundrawtransaction](../komodo-api/rawtransactions.html#fundrawtransaction) and [signrawtransaction](../komodo-api/rawtransactions.html#signrawtransaction). + +The signed burn transaction must be broadcast to the source chain using the [sendrawtansaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +::: warning Limitations + +- The migrate_converttoexport method supports only coins (tokens are not supported). +- The burn transaction must be stored in the import transaction's opreturn vout. Because an opreturn's data size is limited to 10,001 bytes, we recommend that the user limit the burn transaction's size to 30% of the opreturn object. + +::: + +#### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | ---------------------------------- | +| "burntx" | (string, required) | the burn transaction in hex format | +| "destChain" | (string, required) | the name of the destination chain | + +#### Response + +| Name | Type | Description | +| ---------- | -------- | --------------------------------------------------------------------------------------------------- | +| "payouts" | (string) | a hex string of the created payouts; this is passed into the migrate_createimporttransaction method | +| "exportTx" | (string) | a hex string of the returned burn transaction | + +#### :pushpin: Examples + +Create a raw transaction: + +```bash +./komodo-cli -ac_name=CFEKHOUND createrawtransaction '[{"txid":"ad930d24e0d1c060d7acf46170e31b6863cb429969449d81babd7a644745bfff","vout":6}]' '{"RBQ1XwmzduHvciRJbXbWY9YBSNtaqZvfC4":0.077}' +``` + + + +Convert it to an export transaction: + +```bash +./komodo-cli -ac_name=CFEKHOUND migrate_converttoexport 0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000000ffffffff01207e7500000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac00000000f36f00000000000000000000000000 CFEKDRAGON +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_converttoexport", "params": ["0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000000ffffffff01207e7500000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac00000000f36f00000000000000000000000000","CFEKDRAGON"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +Sign the export transaction: + +```bash +./komodo-cli -ac_name=CFEKHOUND signrawtransaction 0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000000ffffffff0130a57500000000003b6a39e283150a4346454b445241474f4efa2fe05c5d6cb0bf5a9be2aec4f1cd7a10c9472d6abc1e9bb9dc5903a4ec1a5b0a094346454b484f554e4400000000f36f00000000000000000000000000 +``` + + + +Broadcast the export transaction (using the method [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction), with the option `allowhighfees` set to `true`) + +```bash +./komodo-cli -ac_name=CFEKHOUND sendrawtransaction 0400008085202f8901ffbf4547647abdba819d44699942cb63681be37061f4acd760c0d1e0240d93ad0600000049483045022100f609176d691bade4060799424d7d3813ea3337ad8aabc79bb6fd51797b6ec9c80220073d1ba3a74da7e33bcccf5851c2152d66fcd7aa0d2c1521ec8b2ab444d656f801ffffffff0130a57500000000003b6a39e283150a4346454b445241474f4efa2fe05c5d6cb0bf5a9be2aec4f1cd7a10c9472d6abc1e9bb9dc5903a4ec1a5b0a094346454b484f554e4400000000f36f00000000000000000000000000 true +``` + + + +To see the rest of the process when `migrate_converttoexport` is used, click the following button: + + + +### migrate_createimporttransaction + +**migrate_createimporttransaction burntx payouts [notaryTxid1]...[notaryTxidN]** + +- The `migrate_createimporttransaction` method performs the initial step in creating an import transaction. This method should be called on the source chain. +- This method returns a created import transaction in hex format. This string should be passed to the `migrate_completeimporttransaction` method on the main KMD chain to be extended with the `MoMoM` proof object. +- When using the MoMoM backup solution (described later), the created import transaction is not passed to the `migrate_completeimporttransaction` method. +- The user may need to wait for some time before the back notarizations objects are stored in the destination chain. + +#### Arguments + +| Name | Type | Description | +| ------------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | +| "burntx" | (string, required) | the burn transaction in hex format returned from the previous method | +| "payouts" | (string, required) | the payouts object in hex format returned from the previous method and used for creating an import transaction | +| "notaryTxid1" | (string, optional) | the notary approval transaction id 1, to be passed if the `MoMoM` backup solution is used for notarization | +| "notaryTxidN" | (string, optional) | the notary approval transaction id N, to be passed if the `MoMoM` backup solution is used for notarization | + +#### Response + +| Name | Type | Description | +| ------------- | -------- | -------------------------------------------- | +| "ImportTxHex" | (string) | the created import transaction in hex format | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND migrate_createimporttransaction 0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c00000000000000000000000000 014014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_createimporttransaction", "params": ["0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c00000000000000000000000000","014014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### migrate_completeimporttransaction + +**migrate_completeimporttransaction importtx** + +The `migrate_completeimporttransaction` method performs the finalizing step in creating an import transaction. This method should be called on the KMD (Komodo) chain. + +This method returns the import transaction in hex format, updated with the `MoMoM` proof object. This object provides confirmation that the burn transaction exists in the source chain. + +The finalized import transaction should be broadcast on the destination chain through the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +Komodo recommends that the user wait until the notarization objects are stored in the destination chain before broadcasting the import transaction. Otherwise an error message is returned. + +In the event that an error is returned, simply wait until the notarization objects are stored in the KMD chain and try again. + +#### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | +| "importtx" | (string, required) | the import transaction in hex format created using the previous method | +| "offset" | (string, optional) | the number of blocks below the current KMD(Komodo) blockchain height in which a `MoMoM` proof must be searched | + +#### Response + +| Name | Type | Description | +| ------------- | -------- | --------------------------------------------------------------------------- | +| "ImportTxHex" | (string) | import transaction in hex extended with the MoMoM proof of burn transaction | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli migrate_completeimporttransaction 0400008085202f89011016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd100ca9a3b0201e2ffffffff024014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac0000000000000000fdc9016a4dc501e211da14c5a904dcf9dcc5c4471bae0f3e90274bc782fcaf7a828c23190dbbd3392205042cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b6f7fb8e5644af270917b10fa879a0c5636de719d308efd245ff5613450b934a5f32fd21b84a67d7b6be78b5d625af836cf7efddab3c6e8fea54345bab9ea7732cf073ef25f0b8a0764d928c8a420d45beb793fa8ea93432a908c808e4f47daadf0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c0000000000000000000000000000000000000000000000000000000000000000 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_completeimporttransaction", "params": ["0400008085202f89011016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd100ca9a3b0201e2ffffffff024014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac0000000000000000fd49026a4d4502e211a2f7550475bf21bac89b760b8c1e6a114d77c22de1584f3d65a09b98fe73360945082cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b6f7fb8e5644af270917b10fa879a0c5636de719d308efd245ff5613450b934a5f32fd21b84a67d7b6be78b5d625af836cf7efddab3c6e8fea54345bab9ea7732cf073ef25f0b8a0764d928c8a420d45beb793fa8ea93432a908c808e4f47daadfdfaa753cfdd54be8cc63b15bc2544964c03c43e0645a1ea9302522a1c9daf4c19dd9ff959973a556e4761ae171363572f782f5660a89acde315cd811a1b42140fa6d1de2ced3e371e4f8e4bca493a23d6121a608ccc0d66eb45b3ccce9518612bef75468f0fe5310972c8059e9aabf86b59a824bf5e2ac6f6b6eeb7dc171ebcb0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c0000000000000000000000000000000000000000000000000000000000000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +Broadcast the transaction: + +```bash +./komodo-cli CFEKDRAGON sendrawtransaction 0400008085202f89011016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd100ca9a3b0201e2ffffffff024014502e000000001976a914173a5c80d8956eed4f1b2d46e3855fc97b3b64cf88ac0000000000000000fd49026a4d4502e211a2f7550475bf21bac89b760b8c1e6a114d77c22de1584f3d65a09b98fe73360945082cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b6f7fb8e5644af270917b10fa879a0c5636de719d308efd245ff5613450b934a5f32fd21b84a67d7b6be78b5d625af836cf7efddab3c6e8fea54345bab9ea7732cf073ef25f0b8a0764d928c8a420d45beb793fa8ea93432a908c808e4f47daadfdfaa753cfdd54be8cc63b15bc2544964c03c43e0645a1ea9302522a1c9daf4c19dd9ff959973a556e4761ae171363572f782f5660a89acde315cd811a1b42140fa6d1de2ced3e371e4f8e4bca493a23d6121a608ccc0d66eb45b3ccce9518612bef75468f0fe5310972c8059e9aabf86b59a824bf5e2ac6f6b6eeb7dc171ebcb0400008085202f8901a91010764d209bb4bdc9586f44cfced36ea75289026e714e040acac9eea475c00c0000006b483045022100e57af148204d15daa51fde4d21f0a0e54e7dd237f2bb4ee4a82bf34b27002178022052dc8e4601dd0bcbab3024ef47517391258fe5ef0fc2d4be38cc10e0c15fdbb6012103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ffffffff02403b5a0c00000000232103336ca9db27cb6e882830e20dc525884e27dc94d557a5e68b972a5cbf9e8c62a8ac503b502e000000003b6a39e283150a4346454b445241474f4e8c5970dd6f483fef99e6be0bbc64adc1ab1060e341a5c2c8b0f0a56a6d7936e80a094346454b484f554e4400000000466c0000000000000000000000000000000000000000000000000000000000000000 +``` + + + +## Notarization Backup Solution + +There is an alternative solution to notarize burn transactions. This method is useful when the automated MoMoM notarization method fails or is slow. + +In this method, the user sends burn transactions to a special publishing resource that is monitored by the notary operators. The notary operators check this publishing resource, pick a burn transaction, validate and check the existence of the burn transaction in its source chain. The notary operators then create an approval transaction in the destination chain and return the transaction ids to the publishing resource. + +### Alternative Transfer Method Flow + +- A user creates a burn transaction using the [migrate_createburntransaction](./crosschain.html#migrate-createburntransaction) method and publishes the transaction in hex format to a publishing resource + - The publishing resource is monitored by the notary operators (currently the discord channel: [#cc-momom](https://discord.gg/JE9tkmN)) +- The notary operators must collect the burn transaction, and check its validity and existence in the source chain + - To check the transaction, the notary operators use the `migrate_checkburntransactionsource` method + - If the burn transaction is successfully validated, the notary operators must create approval transactions using the method [migrate_createnotaryapprovaltransaction](#migrate_createnotaryapprovaltransaction) in the destination chain and publish their transaction ids back into the publishing resource +- The user collects the transaction ids and calls the [migrate_createimporttransaction](./crosschain.html#migrate-createimporttransaction) method, passing the collected notary approval transaction ids as arguments in the destination chain + - Currently, the user must have at least 5 successful notary-approval transactions for an import transaction to be considered as valid in the destination chain + +### migrate_checkburntransactionsource + +**migrate_checkburntransactionsource burntxid** + +The `migrate_checkburntransactionsource` method allows a notary operator to check the burn transaction's structure and verify its presence in the source chain. + +#### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------- | +| "burntxid" | (string, required) | the burn transaction's id | + +#### Response + +| Name | Type | Description | +| -------------- | ------------------ | ----------------------------------------------------------------- | +| "sourceSymbol" | (string) | the source chain's name | +| "targetSymbol" | (string) | the target chain's name | +| "targetCCid" | (number) | the target chain's `CCid` | +| "tokenid" | (string, optional) | the token id if a token is to be migrated | +| "TxOutProof" | (string) | the proof of the burn transaction's existence in the source chain | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND migrate_checkburntransactionsource d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_checkburntransactionsource", "params": ["d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### migrate_createnotaryapprovaltransaction + +**migrate_createnotaryapprovaltransaction burntxid txoutproof** + +A notary operator uses the `migrate_createnotaryapprovaltransaction` method to create an approval transaction in the destination chain with the proof of the burn transaction's existence in the source chain. + +The returned notary approval transaction should be broadcast to the destination chain using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. + +#### Arguments + +| Name | Type | Description | +| ------------ | ------------------ | --------------------------------------------- | +| "burntxid" | (string, required) | the burn transaction's id | +| "txoutproof" | (string, required) | the proof of the burn transaction's existence | + +#### Response + +| Name | Type | Description | +| ------------- | -------- | ----------------------------------------- | +| "NotaryTxHex" | (string) | notary approval transaction in hex format | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND migrate_createnotaryapprovaltransaction d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610 040000009c6c2e1c0607ea57d44d6d0518cebc341a76e8f294ad6d2844d84f09983b35013bfacfeb3d1a412c1261f59f122fae6ae3d657d3a1871902282519a0b0d08045fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493ec64bd45c8fab0220360057fb64b4378bb1a33d9dcf9acf6e5b7c42f6a08db8eb87bfaad001910000143427efb28257954cb4e6596f4e06bdcad43cb9a402000000022cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b61016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd10105 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "migrate_createnotaryapprovaltransaction", "params": ["d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610","040000009c6c2e1c0607ea57d44d6d0518cebc341a76e8f294ad6d2844d84f09983b35013bfacfeb3d1a412c1261f59f122fae6ae3d657d3a1871902282519a0b0d08045fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493ec64bd45c8fab0220360057fb64b4378bb1a33d9dcf9acf6e5b7c42f6a08db8eb87bfaad001910000143427efb28257954cb4e6596f4e06bdcad43cb9a402000000022cd74dc8b4504472d782478b374fe3fa406f9b9199d5b8ccac7c202a73c812b61016cf36b2605abe44354cd328d8cba6638c6cc53808d4e16609637e3f1c9fd10105"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +## Self Import API + +The Self Import API is a special API available only in chains that need a pubkey to create new coins arbitrarily. + +### selfimport + +**selfimport destAddress amount** + +The Self Import API allows a trusted pubkey to create more coins on the same chain. + +#### Requirements + +The chain must have the custom parameters `-ac_import=PUBKEY` and `-ac_pubkey` set to a pubkey which is allowed to create coins. + +#### Self Import Flow + +- For creating more coins in the chain with `-ac_import=PUBKEY` enabled, use the selfimport method +- The method returns a source transaction that contains a parameter with the amount of coins to create + - The returned value is a proof of the trusted pubkey owner's intention to create new coins in the chain +- The returned source transaction should be broadcast to the chain using the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. The source transaction spends a `txfee=10000 satoshis` from the `-ac_pubkey` owner's uxtos +- After the source transaction is mined, the import transaction should also be broadcasted to the chain with the [sendrawtransaction](../komodo-api/rawtransactions.html#sendrawtransaction) method. After this transaction is mined, its vout contains the amount of created coins in the chosen destination address + +#### Arguments + +| Name | Type | Description | +| ------------- | ------------------ | -------------------------------------------------- | +| "destAddress" | (string, required) | the address where the created coins should be sent | +| "amount" | (number, required) | the amount in coins to create | + +#### Response + +| Name | Type | Description | +| ------------- | -------- | ------------------------------------ | +| "SourceTxHex" | (string) | the source transaction in hex format | +| "ImportTxHex" | (string) | the import transaction in hex format | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=IMPORTTEST selfimport RM9n6rts1CBKX4oXziLp1WBBgEUjKKWHb3 100000 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "selfimport", "params": ["RM9n6rts1CBKX4oXziLp1WBBgEUjKKWHb3","100000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +To see the rest of the process of the `migrate_converttoexport` method, click the following button. + + + +## Notary API + +The following methods are available to the notary nodes for retrieving the blockchain "fingerprints" and notarization data. + +### calc_MoM + +**calc_MoM height MoMdepth** + +The `calc_MoM` method calculates the value of the merkle root of the blocks' merkle roots (MoM), starting from the block of the indicated height for the chosen depth. + +:::tip Note +This method should be run on an asset chain. +::: + +#### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------------------------------------------ | +| "height" | (number, required) | the block height from which the `MoM` calculation must begin | +| "MoMdepth" | (number, required) | the number of blocks to include in the MoM calculation | + +#### Response + +| Name | Type | Description | +| ---------- | -------- | ------------------------------------------------------ | +| "coin" | (string) | the chain's name | +| "height" | (string) | the starting block height | +| "MoMdepth" | (number) | the number of blocks included in the `MoM` calculation | +| "MoM" | (string) | the `MoM` value | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND calc_MoM 1000 100 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "calc_MoM", "params": ["1000","100"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### MoMoMdata + +**MoMoMdata symbol kmdheight ccid** + +The `MoMoMdata` method calculates the value of the merkle root of merkle roots of the blocks' merkle roots (MoMoM), starting from the block of the indicated height for the data of the indicated chain. + +:::tip Note + +Execute this method on the KMD chain. + +::: + +#### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | --------------------------------------------------------------- | +| "symbol" | (string, required) | the chain's name whose data's `MoMoM` value is to be calculated | +| "kmdheight" | (number, required) | the number of blocks to include in the `MoM` calculation | +| "ccid" | (number, required) | the chain's CCid | + +#### Response + +| Name | Type | Description | +| ------------------ | -------- | --------------------------------------------------------- | +| "coin" | (string) | the chain's name | +| "kmdheight" | (string) | the starting block's height | +| "ccid" | (number) | the chain's `CCid` | +| "MoMs" | (string) | the array of `MoM` values | +| "notarizationHash" | (string) | the first found notarization transaction id for the chain | +| "MoMoM" | (string) | the MoMoM value | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli MoMoMdata CFEKHOUND 1350074 533 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "MoMoMdata", "params": ["CFEKHOUND","1350074","533"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### assetchainproof + +**assetchainproof txid** + +The `assetchainproof` method scans the chain for the back `MoM` notarization for a transaction corresponding to the given transaction id and returns a proof object with MoM branch. Scanning is performed from the height up to the chain tip, with a limit of `1440` blocks. + +#### Arguments + +| Name | Type | Description | +| ------ | ------------------ | ------------------------------------------------------------ | +| "txid" | (string, required) | the transaction id for which a proof object must be returned | + +#### Response + +| Name | Type | Description | +| -------------- | -------- | ------------------------------------------------------- | +| "proof object" | (string) | the returned proof object with MoM branch in hex format | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND assetchainproof d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "assetchainproof", "params": ["d19f1c3f7e630966e1d40838c56c8c63a6cbd828d34c3544be5a60b236cf1610"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### getNotarisationsForBlock + +**getNotarisationsForBlock height** + +The `getNotarisationsForBlock` method returns the notarization transactions within the block of the given block hash. + +#### Arguments + +| Name | Type | Description | +| -------- | ------------------ | -------------------------------------------- | +| "height" | (number, required) | the block number of the block to be searched | + +#### Response + +| Name | Type | Description | +| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------- | +| "Notary Cluster" | (string) | refers to the notary group which performed the notarizations; KMD for the main Komodo notaries, LABS for the LABS notaries | +| "txid" | (string) | the notarization transaction's id | +| "chain" | (string) | the chain that has been notarized | +| "height" | (number) | the notarization transaction's block height | +| "blockhash" | (string) | the hash of the notarization transaction's block | +| "notaries" | (array) | the [ids](https://github.com/jl777/komodo/blob/master/src/komodo_notary.h) of the notaries who performed the notarization | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getNotarisationsForBlock 1350074 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getNotarisationsForBlock", "params": ["1350074"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### scanNotarisationsDB + +**scanNotarisationsDB blockHeight symbol [blocksLimit=1440]** + +The `scanNotarisationsDB` method scans the notarization database backwards from the given block height for a notarization of the chain with the given name (symbol). + +#### Arguments + +| Name | Type | Description | +| ------------- | ------------------ | --------------------------------------------------------------------- | +| "blockHeight" | (number, required) | the starting block height from which notarizations are to be searched | +| "symbol" | (string, required) | the chain's name whose notarizations are to be searched | +| "blocksLimit" | (number, optional) | an optional block depth to search for notarizations | + +#### Response + +| Name | Type | Description | +| ---------- | -------- | ----------------------------------------------------------------------- | +| "height" | (number) | the block height of the notarization transaction id that has been found | +| "hash" | (string) | the hash of the notarization transaction id that has been found | +| "opreturn" | (string) | the notarization data in hex format | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli scanNotarisationsDB 1350074 EMC2 +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "scanNotarisationsDB", "params": ["1350074","EMC2"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +## User API + +The following are utility methods available to user. These methods assist in retrieving information about burn and import transactions. + +### getimports + +**getimports hash|height** + +The `getimports` method lists import transactions in the indicated block of the chain. + +#### Arguments + +| Name | Type | Description | +| ---------------- | ---------------------------- | ----------------------------------------- | +| "hash or height" | (string or number, required) | the block's hash or height to be searched | + +#### Response + +| Name | Type | Description | +| --------------- | ----------------- | --------------------------------------------------- | +| "imports" | (array) | | +| "txid" | (string) | the import transaction id | +| "amount" | (number) | the import transaction's value in coins | +| "export" | (json) | the export or burn transaction's infomation | +| "txid" | (string) | the export transaction's id | +| "amount" | (number) | the export transaction's value | +| "txid" | (string) | the export transaction's id | +| "source" | (string) | the source chain's name | +| "tokenid" | (string,optional) | the source chain's token id, if tokens are imported | +| "TotalImported" | (number) | the total imported amount in coins | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKDRAGON getimports 027366fc75eb2adda37f54092f29130d3feafd5bf453b4005fbdc68a27391a8f +``` + +:::tip Note + +If the transaction id of an import is known, use the [gettransaction](../komodo-api/wallet.html#gettransaction) method to retrieve its block hash. + +::: + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getimports", "params": ["027366fc75eb2adda37f54092f29130d3feafd5bf453b4005fbdc68a27391a8f"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +### getwalletburntransactions + +**getwalletburntransactions "count"** + +The `getwalletburntransactions` method lists all the burn transactions in the current wallet. + +#### Arguments + +| Name | Type | Description | +| ------- | ------------------ | -------------------------------------------------------------------------------------------- | +| "count" | (number, optional) | the number of burn transactions to be returned; if omitted, defaults to 10 burn transactions | + +#### Response + +| Name | Type | Description | +| -------------- | ------------------ | ---------------------------------- | +| "txid" | (string) | the burn transaction's id | +| "burnedAmount" | (number) | the burned value in coins | +| "tokenid" | (string, optional) | the token id, if tokens are burned | +| "targetSymbol" | (string) | the target chain's name | +| "targetCCid" | (number) | the target chain's `CCid` | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli -ac_name=CFEKHOUND getwalletburntransactions +``` + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletburntransactions", "params": [""] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + +# Disclosure + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## z_getpaymentdisclosure + +::: warning +EXPERIMENTAL FEATURE: Payment disclosure is currently DISABLED. This call always fails. +::: + +**z_getpaymentdisclosure transaction js_index output_index ("message")** + +The `z_getpaymentdisclosure` method generates a payment disclosure for a given joinsplit output. + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------ | ----------- | +| "txid" | (string, required) || +| "js_index" | (string, required) || +| "output_index" | (string, required) || +| "message" | (string, optional) || + +### Response + +| Name | Type | Description | +| ------------------- | -------- | ----------------------------------- | +| "paymentdisclosure" | (string) | a hex data string, with a "zpd:" prefix | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_getpaymentdisclosure 96f12882450429324d5f3b48630e3168220e49ab7b0f066e5c2935a6b88bb0f2 0 0 "refund" +``` + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in your coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getpaymentdisclosure", "params": ["96f12882450429324d5f3b48630e3168220e49ab7b0f066e5c2935a6b88bb0f2", 0, 0, "refund"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + +## z_validatepaymentdisclosure + +**z_validatepaymentdisclosure "paymentdisclosure"** + +The `z_validatepaymentdisclosure` method validates a payment disclosure. + +::: warning +EXPERIMENTAL FEATURE: Payment disclosure is currently DISABLED. This call always fails. +::: + +### Arguments + +| Name | Type | Description | +| ------------------- | ------------------ | ----------------------------------- | +| "paymentdisclosure" | (string, required) | hex data string, with "zpd:" prefix | + +### Response + +| Name | Type | Description | +| -------------------- | ---- | ----------- | +| (currently disabled) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_validatepaymentdisclosure "zpd:706462ff004c561a0447ba2ec51184e6c204..." +``` + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_validatepaymentdisclosure", "params": ["zpd:706462ff004c561a0447ba2ec51184e6c204..."] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + +# Generating + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## generate + +**generate numblocks** + +::: tip +This function can only be used in the regtest mode (for testing purposes). +::: + +The `generate` method instructs the coin daemon to immediately mine the indicated number of blocks. + +### Arguments + +| Name | Type | Description | +| --------- | --------- | ---------------------------------------- | +| numblocks | (numeric) | the desired number of blocks to generate | + +### Response + +| Name | Type | Description | +| ----------- | ------- | -------------------------- | +| blockhashes | (array) | hashes of blocks generated | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli generate 2 +``` + + + + + +## getgenerate + +**getgenerate** + +The `getgenerate` method returns a boolean value indicating the server's mining status. + +The default value is false. + +::: tip +See also gen. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------ | ----------- | +| (none) | (none) | + +### Response + +| Name | Type | Description | +| ---------- | --------- | ----------------------------------------------------- | +| true/false | (boolean) | indicates whether the server is set to generate coins | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getgenerate +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getgenerate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## setgenerate + +**setgenerate generate ( genproclimit )** + +The `setgenerate` method allows the user to set the `generate` property in the coin daemon to `true` or `false`, thus turning generation (mining/staking) on or off. + +Generation is limited to [genproclimit](../installations/common-runtime-parameters.html#genproclimit) processors. Set `genproclimit` to `-1` to use maximum available processors. + +::: tip +See also the [getgenerate](../komodo-api/generate.html#getgenerate) method to query the current setting, and [genproclimit](../installations/common-runtime-parameters.html#genproclimit) for setting the default number of processors the daemon uses through the `.conf` file. +::: + +### Arguments + +| Name | Type | Description | +| ------------ | ------------------- | ------------------------------------------------------------------------------- | +| generate | (boolean, required) | set to true to turn on generation; set to off to turn off generation | +| genproclimit | (numeric, optional) | set the processor limit for when generation is on; use value "-1" for unlimited | + +### Response + +| Name | Type | Description | +| --------- | ------ | ----------- | +| (none) | (none) | + +#### :pushpin: Examples + +##### Activate mining with maximum available processors + +Command: + +```bash +./komodo-cli setgenerate true -1 +``` + + + + + +##### Activate staking + +Command: + +```bash +./komodo-cli setgenerate true 0 +``` + + + + + +##### Activate mining with 4 threads + +Command: + +```bash +./komodo-cli setgenerate true 4 +``` + + + + + +##### Check the setting + +Command: + +```bash +./komodo-cli getgenerate +``` + + + + + +##### Turn off generation + +Command: + +```bash +./komodo-cli setgenerate false +``` + + + + + +##### Turning the setting on via json RPC + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setgenerate", "params": [true, 1] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + +# Jumblr + +::: tip Note + +At this time, all z-transaction functionality on the main KMD chain is disabled. Other Smart Chains in the Komodo ecosystem offer zk-SNARK functionality. Please check with the developers of your desired Smart Chain to learn about z-transaction and Jumblr availability. + +::: + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## Basic Instructions + +- Install Komodo following the [installation guides](../installations/basic-instructions.html#installing-basic-komodo-software) and change into the `komodod` subdirectory using: + +```bash +cd ~/komodo/src +``` + +- Start the daemon: + +```bash +./komodod & +``` + +- Designate a KMD address with at least 10.024 KMD funds: + +```bash +./komodo-cli jumblr_deposit KMD_address +``` + +::: tip +The jumblr process continues until there are less than ~ 10.024 KMD in the deposit address. +::: + +- Designate a destination address for your funds. This should be a transparent address that you are keeping secret: + +```bash +komodo-cli jumblr_secret destination_KMD_address +``` + +- Leave your node running until the balance in your first address reaches below 10.024 KMD and the destination address receives the correct amount. + +::: warning +Jumblr is created to be resistant against time-based analysis. Because of this, Jumblr is purposefully designed not to be fast. You will need to leave your node running for several hours for the process to finish. +::: + +For a more detailed description of Jumblr, please read Section IV of our [whitepaper](https://komodoplatform.com/whitepaper). + +#### :pushpin: Examples + +Designate your deposit address. + +```bash +./komodo-cli jumblr_deposit RT4mSUjG35QeuGcedsfpHtP5MhDeEGTAqb +``` + +Designate your secret destination address. + +```bash +./komodo-cli jumblr_secret RS46GZ5iTkt2exdauQG3JJ8fdnZNJUvAc1 +``` + +## jumblr_deposit + +**jumblr_deposit "depositaddress"** + +The `jubmlr_deposit` method indicates the address from which Jumblr should withdraw funds. There should be at least 10.024 KMD in this address. Jumblr will withdraw funds in increments of 10, 100, or 7770 KMD. + +::: tip +While shielded z_address technology is available on all KMD-based asset chains, the Jumblr engine and methods are only available on the KMD mainnet. +::: + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------ | ------------------------------------------------- | +| "depositaddress" | (string, required) | the address from which Jumblr will withdraw funds | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli jumblr_deposit RT4mSUjG35QeuGcedsfpHtP5MhDeEGTAqb +``` + + + + + +## jumblr_pause + +**jumblr_pause** + +The `jumblr_pause` method instructs Jumblr to temporarily pause the privacy-shielding process. + +::: tip +See also jumblr_resume. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli jumblr_pause +``` + + + + + +## jumblr_resume + +**jumblr_resume** + +The `jumblr_resume` method instructs Jumblr to resume the privacy-shielding process. + +::: tip +See also jumblr_pause. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli jumblr_resume +``` + + + + + +## jumblr_secret + +**jumblr_secret "secretaddress"** + +The `jumblr_secret` method indicates to Jumblr the final t destination address. This should be a separate t address that has no connection to the `wallet.dat` file of your `jumblr_deposit` address. Ideally, you should only access the final `jumblr_secret` address via a separate node, and with other layers of privacy (VPN, Tor, etc.). + +### Arguments + +| Name | Type | Description | +| --------------- | ------------------ | ----------------------------------- | +| "secretaddress" | (string, required) | the destination transparent address | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli jumbr_secret "RCpMUZwxc3pWsgip5aj3Sy1cKkh86P3Tns" +``` + + + + +# Mining + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## getblocksubsidy + +**getblocksubsidy height_number** + +The `getblocksubsidy` method returns the block-subsidy reward. The resulting calculation takes into account the mining slow start. This method can be used in conjunction with custom mining rewards designed by the developers of a KMD-based asset chain. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | ------------------------------------------------------------------------------------------------------------- | +| height | (numeric, optional) | the block height; if the block height is not provided, the method defaults to the current height of the chain | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------------ | +| "miner" | (numeric) | the mining reward amount | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblocksubsidy 100 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocksubsidy", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getblocktemplate + +**getblocktemplate ( "jsonrequestobject" )** + +::: tip +See the Bitcoin wiki for the full specification. +::: + +The `getblocktemplate` method returns data that is necessary to construct a block. + +If the request parameters include a `mode` key, it is used to explicitly select between the default 'template' request, a 'proposal' or 'disablecb'. + +#### A Note on Unique Mining Circumstances + +There are many features in the Komodo Ecosystem that can make an asset chain's daemon produce non-standard coinbase transactions. Examples include an asset chain parameter that creates new coins for a specific pubkey in every block or a CC module that adds outputs to the coinbase transaction. + +This can be dealt using a mode called `disablecb` + +Usage: + +```bash +./komodo-cli getblocktemplate '{"mode":"disablecb"}' +``` + +The block template produced using this mode doesn't have the `"coinbasetxn": { ... }` json object but adds the coinbase transaction to the `"transactions":[ ... ]` array, just like a regular transaction. + +Now the pool software can use the `"transactions":[ ... ]` array to create a block and take fees in the payment processor. The `knomp` [fork](https://github.com/blackjok3rtt/knomp) by [@blackjok3rtt](https://github.com/blackjok3rtt) uses this mode. + +### Arguments + +| Name | Type | Description | +| ----------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | +| "jsonrequestobject" : { ... } | (string, optional) | a json object in the following spec | +| "mode" | (string, optional) | this must be set to "template" or omitted | +| "capabilities": [ ... ] | (array, optional) | a list of strings | +| "support" | (string) | client side supported features: "longpoll", "coinbasetxn", "coinbasevalue", "proposal", "serverlist", "workid" | + +### Response + +| Name | Type | Description | +| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| "version" | (numeric) | the block version | +| "previousblockhash" | (string) | the hash of current highest block | +| "finalsaplingroothash" | (string) | the hash of the final sapling root | +| "transactions":[ ... ] | (array) | the contents of non-coinbase transactions that should be included in the next block | +| "data" | (string) | transaction data encoded in hexadecimal (byte-for-byte) | +| "hash" | (string) | the hash/id encoded in little-endian hexadecimal | +| "depends" : [ ... ] | (array) | an array of numbers | +| number | (numeric) | the indexes of transactions that must be present in the final block if this transaction is present in the final block; the index of the array of transactions starts with "1" | +| "fee" | (numeric) | the difference in value between transaction inputs and outputs in satoshis; for coinbase transactions, this is the negative number of the total collected block fees, not including the block subsidy; if a key is not present, the fee is unknown and clients MUST NOT assume it is not present | +| "sigops" | (numeric) | the total number of sigops, as counted for the purposes of block limits; if a key is not present, the sigop count is unknown and clients MUST NOT assume they are not present. | +| "required" | (boolean) | if provided and true, this transaction must be in the final block | +| "coinbasetxn": { ... } | (json object) | information for the coinbase transaction | +| "longpollid" | (string) | the last seen longpollid when this response was sent by the server | +| "data" | (string) | transaction data encoded in hexadecimal (byte-for-byte) | +| "hash" | (string) | the hash/id encoded in little-endian hexadecimal | +| "depends" : [ ... ] | (array) | an array of numbers | +| "fee" | (numeric) | the difference in value between transaction inputs and outputs in satoshis; for coinbase transactions, this is the negative number of the total collected block fees, not including the block subsidy; if a key is not present, the fee is unknown and clients MUST NOT assume it is not present | +| "sigops" | (numeric) | the total number of sigops, as counted for the purposes of block limits; if a key is not present, the sigop count is unknown and clients MUST NOT assume they are not present. | +| "foundersreward" | (numeric) | the founder's reward that should be paid out in this block; this key is present only in the blocks that payout the founder's reward; present only in chains with [ac_founders](../installations/asset-chain-parameters.html#ac_founders) enabled | +| "coinbasevalue" | (numeric) | the value of the coinbase transaction (in satoshis) | +| "required" | (boolean) | if provided and true, this transaction must be in the final block | +| "target" | (string) | the hash target | +| "mintime" | (numeric) | the minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT) | +| "mutable": [ ... ] | (array of strings) | a list of ways the block template may be changed | +| "value" | (string) | a way the block template may be changed, e.g. "time", "transactions", "prevblock" | +| "noncerange" | (string) | a range of valid nonces | +| "sigoplimit" | (numeric) | the limit of sigops in blocks | +| "sizelimit" | (numeric) | the limit of block size | +| "curtime" | (numeric) | current timestamp in seconds since epoch (Jan 1 1970 GMT) | +| "bits" | (string) | the compressed target of the next block | +| "height" | (numeric) | the height of the next block | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getblocktemplate '{"mode":"template","capabilities":["workid"]}' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocktemplate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getlocalsolps + +**getlocalsolps** + +The `getlocalsolps` method returns the average local solutions per second since this node was started. + +::: tip +This is the same information shown on the metrics screen (if enabled). +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | --------- | -------------------------------- | +| "data" | (numeric) | the solutions-per-second average | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getlocalsolps +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getlocalsolps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getmininginfo + +**getmininginfo** + +The `getmininginfo` method returns a json object containing mining-related information. + +### Arguments + +| Name | Type | Description | +| --------- | ------ | ----------- | +| (none) | (none) | + +### Response + +| Name | Type | Description | +| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "blocks" | (numeric) | the current block | +| "currentblocksize" | (numeric) | the last block size | +| "currentblocktx" | (numeric) | the last block transaction | +| "difficulty" | (numeric) | the current difficulty | +| "errors": | | +| "generate" | (boolean) | if the generation is on or off (see [getgenerate](../komodo-api/generate.html#getgenerate) or [setgenerate](../komodo-api/generate.html#setgenerate) calls) | +| "genproclimit" | (numeric) | the processor limit for generation; `-1` if no generation (see [getgenerate](../komodo-api/generate.html#getgenerate) or [setgenerate](../komodo-api/generate.html#setgenerate) calls) | +| "localsolps" | (numeric) | the average local solution rate (solutions per second) since this node was started | +| "networksolps" | (numeric) | the estimated network solution rate (solutions per second) | +| "pooledtx": | | +| "testnet" | (boolean) | if using testnet or not | +| "chain" | (string) | the current network name as defined in BIP70 (main, test, regtest) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getmininginfo +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getnetworkhashps + +**getnetworkhashps ( blocks height )** + +::: warning +DEPRECATED: Use getnetworksolps instead. +::: + +The `getnetworkhashps` method returns the estimated network solutions per second based on the last `n` blocks. + +Pass in `blocks` value to override the default number of blocks. Passing in `-1` will return a value based on the average `hashps` of the relevant difficulty window. + +Pass in `height` to estimate the network speed at the time when a certain block was found. + +### Arguments + +| Name | Type | Description | +| --------- | -------------------------------- | ------------------------------------------------------------------------------------------ | +| blocks | (numeric, optional, default=120) | the number of blocks (use `-1` to calculate over the relevant difficulty averaging window) | +| height | (numeric, optional, default=-1) | the block height that corresponds to the requested data | + +### Response + +| Name | Type | Description | +| --------- | --------- | --------------------------------- | +| data | (numeric) | the solutions-per-second estimate | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getnetworkhashps +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhashps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getnetworksolps + +**getnetworksolps ( blocks height )** + +The `getnetworksolps` method returns the estimated network solutions per second based on the last `n` blocks. + +Pass in `blocks` to override the default number of blocks. Use -1 to calculate according to the relevant difficulty averaging window. +Pass in `height` to estimate the network speed at the time when a certain block was found. + +### Arguments + +| Name | Type | Description | +| --------- | -------------------------------- | ------------------------------------------------------------------------------------------------- | +| blocks | (numeric, optional, default=120) | the number of blocks; use `-1` to calculate according to the relevant difficulty averaging window | +| height | (numeric, optional, default=-1) | the block height that corresponds to the requested data | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------------------- | +| data | (numeric) | solutions per second, estimated | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getnetworksolps +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworksolps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## prioritisetransaction + +**prioritisetransaction "transaction_id" priority_delta fee_delta** + +The `prioritisetransaction` method instructs the daemon to accept the indicated transaction into mined blocks at a higher (or lower) priority. The transaction selection algorithm considers the transaction as it would have a higher priority. + +::: tip +This method is inherited from the original Bitcoin protocol, of which KMD is a fork (via Zcash). For more examples regarding this method, please see the linked documentation. +::: + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "transaction_id" | (string, required) | the transaction id | +| priority_delta | (numeric, required) | the priority to add or subtract (if negative). The transaction selection algorithm assigns the tx a higher or lower priority. The transaction priority calculation: `coinage * value_in_satoshis / txsize` | +| fee_delta | (numeric, required) | the fee value in satoshis to add or subtract (if negative); the fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as if it paid a higher (or lower) fee. | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------ | +| true | (boolean) | returns true | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli prioritisetransaction "7dc902b280da27cf2dabe41ed6f4d04c828714f289435db193a49341005607eb" 0.0 10000 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "prioritisetransaction", "params": ["txid", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## submitblock + +**submitblock "hexdata" ( "jsonparametersobject" )** + +The `submitblock` method instructs the daemon to propose a new block to the network. + +::: tip +The jsonparametersobject parameter is currently ignored. See the linked documentation for full specification details. +::: + +::: tip +Note: for more information on submitblock parameters and results, see the linked documentation. +::: + +### Arguments + +| Name | Type | Description | +| -------------------------------- | ---------------------------- | --------------------------------------------------------------------- | +| "hexdata" | (string, required) | the hex-encoded block data to submit | +| "jsonparametersobject" : { ... } | (string, optional) | object of optional parameters | +| "workid" | (string, sometimes optional) | if the server provides a workid, it MUST be included with submissions | + +### Response + +| Name | Type | Description | +| ------------------------ | ---- | ------------------------------------------------------------------------------------ | +| "duplicate" | | the node already has a valid copy of the block | +| "duplicate-invalid" | | the node already has the block, but it is invalid | +| "duplicate-inconclusive" | | the node already has the block but has not validated it | +| "inconclusive" | | the node has not validated the block, it may not be on the node's current best chain | +| "rejected" | | the block was rejected as invalid | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli submitblock "0400000029865a4962f43d6f95fdf9ccc89f82377a23d1fdc41eaf943c7881a5ca55c5018973d81f5ce7ab99f027b15c86ca88ec5e4b6f35ad4018bfc2058568bbe7f526000000000000000000000000000000000000000000000000000000000000000097954a5b9e830c1d1600ac305580abea34bda62eb503b02fc4b7872428cfa60bf5824a9b78fc0000fd400500c80d4a8c84cec781a5740d8d3fb18587a850b6380f073cd861c4ce7c4290460c533e0d4dd3b89fe0f0052ccdf9d450a1dfcd7263a39422000378da3eeb621078af689447a5ed0a7265a857463a36d72cdd35910d14de9816a25d631aeb0249ede829aca77f9cce1a2e4a84b75e4bd515845043d52f718638fb41e92d8b18bfe1f49e1c0d23223a285b2850e8469dfbb9782b20c8bebf2a61d7b7d8eea310c7c8d5bfa612bf94fd05562ec8876eacafa0c334a651ef70c941459161b60c20511087d63223878052d4fd1a92298789d7c57609fe3a247489674592e8e34a1728b28e2c2b3165f01d5fefa22e6384f7fe4e566de1741e264f057a0feb1b35d51694647ba52afd71c3bd375b924da95e2b413dbea256a2de9ccddcab88bd2e69cc3acc8a778b4d1db78b41df9fea6d69b071f570f628ad47537d081740a4f2c4fa6666dbb862a6d02ff07b5ae0a9fa24b003fa0355dbde0425d6c14452f0d357f2cfd97960c343ba73789a2d7ba580ea8834ef656a9e79c49fc0f61aa9452a644c8bc06afe31dce2a7ca5d6995adc8ce1f77165a075399e1d006e2bb57c09ffd6e21fcff440645faef599264a3b8c005cf60683371ba1af8847d1992c64e512f13d9d2d364969759233a27c65e1f2f1113cdb665e3e8f7baa2c398c4a2ee85a6ad1bdb095962fafaa01c3d85bc820653544b89b6e75a584d8d04bc77e5284a9ebbcd46c1a6732b841e46c876976805d932a90ac215bcc37801900d49cfb87fe5c809b30ebd8ece38669153c1f1a2438253a56a6507d556cc16b2990f0bd290fea59462d25eebdbfcb78eb403c8080e0c68e8e2ef8f67145121bce83b94dc8f9d0a742752323c5a4b42409ffcc37053c58596deff7981a20e3f412c07c839a341fdc177d5e28f7909696f90c90efff14048f440e7ea3181378f66d35b0697dc02c60154778f438cdd3dba5dc4c2763319498bbb3b8fae17508b073d07d83f5f1dc71bf2dc205f06245872620dfa341dbcdf9c574598c121120e91dd687dfd08451369ab29a11dc73f69d0722992a1c70cf1498ec9b9143fcb0abfd7b1e39189125e8567cb2cc3d71fcdb541a0776a5a665161f98385633153fc9702f079269a1dac0d2c708f5d94e346159858cfd50624ff5a0505358739b5f41adbe739bf75852eebb06eeccd79e030019a5227cd9a19e77b6821ba0794fe09cb074f40ce0b92c081c31cda2d4711d53889fc6f0579839fa74309768ef0a796fa1fa660e150d3ea5c0a369e1297d11177fc284524d6d5e40eb7ee4b400f6dfd6a10402904394e1694de300ddd565622e7ca7ed62970ff5add0b36a513b5d90d2194cf414ecc97e5dcc88698e06405dea09f49503c81cc61518f8aee882da6eeae09b4127a7fcc0c0829fca8fda3502ebf13ece0a90a8dfd05d8e514452247f79472c20683e2b1fde5ec14a2453bf00f9f1cd5a088d229a7fdfdfdc24f176fb9a8a409af70d894998957394d30a46668d71cd16907aa800ee9d96c2b9fc7fb5a7944a9b8d4f76609fc186e3c0a4d80fb9c8c236f76eb00bc24dd9abddef7d653740ece7141ac6175f7e9cab1cb0216e85adde43907b60c0581336b50ccd7682f28f00f7efd663df4d31701141657da989d236d16052c4b59fc46fb41657a26d7074fbc9dee602f7d03b86179e4c12bc0df253f815319dff12353a478d95febd5f902e363734e6e5ef4bf1865eb70750b9238be3382a51ded182569d112f37870d43465615ca9174d41f7f3b9eb780a28c7dba674075bbe04538ad669eef7716d1b7b252d49da3b00993f0c829860a1efafdcdc865d46f2f8aec9893b5bc607db33272e5b9f7cf134595e1ad5e8f34b1b7f93ca181c513afc4d8a531c36929e95cfbb4d268a9d94f80201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0603860f0e0101ffffffff0188b6e1110000000023210383d0b37f59f4ee5e3e98a47e461c861d49d0d90c80e9e16f7e63686a2dc071f3ac67954a5b01000000010b1561554a46ec535c4972a3a16652b270ee4af847ec3bbfcf6ba663ebcfefcb1a00000049483045022100b9cd7c1c56d69d9b05d695f9ac86c1233427ec26860774a0eb4e6052fe11ca8502207eca5a4eda1ccf92ccdb501ab7d61cf084d0f4431f059e27ee13ce11f9aa159b01ffffffff0188130000000000002321020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9ac00000000" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "submitblock", "params": ["0400000029865a4962f43d6f95fdf9ccc89f82377a23d1fdc41eaf943c7881a5ca55c5018973d81f5ce7ab99f027b15c86ca88ec5e4b6f35ad4018bfc2058568bbe7f526000000000000000000000000000000000000000000000000000000000000000097954a5b9e830c1d1600ac305580abea34bda62eb503b02fc4b7872428cfa60bf5824a9b78fc0000fd400500c80d4a8c84cec781a5740d8d3fb18587a850b6380f073cd861c4ce7c4290460c533e0d4dd3b89fe0f0052ccdf9d450a1dfcd7263a39422000378da3eeb621078af689447a5ed0a7265a857463a36d72cdd35910d14de9816a25d631aeb0249ede829aca77f9cce1a2e4a84b75e4bd515845043d52f718638fb41e92d8b18bfe1f49e1c0d23223a285b2850e8469dfbb9782b20c8bebf2a61d7b7d8eea310c7c8d5bfa612bf94fd05562ec8876eacafa0c334a651ef70c941459161b60c20511087d63223878052d4fd1a92298789d7c57609fe3a247489674592e8e34a1728b28e2c2b3165f01d5fefa22e6384f7fe4e566de1741e264f057a0feb1b35d51694647ba52afd71c3bd375b924da95e2b413dbea256a2de9ccddcab88bd2e69cc3acc8a778b4d1db78b41df9fea6d69b071f570f628ad47537d081740a4f2c4fa6666dbb862a6d02ff07b5ae0a9fa24b003fa0355dbde0425d6c14452f0d357f2cfd97960c343ba73789a2d7ba580ea8834ef656a9e79c49fc0f61aa9452a644c8bc06afe31dce2a7ca5d6995adc8ce1f77165a075399e1d006e2bb57c09ffd6e21fcff440645faef599264a3b8c005cf60683371ba1af8847d1992c64e512f13d9d2d364969759233a27c65e1f2f1113cdb665e3e8f7baa2c398c4a2ee85a6ad1bdb095962fafaa01c3d85bc820653544b89b6e75a584d8d04bc77e5284a9ebbcd46c1a6732b841e46c876976805d932a90ac215bcc37801900d49cfb87fe5c809b30ebd8ece38669153c1f1a2438253a56a6507d556cc16b2990f0bd290fea59462d25eebdbfcb78eb403c8080e0c68e8e2ef8f67145121bce83b94dc8f9d0a742752323c5a4b42409ffcc37053c58596deff7981a20e3f412c07c839a341fdc177d5e28f7909696f90c90efff14048f440e7ea3181378f66d35b0697dc02c60154778f438cdd3dba5dc4c2763319498bbb3b8fae17508b073d07d83f5f1dc71bf2dc205f06245872620dfa341dbcdf9c574598c121120e91dd687dfd08451369ab29a11dc73f69d0722992a1c70cf1498ec9b9143fcb0abfd7b1e39189125e8567cb2cc3d71fcdb541a0776a5a665161f98385633153fc9702f079269a1dac0d2c708f5d94e346159858cfd50624ff5a0505358739b5f41adbe739bf75852eebb06eeccd79e030019a5227cd9a19e77b6821ba0794fe09cb074f40ce0b92c081c31cda2d4711d53889fc6f0579839fa74309768ef0a796fa1fa660e150d3ea5c0a369e1297d11177fc284524d6d5e40eb7ee4b400f6dfd6a10402904394e1694de300ddd565622e7ca7ed62970ff5add0b36a513b5d90d2194cf414ecc97e5dcc88698e06405dea09f49503c81cc61518f8aee882da6eeae09b4127a7fcc0c0829fca8fda3502ebf13ece0a90a8dfd05d8e514452247f79472c20683e2b1fde5ec14a2453bf00f9f1cd5a088d229a7fdfdfdc24f176fb9a8a409af70d894998957394d30a46668d71cd16907aa800ee9d96c2b9fc7fb5a7944a9b8d4f76609fc186e3c0a4d80fb9c8c236f76eb00bc24dd9abddef7d653740ece7141ac6175f7e9cab1cb0216e85adde43907b60c0581336b50ccd7682f28f00f7efd663df4d31701141657da989d236d16052c4b59fc46fb41657a26d7074fbc9dee602f7d03b86179e4c12bc0df253f815319dff12353a478d95febd5f902e363734e6e5ef4bf1865eb70750b9238be3382a51ded182569d112f37870d43465615ca9174d41f7f3b9eb780a28c7dba674075bbe04538ad669eef7716d1b7b252d49da3b00993f0c829860a1efafdcdc865d46f2f8aec9893b5bc607db33272e5b9f7cf134595e1ad5e8f34b1b7f93ca181c513afc4d8a531c36929e95cfbb4d268a9d94f80201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0603860f0e0101ffffffff0188b6e1110000000023210383d0b37f59f4ee5e3e98a47e461c861d49d0d90c80e9e16f7e63686a2dc071f3ac67954a5b01000000010b1561554a46ec535c4972a3a16652b270ee4af847ec3bbfcf6ba663ebcfefcb1a00000049483045022100b9cd7c1c56d69d9b05d695f9ac86c1233427ec26860774a0eb4e6052fe11ca8502207eca5a4eda1ccf92ccdb501ab7d61cf084d0f4431f059e27ee13ce11f9aa159b01ffffffff0188130000000000002321020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + +# Network + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## addnode + +**addnode "node" "add|remove|onetry"** + +The `addnode` method attempts to add or remove a node from the addnode list, or to make a single attempt to connect to a node. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------- | +| "node" | (string, required) | the node (see [getpeerinfo](../komodo-api/network.html#getpeerinfo) for nodes) | +| "command" | (string, required) | 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli addnode "192.168.0.6:8233" "onetry" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8233", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## clearbanned + +**clearbanned** + +The `clearbanned` method clears all banned IPs. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli clearbanned +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## disconnectnode + +**disconnectnode "node"** + +The `disconnectnode` method instructs the daemon to immediately disconnect from the specified node. + +Use `getpeerinfo` to determine the result. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ---------------------------------------------------------------------------------------- | +| "node" | (string, required) | the node's address (see [getpeerinfo](../komodo-api/network.html#getpeerinfo) for nodes) | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli disconnectnode "192.168.0.6:8233" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8233"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaddednodeinfo + +**getaddednodeinfo dns ( "node" )** + +The `getaddednodeinfo` method returns information about the given added node, or all added nodes. + +If `dns` is set to `false`, only a list of added nodes is returned. Otherwise, connection information is also provided. + +::: tip +Nodes added via onetry are not listed here. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | --------------------------------------------------------------------------------------------------------- | +| dns | (boolean, required) | if false, only a list of added nodes will be provided; otherwise, connection information is also provided | +| "node" | (string, optional) | if provided, the method returns information about this specific node; otherwise, all nodes are returned | + +### Response + +| Name | Type | Description | +| --------------------- | ---------------- | ---------------------------------------------------------------- | +| "addednode" | (string) | the node ip address | +| "connected" | (boolean) | if connected | +| "addresses" : [ ... ] | (array of jsons) | +| "address" | (string) | the server host and port | +| "connected" | (string) | "connected" accepts two possible values: "inbound" or "outbound" | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaddednodeinfo true +``` + + + + + +Command: + +```bash +./komodo-cli getaddednodeinfo true "78.47.205.239" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": [true, "78.47.205.239"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getconnectioncount + +**getconnectioncount** + +The `getconnectioncount` method returns the number of connections to other nodes. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | --------- | -------------------- | +| n | (numeric) | the connection count | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getconnectioncount +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getdeprecationinfo + +**getdeprecationinfo** + +The `getdeprecationinfo` method returns an object containing current version and deprecation block height. + +::: tip +This method is applicable only to the KMD main net. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| "version" | (numeric) | the server version | +| "subversion" | (string) | the server sub-version string (i.e. "/MagicBean:x.y.z[-v]/") | +| "deprecationheight" | (numeric) | the block height at which this version will deprecate and shut down (unless [disabledeprecation](https://z.cash/blog/new-release-1-1-2/) is set) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getdeprecationinfo +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdeprecationinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getnettotals + +**getnettotals** + +The `getnettotals` method returns information about network traffic, including bytes in, bytes out, and current time. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ---------------- | --------- | -------------------- | +| "totalbytesrecv" | (numeric) | total bytes received | +| "totalbytessent" | (numeric) | total bytes sent | +| "timemillis" | (numeric) | total cpu time | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getnettotals +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getnetworkinfo + +**getnetworkinfo** + +The `getnetworkinfo` method returns an object containing various state info regarding p2p networking. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ------------------------- | ---------------- | ------------------------------------------------------------------------------------ | +| "version" | (numeric) | the server version | +| "subversion" | (string) | the server subversion string (i.e. "/MagicBean:x.y.z[-v]/") | +| "protocolversion" | (numeric) | the protocol version | +| "localservices" | (string) | the services we offer to the network | +| "timeoffset" | (numeric) | the time offset | +| "connections" | (numeric) | the number of connections | +| "networks": [ ... ] | (array of jsons) | information per network | +| "name" | (string) | network (ipv4, ipv6 or onion) | +| "limited" | (boolean) | whether the network is limited using -onlynet | +| "reachable" | (boolean) | whether the network is reachable | +| "proxy" | (string) | (submitted as "host:port") the proxy that is used for this network, or empty if none | +| "relayfee" | (numeric) | minimum relay fee for non-free transactions in COIN/kB | +| "localaddresses": [ ... ] | (array of jsons) | list of local addresses | +| "address" | (string) | network address | +| "port" | (numeric) | network port | +| "score" | (numeric) | relative score | +| "warnings" | (string) | any network warnings (such as alert messages) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getnetworkinfo +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getpeerinfo + +**getpeerinfo** + +The `getpeerinfo` method returns data about each connected network node as a json array of objects. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ------------------- | --------- | -------------------------------------------------------------------- | +| "id" | (numeric) | peer index | +| "addr":, | (string) | the ip address and port of the peer ("host:port") | +| "addrlocal" | (string) | local address ("ip:port") | +| "services" | (string) | the services offered | +| "lastsend" | (numeric) | the time in seconds since epoch (Jan 1 1970 GMT) of the last send | +| "lastrecv" | (numeric) | the time in seconds since epoch (Jan 1 1970 GMT) of the last receive | +| "bytessent" | (numeric) | the total bytes sent | +| "bytesrecv" | (numeric) | the total bytes received | +| "conntime" | (numeric) | the connection time in seconds since epoch (Jan 1 1970 GMT) | +| "timeoffset" | (numeric) | the time offset in seconds | +| "pingtime" | (numeric) | ping time | +| "pingwait" | (numeric) | ping wait | +| "version" | (numeric) | the peer version, such as 170002 | +| "subver" | (string) | the string version (i.e. "/MagicBean:x.y.z[-v]/") | +| "inbound" | (boolean) | inbound (true) or outbound (false) | +| "startingheight" | (numeric) | the starting height (block) of the peer | +| "banscore" | (numeric) | the ban score | +| "synced_headers" | (numeric) | the last header we have in common with this peer | +| "synced_blocks" | (numeric) | the last block we have in common with this peer | +| "inflight": [ ... ] | (array) | +| number | (numeric) | the block height requested from this peer | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getpeerinfo +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listbanned + +**listbanned** + +The `listbanned` method lists all banned IP addresses and subnets. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| -------------- | --------- | ----------------------------------------------------- | +| "address" | (string) | the address/subnet that is banned | +| "banned_until" | (numeric) | the timestamp, at which point the ban will be removed | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listbanned +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## ping + +**ping** + +The `ping` method requests that a ping be sent to all other nodes, to measure ping time. + +Results provided in `getpeerinfo`, `pingtime` and `pingwait` fields are decimal seconds. + +The `ping` command is handled in queue with all other commands, so it measures processing backlog, not just network ping. + +::: tip +Use getpeerinfo to see ping results. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli ping +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## setban + +**setban "ip(/netmask)" "add|remove" (bantime) (absolute)** + +The `setban` method attempts to add or remove an IP address (and subnet, if indicated) from the banned list. + +### Arguments + +| Name | Type | Description | +| -------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "ip(/netmask)" | (string, ip required) | the IP/subnet (see `getpeerinfo` for nodes ip) with an optional netmask (default is /32 = single ip) | +| "command" | (string, required) | use "add" to add an IP/subnet to the list, or "remove" to remove an IP/subnet from the list | +| bantime | (numeric, optional) | indicates how long (in seconds) the ip is banned (or until when, if [absolute] is set). 0 or empty means the ban is using the default time of 24h, which can also be overwritten using the -bantime runtime parameter. | +| absolute | (boolean, optional) | if set to true, the bantime must be an absolute timestamp (in seconds) since epoch (Jan 1 1970 GMT) | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +::: tip +Use listbanned to view results. +::: + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli setban "192.168.0.6" "add" 86400 +``` + + + + + +Command: + +```bash +./komodo-cli setban "192.168.0.0/24" "add" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["78.47.205.239", "add", 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + +# Rawtransactions + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## createrawtransaction + +**createrawtransaction '[{ "txid": "id_string", "vout": number }, ... ]' '{ "address": amount, ... }'** + +The `createrawtransaction` method creates a transaction, spending the given inputs and sending to the given addresses. The method returns a hex-encoded raw transaction. + +::: tip +This is a raw transaction, and therefore the inputs are not signed and the transaction is not stored in the wallet nor transmitted to the network. +::: + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------- | ---------------------------------------------------------- | +| "transactions" | (string, required) | a json array of json objects | +| "txid" | (string, required) | the transaction id | +| "vout" | (numeric, required) | the output number | +| "addresses" | (string, required) | a json object with addresses as keys and amounts as values | +| "address" | (numeric, required) | the key is the address, the value is the COIN amount | + +### Response + +| Name | Type | Description | +| ------------- | -------- | ------------------------------- | +| "transaction" | (string) | a hex string of the transaction | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli createrawtransaction '[{"txid":"9f44dc664882198b14e9a8c466d466efcdd070ccb6f57be8e2884aa11e7b2a30","vout":0}]' '{"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01}' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": [[{"txid":"9f44dc664882198b14e9a8c466d466efcdd070ccb6f57be8e2884aa11e7b2a30","vout":0}], {"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01} ]}' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## decoderawtransaction + +**decoderawtransaction "hexstring"** + +The `decoderawtransaction` method returns a json object representing the serialized, hex-encoded transaction. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | -------------------------- | +| "hex" | (string, required) | the transaction hex string | + +### Response + +| Name | Type | Description | +| ----------------------- | ---------------------------------------------- | ----------------------------------------------------------------- | +| "txid" | (string) | the transaction id | +| "overwintered" | (boolean) | the overwintered flag | +| "version" | (numeric) | the version | +| "versiongroupid" | (string, optional) | the version group id (overwintered txs) | +| "locktime" | (numeric) | the lock time | +| "expiryheight" | (numeric, optional) | last valid block height for mining transaction (overwintered txs) | +| "vin" : [ ... ] | (array of json objects) | +| "txid" | (string) | the transaction id | +| "vout" : [ ... ] | (numeric) | the output number | +| "scriptSig" | (json object) | the script | +| "asm" | (string) | asm | +| "hex" | (string) | hex | +| "sequence" | (numeric) | the script sequence number | +| "vout" | (array of json objects) | +| "value" | (numeric) | the value | +| "number" | (numeric) | index | +| "scriptPubKey" | (json object) | +| "asm" | (string) | the asm | +| "hex" | (string) | the hex | +| "reqSigs" | (numeric) | the required sigs | +| "type" | (string) | the type, eg 'pubkeyhash' | +| "addresses" | | +| "address" | (string) | the address | +| "vjoinsplit" : [ ... ] | (array of json objects, only for version >= 2) | +| "vpub_old" | (numeric) | public input value | +| "vpub_new" | (numeric) | public output value | +| "anchor" | (string) | the anchor | +| "nullifiers" : [ ... ] | (array of strings) | +| "hex" | (string) | input note nullifier | +| "commitments" : [ ... ] | (array of strings) | +| "hex" | (string) | output note commitment | +| "onetimePubKey" | (string) | the onetime public key used to encrypt the ciphertexts | +| "randomSeed" | (string) | the random seed | +| "macs" : [ ... ] | (array of strings) | +| "hex" | (string) | input note MAC | +| "proof" | (string) | the zero-knowledge proof | +| "ciphertexts" : [ ... ] | (array of strings) | +| "hex" | (string) | output note ciphertext | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli decoderawtransaction "0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## decodescript + +**decodescript "hex"** + +The `decodescript` method decodes a hex-encoded script. + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ---------------------- | +| "hex" | (string) | the hex encoded script | + +### Response + +| Name | Type | Description | +| -------------------- | ------------------ | ----------------------- | +| "asm" | (string) | the script public key | +| "hex" | (string) | the hex-encoded public key | +| "type" | (string) | the output type | +| "reqSigs" | (numeric) | the required signatures | +| "addresses": [ ... ] | (array of strings) | +| "address" | (string) | the address | +| "p2sh" | (string) | the script address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli decodescript "0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["0100000001302a7b1ea14a88e2e87bf5b6cc70d0cdef66d466c4a8e9148b19824866dc449f0000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## fundrawtransaction + +**fundrawtransaction "hexstring"** + +The `fundrawtransaction` method adds inputs to a transaction until it has enough `in` value to meet its `out` value. This will not modify existing inputs, and will add one `change` output to the outputs. + +::: tip +Inputs which were signed may need to be resigned after completion since in/outputs have been added. To sign the inputs added, use signrawtransaction. +::: + +::: tip +This method comes from the BTC codebase, of which KMD is ultimately a fork (via Zcash). For full details, please see the linked documentation. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | ------------------------------------- | +| "hexstring" | (string, required) | the hex string of the raw transaction | + +### Response + +| Name | Type | Description | +| ----------- | --------- | -------------------------------------------------- | +| "hex" | (string) | the resulting raw transaction (hex-encoded string) | +| "fee" | (numeric) | the fee added to the transaction | +| "changepos" | (numeric) | the position of the added change output, or -1 | + +#### :pushpin: Examples + +Create a transaction with no inputs: + +Command: + +```bash +./komodo-cli createrawtransaction "[]" '{"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01}' +``` + + + + + +Add sufficient unsigned inputs to meet the output value: + +Command: + +```bash +./komodo-cli fundrawtransaction "rawtransactionhex" +``` + + + + + +Sign the transaction: + +Command: + +```bash +./komodo-cli signrawtransaction "01000000660aeb1fef3f0f6e8e9598a2f4b434466b5ccb95e49aa7c4286bc5392d43fa1f280000000000feffffff0d204965060600f1e79bfd183e7ee1b5b9b61c6379d6c95984cb7cdf79231c4c0000000000feffffff0d3eba8ce5b6b6ee7d2e804be57dbe4544d7b7169caf5afd6f207c1275e8977e0000000000feffffff04f8b24c1eb3aeb01cc483a5b6922eb341da17fd42c944b0bb18998c04fea67e0000000000feffffff0360b074597abb6e32c319078ea5f83cdfc85d5c892c0388893d8b66876c077b0000000000feffffff0e2ae757c446029f5dbea36926883744a2d3fe8ee05381c2b4311e7d58057fd40000000000feffffff149c5bbedff321a7810d5db264829ffa5529a4f29ca3a452b0543736339bf0260000000000feffffff1f9e6624bb5185f0b51d36a3a94982f0d8a325bdf81db90bf67945354a6f40c60000000000feffffff22e752f465434c0563a7e0b9d104b8633bdbd6073bbe61d17dee0d53ac8220430000000000feffffff2780816ab4fd0177dfff1a98b7783bbefe8d08f339c964d2438b7e73c8ce614c0000000000feffffff2da12ef31d8678120d4961c9090035ae9e8f48dcfe4e2f461fb10437473c2bc90000000000feffffff39a00efcf7f678ecf0252ee2b4998a43121aaad28abe518be06a830fd34ae24e0000000000feffffff3c5b78d98b3edf510b003cc5723270854313d51ad40859ba08a622f3a269a6690000000000feffffff3ca10423750150708e817fe0020a7fd0a687a0456158db659af112dfefefa2990000000000feffffff4005c2dd439c35e3f04384142b66871e15a72149218d66be2ca3b13f7e1604b00000000000feffffff408d53f3499c6db833b4a9b19aa8cf61c95182775a0539efef9c62a0456520c40000000000feffffff43671a7bd5f31ee1642842027378035d73b06d446fbb1666e95638eb0d55d1c90000000000feffffff45ee4a5c7a98f315d26c1020b26576500ecae4d6a6a78b3ad169788006e7c76c0000000000feffffff48244290df0dccc781e7d081c731081c2e7e022176cc7b4b31fd92c1e31d970e0000000000feffffff48c28c27f8303266e0547b8c453b9823baed7a9e06105c09ba4cf65cb2bd5d2b0000000000feffffff4b28d567f5933d5992559fb19f90115b145db32bd1b6e52d309021da8e6063cc0000000000feffffff4d45006be4acc1bf5c69722cb744b967e615d2d35014fc82cf61c2a4905717a50000000000feffffff4d8540fa9e580b140359e0a17aac6415ca80072f9ba26fc2b43914092f4702400000000000feffffff4ff26de89311f83d65a3936e06937f30a75dd50594246d910035bcbe19c0ea6a0000000000feffffff511e169a83c0c0f8ee7163c34fa0e3b024275892419f11a2bb96d4976d3f9b470000000000feffffff52325adf85f74f38f467bc3a99657f322988add8aebb371bd080088efb95836f0000000000feffffff532ff452f8423507348c542063deb6f257de711237ff8d718143358128e2c6470000000000feffffff5b0d6fe54dce0515e6947f5170478cabb06d1e855365a6b7dbb0118c4450ff0b0000000000feffffff5b7db5b32a8e8e8c6307a7d0afec7062637eec39670f1afb08f0b04a50fbc4740000000000feffffff5cbecf874fd1996cd4e49cd41c98a586c533eac1ebc37df92cf5a9545203f9350000000000feffffff5d015b907e23b9c5e00907013f66d258fab2f016842f0c8e69346d72b0221dd70000000000feffffff65c461a04f571b50ab4fe3e367952bfba755eec9b6ed23cb460ab3bdc873fff80000000000feffffff686da3cbb1a1af26c2c01793345a5fb8ee47829aa907ab95b8144fbeda1707920000000000feffffff6896423421d7e1193a7b88d2fbf1eef1c46f637e7a49217c171a18852d29e8d60000000000feffffff6a0f6f77ae1d42dc96c39c620f401f32c9774f18f1a039e97b4b405b8aaa757d0000000000feffffff6cfa0bcd2e2689498496dc4b15feb0fc535667a88005f2c88198265bb1f8f3d80000000000feffffff705456a54cb0b94ec15890bd957dd778581f606270a331ad5b15ef48684a5fc40000000000feffffff718076a7dd771121e817b98e98f46c7f52722d6cdfca9130203fe5965f0a3c000000000000feffffff780ed86aeead9747bc96bf7053b02ada6ac566481763e70c29d3d00162bc7b530000000000feffffff7b3ad2352be9169286629dcf064fa769c23a8aabd468c30eec35a0c79b61f1f80000000000feffffff7fc4676bc415a467bd10d303eacd54617acfb6876945e3bf1217dfd208c6d58d0000000000feffffff80fe96eb05e5fcf89fa7e19b1a653e0b8164cba383e2d2ff5934a61c42698cb10000000000feffffff875ea454109c4725766d372f0fe395dd4744737378b3a246094dc0db7fb6e95f0000000000feffffff87b7c1fd810834fdd892975a795b9e6c1b1aa398436ae3ecb19bce62ac11aa4e0000000000feffffff88b22fca9de29db1901e9c8accbf1caf8fd4d5a37802b3bf5142038809ee3c690000000000feffffff89e4b0f44e022cf53736520aef84a324100f19f4f0862c9d2150b686e951d3740000000000feffffff8e0611807aa639621ca6be13a2eda8d98c32867041f929dbbef7742c7c867db00000000000feffffff8e77d64182b666e50377b3c9a39395735a89d2c90f5ff62024143f2c25ea51d50000000000feffffff8fe0b55ad0e150fbfe8d263c44527b967c44fd79ebbe88a09a91a4318f1c17c40000000000feffffff91ad86b51f541d480383681c4faa26575f723154ed6e39cb76e03317c8984c610000000000feffffff927673288f7c95f452e035b65c8cd46a57e58451b93dcfecfae0c33f00b4e5350000000000feffffff9477cc8e7dddfa7d183bfe0771def3778e7b2641996a3ea52f42d085d4007d190000000000feffffff948a1e5af04f265b29fd23700d1ac9926b5bed71ed5b2968f29abaa15036848c0000000000feffffff98a1cd6c74d9d42f88032e74182cfe8e71f125eb7eb1b49e8334d5b17bf4d07e0000000000feffffff9a7fefd1b1409dfc23d6be09dab5692cd9f6c59c98b2d7b0231f40b396999c2b0000000000feffffff9b0ed42c0446f8ea3c19b47be97f42d1a546bbd6a5a311cded5c1dd16c3606d40000000000feffffff9ba78bb678f5b7a289ca37b49835bc6ad383e2089dd3711833383c0c6e6d40cb0000000000feffffff9d2bdc85ec46fb0457dd41f02f5f7b203ff8c844062f3376c7f86cf2144dc6a60000000000feffffff9dc64c498135ebd6c025d7d43ae71120d6477bcbcd9828aebe21911ea21655c80000000000feffffffa0c3203666c02ea6f958408c8f2241b4d6e3a8beb9ab54736fe73621feb57ce40000000000feffffffa14e8b18777a8710e58942b56d094243151299f033cc21bb3ad3dfce2b3e77ad0000000000feffffffa262a97a28944d41d47c7f8788528c797d322f7abc0390c20bf22e3b835e127a0000000000feffffffaa3c2496b8237d865f81ff0bb8eb01bf2b69ee806463816ec83b60cace7a58330000000000feffffffabfc5cf05834234e1ee8a3c87c8de5d6a07f9530a09f2b34d9303ef30d8646cf0000000000feffffffa2d1512943366ab64e6d1749b81f993e830e5b546a87b9bd68fe0c5c865da9530100000000feffffffad976a10bc9ebe391cee6b83191520a9d0fb62a24e969477a4cc6dd26b29e4da0000000000feffffffadd486a6d94629b19713d723301b135c11af92b5ed69e6f0b9ed07d417078b240000000000feffffffb04574d6517ca90a26e07a749ebcde23f67f7ef8a594b23e699fa084529d96e80000000000feffffffb2197245ddc53b189c18d05d167210fd6291c6b9116862144c3654da5bb55d060000000000feffffffb4b953583df750085d727027674f69c6ba63513915941e42924a462d5bc15c9b0000000000feffffffb7f5149ac38efb591ad8c3a46ec9e979d5647c964190a135342435b55484dd570000000000feffffffbfc02225e0c5351bbeb63adb8e3b7859752363a5b85f5b2a6da5240a449e80650000000000feffffffc0def09bb3cbf791c52764cceadd389199be9d7603cc3d6d213ba45ffc98518d0000000000feffffffc5c9957c3a3e03204e603c313368d3c01206320beddfd28b850fd17b09a61a410000000000feffffffc64396e634d716a5ae280d9fd821507239d7b25a812eea6751254e462c8a73a50000000000feffffffc69c9cdd6825a657be1a06008f73b78cf185a9d195ba771451ca1ec09ce54d4f0000000000feffffffca6112fdc1db1a441961f6eb62b492c1397732cc5519d40f6aa335612f42d39c0000000000feffffffcb15dbc245dec1ef8cb8e25ef11921ca804c023e6ad803ebcb2a7b98380b60b30000000000feffffffcfe47e6ce0780c4594a2d1b76a2906c0a9ea32d39a73c244aa9d5d8dea67248c0000000000feffffffd0a4d502c22cea7da0d1a3cf99aef598b74fad19a6de35f21c6fd0d1b8cf27560000000000feffffffd25452b8575cafca10255179f95c8c66e255329220b7ff645af522af7b8038320000000000feffffffd3922dfd1a65216bbcd4646d0cbcfa70cfe587775cf4c673043c57061f48d7630000000000feffffffd75c777645d534009bc8e7b2c0b58a78cd63f41f47f6cd30868aeaf9b55e47700000000000feffffffd8f837530faf0d9b50efe1d79aed453b11916d565a2b9c40a380a85f0be2af6b0000000000feffffffdbce76e284668c829366dafd00ae4884ea39b2aa597cc1b4d2a37991a9b2ea560000000000feffffffe481d9493d67997104c12972b7c8a73fb87b16e228665bb784436fc0f58d7e660000000000feffffffe7a22d3d87255e4adaab9a6fd8a72320299a6902426424aa8b2b89b7c3b0c0950000000000feffffffe80ac9635b6bd91c1935eca6df80876ac8cdc87a2b91e925cfdcc0f06059b2e50000000000feffffffedad3357a1a9aeeb8c2771cc6f284db92a2aa31f458e35bb270216015bb0edd40000000000feffffffee85afefc31a99a4616bfb228e1f48691976b900ecdfe838e1310bf5b33fadcf0000000000fefffffff13e4784de0564595f3b4cce57ec0d8a4b72a798feb65f5fbca5b26a3a91d0760000000000fefffffff205212771fd3ca5a68340fa307810e44315ae02464b5d8a235ba6bca691bd710000000000fefffffff31cea9351fddc36393fa996962e204c461a34ff1c6ad243b3a4902440f165da0000000000fefffffff3c67e78777cc42ae2834bcf5dce5493fbcfcc6e0aabd7608cf4f9c936a37f490000000000fefffffff3ddc14df664f6e4f59b1f1e25241a61fc69f13125ea5a67edbd03b37d332eb50000000000fefffffff614bd5d83278ad95d8c5bf6fefe59b3675e832cc1c2349d7952aa734fd202830000000000fefffffff67ef42d75fc5d36ff32ab40f5c9f88f279a1173ee1db227a4706aa0480d66ab0000000000fefffffff69f0798ab6de485dcfe72391f4cbb1e5f4d39ee8f852b80fd4bb730eabd8e930000000000fefffffff8dd75e7c674cf7bf15f42fcb1256ef4f16b96e0ff6a359bc24c07ba734f09a30000000000fefffffffa0c47583d4c6f18e12b93764ccf57d2430a52bdd0ceb611924a79c82daf48b90000000000fefffffffa5ca0440f302bcf118946714dba6e81036e48477ff3a315084fe682aea6d1d50000000000fefffffffef369694bf0493161762e49d7ca16f1ba600250d801a848d0ca8d3f2d677d4a0000000000feffffff02c5490f00000000001976a9146843838a0aa11686cd0c01fbf470c9c5f302249488ac40420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +Send the transaction: + +Command: + +```bash +./komodo-cli sendrawtransaction "01000000660aeb1fef3f0f6e8e9598a2f4b434466b5ccb95e49aa7c4286bc5392d43fa1f2800000000484730440220234b370cddf91b27e172cb5d6257a9807e63cf680a644229147b39d87e597875022047a58509a11b190107a9ff6e08143bd0d450db233518ed26f123bd739576e9c201feffffff0d204965060600f1e79bfd183e7ee1b5b9b61c6379d6c95984cb7cdf79231c4c000000004847304402202ffed5ef972b01ec4290343ab0bc4cff989d0047f2cbc9e8b69f0f3102824c0e02203c7e3214344e6ac430e4f996a8980e7d9172ea1e8c0c238ba32b8930f4d4119301feffffff0d3eba8ce5b6b6ee7d2e804be57dbe4544d7b7169caf5afd6f207c1275e8977e00000000484730440220096fdd062535f200897de2f2dfb7d782499dc5fc24d8e06805eebed6ec125c07022077e4379409bd7c9052608e8cd52cd83b0c9314c623d9b85012eab28e10f8c13601feffffff04f8b24c1eb3aeb01cc483a5b6922eb341da17fd42c944b0bb18998c04fea67e000000004847304402204a8f45abf51333ec7c4491cd5750e5d46785475ebdb0a13a6a946711f17483a9022075805ee9f2130c3938e273c280b6b14b27640349b537b55348c40ede1508938f01feffffff0360b074597abb6e32c319078ea5f83cdfc85d5c892c0388893d8b66876c077b000000004948304502210089c7919c6e7412a1569434f74caf7110bbb0341361384067265c142c8e033b2d02203d5eaa583d727fad487bbb689bf433bac32d907e707043e8f96f8c50fd3480d501feffffff0e2ae757c446029f5dbea36926883744a2d3fe8ee05381c2b4311e7d58057fd40000000049483045022100a0672d882511b01696192965175f3827e65ef8d45b3217b563d0f97f3cab512602205c568b5c1eda0c149976380b38d2f93ee384500bb5eecf6e9f3f2101d649eace01feffffff149c5bbedff321a7810d5db264829ffa5529a4f29ca3a452b0543736339bf0260000000049483045022100981f7f5210e17e1c73fe5083ca7b29a5b1a9dfbbf5474c109069a4b3eecbb5c5022065e21331260c718788b72902da250418b0091537a540e8f6152ae097632637da01feffffff1f9e6624bb5185f0b51d36a3a94982f0d8a325bdf81db90bf67945354a6f40c6000000004847304402204391d39a88d2f8427396bbbca508bcdb3b6897c25bee4c68d357b878419285a602205da8f54aec5bb9253aeaa9b4c4a1a8a2fe602e894422da0279f21f9799a3540201feffffff22e752f465434c0563a7e0b9d104b8633bdbd6073bbe61d17dee0d53ac8220430000000049483045022100d5a4b70ce4542e30a7cfb09ea259405ee202f99b556c88604b06a86419b2e72602202417376668f93e44b404ec2bfe6e797b699367604de296377dfc6944afce722901feffffff2780816ab4fd0177dfff1a98b7783bbefe8d08f339c964d2438b7e73c8ce614c00000000494830450221009d1878ce69f3a438748bcc73de00d531492cd36d2bf7a292bc5bbf67fcf6c774022066e1705510ed5a5177e78a71ba9891d69e11a7a3bc28599d5d18c29c2033a00e01feffffff2da12ef31d8678120d4961c9090035ae9e8f48dcfe4e2f461fb10437473c2bc90000000049483045022100fe0f6284ddb97b4595d77cf7ad5ef4f5caa67cb7c4b6e6ee9812bac076787377022032991f85e1962140673af04a85a442bca3df931ca52c365d3cf24e79b782b2d101feffffff39a00efcf7f678ecf0252ee2b4998a43121aaad28abe518be06a830fd34ae24e0000000048473044022038759690b62c95f80a54d3bde28abdf7dddae992ee4a18c511a4d442da67d758022016aa7dba3da26aa7531731222a0f66cec25c5026cc4903b51dd3fe5483af4cc401feffffff3c5b78d98b3edf510b003cc5723270854313d51ad40859ba08a622f3a269a66900000000484730440220141e545e4ea0c27a630972d474b7d95dd2c9da1a129a7e680016e4ad70c5579102207a3384d8c988bfa526bea0f7cebfb8a8d81ae4b7272d23e83268791fc8eba2bf01feffffff3ca10423750150708e817fe0020a7fd0a687a0456158db659af112dfefefa299000000004847304402205c4e4f8934cea71191f87208bbbaae36b2b3ac4f7282256cc05446cdd1ccc0980220038db0a46e2b06fd61acdf1b47a5de87b787a62a1b65db823c904efa6223129b01feffffff4005c2dd439c35e3f04384142b66871e15a72149218d66be2ca3b13f7e1604b0000000004847304402206b8854445fdb689929143c8daf33fa52ddee06c360073f6262ffea4db0b8b71102200b4d7a166bfa81e8f2570afcd9de338b9a0d7bc72a3962c775205933690f302901feffffff408d53f3499c6db833b4a9b19aa8cf61c95182775a0539efef9c62a0456520c40000000049483045022100c1f028354c1034e61d59999070a8ab554a97f81583d72f38c0f6b0b7a52fe8ab0220538d6fec3f35a595614602203b360730b2f13c3bd879fdadca06dd8a16b90b9d01feffffff43671a7bd5f31ee1642842027378035d73b06d446fbb1666e95638eb0d55d1c9000000004847304402203fc7529cc7a96726728a4aa6a1698fc31bad94d1eadda2a0f74ea8f22d752869022011983a3c457e5c7ffc87b576d877e6f02ab8e08dbda6a94dfbf245315a3365e201feffffff45ee4a5c7a98f315d26c1020b26576500ecae4d6a6a78b3ad169788006e7c76c000000004847304402207a60671e1d0cd3d5d7b8eb2a1b53a0014f30de45f0e379a30435a47e7f9861eb0220689af75a99876c1d1d206869dca223806c45ad64f32cc08cd624936ec6c0600f01feffffff48244290df0dccc781e7d081c731081c2e7e022176cc7b4b31fd92c1e31d970e000000004847304402201972bc346632bcd5166cecbd9d7ca29583c7ad938640d7db9f4bdc6629fff086022019135d7341ef96813a839c6cc14f47c7d2e42c262abbe8747e16c6869cf2b90a01feffffff48c28c27f8303266e0547b8c453b9823baed7a9e06105c09ba4cf65cb2bd5d2b000000004847304402205e40a09a37c939cfa6b5143a2ce596452ecbbd223400922b0001bda694f4c63602205aad66d989167c9bbca130aa489de6286390e55f9e9ef4c5c043c2f13377c7c701feffffff4b28d567f5933d5992559fb19f90115b145db32bd1b6e52d309021da8e6063cc0000000049483045022100ceb282925d7eac742085d5ac48443e9af8b72873fb7a2f96b4e196a58a4b29d7022074790a63adec4088a5d5c2bf1fa80597be0e17afc7490620163a873a2ef1855d01feffffff4d45006be4acc1bf5c69722cb744b967e615d2d35014fc82cf61c2a4905717a50000000049483045022100c6f42ccf0af44182e144aa925b631cab8d90959fa96eb0453335a970e74910d402205e99e1f1d23813e336a3c96efd6e75490f3b5d807f0f2bbc677499cc0b92f47a01feffffff4d8540fa9e580b140359e0a17aac6415ca80072f9ba26fc2b43914092f4702400000000049483045022100b42e72fdb23f4f50af0222d5e590bcc676d60858583dffc1ba8b35730e1c8eb102207cc50ecd38639100131b4c4950cedaac4c4ee37c7a6f87d3ed7fb7eb165559c101feffffff4ff26de89311f83d65a3936e06937f30a75dd50594246d910035bcbe19c0ea6a00000000484730440220425c41bc88fce16ba54f2611a54737d9b5197abc541c730711157b290486cdc6022003f967d0f98864249d80720c65e04c475cbc12c482104aa7e45a06bc9eb080b901feffffff511e169a83c0c0f8ee7163c34fa0e3b024275892419f11a2bb96d4976d3f9b4700000000484730440220136e776a7bfe3fdb5a5b8db2783452ed7cf1fe3c89ec001ed69455a082337e49022057e7dc0ace7ae100a2f2c26291cfe80352b34dfd9269d07468ee2dfba13fc02001feffffff52325adf85f74f38f467bc3a99657f322988add8aebb371bd080088efb95836f000000004847304402201fafc46f92d80a9b4f71a15113ae8e8182dcaa09cff63645db5b858044f329730220160082cc1a3bb262458a204040c3ecc23b276c4558ea095c1b66e20a4004e26b01feffffff532ff452f8423507348c542063deb6f257de711237ff8d718143358128e2c6470000000049483045022100d8dfe5557eae68e8b3da5cc787b14e85fb4d10d2c8a80eda12e69b807319ff9902200b104ae561f1d9c4f0c1646327686f890aed1ea8fb1c1b411f07059517737d0001feffffff5b0d6fe54dce0515e6947f5170478cabb06d1e855365a6b7dbb0118c4450ff0b000000004847304402207fad37e344180882f9cfa3e36d036282a91467ff15fca2f24278f5fa5283b99d0220325dda0a7c35a85cb617bcac369ec0033023c221771cf02f1f877f693f1059d901feffffff5b7db5b32a8e8e8c6307a7d0afec7062637eec39670f1afb08f0b04a50fbc47400000000484730440220752cc9659edbddc78293b1947f84d2bd69e32ef4d5425d4e55df4ca74a7a962402203a755152ab6d38a7ba91f26f476d611cd9c6b27167d6e20b511c4830038d102c01feffffff5cbecf874fd1996cd4e49cd41c98a586c533eac1ebc37df92cf5a9545203f935000000004847304402203af4f03cfed41a4d8387a0859324ce3c40c953582e8848867d06d3aef096deba0220104c18b2e243cf7f076d2833c4fac30e0f5e62b58bc039cba6ce7fe47ea394a101feffffff5d015b907e23b9c5e00907013f66d258fab2f016842f0c8e69346d72b0221dd70000000049483045022100bc3e1c873f25e1a661ef81c109de1758ab13df3fc591540658c5fc05bb1e8c150220309b87661ce039899d5be3b510fcdbb9464ff8cb47af06c016390d79daa7029c01feffffff65c461a04f571b50ab4fe3e367952bfba755eec9b6ed23cb460ab3bdc873fff80000000048473044022037b231fec860afbac51e3034e1308e1873d87dc586258ad8c7ede04cf0fab97e022012eceff07cf09a2c3d2f6884ee885ff9f8e7526de8c08b54e5e538ab223bb31b01feffffff686da3cbb1a1af26c2c01793345a5fb8ee47829aa907ab95b8144fbeda1707920000000049483045022100a0d89b8331105f34528f2c9687f53897a2a14f57cde1390513b4d0fda530a4200220573800bfa5cba98af2a08fa3e87fd0142fe1db6f391a4d160f70565b1078210d01feffffff6896423421d7e1193a7b88d2fbf1eef1c46f637e7a49217c171a18852d29e8d60000000049483045022100cde87af1eb614761149aef298153c541e24ff45345f99dbef18bf2379d27f347022063115fb6b37842eb7cc4d8910ccd047635a9674e72d9418894614014c19d583a01feffffff6a0f6f77ae1d42dc96c39c620f401f32c9774f18f1a039e97b4b405b8aaa757d0000000049483045022100a82d1afe573bfaf0668b3acbec55f68bcbb58bed7b806d59837c32f3560cd1d70220198904866e0bd9d19cc465cf09e256c439ad5309caffa347b8c416443ed07a0c01feffffff6cfa0bcd2e2689498496dc4b15feb0fc535667a88005f2c88198265bb1f8f3d8000000004847304402207917043acb4879438625ace42109cc1bee16054222473d2f975b3edf27286f3602207413e93cf5e696de7c0d210dfa70cd4dd9e62e78ed86a3d99682ef8ea5c064cd01feffffff705456a54cb0b94ec15890bd957dd778581f606270a331ad5b15ef48684a5fc4000000004847304402206668503174e874bc09d999d7bc47f82a5ac47c3f1bc1c43ffa1cca74c1cde4410220616df31f268371b61d83acdfd394a7bcd8da5817174faa29b51c648786c5405a01feffffff718076a7dd771121e817b98e98f46c7f52722d6cdfca9130203fe5965f0a3c00000000004847304402200f1c2ef04cf5fceacb53724360ce3af3794d14ef8a47d4d09c8e3b95b20e48770220659021ba00a68e5f2f4053ec904cc7e65b5bd5db76ff45a9be4ba35ad1a2d0a201feffffff780ed86aeead9747bc96bf7053b02ada6ac566481763e70c29d3d00162bc7b530000000048473044022027f04c7d149ed6c9c72ce3956917444cb5f943aa95adb694ec30ef53c930cfe202206dc14b5f1d59b6724fea484501e36fe7bf40849614921cf76130ec20665f35d401feffffff7b3ad2352be9169286629dcf064fa769c23a8aabd468c30eec35a0c79b61f1f80000000049483045022100c4a61d02e54b0c0b8a9749d394d6447326bf66f3524388b8854c5585ad71704702200b0e71e178082df01e66d0bb72aad0238b0063018cae190c2f21c0fbd78a462001feffffff7fc4676bc415a467bd10d303eacd54617acfb6876945e3bf1217dfd208c6d58d0000000048473044022064ab0c92b7cb2205f1d7af0a2faa441eac041cbb892b166b8f1f060019301546022066924807801b03876a0ac1830eb355ed26c7a67b9e28fcb0b3c6dc5d3c8ca1db01feffffff80fe96eb05e5fcf89fa7e19b1a653e0b8164cba383e2d2ff5934a61c42698cb100000000484730440220515b9c588036449b326ab8d74679cf65c7fe780a03b23ba8428cf829a070abd402204c71e343cfe18e166b7259509b47dcbec0b5b29a764e4dbd29a39479ef60d34601feffffff875ea454109c4725766d372f0fe395dd4744737378b3a246094dc0db7fb6e95f0000000048473044022039167229a3f6ece80aebdfb425608c855989a0e7934abe0c4fca1175f60d46b5022069f57fb057a537cd95e5ebd6a93709e0bffde3d05bd01322f08d0fecef7c061f01feffffff87b7c1fd810834fdd892975a795b9e6c1b1aa398436ae3ecb19bce62ac11aa4e0000000049483045022100ab701a93c793c182bd54f06f80de91c03e36fa9b33b220a91d028f2196d329b5022020e23cff44abe2510b50ce0a8cab286d3ae17c59d8aebd20b42613b764a128c801feffffff88b22fca9de29db1901e9c8accbf1caf8fd4d5a37802b3bf5142038809ee3c6900000000494830450221008ade6fbaec28bf02b3914ffc62c4e0dd7da3d50b41b1054653826a38573e6c13022032d2528595fad675d3f01aad532bdd5ca64960a9cdec35822bb0e69b57fb78ba01feffffff89e4b0f44e022cf53736520aef84a324100f19f4f0862c9d2150b686e951d3740000000049483045022100e69902cff246e6ae5ae8a502aaf2ecc0f8505b8546b17fef18a6e2dde8703bc60220121b6293f7c24aad7766900a746693b9e30ef4e8cc1ca01b2ed4537b47debd2f01feffffff8e0611807aa639621ca6be13a2eda8d98c32867041f929dbbef7742c7c867db000000000484730440220710257eb2b9f5e7b9517770f81c0999a7fcd5b798d8665e0674abec0909b5bad02207bcbcebecb36661cbc8793575f62524dac431fbee3f9c02fb0d854933357694001feffffff8e77d64182b666e50377b3c9a39395735a89d2c90f5ff62024143f2c25ea51d50000000049483045022100ec5f6927e57df66eefcd1275d4236f38841466cdb29aa9ed8c6f8b8f64e0cc4302200141c090ae22c294844bd0b5179f97fd4b98cee426dfb795c3288f37f67a70e401feffffff8fe0b55ad0e150fbfe8d263c44527b967c44fd79ebbe88a09a91a4318f1c17c40000000049483045022100bbaec071109be2005be905bc0b2877286f24cfdb4d8431a31c8f57d802db31270220345e56f174738a6a191ef0a91c4cdeb686dd552d8992ea6ce7517e0ff9cafad001feffffff91ad86b51f541d480383681c4faa26575f723154ed6e39cb76e03317c8984c610000000048473044022046628accc862ea34ab15232f97505cf673d8bfd23d6316677e524e3643e92a20022078414e64419c96474fe2559c30134ac4c08b5a0617a0dc9bd1ce09e85a8df89001feffffff927673288f7c95f452e035b65c8cd46a57e58451b93dcfecfae0c33f00b4e5350000000049483045022100b9e84841140ae7b9bf08f82e014247a8c270d4073b457fbee74743c413e0b4370220292fc63652cd2fae0d1baf9c705de61478b2ec8d4623b9ecaf2aca715c1e69d801feffffff9477cc8e7dddfa7d183bfe0771def3778e7b2641996a3ea52f42d085d4007d190000000048473044022073842db3431ea57cb4aa05435648817bacb36a623e2528817e399126068fbd8b02206744687cfc5587f07d6a507eeeb2aaff45731b3dd9222c40f2b62b60e4db59b301feffffff948a1e5af04f265b29fd23700d1ac9926b5bed71ed5b2968f29abaa15036848c000000004847304402207c5440b72bc608cdf4c7fad0bccdc19d43877e31b22fe3f5873f558a6068e28c022013e3a5b0b11eeec0bfd5cc8317c8a61ccf28ce19a1b50fd7759502a350b991e401feffffff98a1cd6c74d9d42f88032e74182cfe8e71f125eb7eb1b49e8334d5b17bf4d07e00000000484730440220393955bb76c236467d92d42091a290631cbcd9ef3c3f177ace6f1ce73abe319f0220153d5c0aef39f5cea8ef53822993e374dc6d66a758d599f25d2e934d8c97769601feffffff9a7fefd1b1409dfc23d6be09dab5692cd9f6c59c98b2d7b0231f40b396999c2b000000004847304402201f9d944711c3ee35c47b68ddac1a0e1f728884847d8df788b398157de22e9bbd022005d97ceca294e96f5484420189d7a99b9850ecb2c849223ddb934c6c772e32f401feffffff9b0ed42c0446f8ea3c19b47be97f42d1a546bbd6a5a311cded5c1dd16c3606d40000000049483045022100d42b4c9c6fbcbd65d69f0967cca562227f8fbab7ca2727822eb9eb4d0ce8e77a022049d752916ee19c285675786aa04c37d7025e2cef6907f70849f55cda414f3fb501feffffff9ba78bb678f5b7a289ca37b49835bc6ad383e2089dd3711833383c0c6e6d40cb000000004847304402205d3a652a05971d324947fb9d4d15e98393262498e09a6d8fdde7422af91d341a022070e017f2edf61310cb724401a451c1d2be59175e68b49e5c1f82f20084f0b2e501feffffff9d2bdc85ec46fb0457dd41f02f5f7b203ff8c844062f3376c7f86cf2144dc6a6000000004847304402202f93a774f96364ad8fdf46132f47dde1fac4b833d1cf7c20c6c69f03c605c09702207cf7ef42d8c97b96e349d023efd9e7e0b1fd74c50561290d16f3f122e1ead8fb01feffffff9dc64c498135ebd6c025d7d43ae71120d6477bcbcd9828aebe21911ea21655c80000000049483045022100f72cd391c5dd1bc77de0605a3cb35c246a5c1cc14e7b9b3fc1cdd90fd42cfa4b022069049bca8a2f5100ada2a407a2354d04efa94573a7cd1bfa4130cde66e481a1001feffffffa0c3203666c02ea6f958408c8f2241b4d6e3a8beb9ab54736fe73621feb57ce40000000049483045022100daa9b7a48975348b41dfdf8b5e4614721fd018b950d3cec1d7009386bffddb470220522220c5f3ad8f1f19cb0eafea1aae7a3489cdd3dcb3d64f2ce75bd2066a73dd01feffffffa14e8b18777a8710e58942b56d094243151299f033cc21bb3ad3dfce2b3e77ad0000000049483045022100a9e02b9ad05da478a1cf06a235743d202d1f9e8c2e969ea8b1b7d5fe6778fd9602203880f139bf40766d264c2d7f858eb36dc2257b4cacd116cacca400645f80680401feffffffa262a97a28944d41d47c7f8788528c797d322f7abc0390c20bf22e3b835e127a0000000048473044022059a9da8cb72d3d3967ad3adcfb400ee6043ee088707424728de63cba9361da2102206ca3e6681ff149bff11135315d431e24e05aa3c794b41ef0822b8969b0d1597401feffffffaa3c2496b8237d865f81ff0bb8eb01bf2b69ee806463816ec83b60cace7a5833000000004847304402205637e4e9538fa7489e017da763bce9182c5e78492fe23d5366c0638af15c7eef022034e9a552d342053c4184cea58684ffbd0881467cd0a40f009db155275deae1c001feffffffabfc5cf05834234e1ee8a3c87c8de5d6a07f9530a09f2b34d9303ef30d8646cf0000000049483045022100a68eff499320029204dd73f707d36d65583d21ebfa063d770f55139ed546ea8102206646e141b55f506ed457f24311eeec6e302833f69cd08c9ea3086c78f82dfd3801feffffffa2d1512943366ab64e6d1749b81f993e830e5b546a87b9bd68fe0c5c865da953010000006b483045022100c686f7a4b2e8af7deca60cb20b0c626609548f5426dda6bf33207f82923e0ea202200d9c36dc490f014d0d4970ce8c18621d39b6c0c134c7e43da0f62326725598ba01210360cfa32fd05b4c3bc270fc6e8c891af45a149d34664746ffc67f5cb49c6b5f5bfeffffffad976a10bc9ebe391cee6b83191520a9d0fb62a24e969477a4cc6dd26b29e4da000000004847304402203385b46d676be7f898b316fdcf56a8521bda2224ae891b48be05cd880ae7a0e502201f6de4117623336529e445e0943c519e80150cf0d4a5b1427766d06db2d7a26b01feffffffadd486a6d94629b19713d723301b135c11af92b5ed69e6f0b9ed07d417078b2400000000484730440220575a03c7a331f65defeab66ab1404503a700ece0780889266bd1866ff806096b022069348e446f67f551949267b49861e96904e0b47c75a220aa1cd7ffec3b8fa7d801feffffffb04574d6517ca90a26e07a749ebcde23f67f7ef8a594b23e699fa084529d96e80000000049483045022100948f7ec200d121bdea79b29bf1c608c6d5e007aec62acfb3a5cbcae84ce457490220431802ca646caacfeaf1827e1ceb70f07752413c65bb50db24957166603bab3f01feffffffb2197245ddc53b189c18d05d167210fd6291c6b9116862144c3654da5bb55d06000000004847304402204def3dfa143d5887b4075f45d92a91df9825f1e08bee1c29901c1f117ab30df302207eff300c5347d13f531ec36789a6f4f66c07149ff4c86f21107d0f21dc400d9e01feffffffb4b953583df750085d727027674f69c6ba63513915941e42924a462d5bc15c9b0000000049483045022100a267fdd914d9ce78ca819e08312fb2b3c0f9c395bd30d22b26ea8c6a8af3618f0220548b821abd8f1f1fec1db25fbc277cbfc5840e47185a830174a97b74645af60401feffffffb7f5149ac38efb591ad8c3a46ec9e979d5647c964190a135342435b55484dd570000000049483045022100d1d05a271a8516b9357b0e3e73d5413aa138ae9a10c1ccbe30ba7ef15994c24202203df3584a99260ff637db9515361b258e6cf7fbbfa15278b29173dd2c4f25264901feffffffbfc02225e0c5351bbeb63adb8e3b7859752363a5b85f5b2a6da5240a449e8065000000004948304502210082c85c2c7d8316e9e3cfba9f5bafcdbbeaf0509c3e896bd4121f19e4b82cbfe6022070d7650714cb1975215fe109b8f1da2eea866abbdf05e487eb1d75e12776e52d01feffffffc0def09bb3cbf791c52764cceadd389199be9d7603cc3d6d213ba45ffc98518d0000000049483045022100841df35265191f063a9ad2414ec9b36fe39ef9ae13c9fde0e82d67ec9bc654e302206dd8523cf58547ab425ea55a8d879e75d31558701d4f57d76b0f67736ca5e5ea01feffffffc5c9957c3a3e03204e603c313368d3c01206320beddfd28b850fd17b09a61a410000000049483045022100c3467add04b9e313238376a0d3867bc5b59fca8b2eb76bcc18fbc0b0805e63960220578a2cf379848771a9b13e12559cd130853c7f02d9ab497a74f3305aeaf7b00b01feffffffc64396e634d716a5ae280d9fd821507239d7b25a812eea6751254e462c8a73a50000000048473044022040e5e55b23846cbd5e0af588564e5501d58cf2a18eb485c562352fe2801230d002200c70fcf828a81c1cfb856a2d2cc9de21f2564e6080b2f84f44c65b679f49d09c01feffffffc69c9cdd6825a657be1a06008f73b78cf185a9d195ba771451ca1ec09ce54d4f0000000049483045022100e10488858800081f775278c5d844ba2c2cda71ebb4a822d028637191e13efb2602203f7e7f580dad9d7ed1d4cda38222095d8377917c7d4e90c8abb4b9bf3a40975c01feffffffca6112fdc1db1a441961f6eb62b492c1397732cc5519d40f6aa335612f42d39c000000004948304502210097ed9842254112825356823d7365ce8d0bbc973702be7f25951e21f48fcd6e5702203a0aab0ef62926936815e1d9490b335359f766d0ace9b858d59bbd8ba26cb1d901feffffffcb15dbc245dec1ef8cb8e25ef11921ca804c023e6ad803ebcb2a7b98380b60b30000000049483045022100bb9285cab4a68dcb68b46687b59ab1769a0b5aa1ea6f45488e189f58e698321f02205e6499101ee3b0f005e6d3ba151282c236a79d32488e16b1867c6e70c8f7f51001feffffffcfe47e6ce0780c4594a2d1b76a2906c0a9ea32d39a73c244aa9d5d8dea67248c0000000049483045022100a4681709fd0b79ceaddd9d695bd5c740391970a1feff2dd3a90674d20ca95a2a022076dbad3df0c4f8158eba4a087650feeeb1736b5a8b03aef15f698be4fc668abd01feffffffd0a4d502c22cea7da0d1a3cf99aef598b74fad19a6de35f21c6fd0d1b8cf275600000000494830450221009d8a22fe94f18d0a65e8f188b702b4023948e236ac2efd36bfb20d2054e1d55402201383ab2ed9465790eb9496483f10f54e40ae201fb98358cbdd71a0e650ad1b9701feffffffd25452b8575cafca10255179f95c8c66e255329220b7ff645af522af7b8038320000000048473044022013581d5e4794efb6df6dbe04339478ecf019493814d9d52390b6cc790c998762022006aef7acc10019a8cfd7ae99e11e5877a9cf1a5a6ef084549815435f7b681e1801feffffffd3922dfd1a65216bbcd4646d0cbcfa70cfe587775cf4c673043c57061f48d763000000004847304402200bc9095368e4409c7debdf0871f18af1d36e1a4851e4b948a1ce362926550611022034fb19afe76cf133e4bb561fcd3cfe7f3d49743fd75022c124b6e45bd9f503cd01feffffffd75c777645d534009bc8e7b2c0b58a78cd63f41f47f6cd30868aeaf9b55e477000000000494830450221008f4a11d94e97f02e3226c509c70a3582a280ea3bf33309ec392ceeda7a59567e022044bf0d858442058b7c5fd8c73e47287f9283e957fdb39fc005cef70e22b0c07001feffffffd8f837530faf0d9b50efe1d79aed453b11916d565a2b9c40a380a85f0be2af6b0000000048473044022065ac672cfaffe8f8d02fb8064cb54f4d335e7af222452ee71c9b249602cbfcac02202cdb7e8cc05c52db51b71a05258abaf0810d61199eff9ee0ea37d8c373a876ab01feffffffdbce76e284668c829366dafd00ae4884ea39b2aa597cc1b4d2a37991a9b2ea56000000004847304402204480dd6aac1167bb49f32fc04feaa3a7c19ad6cba48479cb72dc7d0bd71ca279022036e654a48cadceba49dbb097892ce5d90d8f082460fb18776d353e9d832ba83301feffffffe481d9493d67997104c12972b7c8a73fb87b16e228665bb784436fc0f58d7e66000000004847304402203645fe9770f3851392a85b8dc9dd405ab13fd8434122f6763de459129527fd0702204d240e91298a1487d496feb320dee028df7dbb5c9236e5d62a4964347f97279001feffffffe7a22d3d87255e4adaab9a6fd8a72320299a6902426424aa8b2b89b7c3b0c0950000000049483045022100b362e030a6739f020622f0f7e34c48fc4ff6147ed88a194a37a8a04c8e42822a0220755bcc63667eb4cbcd52108d27245765176c6c5b2e9a77013aea4d7474c0a1ec01feffffffe80ac9635b6bd91c1935eca6df80876ac8cdc87a2b91e925cfdcc0f06059b2e5000000004847304402204a2b8c311a11920eef4d64e786c5f26ed82d4c1562f2cc0e73fd5a5374c7061e02203693e77f88372a335d1463df4edd062b6dfe2bb895d56d58f3a404c27757378501feffffffedad3357a1a9aeeb8c2771cc6f284db92a2aa31f458e35bb270216015bb0edd40000000049483045022100abad2415b7c6ca9ccf3c52b4008c4d531360f2d6541d9025ec2caa4d764b46da022054f5d2833704686a860fcf978313a3c6c61f16e9a1cf84a3e4ac76c8950dabb701feffffffee85afefc31a99a4616bfb228e1f48691976b900ecdfe838e1310bf5b33fadcf000000004847304402200f7afc12d43432f5303b892b08417743d43a05bf938719428a88c85e255e5b0d02201a12cc706286a1c9329f9e37e62143866563b3773769def6912494a73c17a9f201fefffffff13e4784de0564595f3b4cce57ec0d8a4b72a798feb65f5fbca5b26a3a91d0760000000049483045022100fd3c9b2e02db889ae2bd43537a308a87a7d701bac19083e3a985a93674239e2802206dd36da12f3f2b222ce4387cb91e1098c5f93d25ce95fed0e5d21e6724af554401fefffffff205212771fd3ca5a68340fa307810e44315ae02464b5d8a235ba6bca691bd710000000048473044022062aa2571a91a7e06f0e96570bb3a348296ce7b756ceed48fe69be91f94a6c5c70220631885aa6fc967e40cd1820c83310143884e175227c5434e33b89245598d5e5c01fefffffff31cea9351fddc36393fa996962e204c461a34ff1c6ad243b3a4902440f165da000000004847304402203355527ee222e6bc756ef30c6ad687a21109a5175b1eb27592e9e1938b9e8f850220206ea10896e9e307ee73d33813048fece04bbeda702e11cae8bd61297b73590601fefffffff3c67e78777cc42ae2834bcf5dce5493fbcfcc6e0aabd7608cf4f9c936a37f49000000004847304402207cd40b7d6ca2b869d3f00c0babb484c7a2896c080c593767e0a293acd1505a9c02203a2f8c191b20fe4fb08958b3bb20411834d17f7fa075deb8b2272d22112ec8b001fefffffff3ddc14df664f6e4f59b1f1e25241a61fc69f13125ea5a67edbd03b37d332eb50000000049483045022100a40f81d4e1791d0253a2484656c27994d1e42aaaf77995e9fa6e0eb02480bde30220669c0bfbd0772ec1ad8ca9357eb3ca1100d7b40ed97bb34e23c8cecb42511c7001fefffffff614bd5d83278ad95d8c5bf6fefe59b3675e832cc1c2349d7952aa734fd20283000000004847304402207709f2089f820012e76eaa6221aa0b9776cbdcd0b0b458d400c7c1ca9ed7eedb02200de75bbdae8100b4b27e5deb164e13d596b6661248be45d817b573cdf8cb2c7c01fefffffff67ef42d75fc5d36ff32ab40f5c9f88f279a1173ee1db227a4706aa0480d66ab0000000049483045022100b09aa2cca247052451537f64801ea561506bff82794a8870c077c32c69d0bebc022013bceb4edd8f126af25c07a74d5c16935b0e916cdcc25d49ee335c430400eb2601fefffffff69f0798ab6de485dcfe72391f4cbb1e5f4d39ee8f852b80fd4bb730eabd8e9300000000494830450221009d91a34a7294250ac5b31bc86a2f7ceac8ce79e49d8ac7b3b02ad0cc278f16d102207b9ea41b03e72746a67e7bedfd1cad7f5055a915abdabc13f8e51815f29e983601fefffffff8dd75e7c674cf7bf15f42fcb1256ef4f16b96e0ff6a359bc24c07ba734f09a30000000049483045022100cf9283df82dc2c0d26c2fc9349d16faf2c961919066798705da4afe6fbf27af202207740172e195f5713eff2aeb39d12923625401dea6a0c4b4aa19be3b973c9077601fefffffffa0c47583d4c6f18e12b93764ccf57d2430a52bdd0ceb611924a79c82daf48b9000000004847304402207b46c5dfb4e65c5f91f9770acca2a1ad24a4cdd7e4f27ac9c5e55b14f8d7c00202203b17ab29bd9be1559d550cae9f79728a644682a8aab5db1a1cc3432bad159f4701fefffffffa5ca0440f302bcf118946714dba6e81036e48477ff3a315084fe682aea6d1d50000000049483045022100929668780086aa4c8945fc6d9aaa340ee8ae2807ff2f6a89623ffa102d2bdf6d0220318d3e075a82195af58a66b47c8d62849d69ed1da2e07402d89440a6a77b63ba01fefffffffef369694bf0493161762e49d7ca16f1ba600250d801a848d0ca8d3f2d677d4a0000000049483045022100f7dd5f966156c81a1d2aa694befa6b19e35aa8d7fa199c37a803cd382836fdbe0220669d85a44632a8ea6093b783693c4626ad8c71be4b82b027c4cdfa63682a9a1601feffffff02c5490f00000000001976a9146843838a0aa11686cd0c01fbf470c9c5f302249488ac40420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +## getrawtransaction + +**getrawtransaction "transaction_id" ( verbose )** + +The `getrawtransaction` method returns the raw transaction data. + +If `verbose=0`, the method returns a string that is serialized, hex-encoded data for `transaction_id`. If `verbose` is non-zero, the method returns an object with information about `transaction_id`. + +::: tip +This method relies on the txindex runtime parameter, which is enabled by default on all KMD-based chains. Disabling txindex will cause this method to malfunction. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------------------ | ----------------------------------------------------------------------------- | +| "txid" | (string, required) | the transaction id | +| verbose | (numeric, optional, default=0) | if 0, the method returns a string in hex; otherwise, it returns a json object | + +### Response (if `verbose` is not set, or set to `0`) + +| Name | Type | Description | +| --------- | -------- | ------------------------------------------- | +| "data" | (string) | the serialized, hex-encoded data for 'txid' | + +### Response (if `verbose` > `0`) + +| Name | Type | Description | +| ----------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| "hex" | (string) | the serialized, hex-encoded data for 'txid' | +| "txid" | (string) | the transaction id (same as provided) | +| "version" | (numeric) | the version | +| "locktime" | (numeric) | the lock time | +| "expiryheight" | (numeric, optional) | the block height after which the transaction expires | +| "vin" : [ ... ] | (array of json objects) | +| "txid" | (string) | the transaction id | +| "vout" | (numeric) | +| "scriptSig": { ... } | (array of json objects) | the script | +| "asm" | (string) | asm | +| "hex" | (string) | hex | +| "sequence" | (numeric) | the script sequence number | +| "vout" : [ ... ] | (array of json objects) | +| "value" | (numeric) | the value | +| "number" | (numeric) | index | +| "scriptPubKey" | | +| "asm" | (string) | the asm | +| "hex" | (string) | the hex | +| "reqSigs" | (numeric) | the required sigs | +| "type" | (string) | the type, e.g. 'pubkeyhash' | +| "addresses" : [ ... ] | (array of strings) | +| "address" | (string) | the address | +| "vjoinsplit" : [ ... ] | (array of json objects, only for version >= 2) | +| "vpub_old" | (numeric) | public input value | +| "vpub_new" | (numeric) | public output value | +| "anchor" | (string) | the anchor | +| "nullifiers" | | +| "hex" | (string) | input note nullifier | +| "commitments" : [ ... ] | (array of strings) | +| "hex" | (string) | output note commitment | +| "onetimePubKey" | (string) | the onetime public key used to encrypt the ciphertexts | +| "randomSeed" | (string) | the random seed | +| "macs": [ ... ] | (array of strings) | +| "hex" | (string) | input note MAC | +| "proof" | (string) | the zero-knowledge proof | +| "ciphertexts": [ ... ] | (array of strings) | +| "hex" | (string) | output note ciphertext | +| "blockhash" | (string) | the block hash | +| "height" | (numeric) | height of the block | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | +| "time" | (numeric) | the transaction time in seconds since epoch (Jan 1 1970 GMT) | +| "blocktime" | (numeric) | the block time in seconds since epoch (Jan 1 1970 GMT) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getrawtransaction "a44feb2e788d0332e283d8ca69c6a20999944dccac93246cbf9b36d841b08c95" +``` + + + + + +Command: + +```bash +./komodo-cli getrawtransaction "3ac97fdd33c713857c1aac8de58cee5d51c768619602b969db9c752e65b28d69" 1 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["3ac97fdd33c713857c1aac8de58cee5d51c768619602b969db9c752e65b28d69", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## sendrawtransaction + +**sendrawtransaction "hexstring" ( allowhighfees )** + +The `sendrawtransction` method submits raw transaction (serialized, hex-encoded) to local nodes and the network. + +Also see [createrawtransaction](../komodo-api/rawtransactions.html#createrawtransaction) and [signrawtransaction](../komodo-api/rawtransactions.html#signrawtransaction) calls. + +### Arguments + +| Name | Type | Description | +| ------------- | ---------------------------------- | ------------------------------------- | +| "hexstring" | (string, required) | the hex string of the raw transaction | +| allowhighfees | (boolean, optional, default=false) | whether to allow high fees | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------------------- | +| "hex" | (string) | the transaction hash in hex | + +#### :pushpin: Examples + +Create a transaction: + +Command: + +```bash +./komodo-cli createrawtransaction '[{"txid" : "a44feb2e788d0332e283d8ca69c6a20999944dccac93246cbf9b36d841b08c95","vout":0}]' '{"RHCXHfXCZQpbUbihNHh5gTwfr7NXmJXmHi":0.01}' +``` + + + + + +Sign the transaction, and get back the hex: + +Command: + +```bash +./komodo-cli signrawtransaction "0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa40000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +Send the transaction (signed hex): + +Command: + +```bash +./komodo-cli sendrawtransaction "0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa4000000006a4730440220242c38740261799f9b6ccbde8f941e2567e86c84108c508d108d062ab9677b6e02206fea089b28c6d66d1c8f2343e1de7960dadafa3cf268c00f7dbe391cd8b9365f01210384c0db4f1eaa142a2745742b942f989375dbec32c55310a793225bb5c43cdc98ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa4000000006a4730440220242c38740261799f9b6ccbde8f941e2567e86c84108c508d108d062ab9677b6e02206fea089b28c6d66d1c8f2343e1de7960dadafa3cf268c00f7dbe391cd8b9365f01210384c0db4f1eaa142a2745742b942f989375dbec32c55310a793225bb5c43cdc98ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## signrawtransaction + +**signrawtransaction "hexstring" ( [{ "txid": "id", "vout": n, "scriptPubKey": "hex", "redeemScript": "hex" }, ... ][ "privatekey1", ... ] sighashtype )** + +The `signrawtransaction` method signs inputs for a raw transaction (serialized, hex-encoded). The second optional argument (may be `null`) is an array of previous transaction outputs that this transaction depends on, but may not yet be in the block chain. The third optional argument (may be `null`) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction. + +::: tip +For full details, please see the linked documentation. +::: + +### Arguments + +| Name | Type | Description | +| -------------- | ------------------------------- | ------------------------------------------------------------------- | +| "hexstring" | (string, required) | the transaction hex string | +| "prevtxs" | (string, optional) | a json array of previous dependent transaction outputs | +| "txid" | (string, required) | the transaction id | +| "vout" | (numeric, required) | the output number | +| "scriptPubKey" | (string, required) | the script key | +| "redeemScript" | (string, required for P2SH) | redeem script | +| "amount" | (numeric, required) | the amount spent | +| "privatekeys" | (string, optional) | a json array of base58-encoded private keys for signing | +| "privatekey" | (string) | the private key in base58-encoding | +| "sighashtype" | (string, optional, default=ALL) | the signature hash type; the following options are available: "ALL" | "NONE" | "SINGLE" | "ALL | ANYONECANPAY" | "NONE | ANYONECANPAY" | "SINGLE | ANYONECANPAY" | + +### Response + +| Name | Type | Description | +| ----------- | --------- | -------------------------------------------------------- | +| "hex" | (string) | the hex-encoded raw transaction with signature(s) | +| "complete" | (boolean) | whether the transaction has a complete set of signatures | +| "errors" | | +| "txid" | (string) | the hash of the referenced, previous transaction | +| "vout" | (numeric) | the index of the output to spend and used as input | +| "scriptSig" | (string) | the hex-encoded signature script | +| "sequence" | (numeric) | the script sequence number | +| "error" | (string) | verification or signing error related to the input | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli signrawtransaction "0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa40000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's .conf file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransaction", "params": ["0100000001958cb041d8369bbf6c2493accc4d949909a2c669cad883e232038d782eeb4fa40000000000ffffffff0140420f00000000001976a91456def632e67aa11c25ac16a0ee52893c2e5a2b6a88ac00000000"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + +# Util + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## createmultisig + +**createmultisig nrequired [ "key", ... ]** + +The `createmultisig` method creates a multi-signature address with `n` signature(s) of `m` key(s) required. The method returns a json object with the address and redeemScript. + +### Arguments + +| Name | Type | Description | +| --------------- | ------------------- | ---------------------------------------------------------------------- | +| number_required | (numeric, required) | the number of required signatures out of the `n` key(s) or address(es) | +| "keys" | (string, required) | a json array of keys which are addresses or hex-encoded public keys | +| "key" | (string) | an address or hex-encoded public key | + +### Response + +| Name | Type | Description | +| -------------- | -------- | ----------------------------------------------------- | +| "address" | (string) | the value of the new multisig address | +| "redeemScript" | (string) | the string value of the hex-encoded redemption script | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli createmultisig 2 "[\"RJnVEQgucK1iwiRjfTZmreXkF49KgTErDn\",\"RCVyjn9MQ8Tw6YRJnDcsx67kfsmfUgLdfw\"]" +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, ["RJnVEQgucK1iwiRjfTZmreXkF49KgTErDn","RCVyjn9MQ8Tw6YRJnDcsx67kfsmfUgLdfw"]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## decodeccopret + +**decodeccopret scriptPubKey** + +The `decodeccopret` method decodes the OP RETURN data from a CC transaction to output the `EVALCODE` and `function id` of the method that produced the transaction. + +#### Finding the OP RETURN Data From a CC Transaction + +The OP RETURN data from a CC transaction can be found by following these steps: + +- Decode a transaction produced by a CC module using the method [getrawtransaction](./rawtransactions.html#getrawtransaction)'s verbose option. +- Look for the `vout` key; it is an array of jsons +- Find the json that contains the `scriptPubkey`, and which has the `type:nulldata` key pair +- Copy the `hex` value from that `scriptPubkey` json +- This is the hex-string that is expected as the argument for the above method. +- You can verify that the transaction was produced by a CC module by checking if one of the `vout` json's `scriptPubkey` json has the `type:cryptocondition` key pair + +### Arguments + +| Name | Type | Description | +| ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------- | +| scriptPubKey | (string) | the hex-string format `scriptPubKey` of the `type` : `nulldata` in the `vout` of a transaction produced by a CC module | + +### Response + +| Name | Type | Description | +| --------- | -------------------- | ------------------------------------------------------------- | +| result | (string) | whether the call succeeded | +| OpRets | (json) | a json containing the keys `EVALCODE` and `function id` | +| eval_code | (hexadecimal number) | the `EVALCODE` of the method that produced the transaction | +| function | (string) | the `function id` of the method that produced the transaction | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli decodeccopret 6a2412782103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodeccopret", "params": ["6a2412782103d31479e789014a96ba6dd60d50210045aa8292fe693f293d44615929f04cf57a"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## estimatefee + +**estimatefee nblocks** + +The `estimatefee` method estimates the approximate fee per kilobyte. The method is needed for a transaction to begin confirmation within `nblocks` blocks. + +The value `-1.0` is returned if not enough transactions and blocks have been observed to make an estimate. + +### Arguments + +| Name | Type | Description | +| --------- | --------- | ---------------------------------------------------------- | +| nblocks | (numeric) | the number of blocks within which the fee should be tested | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------- | +| n | (numeric) | the estimated fee | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli estimatefee 6 +``` + + + + + +## estimatepriority + +**estimatepriority nblocks** + +The `estimatepriority` method estimates the approximate priority of a zero-fee transaction, when it needs to begin confirmation within `nblocks` blocks. + +The value `-1.0` is returned if not enough transactions and blocks have been observed to make an estimate. + +### Arguments + +| Name | Type | Description | +| --------- | --------- | --------------------------------------------------------------------------------- | +| nblocks | (numeric) | a statement indicating within how many blocks the transaction should be confirmed | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------ | +| n | (numeric) | the estimated priority | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli estimatepriority 6 +``` + + + + + +## invalidateblock + +**invalidateblock "hash"** + +The `invalidateblock` method permanently marks a block as invalid, as if it violated a consensus rule. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ---------------------------------------- | +| hash | (string, required) | the hash of the block to mark as invalid | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli invalidateblock "02f51fb2793b0728050c5e983ffed669594e0a2dda01dcb7a68d129fd87436e0" +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "invalidateblock", "params": ["02f51fb2793b0728050c5e983ffed669594e0a2dda01dcb7a68d129fd87436e0"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## reconsiderblock + +**reconsiderblock "hash"** + +The `reconsiderblock` method removes invalidity status of a block and its descendants, reconsidering them for activation. This can be used to undo the effects of the `invalidateblock` method. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ----------------------------------- | +| hash | (string, required) | the hash of the block to reconsider | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli reconsiderblock "02f51fb2793b0728050c5e983ffed669594e0a2dda01dcb7a68d129fd87436e0" +``` + + + + + +## txnotarizedconfirmed + +**txnotarizedconfirmed txid** + +The `txnotarizedconfirmed` method returns information about a transaction's state of confirmation. + +If the transaction is on a chain that has Komodo's dPoW security service, the method returns `true` if the transaction is notarized. + +If the chain does not have dPoW, the method returned `true` if the confirmation number is greater than `60`. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------ | +| "txid" | (string, required) | the transaction id | + +### Response + +| Name | Type | Description | +| --------- | --------- | ----------------------------------------- | +| "result" | (boolean) | whether the transaction is confirmed, for dPoW-based chains; for non-dPoW chains, the value indicates whether the transaction has `60` or more confirmations | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli txnotarizedconfirmed ce1e3df1fb24ab3301b4032c3a0af466ca03b9365f8c649511bdd72f5519fecb +``` + + + + + +## validateaddress + +**validateaddress "komodoaddress"** + +The `validateaddress` method returns information about the given address. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ----------------------- | +| "address" | (string, required) | the address to validate | + +### Response + +| Name | Type | Description | +| -------------- | --------- | ----------------------------------------------------------------------------------------- | +| "isvalid" | (boolean) | indicates whether the address is valid. If it is not, this is the only property returned. | +| "address" | (string) | the address validated | +| "scriptPubKey" | (string) | the hex encoded scriptPubKey generated by the address | +| "ismine" | (boolean) | indicates whether the address is yours | +| "isscript" | (boolean) | whether the key is a script | +| "pubkey" | (string) | the hex value of the raw public key | +| "iscompressed" | (boolean) | whether the address is compressed | +| "account" | (string) | DEPRECATED the account associated with the address; "" is the default account | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli validateaddress "RDNC9mLrN48pVGDQ5jSoPb2nRsUPJ5t2R7" +``` + + + + + +## verifymessage + +**verifymessage "address" "signature" "message"** + +The `verifymessage` method verifies a signed message. + +::: tip +See also signmessage. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | -------------------------------------------------------- | +| "address" | (string, required) | the address to use for the signature | +| "signature" | (string, required) | the signature provided by the signer in base 64 encoding | +| "message" | (string, required) | the message that was signed | + +### Response + +| Name | Type | Description | +| ---------- | --------- | ------------------------------------------- | +| true/false | (boolean) | indicates whether the signature is verified | + +#### :pushpin: Examples + +Create the signature: + +Command: + +```bash +./komodo-cli signmessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "my message" +``` + + + + + +Verify the signature: + +Command: + +```bash +./komodo-cli verifymessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "H1y0mn/wRv56r1bcfkbQtzjG6XeWSelAsyayBuCwEL9XGXs7ieU55dryt/cFWM9gnRFI7gS01AByuSqRs+o/AZs=" "my message" +``` + + + + + +## z_validateaddress + +**z_validateaddress "zaddr"** + +The `z_validateaddress` method returns information about the given z address. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------------- | +| "zaddr" | (string, required) | the z address to validate | + +### Response + +| Name | Type | Description | +| ----------------- | --------- | ---------------------------------------------------------------------------------- | +| "isvalid" | (boolean) | indicates whether the address is valid; if not, this is the only property returned | +| "address" | (string) | the z address validated | +| "ismine" | (boolean) | indicates if the address is yours or not | +| "payingkey" | (string) | the hex value of the paying key, a_pk | +| "transmissionkey" | (string) | the hex value of the transmission key, pk_enc | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_validateaddress "zcWsmqT4X2V4jgxbgiCzyrAfRT1vi1F4sn7M5Pkh66izzw8Uk7LBGAH3DtcSMJeUb2pi3W4SQF8LMKkU2cUuVP68yAGcomL" +``` + + + + +# Wallet + +The following RPC calls interact with the `komodod` software, and are made available through the `komodo-cli` software. + +## addmultisigaddress + +**addmultisigaddress nrequired [ "key", ... ] \( "account" )** + +The `addmultisigaddress` method adds a multi-signature address to the wallet, where `nrequired` indicates the number of keys (out of the total provided) required to execute a transaction. + +The keys function as signatures, allowing multiple parties or entities to manage an account. Each key in the array can be an address or a hex-encoded public key. + +::: tip +DEPRECATED: If account is specified, the method assigns the multi-signature address to that account. +::: + +### Arguments + +| Name | Type | Description | +| ------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| nrequired | (numeric, required) | the number of required keys (out of the `n` submitted) | +| "keysobject" | (string, required) | a json array of addresses or hex-encoded public keys | +| "address" | (string) | the address or hex-encoded public key | +| "account" | (string, optional) | DEPRECATED: if provided, "account" MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | + +### Response + +| Name | Type | Description | +| --------- | -------- | ----------------------------------- | +| "address" | (string) | an address associated with the keys | + +#### :pushpin: Examples + +Add a multisig address from 2 addresses: + +Command: + +```bash +./komodo-cli addmultisigaddress 2 '["RSWwtqsNr9mW21UXRm6Lz4AzQnj4pVzzkp","RW8d8EChHTooVbwF3reqHYgkzWCnJFLXgh"]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, ["RL4CuA2MSAbBiqJKQEr2TKnKT2fSwK99mG","RBYVFCxpJdLgvUixhguxzuH1TJpoNLYCJ6"]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## backupwallet + +**backupwallet "destination"** + +The `backupwallet` method safely copies the `wallet.dat` file to the indicated destination. The `destination` input accepts only alphanumeric characters. + +::: tip +This method requires that the coin daemon have the exportdir runtime parameter enabled. +::: + +### Arguments + +| Name | Type | Description | +| ------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| "destination" | (string, required) | the destination filename, saved in the directory set by the [exportdir](../installations/common-runtime-parameters.html#exportdir) runtime parameter | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------- | +| "path" | (string) | the full path of the destination file | + +#### :pushpin: Examples + +```bash +./komodo-cli backupwallet "mybackupdata" + +/home/myusername/myexportdir/mybackupdata +``` + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backupdata"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## dumpprivkey + +**dumpprivkey "address"** + +The `dumpprivkey` method reveals the private key corresponding to the indicated `address`. + +::: tip +See also importprivkey. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------------------- | +| "address" | (string, required) | the address for the private key | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------- | +| "data" | (string) | the private key | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli dumpprivkey "RTcwYaQPDVN7V9SdfFHARWnoB7vcpSfdvs" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpprivkey", "params": ["RTcwYaQPDVN7V9SdfFHARWnoB7vcpSfdvs"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## dumpwallet + +**dumpwallet "filename"** + +The `dumpwallet` method dumps all transparent-address wallet keys into a file, using a human-readable format. + +Overwriting an existing file is not permitted. The `destination` parameter accepts only alphanumeric characters. + +::: tip +This method requires that the coin daemon have the [exportdir](../installations/common-runtime-parameters.html#exportdir) runtime parameter enabled. +::: + +### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | +| "filename" | (string, required) | the filename, saved in the folder set by the [exportdir](../installations/common-runtime-parameters.html#exportdir) runtime parameter | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------- | +| "path" | (string) | the full path of the destination file | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli dumpwallet "test" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## encryptwallet + +**encryptwallet "passphrase"** + +::: warning +Using the `encryptwallet` method will shutdown the Komodo daemon (`komodod`). +::: + +:::tip +This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. +::: + +The `encryptwallet` method encrypts the wallet with the indicated `passphrase`. + +For more information, please see these instructions: [Encrypt Komodo's wallet.dat File](https://docs.komodoplatform.com/komodo/encrypt-wallet.html) + +This method is for first-time encryption only. After the first encryption, any calls that interact with private keys will require the passphrase via [walletpassphrase](../komodo-api/wallet.html#walletpassphrase) prior to calling the corresponding method. This includes methods that create a transaction, dump a private key for an address, sign a transaction, etc. + +### Arguments + +| Name | Type | Description | +| ---------- | -------- | ----------------------------------------------------------------------------------------------------- | +| passphrase | (string) | the passphrase for wallet encryption; the passphrase must be at least 1 character, but should be many | + +### Response + +| Text Response | +| -------------------------------------------------------------------------------------------------------------------------------------------- | +| wallet encrypted; Komodo server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup. | + +#### :pushpin: Examples + +##### Encrypt your wallet + +Command: + +```bash +./komodo-cli encryptwallet "mypassphrase" +``` + + + + + +##### Unlock the wallet for 60 seconds + +Command: + +```bash +./komodo-cli walletpassphrase "mypassphrase" 60 +``` + + + + + +##### Lock the wallet again by removing the passphrase + +Command: + +```bash +./komodo-cli walletlock +``` + + + + + +As a json rpc call: + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["mypassphrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaccount + +**getaccount "address"** + +The `getaccount` method returns the account associated with the given address. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ----------- | +| "address" | (string, required) | the address | + +### Response + +| Name | Type | Description | +| ------------- | -------- | ------------------- | +| "accountname" | (string) | the account address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaccount "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccount", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaccountaddress + +**getaccountaddress "account"** + +::: tip +DEPRECATED +::: + +The `getaccountaddress` method returns the current address for receiving payments to this account. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- | +| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------- | +| "address" | (string) | the account address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaccountaddress +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccountaddress", "params": ["myaccount"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getaddressesbyaccount + +**getaddressesbyaccount "account"** + +::: tip +DEPRECATED +::: + +The `getaddressesbyaccount` method returns the list of addresses for the given `account`. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- | +| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | + +### Response + +| Name | Type | Description | +| --------- | -------- | -------------------------------------------- | +| "address" | (string) | an address associated with the given account | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getaddressesbyaccount "tabby" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbyaccount", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getbalance + +**getbalance ( "account" minconf includeWatchonly )** + +The `getbalance` method returns the server's total available balance. + +::: tip +The account input is deprecated. +::: + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------------------- | -------------------------------------------------------------------------------------- | +| "account" | (string, optional) | DEPRECATED if provided, it MUST be set to the empty string `""` or to the string `"*"` | +| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | +| includeWatchonly | (bool, optional, default=false) | also include balance in watchonly addresses (see `importaddress`) | + +### Response + +| Name | Type | Description | +| --------- | --------- | ---------------- | +| amount | (numeric) | the total amount | + +#### :pushpin: Examples + +The total amount in the wallet: + +Command: + +```bash +./komodo-cli getbalance + +``` + + + + + +The total amount in the wallet where at least five blocks are confirmed: + +Command: + +```bash +./komodo-cli getbalance "*" 5 +``` + + + + + +As a json rpc call: + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getbalance64 + +**getbalance64** + +::: tip +This method is part of the new ac_staked functionality. +::: + +The `getbalance64` method is used only on asset chains that are utilizing the `ac_staked` functionality. On KMD-based Proof-of-Stake (PoS) asset chains, all staked coins are placed into one of 64 segments (`segid`'s'). The `getbalance64` method returns the balance of coins in each `segid`. For further information, please reach out to our support team. + +## getnewaddress + +**getnewaddress ( "account" )** + +The `getnewaddress` method returns a new address for receiving payments. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| "account" | (string, optional) | DEPRECATED: If provided, the account MUST be set to the empty string `""` to represent the default account; passing any other string will result in an error | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------- | +| "address" | (string) | the new address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getnewaddress +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getrawchangeaddress + +**getrawchangeaddress** + +The `getrawchangeaddress` returns a new address that can be used to receive change. + +::: tip +This is for use with raw transactions, NOT normal use. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | -------- | ----------- | +| "address" | (string) | the address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getrawchangeaddress +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawchangeaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getreceivedbyaccount + +**getreceivedbyaccount "account" ( minconf )** + +::: tip +DEPRECATED +::: + +The getreceivedbyaccount method returns the total amount received by account in transactions with at least minconf confirmations. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------- | +| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | +| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------------------------------ | +| amount | (numeric) | the total amount received for this account | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getreceivedbyaccount "" +``` + + + + + +## getreceivedbyaddress + +**getreceivedbyaddress "address" ( minconf )** + +The `getreceivedbyaddress` method returns the total amount received by the given `address` in transactions with at least `minconf` confirmations. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------------------ | ------------------------------------------------------------ | +| "address" | (string, required) | the address for transactions | +| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | + +### Response + +| Name | Type | Description | +| --------- | --------- | -------------------------------------------------------------- | +| amount | (numeric) | the total amount of the relevant coin received at this address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getreceivedbyaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" +``` + + + + + +Command: + +```bash +./komodo-cli getreceivedbyaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" 0 +``` + + + + + +Command: + +```bash +./komodo-cli getreceivedbyaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" 6 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaddress", "params": ["RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## gettransaction + +**gettransaction "txid" ( includeWatchonly )** + +The `gettransaction` method queries detailed information about transaction `txid`. This command applies only to `txid`'s that are in the user's local wallet. + +### Arguments + +| Name | Type | Description | +| ------------------ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| "txid" | (string, required) | the transaction id | +| "includeWatchonly" | (bool, optional, default=false) | whether to include watchonly addresses in the returned balance calculation and in the `details[]` returned values | + +### Response + +| Name | Type | Description | +| ----------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| "amount" | (numeric) | the transaction amount | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | +| "blockhash" | (string) | the block hash | +| "blockindex" | (numeric) | the block index | +| "blocktime" | (numeric) | the time in seconds since epoch (1 Jan 1970 GMT) | +| "txid" | (string) | the transaction id | +| "time" | (numeric) | the transaction time in seconds since epoch (1 Jan 1970 GMT) | +| "timereceived" | (numeric) | the time received in seconds since epoch (1 Jan 1970 GMT) | +| "details" : [ ... ] | (array) | +| "account" | (string) | DEPRECATED the account name involved in the transaction; can be "" for the default account | +| "address" | (string) | the address involved in the transaction | +| "category" | (string) | the category - either `send` or `receive` | +| "amount" | (numeric) | the amount | +| "vout" | (numeric) | the vout value | +| "vjoinsplit" : [ ... ] | (array of json objects) | +| "anchor" | (string) | merkle root of note commitment tree | +| "nullifiers" : [ ... ] | (array of strings) | +| "hex" | (string) | +| "commitments" : [ ... ] | (array of strings) | +| "hex" | (string) | +| "macs" : [ ... ] | (array of strings) | +| "hex" | (string) | +| "vpub_old" | (numeric) | the amount removed from the transparent value pool | +| "vpub_new" | (numeric) | the amount added to the transparent value pool | +| "hex" | (string) | transaction data translated into hex | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli gettransaction "34efdb82ec718dede04feccecdc44f119cb7263f11c56ec3d7bf6234c9d0e27a" +``` + + + + + +Command: + +```bash +./komodo-cli gettransaction "34efdb82ec718dede04feccecdc44f119cb7263f11c56ec3d7bf6234c9d0e27a" true +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["34efdb82ec718dede04feccecdc44f119cb7263f11c56ec3d7bf6234c9d0e27a"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getunconfirmedbalance + +**getunconfirmedbalance** + +The `getunconfirmedbalance` method returns the server's total unconfirmed balance. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getunconfirmedbalance +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getunconfirmedbalance", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## getwalletinfo + +**getwalletinfo** + +The `getwalletinfo` method returns an object containing various information about the wallet state. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| "walletversion" | (numeric) | the wallet version | +| "balance" | (numeric) | the total confirmed balance of the wallet | +| "unconfirmed_balance" | (numeric) | the total unconfirmed balance of the wallet | +| "immature_balance" | (numeric) | the total immature balance of the wallet | +| "txcount" | (numeric) | the total number of transactions in the wallet | +| "keypoololdest" | (numeric) | the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool | +| "keypoolsize" | (numeric) | how many new keys are pre-generated | +| "unlocked_until" | (numeric) | the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked | +| "paytxfee" | (numeric) | the transaction fee configuration, given as the relevant COIN per KB | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli getwalletinfo +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## importaddress + +**importaddress "address" ( "label" rescan )** + +The `importaddress` method adds an address or script (in hex) that can be watched as if it were in your wallet, although it cannot be used to spend. + +::: tip +This call can take an increased amount of time to complete if rescan is true. +::: + +### Arguments + +| Name | Type | Description | +| --------- | --------------------------------- | ---------------------------------- | +| "address" | (string, required) | the address to watch | +| "label" | (string, optional, default="") | an optional label | +| rescan | (boolean, optional, default=true) | rescan the wallet for transactions | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Import an address with rescan: + +Command: + +```bash +./komodo-cli importaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" +``` + + + + + +Command: + +```bash +./komodo-cli importaddress "RJSDZjp7kjBNhHsbECDE1jwYNK7af41pZN" "testing" false +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["R9z796AehK5b6NCPeVkGUHSpJnawerf8oP", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## importprivkey + +**importkey "komodoprivkey" ( "label" rescan )** + +The `importprivkey` method adds a private key to your wallet. + +::: tip +This call can take minutes to complete if rescan is true. +::: + +::: tip +See also dumpprivkey. +::: + +### Arguments + +| Name | Type | Description | +| --------- | --------------------------------- | -------------------------------------------------------------------------- | +| "privkey" | (string, required) | the private key (see [dumpprivkey](../komodo-api/wallet.html#dumpprivkey)) | +| "label" | (string, optional, default="") | an optional label | +| rescan | (boolean, optional, default=true) | rescan the wallet for transactions | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------ | +| addresses | (string) | the public address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli importprivkey "DONOTUSExxxxxxxxxxxxxxxxxxxxj4Xu9jjinhLpffhdtoKg5gar2" +``` + + + + + +Command: + +```bash +./komodo-cli importprivkey "DONOTUSExxxxxxxxxxxxxxxxxxxxj4Xu9jjinhLpffhdtoKg5gar2" "testing" false +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importprivkey", "params": ["UwibHKsYfiM19BXQmcUwAfw331GzGQK8aoPqqYEbyoPrzc2965nE", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## importwallet + +**importwallet "filename"** + +The `importwallet` method imports transparent-address keys from a wallet-dump file (see [dumpwallet](../komodo-api/wallet.html#dumpwallet)). + +### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | --------------- | +| "filename" | (string, required) | the wallet file | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli importwallet "path/to/exportdir/nameofbackup" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importwallet", "params": ["path/to/exportdir/nameofbackup"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## keypoolrefill + +**keypoolrefill ( newsize )** + +The `keypoolrefill` method refills the keypool. + +### Arguments + +| Name | Type | Description | +| --------- | -------------------------------- | -------------------- | +| newsize | (numeric, optional, default=100) | the new keypool size | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli keypoolrefill +``` + + + + + +Command: + +```bash +./komodo-cli keypoolrefill 100 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "keypoolrefill", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listaccounts + +**listaccounts ( minconf includeWatchonly )** + +::: tip +DEPRECATED +::: + +The listaccounts method returns an object that has account names as keys and account balances as values. + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------------------- | --------------------------------------------------------------- | +| minconf | (numeric, optional, default=1) | only include transactions with at least this many confirmations | +| includeWatchonly | (bool, optional, default=false) | include balances in watchonly addresses (see 'importaddress') | + +### Response + +| Name | Type | Description | +| ---------------- | --------- | ----------------------------------------------------------------------------------------- | +| "account_number" | (numeric) | the property name is the account name, and the value is the total balance for the account | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listaccounts 6 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaccounts", "params": [6] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listaddressgroupings + +**listaddressgroupings** + +The `listaddressgroupings` method lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------ | +| "address", | (string) | the address | +| amount, | (numeric) | the amount | +| "account" | (string, optional) | (DEPRECATED) the account | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listaddressgroupings +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaddressgroupings", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listlockunspent + +**listlockunspent** + +The `listlockunspent` method returns a list of temporarily non-spendable outputs. + +::: tip +See the lockunspent call to lock and unlock transactions for spending. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------------- | +| "txid" | (string) | the transaction id locked | +| "vout" | (numeric) | the vout value | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listlockunspent +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listlockunspent", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listreceivedbyaccount + +**listreceivedbyaccount ( minconf includeempty includeWatchonly )** + +::: warning +DEPRECATED +::: + +The `listreceivedbyaccount` method lists balances by account. + +### Arguments + +| Name | Type | Description | +| ---------------- | ---------------------------------- | ---------------------------------------------------------------- | +| minconf | (numeric, optional, default=1) | the minimum number of confirmations before payments are included | +| includeempty | (boolean, optional, default=false) | whether to include accounts that haven't received any payments | +| includeWatchonly | (bool, optional, default=false) | whether to include watchonly addresses (see 'importaddress') | + +### Response + +| Name | Type | Description | +| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- | +| "involvesWatchonly" | (bool) | only returned if the imported addresses were involved in the transaction | +| "account" | (string) | the account name of the receiving account | +| "amount" | (numeric) | the total amount received by addresses with this account | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations of the most recent transaction included (number of blocks on top of this transaction's block) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listreceivedbyaccount +``` + + + + + +Command: + +```bash +./komodo-cli listreceivedbyaccount 6 true +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaccount", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listreceivedbyaddress + +**listreceivedbyaddress ( minconf includeempty includeWatchonly)** + +The `listreceivedbyaddress` method lists balances by receiving address. + +### Arguments + +| Name | Type | Description | +| ---------------- | ---------------------------------- | ---------------------------------------------------------------- | +| minconf | (numeric, optional, default=1) | the minimum number of confirmations before payments are included | +| includeempty | (numeric, optional, default=false) | whether to include addresses that haven't received any payments | +| includeWatchonly | (bool, optional, default=false) | whether to include watchonly addresses (see 'importaddress') | + +### Response + +| Name | Type | Description | +| ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- | +| "involvesWatchonly" | (bool) | only returned if imported addresses were involved in transaction | +| "address" | (string) | the receiving address | +| "account" | (string) | DEPRECATED the account of the receiving address; the default account is "" | +| "amount" | (numeric) | the total amount received by the address | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations of the most recent transaction included (number of blocks on top of this transaction's block) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listreceivedbyaddress +``` + + + + + +Command: + +```bash +./komodo-cli listreceivedbyaddress 6 true +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listsinceblock + +**listsinceblock ( "blockhash" target-confirmations includeWatchonly )** + +The `listsinceblock` method queries all transactions in blocks since block `blockhash`, or all transactions if `blockhash` is omitted. + +### Arguments + +| Name | Type | Description | +| -------------------- | ------------------------------- | ---------------------------------------------------------------------- | +| "blockhash" | (string, optional) | the block hash from which to list transactions | +| target-confirmations | (numeric, optional) | the confirmations required (must be 1 or more) | +| includeWatchonly | (bool, optional, default=false) | include transactions to watchonly addresses (see also 'importaddress') | + +### Response + +| Name | Type | Description | +| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| "transactions": | | +| "account" | (string) | DEPRECATED the account name associated with the transaction; will be "" for the default account | +| "address" | (string) | the address of the transaction (not present for move transactions -- category = move) | +| "category" | (string) | the transaction category; `send` has negative amounts, `receive` has positive amounts | +| "amount" | (numeric) | the amount of the relevant currency -- negative for the `send` category, and for the `move` category for moves outbound. It is positive for the `receive` category, and for the `move` category for inbound funds. | +| "vout" | (numeric) | the vout value | +| "fee" | (numeric) | the amount of the fee; this value is negative and only available for the `send` category of transactions | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations of the transaction; available for `send` and `receive` category of transactions (number of blocks on top of this transaction's block) | +| "blockhash" | (string) | the block hash containing the transaction; available for the `send` and `receive` categories of transactions | +| "blockindex" | (numeric) | the block index containing the transaction; available for the `send` and `receive` categories of transactions | +| "blocktime" | (numeric) | the block time in seconds since epoch (1 Jan 1970 GMT) | +| "txid" | (string) | the transaction id; available for `send` and `receive` categories of transactions | +| "time" | (numeric) | the transaction time in seconds since epoch (Jan 1 1970 GMT) | +| "timereceived" | (numeric) | the time received in seconds since epoch (Jan 1 1970 GMT); available for `send` and `receive` category of transactions | +| "comment" | (string) | whether a comment is associated with the transaction | +| "to" | (string) | whether a 'to' comment is associated with the transaction | +| "lastblock" | (string) | the hash of the last block | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listsinceblock +``` + + + + + +Command: + +```bash +./komodo-cli listsinceblock "029f11d80ef9765602235e1bc9727e3eb6ba20839319f761fee920d63401e327" 6 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listsinceblock", "params": ["029f11d80ef9765602235e1bc9727e3eb6ba20839319f761fee920d63401e327", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listtransactions + +**listtransactions ( "account" count from includeWatchonly )** + +The `listtransactions` method returns up to `count` most recent transactions skipping the first `from` transactions for `account`. + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------------------- | ----------------------------------------------------------------- | +| "account" | (string, optional) | DEPRECATED the account name; should be `"*"` | +| count | (numeric, optional, default=10) | the number of transactions to return | +| from | (numeric, optional, default=0) | the number of transactions to skip | +| includeWatchonly | (bool, optional, default=false) | include transactions to watchonly addresses (see `importaddress`) | + +### Response + +| Name | Type | Description | +| ------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "account" | (string) | DEPRECATED the account name associated with the transaction; it will be "" for the default account | +| "address" | (string) | the address of the transaction; not present for move transactions (category = move) | +| "category" | (string) | The transaction category. This property can be `send` | `receive` | `move`. `move` is a local (off blockchain) transaction between accounts -- not associated with an address, transaction id, or block. `send` and `receive` transactions are associated with an address, transaction id, and block details. | +| "amount" | (numeric) | The amount. This value is negative for the `send` category, and for the `move` category for moves outbound. It is positive for the `receive` category and for the `move` category for inbound funds. | +| "vout" | (numeric) | the vout value | +| "fee" | (numeric) | the amount of the fee; this is negative and only available for the `send` category of transactions | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations of the transaction; available for `send` and `receive` category of transactions (number of blocks on top of this transaction's block) | +| "blockhash" | (string) | the block hash containing the transaction; available for the `send` and `receive` categories of transactions | +| "blockindex" | (numeric) | the block index containing the transaction; available for the `send` and `receive` categories of transactions | +| "txid" | (string) | the transaction id; available for the `send` and `receive` categories of transactions | +| "time" | (numeric) | the transaction time in seconds since epoch (midnight Jan 1 1970 GMT) | +| "timereceived" | (numeric) | the time received in seconds since epoch (midnight Jan 1 1970 GMT); available for the `send` and `receive` categories of transactions | +| "comment" | (string) | whether a comment is associated with the transaction | +| "otheraccount" | (string) | for the `move` category of transactions; indicates the account which sent the funds (for receiving funds, positive amounts), or went to (for sending funds, negative amounts) | +| "size" | (numeric) | transaction size in bytes | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listtransactions +``` + + + + + +Command: + +```bash +./komodo-cli listtransactions "*" 20 100 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listtransactions", "params": ["*", 20, 100] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## listunspent + +**listunspent ( minconf maxconf ["address", ... ] )** + +The `listunspent` method returns an array of unspent transaction outputs, with a range between `minconf` and `maxconf` (inclusive) confirmations. The method can, optionally, filter to only include `txouts` paid to specified addresses. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------------------------ | ----------------------------------- | +| minconf | (numeric, optional, default=1) | the minimum confirmations to filter | +| maxconf | (numeric, optional, default=9999999) | the maximum confirmations to filter | +| "address" | (string) | a series of addresses | + +### Response + +| Name | Type | Description | +| ------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------- | +| "txid" | (string) | the transaction id | +| "vout" | (numeric) | the vout value | +| "generated" | (boolean) | true if txout is a coinbase transaction output | +| "address" | (string) | the address | +| "account" | (string) | DEPRECATED the associated account, or "" for the default account | +| "scriptPubKey" | (string) | the script key | +| "amount" | (numeric) | the transaction amount | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli listunspent +``` + + + + + +Command: + +```bash +./komodo-cli listunspent 6 9999999 '["RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu","RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ"]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listunspent", "params": [6, 9999999, ["RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu","RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ"]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## lockunspent + +**lockunspent unlock [{ "txid": "txid", "vout": n }, ... ]** + +The `lockunspent` method locks (unlock = `false`) or unlocks (unlock = `true`) specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection, when spending the relevant coin. The locks are stored in memory only; at runtime a node always starts with zero locked outputs, and the locked output list is always cleared when a node stops or fails. + +::: tip +See the listunspent and listlockunspent calls to determine local transaction state and info. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | ------------------------------------------------------------------- | +| unlock | (boolean, required) | whether to unlock (true) or lock (false) the specified transactions | +| "txid" | (string) | the transaction id | +| "vout" | (numeric) | the output number | + +### Response + +| Name | Type | Description | +| ---------- | --------- | ---------------------------------- | +| true/false | (boolean) | whether the command was successful | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli lockunspent false '[{"txid":"d7ba45296c66e16eb61f27a4eef8848c7f5579fe801f277c1b0e074a4f47d6fd","vout":0}]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "lockunspent", "params": [false, [{"txid":"d7ba45296c66e16eb61f27a4eef8848c7f5579fe801f277c1b0e074a4f47d6fd","vout":0}]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## move + +**move "fromaccount" "toaccount" amount ( minconf "comment" )** + +::: tip +DEPRECATED +::: + +The `move` method moves a specified amount from one account in your wallet to another. + +### Arguments + +| Name | Type | Description | +| ------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------- | +| "fromaccount" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | +| "toaccount" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | +| amount | (numeric) | the quantity to move between accounts | +| minconf | (numeric, optional, default=1) | only use funds with at least this many confirmations | +| "comment" | (string, optional) | an optional comment, stored in the wallet only | + +### Response + +| Name | Type | Description | +| ---------- | --------- | ------------------ | +| true/false | (boolean) | true if successful | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli move "" "tabby" 0.01 +``` + + + + + +Command: + +```bash +./komodo-cli move "timotei" "akiko" 0.01 6 "happy birthday!" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko", 0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## resendwallettransactions + +**resendwallettransactions** + +The `resendwallettransactions` method immediately re-broadcasts unconfirmed wallet transactions to all peers. This method is intended only for testing; the wallet code periodically re-broadcasts automatically. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | ---------------------------------------------- | +| "transaction_id" | (string) | an array of the rebroadcasted transaction id's | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli resendwallettransactions +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "resendwallettransactions", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## sendfrom + +**sendfrom "account" "address" amount ( minconf "comment" "comment-to" )** + +::: tip +DEPRECATED: Use sendtoaddress instead. +::: + +The `sendfrom` method sends an amount from `account` to `address`. + +### Arguments + +| Name | Type | Description | +| ------------ | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | +| "address" | (string, required) | the address to receive funds | +| amount | (numeric, required) | the amount (transaction fee not included) | +| minconf | (numeric, optional, default=1) | only use funds with at least this many confirmations | +| "comment" | (string, optional) | a comment used to store what the transaction is for; this is not part of the transaction, just kept in your wallet | +| "comment-to" | (string, optional) | an optional comment to store the name of the person or organization to which you're sending the transaction; this is not part of the transaction, it is only kept in your wallet | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | ------------------ | +| "transaction_id" | (string) | the transaction id | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli sendfrom "" "RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu" 0.01 +``` + + + + + +Command: + +```bash +./komodo-cli sendfrom "tabby" "RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu" 0.01 6 "donation" "seans outpost" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendfrom", "params": ["tabby", "RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu", 0.01, 6, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## sendmany + +**sendmany "account" { "address": amount, ... } ( minconf "comment" [ "address", ... ] )** + +The `sendmany` method can send multiple transactions at once. Amounts are double-precision floating point numbers. + +### Arguments + +| Name | Type | Description | +| ----------------------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | +| "amounts" { "address":amount, ... } | ("string":numeric) | the address (string) and the value (double-precision floating numeric) | +| minconf | (numeric, optional, default=1) | only use the balance confirmed at least this many times | +| "comment" | (string, optional) | a comment | +| subtractfeefromamount | (string, optional) | a json array with addresses. The fee will be equally deducted from the amount of each selected address; the recipients will receive less than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. | +| "address" | (string) | subtract fee from this address | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | ---------------------------------------------------------------------------------------------------- | +| "transaction_id" | (string) | the transaction id for the send; only 1 transaction is created regardless of the number of addresses | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli sendmany "" '{"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}' +``` + + + + + +Command: + +```bash +./komodo-cli sendmany "" '{"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}' 6 "testing" +``` + + + + + +Command: + +```bash +./komodo-cli sendmany "" '{"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}' 1 "" '["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ","RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu"]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendmany", "params": ["", {"RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ":0.01,"RPS3xTZCzr6aQfoMw5Bu1rpQBF6iVCWsyu":0.02}, 6, "testing"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## sendtoaddress + +**sendtoaddress "address" amount ( "comment" "comment-to" subtractfeefromamount )** + +The `sendtoaddress` method sends an amount to a given address. The amount is real and is rounded to the nearest 0.00000001. + +### Arguments + +| Name | Type | Description | +| --------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| "komodoaddress" | (string, required) | the receiving address | +| "amount" | (numeric, required) | the amount to send (json requires all decimals values less than 1 begin with the characters '0.') | +| "comment" | (string, optional) | a comment used to store what the transaction is for; this is not part of the transaction, just kept in your wallet | +| "comment-to" | (string, optional) | a comment to store the name of the person or organization to which you're sending the transaction; this is stored in your local wallet file only | +| subtractfeefromamount | (boolean, optional, default=false) | when `true`, the fee will be deducted from the amount being sent | + +### Response + +| Name | Type | Description | +| ---------------- | -------- | ------------------ | +| "transaction_id" | (string) | the transaction id | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 +``` + + + + + +Command: + +```bash +./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 "donation" "seans outpost" +``` + + + + + +Command: + +```bash +./komodo-cli sendtoaddress "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" 0.1 "" "" true +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## setaccount + +**setaccount "address" "account"** + +::: tip Notice +DEPRECATED +::: + +The `setaccount` method sets the account associated with the given address. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- | +| "address" | (string, required) | the address to be associated with an account | +| "account" | (string, required) | MUST be set to the empty string "" to represent the default account; passing any other string will result in an error | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli setaccount "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "tabby" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setaccount", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ", "tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## setpubkey + +**setpubkey pubkey** + +The `setpubkey` method sets the indicated `pubkey`. This method can be used in place of the [pubkey](../installations/common-runtime-parameters.html#pubkey) launch parameter, when necessary. + +Visit the section [pubkey](../installations/common-runtime-parameters.html#pubkey) to understand when it is essential to set a pubkey and the consequences of setting it. + +::: warning +This method works only once per daemon start. It can't be used to change the pubkey that has already been set. +::: + +### Arguments + +| Name | Type | Description | +| --------- | -------- | ------------------ | +| pubkey | (string) | the desired pubkey | + +### Response + +| Name | Type | Description | +| --------- | --------- | ------------------------------------------------- | +| pubkey | (string) | the pubkey | +| ismine | (boolean) | indicates whether the address belongs to the user | +| R-address | (string) | the public address associated with the pubkey | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli setpubkey 0260801166cebdc9be1e3460ba9e4959fb29feee7725f565ffc296fa4636aa706f +``` + + + + + +You can find the `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setpubkey", "params": ["02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## settxfee + +**settxfee amount** + +The `settxfee` method sets the transaction fee per kB. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------- | ---------------------------------------------------------------- | +| amount | (numeric, required) | the transaction fee in COIN/kB rounded to the nearest 0.00000001 | + +### Response + +| Name | Type | Description | +| ---------- | --------- | -------------------------- | +| true/false | (boolean) | returns true if successful | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli settxfee 0.00001 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "settxfee", "params": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## signmessage + +**signmessage "address" "message"** + +The `signmessage` method signs a message via the private key of an address. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | -------------------------------------- | +| "address" | (string, required) | the address to use for the private key | +| "message" | (string, required) | the message | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------------------- | +| "signature" | (string) | the signature of the message encoded in base 64 | + +#### :pushpin: Examples + +Create the signature: + +Command: + +```bash +./komodo-cli signmessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "my message" +``` + + + + + +Verify the signature: + +Command: + +```bash +./komodo-cli verifymessage "RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ" "H1y0mn/wRv56r1bcfkbQtzjG6XeWSelAsyayBuCwEL9XGXs7ieU55dryt/cFWM9gnRFI7gS01AByuSqRs+o/AZs=" "my message" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signmessage", "params": ["RBtNBJjWKVKPFG4To5Yce9TWWmc2AenzfZ", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## walletlock + +**walletlock** + +::: tip +The `walletlock` method is neither active nor visible in the `help` method until the [encryptwallet](../komodo-api/wallet.html#encryptwallet) passphrase is set. +::: + +:::tip +This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. +::: + +The `walletlock` method re-locks a wallet that has a passphrase enabled via [encryptwallet](../komodo-api/wallet.html#encryptwallet). + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli walletlock +``` + + + + + +## walletpassphrase + +**walletpassphrase "passphrase" (timeout)** + +::: tip +The `walletpassphrase` method is neither active nor visible in the `help` method until the [encryptwallet](../komodo-api/wallet.html#encryptwallet) passphrase is set. +::: + +:::tip +This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. +::: + +The `walletpassphrase` method unlocks the wallet using the passphrase that was set by the [encryptwallet](../komodo-api/wallet.html#encryptwallet) method. + +The `timeout` argument can be included to limit the length of time (in seconds) the wallet will remain unlocked. + +### Arguments + +| Name | Type | Description | +| ------------ | ----------------------------- | ---------------------------------------------------------------------- | +| "passphrase" | (string) | the passphrase that was set by the `encryptwallet` method | +| timeout | (number in seconds, optional) | the amount of time for which the wallet should remember the passphrase | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli walletpassphrase +``` + + + + + +## walletpassphrasechange + +**walletpassphrasechange "oldpassphrase" "newpassphrase"** + +::: tip +The `walletpassphrasechange` method is neither active nor visible in the `help` method until the [encryptwallet](../komodo-api/wallet.html#encryptwallet) passphrase is set. +::: + +:::tip +This feature is available only on chains where `-ac_public` is enabled. Chains that feature private transactions cannot use this feature. +::: + +The `walletpassphrasechange` method changes `"oldpassphrase"` to `"newpassphrase"`. + +### Arguments + +| Name | Type | Description | +| --------------- | -------- | ------------------ | +| "oldpassphrase" | (string) | the old passphrase | +| "newpassphrase" | (string) | the new passphrase | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli walletpassphrasechange "oldpassphrase" "newpassphrase" +``` + + + + + +## z_exportkey + +**z_exportkey "z_address"** + +The `z_exportkey` method reveals the private z_key corresponding to `z_address`. + +::: tip +See also z_importkey. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | --------------------------------- | +| "z_address" | (string, required) | the z_address for the private key | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------- | +| "key" | (string) | the private key | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_exportkey "ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_exportkey", "params": ["ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_exportviewingkey + +**z_exportviewingkey "z_address"** + +The `z_exportviewingkey` method reveals the viewing key corresponding to `z_address`. + +::: tip +See also z_importviewingkey. +::: + +### Arguments + +| Name | Type | Description | +| ----------- | ------------------ | --------------------------------- | +| "z_address" | (string, required) | the z_address for the viewing key | + +### Response + +| Name | Type | Description | +| --------- | -------- | --------------- | +| "vkey" | (string) | the viewing key | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_exportviewingkey "ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_exportviewingkey", "params": ["ztffWAUUY9PnLiBVXY2pnX67kfm71SevtPC5d9LLM3xZqehy4XxV1FeyxPWcHGTiCd7GtQ17gk5jDTQxhHB13K1A7HT6hZH"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_exportwallet + +**z_exportwallet "filename"** + +The `z_exportwallet` method exports all wallet keys, including both t address and z address types, in a human-readable format. Overwriting an existing file is not permitted. + +### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "filename" | (string, required) | the filename, saved to the directory indicated by the [exportdir](../installations/common-runtime-parameters.html#exportdir) parameter at daemon runtime (required) | + +### Response + +| Name | Type | Description | +| --------- | -------- | ------------------------------------- | +| "path" | (string) | the full path of the destination file | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_exportwallet "test" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_exportwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_getbalance + +**z_getbalance "address" ( minconf )** + +The `z_getbalance` method returns the balance of a t address or z address belonging to the node’s wallet. + +::: warning +CAUTION: If address is a watch-only z address, the returned balance may be larger than the actual balance, +as spends cannot be detected with incoming viewing keys. +::: + +### Arguments + +| Name | Type | Description | +| --------- | ------------------------------ | ------------------------------------------------------------ | +| "address" | (string) | the selected z or t address | +| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | + +### Response + +| Name | Type | Description | +| --------- | --------- | ---------------------------------------------------------------------- | +| amount | (numeric) | the total amount received at this address (in the relevant COIN value) | + +#### :pushpin: Examples + +The total amount received by address "myaddress" at least 5 blocks confirmed + +Command: + +```bash +./komodo-cli z_getbalance "ztfF6SFBfq2qha73dAgsXnL86F8air32CXKxJg8aYtEPJFdLcw4y3zWzBasocnx1V9GLnnFeKnkPvkScjNkQBfWn2kBDmkn" +``` + + + + + +Command: + +```bash +./komodo-cli z_getbalance "ztfF6SFBfq2qha73dAgsXnL86F8air32CXKxJg8aYtEPJFdLcw4y3zWzBasocnx1V9GLnnFeKnkPvkScjNkQBfWn2kBDmkn" 5 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getbalance", "params": ["ztfF6SFBfq2qha73dAgsXnL86F8air32CXKxJg8aYtEPJFdLcw4y3zWzBasocnx1V9GLnnFeKnkPvkScjNkQBfWn2kBDmkn", 5] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_getnewaddress + +**z_getnewaddress** + +The `z_getnewaddress` method returns a new z_address for receiving payments. + +### Arguments + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ----------------- | +| "z_address" | (string) | the new z_address | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_getnewaddress +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_getoperationresult + +**z_getoperationresult ([ "operationid", ... ])** + +The `z_getoperationresult` method retrieves the result and status of an operation which has finished, and then removes the operation from memory. + +::: tip +See also z_getoperationstatus. +::: + +### Arguments + +| Name | Type | Description | +| ------------- | ------------------ | ------------------------------------------------------------------------------------------------------- | +| "operationid" | (string, optional) | a list of operation ids to query; if not provided, the method examines all operations known to the node | + +### Response + +| Name | Type | Description | +| ------------------ | ----------------------- | ---------------------------------------------------------- | +| "id" | (string) | the operation id | +| "status" | (string) | the result of the operation; can be `success` | `failed` | `executing` | +| "creation_time" | (numeric) | the creation time, in seconds since epoch (Jan 1 1970 GMT) | +| "result": { ... } | (array of json objects) | +| "txid": | (string) | the transaction id | +| "execution_secs" | (numeric) | the length of time to calculate the transaction | +| "method" | (string) | the name of the method used in the operation | +| "params": { ... } | (json) | +| "fromaddress" | (string) | the address from which funds are drawn | +| "amounts": [ ... ] | (array of json objects) | +| "address" | (string) | the receiving address | +| "amount" | (numeric) | the amount to receive | +| "minconf" | (numeric) | the minimum number of confirmations required | +| "fee" | (numeric) | the transaction fee | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_getoperationresult '["opid-6e581ee5-4e90-4e70-8961-f95d8d28748c"]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getoperationresult", "params": [["opid-6a9da0dd-a950-4d95-848c-d3c18e44be03"]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_getoperationstatus + +**z_getoperationstatus ([ "operationid", ... ])** + +The `z_getoperationstatus` message queries the operation status and any associated result or error data of any `operationid` stored in local memory. The operation will remain in memory (unlike `z_getoperationresult`, which removes the data from the local memory). + +### Arguments + +| Name | Type | Description | +| ------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| "operationid" | (array, optional) | a list of operation ids we are interested in; if an array is not provided, the method examines all operations known to the node | + +### Response + +| Name | Type | Description | +| ------------------ | ----------------------- | ----------------------------------------------------------------------------- | +| "id" | (string) | the operation id | +| "status" | (string) | the status of the operation; can be `success` | `executing` | `failed` | +| "creation_time" | (numeric) | the creation time, in seconds since epoch (Jan 1 1970 GMT) | +| "error" : { ... } | (array of json objects) | +| "code" | (numeric) | the associated error code | +| "message" | (string) | a message to indicate the nature of the error, if such a message is available | +| "method" | (string) | the name of the method used in the operation | +| "params" : { ... } | (array of json objects) | +| "fromaddress" | (string) | the address from which funds are drawn | +| "amounts": [ ... ] | (array of json objects) | +| "address" | (string) | the receiving address | +| "amount" | (numeric) | the amount to receive | +| "minconf" | (numeric) | indicates the required number of mining confirmations | +| "fee" | (numeric) | the fee | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_getoperationstatus +``` + + + + + +Command: + +```bash +./komodo-cli z_getoperationstatus '["opid-47e12224-8477-4cd4-852d-d8c3ddbc6375"]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_getoperationstatus", "params": [["opid-47e12224-8477-4cd4-852d-d8c3ddbc6375"]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_gettotalbalance + +**z_gettotalbalance ( minconf includeWatchonly )** + +The `z_gettotalbalance` method returns the total value of funds, including both transparent and private, stored in the node’s wallet. + +::: warning +CAUTION: If the wallet contains watch-only z addresses the returned private balance may be larger than the actual balance, as spends cannot be detected with incoming viewing keys. +::: + +::: tip +While the interest property is returned for all KMD-based coin daemons, only the main KMD chain utilizes the interest feature. KMD-based asset chains will always return a 0.00 interest value. +::: + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------------------- | ------------------------------------------------------------------------------------------ | +| minconf | (numeric, optional, default=1) | only include private and transparent transactions confirmed at least this many times | +| includeWatchonly | (bool, optional, default=false) | also include balance in watchonly addresses (see 'importaddress' and 'z_importviewingkey') | + +### Response + +| Name | Type | Description | +| ------------- | --------- | ------------------------------------------------------- | +| "transparent" | (numeric) | the total balance of transparent funds | +| "interest" | (numeric) | the total balance of unclaimed interest earned | +| "private" | (numeric) | the total balance of private funds | +| "total" | (numeric) | the total balance of both transparent and private funds | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_gettotalbalance +``` + + + + + +Command: + +```bash +./komodo-cli z_gettotalbalance 5 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_gettotalbalance", "params": [5] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_importkey + +**z_importkey "z_privatekey" ( rescan startHeight )** + +The `z_importkey` method imports `z_privatekey` to your wallet. + +::: tip +This call can take minutes to complete if rescan is true. +::: + +::: tip +The optional parameters are currently not functional with KMD-based blockchains. +::: + +::: tip +See also z_exportkey. +::: + +### Arguments + +| Name | Type | Description | +| -------------- | -------------------------------------------- | --------------------------------------------------------------------------- | +| "z_privatekey" | (string, required) | the z_privatekey (see [z_exportkey](../komodo-api/wallet.html#z-exportkey)) | +| rescan | (string, optional, default=`"whenkeyisnew"`) | rescan the wallet for transactions; can be `yes` | `no` | `whenkeyisnew` | +| startHeight | (numeric, optional, default=0) | the block height at which to begin the rescan | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_importkey DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK +``` + + + + + +Command: + +```bash +./komodo-cli z_importkey DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK whenkeyisnew 30000 +``` + + + + + +Command: + +```bash +./komodo-cli z_importkey DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK yes 20000 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importkey", "params": ["DONOTUSExxxxxxxxxxxxxxxxBP6ipkmBxmEQbugcCQ16vUaWGFK", "no"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_importviewingkey + +**z_importviewingkey "viewing_key" ( rescan startHeight )** + +The `z_importviewingkey` adds a viewing key to your wallet. This method allows you to view the balance in a z address that otherwise does not belong to your wallet. + +::: tip +See also z_exportviewingkey. +::: + +::: tip +This call can take minutes to complete if rescan is true. +::: + +::: tip +The optional parameters are currently not functional for KMD-based blockchains. +::: + +### Arguments + +| Name | Type | Description | +| ------------- | ------------------------------------------ | ------------------------------------------------------------- | +| "viewing_key" | (string, required) | the viewing key | +| rescan | (string, optional, default="whenkeyisnew") | whether to rescan the wallet for transactions; can be `"yes"` | `"no"` | `"whenkeyisnew"` | +| startHeight | (numeric, optional, default=0) | block height to start rescan | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" +``` + + + + + +Command: + +```bash +./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" no +``` + + + + + +Command: + +```bash +./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" whenkeyisnew 30000 +``` + + + + + +Command: + +```bash +./komodo-cli z_importviewingkey "ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja" yes 20000 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importviewingkey", "params": ["ZiVtfYkeyRY3y8Wykm5zjLcnssEkVrkej6j3kQ5B1AE2qp2F3VsKzpoXTzD82hrvMjWB9WxCHbXXrXax2ceyHLWrnQDaMrMja", "no"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_importwallet + +**z_importwallet "filename"** + +The `z_importwallet` method imports t address and z address keys from a wallet export file. + +::: tip +See also z_exportwallet. +::: + +### Arguments + +| Name | Type | Description | +| ---------- | ------------------ | --------------- | +| "filename" | (string, required) | the wallet file | + +### Response + +| Name | Type | Description | +| --------- | ---- | ----------- | +| (none) | | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_importwallet "/mydirectory/nameofbackup" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_importwallet", "params": ["/mydirectory/nameofbackup"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_listaddresses + +**z_listaddresses ( includeWatchonly )** + +The `z_listaddresses` method returns the list of z addresses belonging to the wallet. + +::: tip +See also z_importviewingkey. +::: + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------------------- | -------------------------------- | +| includeWatchonly | (bool, optional, default=false) | also include watchonly addresses | + +### Response + +| Name | Type | Description | +| ----------- | -------- | ----------------------------------- | +| "z_address" | (string) | a z address belonging to the wallet | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_listaddresses +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listaddresses", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_listoperationids + +**z_listoperationids** + +The `z_listoperationids` method returns the list of operation ids currently known to the wallet. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------ | ----------------------------------------------------- | +| "status" | (string, optional) | filter result by the operation's state e.g. "success" | + +### Response + +| Name | Type | Description | +| ------------- | -------- | --------------------------------------- | +| "operationid" | (string) | an operation id belonging to the wallet | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_listoperationids +``` + + + + + +Command: + +```bash +./komodo-cli z_listoperationids "success" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listoperationids", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_listreceivedbyaddress + +**z_listreceivedbyaddress "address" ( minconf )** + +The `z_listreceivedbyaddress` method returns a list of amounts received by a z address belonging to the node’s wallet. + +### Arguments + +| Name | Type | Description | +| --------- | ------------------------------ | ------------------------------------------------------------ | +| address | (string) | the private address. | +| minconf | (numeric, optional, default=1) | only include transactions confirmed at least this many times | + +### Result + +An array of json objects, each having the properties below. + +| Name | Type | Description | +| ------------------ | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| txid | (string) | the transaction id | +| amount | (numeric) | the amount of value in the note | +| memo | (string) | hexadecimal string representation of memo field | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | +| jsindex | (sprout) | (numeric, received only by sprout addresses) the joinsplit index | +| jsoutindex | (numeric, received only by sprout addresses) | the output index of the joinsplit | +| outindex | (numeric, sapling) | the output index | +| change | (boolean) | true if the address that received the note is also one of the sending addresses | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_listreceivedbyaddress "zs1wqykmk74mv2ezjscpxsgzrn4fasqwh50tgk0ym64m45c5yw5fjtpkps64gle963veqzuj04872z" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user rpcuser:rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listreceivedbyaddress", "params": ["zs1umhaattx6lna933m9zwfqlmkm2qj49hpa9lnymtj5h5c7cwtd3evfpu29hppprax9cs45fzeyqg"] }' -H 'content-type: text/plain;' http://127.0.0.1:rpcport/ +``` + + + + +## z_listunspent + +**z_listunspent ( minconf maxconf includeWatchonly ["zaddr", ...] )** + +The `z_listunspent` method returns an array of unspent shielded notes. + +The method can also filter to only include results that have between `minconf` and `maxconf` (inclusive) confirmations, and also for specified z_addresses (`["zaddr", ...])`. + +When `minconf` is `0` unspent notes with zero confirmations are returned, even though they are not immediately spendable. + +Results are an array of Objects, each of which has: +{txid, jsindex, jsoutindex, confirmations, address, amount, memo} (Sprout) +{txid, outindex, confirmations, address, amount, memo} (Sapling) + +### Arguments + +| Name | Type | Description | +| ---------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | +| minconf | (numeric, optional, default=1) | the minimum confirmations to filter | +| maxconf | (numeric, optional, default=9999999) | the maximum confirmations to filter | +| includeWatchonly | (bool, optional, default=false) | whether to also include watchonly addresses (see [z_importviewingkey](../komodo-api/wallet.html#z-importviewingkey)) | +| addresses | (array) | a json array of z addresses (both Sprout and Sapling) to act as a filter; duplicate addresses are not allowed | +| address | (string) | a z address | + +### Results + +An array of json objects, each having the properties below. + +| Name | Type | Description | +| ------------------ | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| txid | (string) | the transaction id | +| jsindex | (numeric) | the joinsplit index | +| jsoutindex | (numeric, only returned on sprout addresses) | the output index of the joinsplit | +| outindex | (numeric, only returned on sapling addresses) | the output index | +| "confirmations" | (numeric) | a confirmation number that is dPoW aware; see this [article](https://docs.komodoplatform.com/komodo/dPOW-conf.html) for more info | +| "rawconfirmations" | (numeric) | the raw confirmations (number of blocks on top of this transaction's block) | | +| spendable | (boolean) | true if note can be spent by wallet, false if note has zero confirmations, false if address is watchonly | +| address | (string) | the shielded address | +| amount | (numeric) | the amount of value in the note | +| memo | (string) | hexadecimal string representation of memo field | +| change | (boolean) | true if the address that received the note is also one of the sending addresses | + +#### :pushpin: Examples + +Command: + +``` +./komodo-cli z_listunspent +``` + + + + + +Command: + +```bash +./komodo-cli -ac_name=BEER z_listunspent 1 100 false "[\"zs1wqykmk74mv2ezjscpxsgzrn4fasqwh50tgk0ym64m45c5yw5fjtpkps64gle963veqzuj04872z\"]" +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user rpcuser:rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_listunspent", "params": [1, 9999999, false, ["zs1umhaattx6lna933m9zwfqlmkm2qj49hpa9lnymtj5h5c7cwtd3evfpu29hppprax9cs45fzeyqg"] ] }' -H 'content-type: text/plain;' http://127.0.0.1:rpcport/ +``` + + + + + +## z_mergetoaddress + +**z_mergetoaddress [ "fromaddress", ... ] "toaddress" ( fee ) ( transparent_limit ) ( shielded_limit ) ( memo )** + +::: warning +CAUTION: z_mergetoaddress is DISABLED but can be enabled as an experimental feature. +::: + +The `z_mergetoaddress` method merges multiple utxos and notes into a single utxo or note. The method works for both t addresses and z addresses, both separately and in combination. Coinbase utxos are ignored; use `z_shieldcoinbase` to combine those into a single note. + +This is an asynchronous operation, and utxos selected for merging will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos. + +The number of utxos and notes selected for merging can be limited by the caller. If the transparent limit parameter is set to `0`, the `mempooltxinputlimit` option will determine the number of utxos. Any limit is constrained by the consensus rule defining a maximum transaction size of 100000 bytes. + +### The fromaddresses array + +The following special strings are accepted inside the `fromaddresses` array: + +- `"*"`: Merge both utxos and notes from all addresses belonging to the wallet + +- `"ANY_TADDR"`: Merge utxos from all t addresses belonging to the wallet + +- `"ANY_ZADDR"`: Merge notes from all z addresses belonging to the wallet + +If a special string is given, any given addresses of that type will be ignored + +### Arguments + +| Name | Type | Description | +| ----------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| fromaddresses | (string, required) | +| "address" | (string) | can be a t address or a z address | +| "toaddress" | (string, required) | the t address or z address to receive the combined utxo | +| fee | (numeric, optional, default=0.0001) | the fee amount to attach to this transaction | +| transparent_limit | (numeric, optional, default=50) | limit on the maximum number of transparent utxos to merge; you may set this value to 0 to use the node option [mempooltxinputlimit](../installations/common-runtime-parameters.html#mempooltxinputlimit) | +| shielded_limit | (numeric, optional, default=10) | limit on the maximum number of hidden notes to merge; you may set this value to 0 to merge as many as will fit in the transaction | +| "memo" | (string, optional) | encoded as hex; when `toaddress` is a z address, this value will be stored in the memo field of the new note | + +### Response + +| Name | Type | Description | +| --------------------------- | --------- | ----------------------------------------------------------------------------------- | +| "remainingUTXOs" | (numeric) | the number of utxos still available for merging | +| "remainingTransparentValue" | (numeric) | the value of utxos still available for merging | +| "remainingNotes" | (numeric) | the number of notes still available for merging | +| "remainingShieldedValue" | (numeric) | the value of notes still available for merging | +| "mergingUTXOs" | (numeric) | the number of utxos being merged | +| "mergingTransparentValue" | (numeric) | the value of utxos being merged | +| "mergingNotes" | (numeric) | the number of notes being merged | +| "mergingShieldedValue" | (numeric) | the value of notes being merged | +| "opid" | (string) | an operationid to pass to `z_getoperationstatus` to get the result of the operation | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_mergetoaddress '["t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"]' ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_mergetoaddress", "params": [["t1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"], "ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_sendmany + +**z_sendmany "fromaddress" [ { "address": ..., "amount": ... }, ... ] \( minconf ) ( fee )** + +The `z_sendmany` method sends one or more transactions at once, and allows for sending transactions of types `t --> t`, `t --> z`, `z --> z`, `z --> t`. It is the principle method for dealing with shielded `z` transactions in the Komodo ecosystem. + +The `amount` values are double-precision floating point numbers. Change from a t address flows to a new t address address, while change from z address returns to itself. When sending coinbase utxos to a z address, change is not allowed. The entire value of the utxo(s) must be consumed. Currently, the maximum number of z address outputs is 54 due to transaction-size limits. + +### Arguments + +| Name | Type | Description | +| ------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ | +| "fromaddress" | (string, required) | the sending t address or z address | +| "amounts" | (array of json objects) | +| "address" | (string, required) | the receiving address; can be a t address or z address | +| "amount" | (numeric, required) | the numeric amount | +| "memo" | (string, optional) | if the address is a z address, this property accepts raw data represented in hexadecimal string format | +| minconf | (numeric, optional, default=1) | only use funds confirmed at least this many times | +| fee | (numeric, optional, default=0.0001) | the fee amount to attach to this transaction | + +### Response + +| Name | Type | Description | +| ------------- | -------- | --------------------------------------------------------------------------------- | +| "operationid" | (string) | an operationid to pass to z_getoperationstatus to get the result of the operation | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_sendmany "RUX5vGkxJCKBPGm8b97VUumt2aHkuCjp8e" '[{"address":"RVEsww91UBdUNGyCC1GjDVuvJShEei2kj4","amount":0.01}]' +``` + + + + + +Command: + +```bash +./komodo-cli z_sendmany "RCpMUZwxc3pWsgip5aj3Sy1cKkh86P3Tns" '[{"address":"ztci8RzNSo2pdiDpAeHpz9Rp91hq12Mn7zcFfBR8Jjs2ydZUCTw8rLZzkVP888M4vGezpZVfsTR8orgxYK3N8gdgbBzakx3","amount":0.01}]' +``` + + + + + +Command: + +```bash +./komodo-cli z_sendmany "ztci8RzNSo2pdiDpAeHpz9Rp91hq12Mn7zcFfBR8Jjs2ydZUCTw8rLZzkVP888M4vGezpZVfsTR8orgxYK3N8gdgbBzakx3" '[{"address":"ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP","amount":0.0099}]' +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_sendmany", "params": ["RCpMUZwxc3pWsgip5aj3Sy1cKkh86P3Tns", [{"address": "ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf" ,"amount": 0.01}]] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## z_shieldcoinbase + +**z_shieldcoinbase "fromaddress" "tozaddress" ( fee ) ( limit )** + +The `z_shieldcoinbase` method shields transparent coinbase funds by sending the funds to a shielded z address. This is an asynchronous operation and utxos selected for shielding will be locked. If there is an error, they are unlocked. + +The RPC call `listlockunspent` can be used to return a list of locked utxos. The number of coinbase utxos selected for shielding can be limited by the caller. If the limit parameter is set to zero, the [mempooltxinputlimit](../installations/common-runtime-parameters.html#mempooltxinputlimit) option will determine the number of uxtos. Any limit is constrained by the consensus rule defining a maximum transaction size of 100000 bytes. + +### Arguments + +| Name | Type | Description | +| ------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------- | +| "fromaddress" | (string, required) | the address is a t address or `"*"` for all t address belonging to the wallet | +| "toaddress" | (string, required) | the address is a z address | +| fee | (numeric, optional, default=0.0001) | the fee amount to attach to this transaction | +| limit | (numeric, optional, default=50) | limit on the maximum number of utxos to shield; set to `0` to use node option `mempooltxinputlimit` | + +### Response + +| Name | Type | Description | +| ---------------- | --------- | --------------------------------------------------------------------------------- | +| "remainingUTXOs" | (numeric) | the number of coinbase utxos still available for shielding | +| "remainingValue" | (numeric) | the value of coinbase utxos still available for shielding | +| "shieldingUTXOs" | (numeric) | the number of coinbase utxos being shielded | +| "shieldingValue" | (numeric) | the value of coinbase utxos being shielded | +| "opid" | (string) | an operationid to pass to z_getoperationstatus to get the result of the operation | + +#### :pushpin: Examples + +Command: + +```bash +./komodo-cli z_shieldcoinbase "RXN2rxidK4cwzRL44UTnWvQjjvLdoMmCpU" "ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP" +``` + + + + + +Command: + +```bash +./komodo-cli z_shieldcoinbase "REyaj53EB2nwUnsmVyn8JHCcquKf1zYkEP" "ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP" 0.0001 50 +``` + + + + + +You can find your `rpcuser`, `rpcpassword`, and `rpcport` in the coin's `.conf` file. + +Command: + +```bash +curl --user myrpcuser:myrpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "z_shieldcoinbase", "params": ["RWRSfEYcfLv3yy9mhAuKHQTMCs9fArpPiH", "ztYMDvwUqi5FZLQy4so71ZGHXk2fDtEYU9HNns9DNYjXJr9PEzSL8Dq8NcdiRijsgCm4r3nNWA6dUrqW9suGd2F7uuj2BhP"] }' -H 'content-type: text/plain;' http://127.0.0.1:myrpcport/ +``` + + + + + +## zcbenchmark + +**zcbenchmark benchmarktype samplecount** + +The `zcbenchmark` method runs a benchmark of the selected `benchmarktype`. This benchmark is calculated `samplecount` times. + +When finished, the method returns the running times of each sample. + +### Arguments + +| Name | Type | Description | +| --------------- | ------------------ | ----------------------------- | +| "benchmarktype" | (string, required) | the type of the benchmark | +| "samplecount" | (numeric) | the number of samples to take | + +### Response + +| Name | Type | Description | +| ------------- | --------- | ---------------------------------------------------- | +| "runningtime" | (numeric) | the time it took to run the selected `benchmarktype` | + +Output: + +```json +[ + { + "runningtime": runningtime + }, + { + "runningtime": runningtime + } + ... +] +``` + +## zcrawjoinsplit + +**zcrawjoinsplit rawtx inputs outputs vpub_old vpub_new** + +::: warning +DEPRECATED. +::: + +- inputs: a JSON object mapping {note: zcsecretkey, ...} +- outputs: a JSON object mapping {zcaddr: value, ...} + +Splices a joinsplit into a raw transaction. Inputs are unilaterally confidential. +Outputs are confidential between sender/receiver. The vpub_old and +vpub_new values are globally public and move transparent value into +or out of the confidential value store, respectively. + +Note: The caller is responsible for delivering the output enc1 and +enc2 to the appropriate recipients, as well as signing rawtxout and +ensuring it is mined. (A future RPC call will deliver the confidential +payments in-band on the blockchain.) + +Output: + +```json +{ + "encryptednote1": enc1, + "encryptednote2": enc2, + "rawtxn": rawtxout +} +``` + +## zcrawkeygen + +**zcrawkeygen** + +::: warning +DEPRECATED. +::: + +the `zcrawkeygen` method generates a zcaddr which can send and receive confidential values. + +Output: + +```json +{ + "zcaddress": zcaddr, + "zcsecretkey": zcsecretkey, + "zcviewingkey": zcviewingkey +} +``` + +## zcrawreceive zcsecretkey encryptednote + +**zcrawreceive zcsecretkey encryptednote** + +::: warning +DEPRECATED. +::: + +Decrypts `encryptednote` and checks if the coin commitments +are in the blockchain as indicated by the "exists" result. + +Output: + +```json +{ + "amount": value, + "note": noteplaintext, + "exists": exists +} +``` + +## zcsamplejoinsplit + +Perform a joinsplit and return the JSDescription. +# Common Runtime Parameters + +## Introduction + +The following is an abbreviated list of runtime parameters and settings that can be initiated in a [Smart Chain's .conf file.](../installations/common-runtime-parameters.html#accessing-the-coin-daemon-remotely) + +These commands largely derive from the upstream Bitcoin software, `bitcoind`. + +Komodo is a fork of Zcash, and Zcash is a privacy-centric fork of Bitcoin. Therefore, essentially all runtime parameters and API commands available in both Bitcoin and Zcash are available in Komodo. + +To see additional Bitcoin-based runtime parameters not included here, please visit [the relevant Bitcoin wiki page](https://en.bitcoin.it/wiki/Running_Bitcoin). + +## addnode + +`addnode` tells the daemon which nodes are trusted to act as seed nodes. After connecting to a node via `addnode`, the trusted node will send your node the list of all nodes that it is connected to, and your node will then connect to these additional nodes until [the max limit](../installations/common-runtime-parameters.html#maxconnections) is reached. + +This contrasts from the [connect](../installations/common-runtime-parameters.html#connect) runtime parameter, as the latter does not attempt to connect your node to additional nodes. + +If you are behind a firewall or are having issues connecting to the network, `addnode` is a stronger option. + +On the other hand, if you want to connect only to designated and trusted nodes, `connect` is a stronger option. + +If you run multiple nodes that are connected via a LAN, it is not necessary for each node to open multiple connections. Instead, use `connect` to connect all to one primary node, and then use `addnode` on the primary node to connect to the network. + +The p2p port must not be blocked by a firewall. If the computers do not have public IP addresses, you will need to port-forward the p2p port on both computers and append the forwarded port to the IP. + +#### :pushpin: Examples: + +`./komodod -ac_name=EXAMPLECHAIN -ac_supply=1000000 -addnode=:8096` + +Using addnode as a default value in the Smart Chain's `.conf` file: + +```bash +addnode=69.164.218.197 +``` + +## addressindex + +`addressindex` instructs a Smart Chain to maintain an index of all addresses and balances. + +We recommend that the user [manually delete the blockchain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) before initiating this parameter. + +`addressindex` is enabled by default on any Smart Chain that utilizes Fluidity. + +::: tip +The reindex parameter is not a viable alternative method for re-syncing the Smart Chain in this circumstance. +::: + +#### :pushpin: Examples: + +Using `addressindex` as a runtime parameter: + +```bash +komodod -addressindex=1 +``` + +Using `addressindex` as a default value in the Smart Chain's `.conf` file: + +```bash +addressindex=1 +``` + +## bantime + +`bantime` sets the default number of seconds for a ban initiated during the daemon's session. The default is 86400. + +#### :pushpin: Examples: + +Using bantime as a runtime parameter: + +```bash +komodod -bantime=100000 +``` + +Using bantime as a default value in the Smart Chain's `.conf` file: + +```bash +bantime=100000 +``` + +## bind + +`bind` instructs the Smart Chain daemon to bind to a given address and always listen on it. + +Use `[host]:port` notation for IPv6. + +#### :pushpin: Examples: + +Using bind as a runtime parameter: + +```bash +komodod -bind=127.0.0.1:9050 +``` + +Using bind as a default value in the Smart Chain's `.conf` file: + +```bash +bind=127.0.0.1:9050 +``` + +## connect + +`connect` connects the `komodod` server to a trusted peer node, but not to request or add any additional nodes. + +Please refer to the [addnode](../installations/common-runtime-parameters.html#addnode) parameter entry for more information. + +#### :pushpin: Examples: + +Using connect as a default value in the Smart Chain's `.conf` file: + +```bash +connect=69.164.218.197 +``` + +## donation + +`donation` donates all user rewards to a specific address. This value must be set to a 33 byte pubkey. + +#### :pushpin: Examples: + +Using donation as a default value in the Smart Chain's `.conf` file: + +```bash +donation=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 +``` + +## exchange + +`exchange` forfeits all user rewards to miners. Set this to explicitly not claim user rewards. + +#### :pushpin: Examples: + +Using exchange as a default value in the Smart Chain's `.conf` file: + +```bash +exchange=1 +``` + +## exportdir + +`exportdir` tells the Smart Chain daemon where to store the wallet backup files created through the [backupwallet](../komodo-api/wallet.html#backupwallet) and [dumpwallet](../komodo-api/wallet.html#dumpwallet) calls. + +#### :pushpin: Examples: + +Using exportdir as a default value in the Smart Chain's `.conf` file: + +```bash +exportdir=/home/myusername/mydirectory +``` + +## gen + +`gen` instructs the daemon to attempt to generate new blocks, and thereby mine new coins. + +See also [setgenerate](../komodo-api/generate.html#setgenerate). + +::: warning +This parameter should be avoided. Instead, start the daemon without the `-gen` parameter. Once the Smart Chain is launched, wait until the blockchain is synced to the current block and then execute the [setgenerate](../komodo-api/generate.html#setgenerate) method. The sync status of the blockchain can be found by executing the [getinfo](../komodo-api/control.html#getinfo) method and comparing the `blocks` and `longestchain` properties. +::: + +::: tip + +- If the `genproclimit` property is not specified after the `gen` option, the daemon mines using 1 thread. +- To mine using all available threads, use: `-genproclimit=-1` + ::: + +::: tip +`gen=0` in the .conf file on an Smart Chain where [ac_staked](../basic-docs/smart-chains/smart-chain-setup/smart-chain-customizations.html#ac-staked) is enabled sets the daemon to stake using all available coins +::: + +#### :pushpin: Examples: + +Using gen as a runtime parameter to mine using 4 threads: + +```bash +./komodod -gen -genproclimit=4 +``` + +## genproclimit + +`genproclimit` sets the number of threads to be used for mining. To use all the available processors, use the value `-1`. + +::: tip +Setting `genproclimit=0` instructs the daemon to stake (if possible) using all available coins. +::: + +#### :pushpin: Examples: + +Using genproclimit as a default value in the Smart Chain's `.conf` file, to mine using 2 threads: + +```bash +genproclimit=2 +``` + +## keypool + +`keypool` instructs the daemon to pre-generate a certain number of public/private key pairs. This can facilitate `wallet.dat` backups being valid for both prior transactions and several dozen future transactions. + +#### :pushpin: Examples: + +Using keypool as a default value in the Smart Chain's `.conf` file: + +```bash +keypool=100 +``` + +## listen + +`listen` instructs the daemon to listen for RPC calls on the network. It is enabled by default, except when `connect` is used. + +#### :pushpin: Examples: + +Using listen as a runtime parameter: + +```bash +komodod -listen=1 +``` + +Using listen as a default value in the Smart Chain's `.conf` file: + +```bash +listen=1 +``` + +## maxconnections + +`maxconnections` sets the maximum number of inbound and outbound connections. + +#### :pushpin: Examples: + +Using maxconnections as a runtime parameter: + +```bash +komodod -maxconnections=NUMBER +``` + +Using maxconnections as a default value in the Smart Chain's `.conf` file: + +```bash +maxconnections=NUMBER +``` + +## mempooltxinputlimit + +::: tip +DEPRECATED +::: + +`mempooltxinputlimit` is a runtime parameter inherited from Zcash. The functionality it facilitates is now enabled by default, and therefore the parameter is deprecated. Please see [the Zcash documentation for more information](https://blog.z.cash/new-release-1-1-0/). + +## proxy + +`proxy` allows the user to connect via a `SOCKS5` proxy. + +#### :pushpin: Examples: + +Using proxy as a runtime parameter: + +```bash +komodod -proxy=127.0.0.1:9050 +``` + +Using proxy as a default value in the Smart Chain's `.conf` file: + +```bash +proxy=127.0.0.1:9050 +``` + +## pubkey + +`pubkey` sets an address to use as a change address for all transactions. This value must be set to a 33 byte pubkey. All mined/staked coins will also be sent to this address. We recommend that the user ensure they own the corresponding `privkey` of their chosen `pubkey`, lest their funds be sent to a `pubkey` they do not own or control. + +The `pubkey` parameter is required for all Fluidity-enabled chains. All Fluidity transactions will utilize the `pubkey` as an integral property. + +#### :pushpin: Examples: + +Using pubkey as a default value in the Smart Chain's `.conf` file: + +```bash +pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 +``` + +Using pubkey as a startup parameter: + +```bash +-pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 +``` + +## regtest + +`regtest` instructs the Smart Chain daemon to run a regression test network. Typically, the user will create a disposable Smart Chain for these purposes. The [ac_supply](../basic-docs/smart-chains/smart-chain-setup/smart-chain-customizations.html#ac-supply) parameter is not required in this instance. + +(A regression-test network is a useful tool for rapid trial and testing. [Please reach out to us](https://komodoplatform.com/discord) if you are curious to implement this tool in your workflow and are unfamiliar with the process.) + +#### :pushpin: Examples: + +Using regtest as a runtime parameter: + +```bash +komodod -ac_name=TEST -regtest +``` + +Using regtest as a default value in the Smart Chain's `.conf` file: + +```bash +regtest=0 +``` + +## reindex + +`reindex` instructs the daemon to re-index the currently synced blockchain data. + +::: tip +Depending on the size and state of the chain you are re-indexing, this parameter may prolong the daemon launch time. +::: + +#### :pushpin: Examples: + +Using reindex as a runtime parameter: + +```bash +komodod -reindex +``` + +## rewind + +`rewind` rewinds the chain to a specific block height. This is useful for creating snapshots at a given block height. + +#### :pushpin: Examples: + +Using rewind as a runtime parameter: + +```bash +komodod -rewind=777777 +``` + +## rpcallowip + +`rpcallowip` tells the daemon which ip addresses are acceptable for receiving rpc commands. + +By default, only rpc connections from localhost are allowed. + +Specify as many `rpcallowip=` settings as you like to allow connections from other hosts, either as a single IPv4/IPv6 or with a subnet specification. + +::: warning + +Opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED. The rpcpassword is transmitted over the network unencrypted. Also note that anyone that can authenticate on the RPC port can steal your keys and take over the server. [For more information click here](https://github.com/zcash/zcash/issues/1497). + +::: + +#### :pushpin: Examples: + +Using rpcallowip as a default value in the Smart Chain's `.conf` file: + +```bash + rpcallowip=10.1.1.34/255.255.255.0 + rpcallowip=1.2.3.4/24 + rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96 +``` + +## rpcbind + +`rpcbind` instructs the daemon to listen for json-rpc connections. + +Use `[host]:port` notation for IPv6. + +This option can be specified multiple times. + +The default setting is to bind to all interfaces. + +#### :pushpin: Examples: + +Using rpcbind as a runtime parameter: + +```bash +komodod -rpcbind=127.0.0.1:9704 +``` + +Using rpcbind as a default value in the Smart Chain's `.conf` file: + +```bash +rpcbind=127.0.0.1:9704 +``` + +## rpcclienttimeout + +`rpcclienttimeout` indicates the number of seconds to wait for an rpc command to complete before killing the process. + +#### :pushpin: Examples: + +Using rpcclienttimeout as a runtime parameter: + +```bash +komodod -rpcclienttimeout=SECONDS +``` + +Using rpcclienttimeout as a default value in the Smart Chain's `.conf` file: + +```bash +rpcclientttimeout=SECONDS +``` + +## rpcconnect + +`rpcconnect` allows the user to connect to `komodod` and send RPC commands from a host. By default, it is set to localhost. + +::: warning +We DO NOT RECOMMEND that the average user set this value to anything other than the localhost, as it can grant access to a foreign party, who are then able to take control over komodod and all funds in your wallet.dat file. +::: + +#### :pushpin: Examples: + +Using rpcconnect as a default value in the Smart Chain's `.conf` file: + +```bash +rpcconnect=127.0.0.1 +``` + +## rpcport + +`rpcport` tells the daemon to listen for RPC connections on the indicated TCP port. + +#### :pushpin: Examples: + +Using rpcport as a default value in the Smart Chain's `.conf` file: + +```bash +rpcport=8232 +``` + +## sendfreetransactions + +`sendfreetransactions` instructs the daemon to send transactions as zero-fee transactions if possible. The default value is 0. + +#### :pushpin: Examples: + +Using sendfreetransactions as a default value in the Smart Chain's `.conf` file: + +```bash +sendfreetransactions=0 +``` + +## server + +`server` instructs the daemon to accept json-rpc commands. It is enabled by default. + +#### :pushpin: Examples: + +Using server as a runtime parameter: + +```bash +komodod -server=1 +``` + +Using server as a default value in the Smart Chain's `.conf` file: + +```bash +server=1 +``` + +## spentindex + +`spentindex` instructs a Smart Chain to maintain a full index of all spent transactions (txids). + +We recommend that the user [manually delete the blockchain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) before initiating this parameter. + +`spentindex` is enabled by default on any Smart Chain that utilizes the Fluidity. + +::: tip +The reindex parameter is not a viable alternative method for re-syncing the blockchain in this circumstance. +::: + +#### :pushpin: Examples: + +Using spentindex as a runtime parameter: + +```bash +komodod -spentindex=1 +``` + +Using spentindex as a default value in the Smart Chain's `.conf` file: + +```bash +spentindex=1 +``` + +## stopat + +`stopat` stops the chain at a specific block height. This is useful for creating snapshots at a given block height. + +#### :pushpin: Examples: + +Using stopat as a runtime parameter: + +```bash +komodod -stopat=1000000 +``` + +## timestampindex + +`timestampindex` instructs a Smart Chain to maintain a timestamp index for all block hashes. + +We recommend that the user [manually delete the blockchain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) before initiating this parameter. + +::: tip +The reindex parameter is not a viable alternative method for re-syncing the Smart Chain in this circumstance. +::: + +#### :pushpin: Examples: + +Using timestampindex as a runtime parameter: + +```bash +./komodod -timestampindex=1 +``` + +Using timestampindex as a default value in the Smart Chain's `.conf` file: + +```bash +timestampindex=1 +``` + +## txindex + +`txindex` instructs a Smart Chain to track every transaction made on the relevant blockchain. + +`txindex` is enabled by default on all Smart Chains, and is utilized in delayed Proof of Work (dPoW), privacy modules, and Fluidity. + +::: danger Warning! +Disabling `txindex` will cause the default Smart Chain daemon to malfunction. +::: + +## whitebind + +`whitelist` binds the daemon to a given address and whitelists peers connecting to it. + +Use `[host]:port` notation for IPv6 + +#### :pushpin: Examples: + +Using whitebind as a runtime parameter: + +```bash +komodod -whitebind=127.0.0.1:9050 +``` + +Using whitebind as a default value in the Smart Chain's `.conf` file: + +```bash +whitebind=127.0.0.1:9050 +``` + +# Ecosystem Launch Parameters + +A list of launch parameters for all Smart Chains in the Komodo ecosystem can be found here. + +[Link to list of all Smart Chain launch parameters](https://github.com/KomodoPlatform/komodo/blob/beta/src/assetchains.old) + +# Installing Smart Chain Software From Source Code + +The basic Komodo software package includes two applications. + +##### komodod + +The `komodod` software application is the Smart Chain daemon that powers all Komodo blockchains. + +##### komodo-cli + +The `komodo-cli` software application allows a developer to execute API calls to `komodod` via the command line. + +##### Both are Installed Automatically + +Both of these software applications are installed in the `~/komodo/src/` directory as a part of any of the following installation procedures. + +### The Two Methods to Install Smart Chain Software + +There are two methods available to install Smart Chain software. + +##### Pre-compiled Binaries + +You can download and unzip our pre-compiled binaries. This is the simplest method and requires no installation procedure. + +For more information on this method, please see the link below. + +[Link to simple installations section for pre-compiled executables](../basic-docs/start-here/about-komodo-platform/simple-installations.html) + +##### Building Smart Chain Software From Source + +You may also build Smart Chain software from source. + +This is not required, but building from source is considered the best practice in a production environment, as this allows you to instantly update to the latest patches and upgrades. + +- [Linux](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#linux) +- [MacOS](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#macos) +- [Windows](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html#windows) + +## Linux + +#### Requirements + +- Linux (easiest with a Debian-based distribution, such as Ubuntu) + + - For Ubuntu, we recommend using only the 16.04 or 18.04 releases + +- 64-bit Processor + +- Minimum 4GB of free RAM (8GB+ recommended) + +#### Get Started + +Verify that your system is up to date. + +```bash +sudo apt-get update +sudo apt-get upgrade -y +``` + +#### Install the dependency packages + +```bash +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool libncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqrencode-dev libdb++-dev ntp ntpdate nano software-properties-common curl libevent-dev libcurl4-gnutls-dev cmake clang libsodium-dev -y +``` + +This action takes some time, depending on your Internet connection. Let the process run in the background. + +Once completed, follow the steps below to install Komodo. + +::: tip Note +At some point during the installation process, you will see a warning, "libgmp headers missing". This can safely be ignored. +::: + +#### Clone the Komodo Repository + +```bash +cd ~ +git clone https://github.com/jl777/komodo +cd komodo +git checkout dev +``` + +#### Fetch the Zcash Parameters + +```bash +./zcutil/fetch-params.sh +``` + +#### Build the Komodo Daemon + +In the command below, the `-j$(nproc)` parameter instructs the script to utilize all available processors in your hardware. + +Alternatively, you may instruct the script to use only a set number of processors. For example, `-j8` instructs the script to use `8` processors, `-j4` instructs the script to use `4` processors, etc. + +```bash +./zcutil/build.sh -j$(nproc) +``` + +This script can take some time. + +#### Create the komodo.conf File + +```bash +cd ~ +mkdir .komodo +cd .komodo +nano komodo.conf +``` + +With the `komodo.conf` file open in the Nano text editor, add the following lines. + +(Create your own `rpcuser` username and `rpcpassword` password.) + +```bash +rpcuser=usernameChangeItToSomethingSecure +rpcpassword=passwordChangeItToSomethingSecure +txindex=1 +bind=127.0.0.1 +rpcbind=127.0.0.1 +addnode=78.47.196.146 +addnode=5.9.102.210 +addnode=178.63.69.164 +addnode=88.198.65.74 +addnode=5.9.122.241 +addnode=144.76.94.38 +``` + +Press `CTRL+O` to save the changes. + +Press `CTRL+X` to exit the Nano editor. + +Start the `komodod` daemon. It will automatically begin syncing with the network. + +```bash +cd ~ +cd komodo/src +./komodod & +``` + +The `&` parameter in the last instruction above instructs the terminal to continue allowing you to enter commands within this terminal shell. + +#### (Optional) Tail the komodod Daemon + +Enter the following command to "tail" the `komodod` daemon. The `tail` command allows you to view the `debug.log` file updates in real time. + +```bash +tail -f ~/.komodo/debug.log +``` +#### Test Your Daemon with komodo-cli + +Ensure that your current working directory is in the default `src` directory. + +```bash +cd ~/komodo/src/ +``` + +You may now use the `komodo-cli` software to send API (RPC) calls to the `komodod` daemon. + +For example: + +```bash +./komodo-cli getinfo +``` + +This command returns the latest state information about the KMD blockchain and your `wallet.dat` file. + +```json +{ + "version": 1000550, + "protocolversion": 170002, + "KMDversion": "0.1.0", + "notarized": 186670, + "notarizedhash": "000000308845da840ab9af6c1e09dc02f3118683df065b5ec00b05c9bd58cdae", + "notarizedtxid": "6723a10ef4fceab230d4245305d1ed2a916e435abb83269c20daad9bbefd3f0e", + "notarizedtxid_height": "mempool", + "notarized_confirms": 0, + "walletversion": 60000, + "balance": 0, + "interest": 0, + "blocks": 186773, + "longestchain": 308867, + "timeoffset": 0, + "tiptime": 1486411069, + "connections": 8, + "proxy": "", + "difficulty": 1624278.6287953, + "testnet": false, + "keypoololdest": 1482746526, + "keypoolsize": 101, + "paytxfee": 0.0, + "relayfee": 0.00001, + "errors": "" +} +``` + +When the `blocks` and `longestchain` values are equal to each other, your machine is in sync with the network. + +#### Backup your wallet + +We can not stress enough the importance of backing up your `wallet.dat` file. + +On Linux, the file is located here: `~/.komodo/wallet.dat` + +One method to backup this file is to archive a copy of the file. + +```bash +# Copy the file +cp -av ~/.komodo/wallet.dat ~/wallet.dat + +# Rename file +mv ~/wallet.dat ~/2019-05-17-wallet_backup.dat + +# To make archive +tar -czvf ~/2019-05-17-wallet_backup.dat.tgz ~/2019-05-17-wallet_backup.dat + +# Move the final file to a secure location +``` + +## MacOS + +### Requirements + +- OSX (version > 10.11) +- Minimum 4GB of free RAM (8GB+ recommended) + +##### Ensure Command Line Tools are Installed. + +Issue the following command in a terminal. + +```bash +xcode-select --install +``` + +##### Ensure brew is Installed + +We use the software `brew` to install dependencies. If you have the latest version of `brew` installed already, you may skip this step. + +```bash +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + +##### Use brew to Install Dependencies + +Execute each command separately + +```bash +brew update +brew upgrade +brew tap discoteq/discoteq; brew install flock +brew install autoconf autogen automake +brew install gcc@6 +brew install binutils +brew install protobuf +brew install coreutils +brew install wget +``` + +#### Clone the Komodo repository + +```bash +git clone https://github.com/jl777/komodo +``` + +#### Fetch the Zcash Parameters: + +```bash +cd komodo +./zcutil/fetch-params.sh +``` + +#### Compile Komodo + +```bash +git checkout dev +./zcutil/build-mac.sh -j8 +``` + +This can take some time. + +While this process proceeds, open a new terminal for the next step. + +#### Create Configuration File + +Create the configuration file in the following directory: + +```bash +~/Library/Application\ Support/Komodo +``` + +If the directory does not yet exist, create the directory. + +```bash +mkdir ~/Library/Application\ Support/Komodo +``` + +Create the configuration file by entering the following commands in the terminal. Execute each line separately. + +```bash +echo "rpcuser=komodouser" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "txindex=1" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "bind=127.0.0.1" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "rpcbind=127.0.0.1" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "addnode=5.9.102.210" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "addnode=78.47.196.146" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "addnode=178.63.69.164" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "addnode=88.198.65.74" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "addnode=5.9.122.241" >> ~/Library/Application\ Support/Komodo/komodo.conf +echo "addnode=144.76.94.38" >> ~/Library/Application\ Support/Komodo/komodo.conf +``` + +#### Run Komodo + +Once all processes are complete, run the `komodod` daemon. + +```bash +cd ~/komodo/src +./komodod & +``` + +#### Track the Syncing Progress + +##### Using the tail Command + +```bash +tail -f ~/Library/Application\ Support/Komodo/debug.log +``` + +##### Using komodo-cli and getinfo + +```bash +cd ~/komodo/src +./komodo-cli getinfo +``` + +When the returned properties of `blocks` and `longestchain` are equal to each other, the daemon is finished syncing with the network. + +#### Backup Your Wallet + +We can not stress enough the importance of backing up your `wallet.dat` file. + +On MacOS, the file is located here: `~/Library/Application\ Support/Komodo/wallet.dat` + +One method to backup this file is to archive a copy of the file. + +```bash +# Copy the file +cp -av ~/Library/Application\ Support/Komodo/wallet.dat ~/wallet.dat + +# Rename file +mv ~/wallet.dat ~/2019-05-17-wallet_backup.dat + +# To make archive +tar -czvf ~/2019-05-17-wallet_backup.dat.tgz ~/2019-05-17-wallet_backup.dat + +# Move the final file to a secure location +``` + +## Windows + +The Windows software for `komodod` and `komodo-cli` files are slightly different than their MacOS and Linux counterparts in two ways. + +- The Windows software cannot be directly compiled on a Windows machine. Rather, the software must be compiled on a Linux machine (Ubuntu recommended), and then transferred to the Windows machine + - You can use a Virtual Machine-based installation of Ubuntu Linux, running on a Windows machine, as a solution +- The names of the software are `komodod.exe` and `komodo-cli.exe` + +Once you have access to an Ubuntu machine and have access to a terminal [with sudo privileges](https://help.ubuntu.com/community/RootSudo), you are prepared to continue the installation process. + +#### Install dependencies + +```bash +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl libsodium-dev cmake mingw-w64 +``` + +#### Install Rust + +```bash +curl https://sh.rustup.rs -sSf | sh +source $HOME/.cargo/env +rustup target add x86_64-pc-windows-gnu +``` + +#### Clone the Komodo Repository + +```bash +git clone https://github.com/jl777/komodo +cd komodo +git checkout dev +``` + +#### Fetch the Zcash Parameters + +```bash +./zcutil/fetch-params.sh +``` + +#### Build the Komodo Daemon + +In the command below, you may instruct the script to use only a set number of processors. For example, `-j8` instructs the script to use `8` processors, `-j4` instructs the script to use `4` processors, etc. + +```bash +./zcutil/build-win.sh -j8 +``` + +This script can take some time. Once completed, you will find `komodod.exe` & `komodo-cli.exe` files inside the `src` directory. + +Transfer these 2 executable files to your Windows computer and place the files in a new folder on the Desktop called kmd or any other location you prefer (remember the location and use that). For this guide we are using `kmd` directory on Desktop. + +Open a command prompt for the following steps. + +#### Create the Komodo Directory + +```bash +mkdir "%HOMEPATH%\AppData\Roaming\komodo" +``` + +#### Create the Configuration File + +```bash +notepad “%HOMEPATH%\AppData\Roaming\Komodo\komodo.conf” +``` + +When the software dialogue box opens, click `Yes` to create the `komodo.conf` file. + +Copy the information below and paste it into Notepad. + +```bash +rpcuser=usernameChangeItToSomethingSecure +rpcpassword=passwordChangeItToSomethingSecure +daemon=1 +rpcallowip=127.0.0.1 +rpcbind=127.0.0.1 +server=1 +txindex=1 +addnode=5.9.102.210 +addnode=78.47.196.146 +addnode=178.63.69.164 +addnode=88.198.65.74 +addnode=5.9.122.241 +addnode=144.76.94.38 +``` + +After pasting, save and exit Notepad. + +#### Create the Directory for the Zcash Parameters + +```bash +mkdir “%HOMEPATH%\AppData\Roaming\ZcashParams” +``` + +Download following files and move them into the new directory. + +- [sprout-proving.key](<[https://z.cash/downloads/sprout-proving.key](https://z.cash/downloads/sprout-proving.key)>) + +- [sprout-verifying.key](<[https://z.cash/downloads/sprout-verifying.key](https://z.cash/downloads/sprout-verifying.key)>) + +- [sapling-spend.params](<[https://z.cash/downloads/sapling-spend.params](https://z.cash/downloads/sapling-spend.params)>) + +- [sapling-output.params](<[https://z.cash/downloads/sapling-output.params](https://z.cash/downloads/sapling-output.params)>) + +- [sprout-groth16.params](<[https://z.cash/downloads/sprout-groth16.params](https://z.cash/downloads/sprout-groth16.params)>) + +#### Run Smart Chain Software + +```bash +"%HOMEPATH%\Desktop\kmd\komodod.exe" +``` + +#### Verify Syncing Progress + +```bash +"%HOMEPATH%\Desktop\kmd\komodo-cli.exe" getinfo +``` + +#### Backup Your Wallet + +We can not stress enough the importance of backing up your `wallet.dat` file. + +On Windows, the file is located here: `%HOMEPATH%\AppData\Roaming\Komodo\wallet.dat` + +One method to backup this file is to create a copy and archive it. +# Interacting with Komodo Chains + +## Using komodo-cli +Initiate the `komodod` daemon by calling it from the command line and including any desired runtime parameters. + +When initiating any Smart Chain other than the main KMD chain, the user should always include all parameters that were used to create the Smart Chain. + +::: tip + Note to Windows Users: Replace ./komodod and ./komodo-cli with komodod.exe and komodo-cli.exe for each step. +::: + +To launch the main KMD chain, execute the following command in the directory where `komodod` is installed. + +```bash +./komodod & +``` + +After the daemon launches, you may interact with it using the `komodo-cli` software. + +```bash +./komodo-cli API_COMMAND +``` + +To launch another Smart Chain, include the necessary parameters. + +::: tip IMPORTANT +Always execute the launch command EXACTLY as indicated, and as the Smart Chain's developers instruct. If you make a mistake, you must [delete the Smart Chain data](../../../basic-docs/smart-chains/smart-chain-setup/smart-chain-maintenance.html#manually-deleting-blockchain-data) and re-launch to regain access to the Smart Chain's network. +::: + +For example, to launch the DEX Smart Chain, execute: + +```bash +./komodod -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 & +``` + +To interact with the DEX daemon, use `komodo-cli` like so: + +```bash +./komodo-cli -ac_name=DEX API_COMMAND +``` + +In the terminal you can call the Komodo documentation by executing: + +```bash +./komodo-cli help +``` + +To learn more via the terminal about a specific API command, execute: + +```bash +./komodo-cli help API_COMMAND +``` +## Using curl + +To access a coin daemon remotely -- for example, via a `curl` command in the shell -- the user will need to obtain the `rpcuser`, `rpcpassword`, and `rpcport` from the `.conf` file of the relevant coin daemon. + +Assuming the default installation location, the `.conf` file can be found by exploring the following directories: + +| Operating System | Directory | +| ---------------- | --------- | +| MacOS | `~/Library/Application Support/Komodo` | +| Windows | `C:\Users\myusername\AppData\Roaming\Komodo\` | +| GNU/Linux | `~/.komodo` | + + +Within this directory there are also subdirectories containing all KMD-compatible `.conf` files used on this node. + +Contents of a KMD `.conf` file: + +```bash +rpcuser=myusername +rpcpassword=myrpcpassword +server=1 +rpcport=7771 +addnode=78.47.196.146 +addnode=5.9.102.210 +addnode=178.63.69.164 +addnode=88.198.65.74 +addnode=5.9.122.241 +addnode=144.76.94.3 +``` + +# Smart Chain Maintenance + +## Manually Deleting Blockchain Data + +Sometimes it is necessary to manually delete all blockchain data. This should automatically trigger a full re-sync of the Smart Chain. + +Users should exercise caution not to delete the `wallet.dat` file during this procedure. We recommend that the user make frequent backups of the `wallet.dat` file, especially before deleting files from the data directory. + +To erase all synced blockchain data, the following files should be deleted from the `.komodo` folder: + +#### Files to Delete + +- `blocks` +- `chainstate` +- `notarisations` +- `komodostate` +- `komodostate.ind` +- `peers.dat` + +#### Default Location for Files + +| Operating System | Directory | +| ---------------- | --------- | +| MacOS | `~/Library/Application Support/Komodo` | +| Windows | `C:\Users\myusername\AppData\Roaming\Komodo\` | +| GNU/Linux | `~/.komodo` | + +# Updating Smart Chain Software From Source + +## Linux + +To update your compiled `komodod` daemon, follow the steps below carefully. For each step, do not proceed to the next step until the current step is fully complete. + +You may leave the `komodod` daemon running, if necessary, and if your machine has sufficient resources. + +Alternatively, you may stop the daemon by executing `~/komodo/src/komodo-cli stop`. + +#### Navigate to your komodo directory + +```bash +cd ~/komodo +``` + +#### Reset Your Local Repository + +```bash +git reset --hard +``` + +#### Clean the Source Directory + +```bash +make clean +``` + +#### Update Your Local Source Code + +```bash +git pull +``` + +#### Compile the Latest Komodo Binary + +```bash +./zcutil/build.sh -j$(nproc) +``` + +#### Restart the komodod Daemon + +Start your services as usual. + +(If you did not stop the daemon before compiling, stop the daemon using `~/komodo/src/komodo-cli stop` and start the daemon again.) + +```bash +~/komodo/src/komodod & +``` + +#### Rapid Update Method + +The steps below can often be used to update the daemon. + +These steps take a lesser amount of time, but they may occasionally produce an error during compilation. If the steps below do not succeed, the compiler will cease and return an error. When this happens, simply switch to the update steps listed above. + +```bash +cd ~/komodo +git checkout dev +git pull +make -j$(nproc) +``` + +## MacOS + +To update your compiled `komodod` daemon, follow the steps below carefully. For each step, do not proceed to the next step until the current step is fully complete. + +You may leave the `komodod` daemon running, if necessary, and if your machine has sufficient resources. + +Alternatively, you may stop the daemon by executing `~/komodo/src/komodo-cli stop`. + +#### Navigate to your komodo directory + +```bash +cd ~/komodo +``` + +#### Reset Your Local Repository + +```bash +git reset --hard +``` + +#### Clean the Source Directory + +```bash +make clean +``` + +#### Update Your Local Source Code + +```bash +git pull +``` + +#### Compile the Latest Komodo Binary + +```bash +./zcutil/build.sh -j8 +``` + +#### Restart the komodod Daemon + +Start your services as usual. + +(If you did not stop the daemon before compiling, stop the daemon using `~/komodo/src/komodo-cli stop` and start the daemon again.) + +```bash +~/komodo/src/komodod & +``` + +#### Rapid Update Method + +The steps below can often be used to update the daemon. + +These steps take a lesser amount of time, but they may occasionally produce an error during compilation. If the steps below do not succeed, the compiler will cease and return an error. When this happens, simply switch to the update steps listed above. + +```bash +cd ~/komodo +git checkout dev +git pull +make -j8 +``` + +## Windows + +To update the Windows software, you will again need access to your available installation of Linux where you originally compiled the software. + +#### Build the New Executables + +Execute the following commands on your Linux machine to build the new executable files. + +```bash +cd ~/komodo +git pull +./zcutil/build-win.sh -j8 +``` + +This can take some time. + +#### Move Executables to Windows OS + +Once the process completes, find the `komodod.exe` and `komodo-cli.exe` files and move them to your Windows OS machine. + +You may drop these executable files into the same `kmd` folder to overwrite the old executables files. + +Once complete, run the `komodod.exe` and `komodo-cli` files to verify that they work properly. + +# Basic Environment Setup for Linux VPS + +## Introduction + +This tutorial provides guidance in creating a simple environment for development in the Komodo ecosystem. + +The content herein is not comprehensive. Rather, this content provides a starting point, from which an enthusiastic learner should be capable of customizing and developing their own approach. + +## Rent a VPS + +A common environment choice among developers is to use a Virtual Private Server (VPS). A VPS allows a developer to use the Internet to access high quality hardware with corporate-level high speed Internet access. + +Popular VPS choices include [Amazon Web Services (AWS)](https://aws.amazon.com) and [DigitalOcean](https://digitalocean.com). + +One reason a VPS is popular is that a developer can quickly create new instances of a virtual machine. This facilitates the developer in having a clean environment that is targeted for a specific purpose. + +VPS's are also relatively cheap. Both AWS and DigitalOcean provide the basic necessities for $0 to $20/month, depending on your desired specifications. + +::: tip + +Alternatively, you can use your own personal computer, or a bare-metal server. However, troubleshooting on a personal setup can prove to be more time consuming than on a VPS. + +::: + +### Recommended Minimum Server Specifications: + +- CPU with 4 cores +- 8 GB RAM +- ~100GB SSD + - Note that using an HDD instead of a SSD will dramatically increase synchronization time, and thus slow down your workflow +- Ubuntu version 18.04 (for beginners) + - Ubuntu is the most popular Linux distribution + - The majority of Komodo's documentation is tested and written on Ubuntu + - To learn more about Linux, [read this linked article](https://www.linux.com/what-is-linux) + +## Connect to Your VPS + +Once you have chosen your VPS provider, you will need to connect to your VPS. + +New developers often find this process confusing. + +Your VPS provider should have several tutorials available to help you through this process. + +Look for tutorials on the following topics. + +* How to launch a terminal shell on your laptop or desktop machine +* How to set up SSH keys for secure login access +* How to execute a `ssh` command on your local machine to connect to your VPS +* How to enter `sudo` commands on your VPS + +For example, AWS has the following documentation to assist new developers in accessing VPS's that use the AWS EC2 service. Choose between MacOS & Linux, or Windows, both of which have different tutorial paths. + +[Link to AWS tutorial starting point](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html) + +## Initial VPS Setup + +Once you can access your VPS via the terminal, it is time to consider security in your environment. You are accessing a machine over the Internet, and there are myriad ways by which an attack can compromise your connection. + +To ensure your own safety, consider the following security measures. + +- Never log into your VPS as the root user +- Consider disabling the option to log in as root +- Use SSH keys to log in, instead of a password +- Enable a firewall to limit all unwanted traffic + +The following tutorials provide many useful tips on creating a secure server. + +- [Initial Server Setup with Ubuntu 18.04 | Digital Ocean](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04) +- [Using SSH to connect to a remove server](https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server-in-ubuntu) + +For experience learning the Linux environment, consider the following tutorials. + +- [How to use the Unix command line (interactive course)](https://www.codecademy.com/learn/learn-the-command-line) +- [An Introduction to Linux (Especially "A Culture of Learning")](https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics) +- [How To Download Software and Content onto your Linux VPS](https://www.digitalocean.com/community/tutorials/how-to-download-software-and-content-onto-your-linux-vps) +- [How To Use cd, pwd, and ls to Explore the File System on a Linux Server](https://www.digitalocean.com/community/tutorials/how-to-use-cd-pwd-and-ls-to-explore-the-file-system-on-a-linux-server) +- [How to Add and Delete Users on Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04) +# Creating Komodo Smart Chains + +## Creating A New Smart Chain + +### Requirements for Creating a New Chain + +- 2 nodes with the ability to open ports (a node can be either a computer or a VPS) +- At least 4GB RAM each +- At least 2 CPU cores each +- 64-bit Operating System (Ubuntu 18.04 recommended) +- Komodo Smart Chain software installed on each + - (when the goal is only to build a new Smart Chain, there is no need to sync the KMD main chain) + +::: tip +When you are building and testing a Komodo Smart Chain, please do not hesitate to reach out to us when you are stuck. We wish to make this as easy as possible. Our support agents are available in our #support channel in Discord for many hours each day, and during off hours you can file a ticket on our support page. +::: + +::: tip +The word "node" is used throughout this documentation, and it can be confusing for beginners. A node can be a unique desktop computer connected to the Internet. It can also be a virtual-private server (VPS) that is rented or purchased, and which the developer can access at will. Or, it can be another type of unique instance of a computational machine. +::: + +### Basic Info for Connecting At Least Two Nodes + +Basic knowledge about how to connect two nodes is recommended for the initial setup. + +As per the original blockchain designs of Satoshi Nakamoto, a Komodo Smart Chain does not exist on a single node. Rather, it exists via a connection between two or more nodes. This is the nature of decentralization: it is on the network we rely, rather than a single authority. Therefore, the design of the technology encourages the developer to have two separate nodes which are able to connect over a network. + +In the most ideal circumstance, the new Komodo developer will already have two virtual private servers (VPS's) available for testing. VPS's can be cheap and easy to manage. A typical VPS will either have a static external IP or can be assigned one. + +If the new developer does not have two VPS's available, setting up a test Smart Chain on two local machines in a home or office-type setting is still achievable, but it may require more troubleshooting. + +When using a home or office-type setup, the challenge lies in the way the network is created, and there are myriad network setups. + +For example, if the developers are operating on a local router, where the two machines are connected via wifi, the local ip addresses of the machines are harder to find. This is because the router assigns new local ip addresses to the machines each time they re-connect to the router. It is not possible to see the ip addresses from the Internet. In this situation, the developer must log into the router's software interface and search for the currently assigned local ip addresses. + +A home or office-type setup can suffice, if you're just looking to test an Smart Chain quickly and don't want to spend money on a VPS. However, don't be surprised if you need to ask for help. Please reach out to us, and we'll help the best we can. + +To prepare for the next step, execute the following command in the terminal on both machines: + +```bash +curl ifconfig.me +``` + +From the response, record the `ip address` value for additional use. + +With the ip addresses available, we are now prepared to test the connection between the machines. + +```bash +ping +``` + +This command will generate a response every second, indicating the `ping` speed with which your machines are able to connect. + +```bash +$ ping 192.168.1.101 + +PING 192.168.1.101 (192.168.1.101) 56(84) bytes of data + +64 bytes from 192.168.1.101: icmp_seq=1 ttl=64 time=131 ms + +64 bytes from 192.168.1.101: icmp_seq=2 ttl=64 time=2.40 ms + +``` + +If you do not see a similar response in the shell, your machines are not able to connect. Please reach out to our team and we will do our best to assist you. + +## Part I: Creating a New Komodo Smart Chain + +With your machines successfully able to `ping` each other, you are ready to create your first Smart Chain. + +The following instructions use the simplest possible set of parameters in creating a new Smart Chain: a coin with the ticker symbol `HELLOWORLD`, `777777` pre-mined coins, and a block reward of `.0001`. + +On your first node, change into the directory where Komodo's `komodod` and `komodo-cli` are installed and execute the following commands in the terminal: + +#### Mac & GNU/Linux + +```bash +./komodod -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & +``` + +#### Windows + +```bash +./komodod.exe -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & +``` + +### Verify the Response + +After issuing this command in the terminal on both machines, you will find the p2p port in the terminal window. + +```bash +>>>>>>>>>> HELLOWORLD: p2p.8096 rpc.8097 magic.c89a5b16 3365559062 777777 coins +``` + +In the above string, take note of the p2p and RPC ports, as well as the magic number. These values must match on both nodes for the chains to be identical. If they are not the same, verify that the launch command is the same on both the nodes. + +In the example above, the p2p port is `8096`. Make sure that the p2p port is open to the internet or any other network from which the second node connects. + +This completes the first half of the Smart Chain creation process. Scroll down to [Part II](../installations/creating-asset-chains.html#part-ii-connecting-the-second-node). + +::: tip +Please refer to [Smart Chain Parameters](../installations/asset-chain-parameters.html) for a full list of parameters to customize the characteristics of your blockchain. +::: + +::: tip +Please note the requirements for [ac_supply](../installations/asset-chain-parameters.html#ac-supply), and instructions for using [addnode](../installations/common-runtime-parameters.html#addnode) under various network conditions, including firewalls and LANs. +::: + +## Part II: Connecting the Second Node + +On the second node you issue the same command, but with a key difference. This time, use the first node's IP address. + +```bash +./komodod -ac_name=HELLOWORLD -ac_supply=777777 -addnode= & +``` + +Once the daemon loads, compare the string that starts with `>>>>>>>>>>` in the second node to the one from the first node to make sure they are identical. + +Mining can be started on a node using the following command: + +```bash +./komodo-cli -ac_name=HELLOWORLD setgenerate true $(nproc) +``` + +`$(nproc)` in the above command makes the daemon mine using all the available CPU threads, which might be necessary in a low end VPS. + +On a Komodo-based blockchain, all of the pre-mined coins are mined in the first block. Therefore, whichever machine executes the mining command will receive the entirety of the blockchain's pre-mined coin supply, as set in the [ac_supply](../installations/asset-chain-parameters.html#ac-supply) parameter. Upon mining the first block, these coins are available in the default `wallet.dat` file. + +To collect all the mining rewards from the node to a single address, execute the following commands before issuing the `setgenerate` command: + +```bash +# Get a new address +newaddress=$(./komodo-cli -ac_name=HELLOWORLD getnewaddress) + +# Get the corresponding pubkey +pubkey=$(./komodo-cli -ac_name=HELLOWORLD validateaddress $newaddress | jq -r '.pubkey' ) + +# Indicate the pubkey to the daemon +./komodo-cli -ac_name=HELLOWORLD setpubkey $pubkey +``` + +After issuing the mining command is issued, can check that the two nodes are connected by using the following command: + +```bash +./komodo-cli -ac_name=HELLOWORLD getinfo | grep connections +``` + +If the nodes are properly connected, both nodes will respond with: `"connections": 1` + +These are the coins you will later distribute to your community, using either our native DEX, [AtomicDEX](../installations/basic-instructions.html#komodo-s-native-dex-barterdex), or our decentralized-ICO software (coming soon), or on any other third-party exchange. + +You can check the contents of the wallet by executing the following command in the terminal: + +```bash +./komodo-cli -ac_name=HELLOWORLD getwalletinfo +``` + +To verify that everything is properly initiated, send a few coins from the second node to the first node: + + + +More info can be found in the debug.log of the chain found at: + +- **MacOS:** `~/.komodo/HELLOWORLD/debug.log` +- **Windows:** `%appdata%\komodo\HELLOWORLD\debug.log` +- **GNU/Linux:** `~/.komodo/HELLOWORLD/debug.log` + +## Querying the Smart Chain + +Using the `komodo-cli` software, which is included in any default installation of `komodod`, you can now execute many commands on your new Smart Chain. This enables you to perform transactions, create and execute smart contracts, store data in KV storage, etc. + +Since the Komodo software began as a fork of Zcash and BTC, essentially all commands that are available on these two upstream blockchains are also available on your new Smart Chain. + +Furthermore, a key purpose of the Komodo blockchain is to create features and functions that facilitate and enhance your development experience. Information regarding these enhancements is available throughout this documentation. + +In addition, since you are building on a Komodo-based blockchain, you have easy access to our multi-coin wallet and atomic-swap powered decentralized exchange, [AtomicDEX](../installations/basic-instructions.html#komodo-s-native-dex-barterdex), the Antara development framework and modules, our decentralized-ICO software, and our future upgrades. + +## Example commands + +To see general information about your new Smart Chain, execute this command: + +`./komodo-cli -ac_name=HELLOWORLD getinfo` + +The following command returns information about all available RPC and API commands: + +`./komodo-cli -ac_name=HELLOWORLD help` + +## Secure this Smart Chain with Delayed Proof of Work + +Your new Smart Chain can receive the same security of the Bitcoin hash rate through our security mechanism, called "delayed Proof of Work" (dPoW). + +There are two aspects to the cost for dPoW services. The first comes from the cost of making records in your Smart Chain's database, and in the records of the KMD main chain. These records are called "notarizations." + +Notarizations are performed as transactions on your blockchain and on the main KMD blockchain. The transactions have messages included inside that indicate the most recent and secure state of your Smart Chain. Your Komodo Smart Chain will know how to recognize and rely on notarizations automatically. + +Every ten to twenty minutes, our notary nodes will hash the history of your Smart Chain and insert it as a record into the KMD main chain. This provides an initial layer of security, but it is not the final layer. + +In another ten to twenty minutes, all of the information in the KMD chain (including your Smart Chain's hashed data) is hashed and inserted into the BTC blockchain. Once your information is pushed into BTC, your Smart Chain will consider all notarized information effectively settled and immutable; only the recent, un-notarized transactions are still relying on your Smart Chain's raw consensus mechanism. [Click here to learn more about the types of consensus mechanisms you can choose on a KMD Smart Chain](../installations/asset-chain-parameters.html#ac-staked). + +Thus, your Smart Chain will have all the power of Bitcoin securing your blockchain's history, with the zero-knowledge privacy of the Zcash parameters pre-installed, and all of the interoperability, scalability, and more that Komodo adds to your development experience. + +As the notarizations are transactions, they naturally have a cost, and this cost is covered by you, the Smart Chain developer. Over the course of a year, assuming consistent activity, the cost for performing these transactions is 365 KMD, and also 365 of your Smart Chain's coins. + +There are extra costs involved that are aimed to compensate the Notary Nodes for the setup and maintainance of the dPOW service. You may reach out to our third-party service providers to receive a quote. They can provide various services related to Smart Chain creation, electrum-server (SPV) setup and maintenance, explorer setup, and other blockchain services. + +[Click Here for the List of Third-Party Service Providers](../../../basic-docs/start-here/about-komodo-platform/orientation.html#production-smart-chains-typically-require-komodo-s-security-services) + +Several teams have already signed up for our services and are developing on our platform. From our experience with them we can confidently say that our pricing is competitive compared to other blockchain services. Furthermore, when considering that a Komodo-based Smart Chain does not require KMD for gas and transaction fees, the cost to your end-users can be exponentially cheaper. All things considered, creating a fully independent blockchain on Komodo can cost but a small fraction of what it would cost to deploy a single smart contract on the platforms of some of our competitors. + +### A Note About Low-Activity Blockchains + +Blockchain technology relies on a network of users using the blockchain and sharing data to function. + +Smart Chains that are built for low-activity networks require extra steps from the developer to ensure proper syncing between nodes. + +If you are building a Smart Chain and would like more information on maintaining constant syncing across nodes, our [third-party service providers](../../../basic-docs/start-here/about-komodo-platform/orientation.html#production-smart-chains-typically-require-komodo-s-security-services) can provide dedicated support for this topic. Please also reach out to our support team and community on [Discord.](https://komodoplatform.com/discord) +# Creating a Smart Chain on a Single Node + +## Introduction + +Under most circumstances, a developer should [use two separate nodes to set up and create a Smart Chain.](../../../basic-docs/smart-chains/smart-chain-tutorials/create-a-default-smart-chain.html) + +However, occasionally a developer may need to create a Smart Chain on a single node. + +In this situation, the developer may create a Smart Chain by running two daemons with slightly different configurations on the same node. + +#### Tutorial Prerequisites + +- Komodo Smart Chain software installed on a compatible machine + - [Install instructions here](../../../basic-docs/smart-chains/smart-chain-setup/installing-from-source.html) + +## Launch the First daemon + +Select the desired Antara customization parameters. + +[Link to Antara Customization Parameters](../../../basic-docs/antara/antara-setup/antara-customizations.html) + +For this example, we use simple configurations. + +##### Command + +```bash +./komodod -ac_name=HELLOWORLD -ac_supply=777777 +``` + +##### Response (truncated) + +Search for the part of the response that begins with this string: `>>>>>>>>>` + +```bash +>>>>>>>>>> HELLOWORLD: p2p.14165 rpc.14166 magic.01362c2a 20327466 777777 coins +``` + +The default `p2p` and `rpc` ports of our chain are `14165` and `14166` respectively. + +#### Test komodo-cli + +To interact with this first daemon, use a `komodo-cli` command as follows. + +```bash +./komodo-cli -ac_name=HELLOWORLD getinfo +``` + +## Create a Data Directory for the Second Daemon + +Create a directory on your machine for the second daemon. + +In this guide, we use a directory named `coinData` in the Home directory: + +```bash +mkdir ~/coinData +``` + +Create the data directory for the second daemon. + +```bash +mkdir ~/coinData/HELLOWORLD +``` + +Copy the `.conf` file created for the first daemon to this new data directory. + +```bash +cp ~/.komodo/HELLOWORLD/HELLOWORLD.conf ~/coinData/HELLOWORLD/ +``` + +Change the values of `rpcuser`, `rpcpassword`, and `rpcport` in the file `~/coinData/HELLOWORLD/HELLOWORLD.conf`. + +##### The HELLOWORLD.CONF File + +``` +rpcuser=changethis +rpcpassword=changethis +... (ommitted) ... +rpcport=12345 +``` + +(Change all values shown above on the right side of the `=` side.) + +Add a new line `port=` to the file. + +``` +... (file continued) ... +port=22020 +``` + +In all values above, the chosen values must be different from the values in the first daemon's .conf file. + +## Launch the Second daemon + +When launching the second daemon, use the same Antara customization parameters as the first daemon. + +However, now we specify the data directory for the daemon, as well as the `p2p` connection. + +To accomplish this, we use the datadir and addnode common launch parameters. + +```bash +./komodod -ac_name=HELLOWORLD -ac_supply=777777 -datadir=/home//coinData/HELLOWORLD -addnode=localhost +``` + +::: tip + +Replace `` with the USERNAME for your local node. You can find this value use the `echo $USER` command in the terminal. + +::: + +To interact with the second daemon, add the datadir parameter to the `komodo-cli` command: + +```bash +./komodo-cli -ac_name=HELLOWORLD -datadir=/home//coinData/HELLOWORLD getinfo +``` + +After launching the second daemon, calling `getinfo` to either of the daemons should report `"connections":1`. + +## Using curl + +To issue a `getinfo` call using curl, observe the following example. + +Replace ``, ``, `` with the values from the `.conf` file in the data directory corresponding to the daemon that needs to be queried. + +```bash +curl -s --user : --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:/ +``` + +Alternatively, source the `.conf` file before using the curl command. Each time you desire to switch daemons, source the `.conf` file of your target daemon. + +##### Source the First Daemon's .conf File + +```bash +# Source the .conf file + +source ~/.komodo/HELLOWORLD/HELLOWORLD.conf + +# Execute the curl command + +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ +``` + +##### Source the Second Daemon's .conf File + +```bash +# Source the .conf file + +source ~/coinData/HELLOWORLD/HELLOWORLD.conf + +# Execute the curl command + +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ +``` +# Introduction to Smart Chain Tutorials + +Welcome to the Komodo Smart Chain tutorial documentation. + +This section contains tutorials that are specifically designed only for the essential aspects of Smart Chain software. These tutorials often focus on technology that is available to Komodo via upstream technologies, such as Bitcoin or Zcash. + +For tutorials regarding other Komodo software, such as Antara, which focuses on Komodo enhancement technologies, or AtomicDEX, which offers cross-chain atomic-swap compatibility, please see their respective documentation centers. + +For a targeted learning approach to Komodo's Smart Chain software, please see the Learning Launchpad. + +[Link to Learning Launchpad](../../../basic-docs/start-here/learning-launchpad/learning-path-outlines.html) + + +# Multisignature Transaction Creation and Walkthrough + +## Introduction + +Multisignature (multisig) is a technology used to increase the number of signatures required for a transaction from an address. This provides an additional layer of security to cryptocurrency transactions. + +In this guide we demonstrate the creation and usage of a `2of2` multisignature wallet. We use two nodes with the KMD main chain. + +To accomplish the same task on another Komodo Smart Chain, add `-ac_name=NAMEOFCHAIN` to each command. + +## Get a New Address, Public Key, and Private Key + +Create addresses on two nodes. We will combine these two addresses into a single multisig address. + +## Node One + +#### Generate a New Address + +##### Command + +``` +./komodo-cli getnewaddress +``` + +##### Response + +``` +RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 +``` + +#### Get the Public Key Using validateaddress + +##### Command + +```shell +./komodo-cli validateaddress RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 +``` + +##### Response + +```JSON +{ + "isvalid": true, + "address": "RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5", + "scriptPubKey": "76a91431a8cbc716e21238079729d46cb655ae7fadc9e388ac", + "segid": 37, + "ismine": true, + "iswatchonly": false, + "isscript": false, + "pubkey": "02dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a26", + "iscompressed": true, + "account": "" +} +``` + +#### Get the Private Key + +##### Command + +```shell +./komodo-cli dumpprivkey RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 +``` + +##### Response + +``` +DO_NOT_USEBnFx9R6iaPmWaBX8iqHzRpFRjNp8kBEQYKNt +``` + +#### A Summarization of Data from Node One + +``` +# address: RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5 +# pubkey: 02dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a26 +# privkey: UrunDGyFJu5UFZG7BnFx9R6iaPmWaBX8iqHzRpFRjNp8kBEQYKNt +``` + +## Node Two + +Follow the same steps. + +#### Generate a New Address + +##### Command + +```shell +./komodo-cli getnewaddress +``` + +##### Response + +``` +RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s +``` + +#### Get the Pubkey Value Using validateaddress + +##### Command + +```shell +./komodo-cli validateaddress RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s +``` + +##### Response + +```JSON +{ + "isvalid": true, + "address": "RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s", + "scriptPubKey": "76a9141c0f1c482d38c43bb847506a527521d2204afe6588ac", + "segid": 38, + "ismine": true, + "iswatchonly": false, + "isscript": false, + "pubkey": "032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a2816", + "iscompressed": true, + "account": "" +} +``` + +#### Get the Private Key + +##### Command + +```shell +./komodo-cli dumpprivkey RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s +``` + +##### Response + +``` +UsuE7jG8BD1CV2xuCoBCwgzzbs4HqZ2P2im5fdyJmP2tSd3arAv7 +``` + +#### Summarization of Data From Node Two + +``` +address: RBqZ6nHcANekX3zxF9y4zRyfB6X8VEWF7s +pubkey: 032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a2816 +privkey: UsuE7jG8BD1CV2xuCoBCwgzzbs4HqZ2P2im5fdyJmP2tSd3arAv7 +``` + +## Create a Multisig Address + +Combine the pubkeys to create a `2of2` multisig address. + +A `2of2` address requires that both addresses sign for every transaction. + +::: tip + +You can customize the signature requirements for essentially any combination. For example, you can make a 3of5 multisig address that requires 3 of 5 available addresses for each transaction. + +::: + +Execute the following command on either node. The command returns the `redeemScript` json object, which is required to spend funds. + +##### Command + +```shell +./komodo-cli createmultisig 2 '["02dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a26","032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a2816"]' +``` + +##### Response + +```JSON +{ + "address": "bEP3HK73CboW8tGN8obyHUQteBzYjFzgNm", + "redeemScript": "522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae" +} +``` + +## Fund the multisig Address + +Fund the multisig address. + +(You may use either node.) + +##### Command + +```shell +./komodo-cli sendtoaddress bEP3HK73CboW8tGN8obyHUQteBzYjFzgNm 7.77 +``` + +##### Response + +``` +194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c +``` + +## Create the Raw Transaction + +As input we use the unspent vout of the transaction used to create the multisig address. We also place our desired target destination address in the transaction. + +In this example, we send the full `7.77` sum to the destination address. + +If you do not want to send the full amount, you must manually specify the "change" address and state how much of the change you desire to keep. + +Recall that any amount taken from the initial utxo and not included in either the destination address, or in the change address, will automatically be given to the miners as a mining fee. + +##### Command + +```shell +./komodo-cli createrawtransaction '[{"txid":"194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c","vout":1}]' '{"RP81MSVu39QgXhGDHfnk9d9KMnp4vhEVBu":7.77}' +``` +##### Response + +``` +0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f190100000000ffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000 +``` + +## Sign the Raw Transaction + +Sign the raw transaction using both nodes. + +## Sign Using Node One + +##### Command + +```shell +./komodo-cli signrawtransaction "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f190100000000ffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000" '[{"txid":"194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c","vout":1,"scriptPubKey":"a914121cbc7a828772bd4612bc7b9765cbbf13d0b3cc87","redeemScript":"522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae","amount":7.77}]' '["UrunDGyFJu5UFZG7BnFx9R6iaPmWaBX8iqHzRpFRjNp8kBEQYKNt"]' +``` + +##### Response + +```JSON +{ + "hex": "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f19010000009200483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000", + "complete": false, + "errors": [ + { + "txid": "194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c", + "vout": 1, + "scriptSig": "00483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae", + "sequence": 4294967295, + "error": "Operation not valid with the current stack size" + } + ] +} +``` + +## Sign Using Node Two + +Use the hex value from node one, but change the privkey to the privkey of node two's address. + +##### Command + +```shell +./komodo-cli signrawtransaction "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f19010000009200483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000" '[{"txid":"194fea388c5474ae25d261d8c57213b79f9a111e774caeea066f796ddd99e81c","vout":1,"scriptPubKey":"a914121cbc7a828772bd4612bc7b9765cbbf13d0b3cc87","redeemScript":"522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652ae","amount":7.77}]' '["UsuE7jG8BD1CV2xuCoBCwgzzbs4HqZ2P2im5fdyJmP2tSd3arAv7"]' +``` + +##### Response + +```JSON +{ + "hex": "0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f1901000000da00483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147304402200abc8c1e1e26090a7012df8859a3986229da34b0edd82c42a64efc8b89390e6702202582cbdce3de13fe59196228d4d0a6a80916e23ccb343f1cf32515688a938ebb0147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000", + "complete": true +} +``` + +## Step 6 - Broadcast the transaction + +Broadcast the raw hex to finish send the transaction. + +##### Command + +```shell +./komodo-cli sendrawtransaction 0400008085202f89011ce899dd6d796f06eaae4c771e119a9fb71372c5d861d225ae74548c38ea4f1901000000da00483045022100a5f4bdf5b61a4f4baf0b5b48f69488b8f752e36cbac23ec0c762bba99552ac9e022036e658c7c8c19ec4bd423fcc6a109a811b189311fc874dd466e58a1755ef4e940147304402200abc8c1e1e26090a7012df8859a3986229da34b0edd82c42a64efc8b89390e6702202582cbdce3de13fe59196228d4d0a6a80916e23ccb343f1cf32515688a938ebb0147522102dd22c272504af79b220ba37c12f777596eff4f54598e2db65be325a9393a3a2621032a73cd31fb86150c33f26312b665c21e5f9391829f29cf48aca03bbb4f9a281652aeffffffff014014502e000000001976a91497d5106d5f69619803eb8d72a2bf45a4f033338a88ac00000000a80000000000000000000000000000 +``` + +##### Response + +``` +23c2aaaf458ada3f171ee5d274e8dcfc91b62099ec15e4b2d02da2b2d1172cb1 +``` + +The above is the output txid which can be used in an online KMD block explorer to verify the transaction. + +## Useful Links +- [Detailed Article in the Russian Language](https://medium.com/@decker.komodo/%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BC%D1%83%D0%BB%D1%8C%D1%82%D0%B8%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D0%B5%D0%B9-multisig-%D0%B2-komodo-9d8f8c48da52) +- [Multisig Web Tool](https://deckersu.github.io/coinbin/#newMultiSig) + +# Running Komodo Software in Debug Mode + +## Introduction + +To run Komodo software in debug mode, follow these steps. + +## Install gdb + +```bash +sudo apt-get install gdb +``` + +## Run Komodo Daemon With `gdb` Tool + +Initiate your daemon using with `gdb -args` as a prefix. + +For example, the below command would initiate the Komodod daemon with mining active and a designated pubkey. + +```bash +gdb -args ./src/komodod -gen -genproclimit=2 -pubkey="03af2412ebf9517a43d192193490476fd0a44312c70755e07eb03b6d71338ebc9d" +``` +::: tip + +If you are having trouble initiating komodod in the shell, try use the absolute path to komodod. For example, /home/$USERNAME/komodo/src/komodod + +::: + +The shell should return the following prompt. + +```bash +gdb> +``` + +Execute `run` in the shell to start Komodo in debug mode. + +```bash +gdb> run +``` + +## Retrieving Backtrace Data + +Whenever komodod crashes, you will again see `gdb>` as a prompt. + +To recall the last stages of komodod before the crash, execute the following command. + +##### Command + +```bash +gdb> backtrace +``` + +The returned data can be shared with any Komodo developer to assist in troubleshooting Komodo development. + +Select and highlight all relevant data using the cursor, and then use `CTRL + SHIFT + C` to copy to the clipboard. +# Smart Chain API Basics + +## API Tutorials: Introduction + +The following tutorial can assist in gaining hands-on experience with the essential Smart Chain API. + +In this tutorial, we create two new blockchains, called RT1 & RT2. + +The first blockchain, RT1, demonstrates the fundamental API concepts, such as how to create and utilize a simple test blockchain, how to query a blockchain for data, etc. + +The RT2 blockchain demonstrates the creation of a custom application-specific blockchain that + +For simplicity's sake, we use the blockchain [regtest](../installations/common-runtime-parameters.html#regtest) feature, which allows us to run a blockchain on a single node without having to connect to a network. + +After the tutorial, the developer should be able to repeat the same concepts on live and fully functional Komodo Smart Chains, assuming the Smart Chain in question has the proper CC features enabled. + +#### Tutorial Topics Outline + +Topics covered in this tutorial include: + +- How to create a simple Smart Chain for testing purposes +- How to execute a komodo-cli command to query the blockchain for existing data +- How to execute a curl command for the same purpose +- Understanding common API methods ("RPC's") +- Understanding common technology concepts in the Komodo ecosystem + + +### Tutorial Prerequisites + +#### komodod and komodo-cli + +The following tutorials assume that you have already [compiled the Komodo daemon](https://docs.komodoplatform.com/komodo/installation.html), and that you have used the default `~/komodo/src` directory as the root Komodo software directory. + +As with all software related to `komodod`, at the command line we use the terminal-based `komodo-cli` software, and the `curl` command, to access the daemon. + +## Komodo API Fundamentals Tutorial + +### Create a Regtest Blockchain + +The quickest way to establish your own development environment is to use the [regtest](../installations/common-runtime-parameters.html#regtest) feature. + +In regtest mode, the daemon creates a blockchain that is almost fully functional, save for a few exceptions. Two of the exceptions are that the chain runs on a single host, and the user instructs the daemon on when and how to perform new blocks (as opposed to receiving new blocks from a decentralized network of miners). + +The command to create our `RT1` regtest chain is as follows: + +```bash +./komodod -regtest -ac_name=RT1 -ac_supply=1000 & +``` + +##### ac_supply + +Note the `-ac_supply=1000` argument. This is the total number of coins we desire when the blockchain spawns. + +For more information, refer to the [ac_supply](../installations/asset-chain-parameters.html#ac-supply) launch parameter. + +##### ac_name + +Also note the `-ac_name=RT1` argument. This is the blockchain ticker name we desire. For more information, refer to the [ac_name](../installations/asset-chain-parameters.html#ac-name) launch parameter. + +There are many additional parameters that you can explore later in the [Smart Chain Parameters](../installations/asset-chain-parameters.html) documentation. + +##### Observe the Response + +The daemon will return a response similar to the following: + +``` +[1] 22892 +ASSETCHAINS_SUPPLY 1000 +MAX_MONEY 106320417438 1063.20417438 +Created (/home/mylo/.komodo/RT1/RT1.conf) +call komodo_args.(./komodod) NOTARY_PUBKEY.() +>>>>>>>>>> RT1: p2p.13100 rpc.13101 magic.fd772ab9 4252445369 1000 coins +initialized RT1 at 1555581638 +finished loading blocks RT1 +fAddressIndex.0/0 fSpentIndex.0/0 +height.0 slowflag.1 possible.1 cmp.0 +``` + +From the response, note the following information: + +##### Smart Chain Supply + +``` +ASSETCHAINS_SUPPLY 1000 +``` + +We see the 1000 coin initial supply. + +##### Configuration File Location + +``` +Created (/home/mylo/.komodo/RT1/RT1.conf) +``` + +This is the location of the configuration file. + +Placing the configuration data here follows the Komodo convention of placing all relevant data for a Smart Chain in a subdirectory contained in the `~/.komodo/` directory. The new subdirectory for our regtest chain is named after the `RT1` value we gave to the `ac_name` parameter. + +##### Relevant RPC Data + +``` +>>>>>>>>>> RT1: p2p.13100 rpc.13101 magic.fd772ab9 4252445369 1000 coins +``` + +This information is the blockchain name, its network ports used for p2p (13100), and RPC control (13101). The magic number is a number the Komodo daemon uses for network purposes, and the number of coins is informational. + +##### Explanation of All Initial Daemon Output + +Here is an explanation of all of the output, as it appears in the above response. Many of the actual values will be different on your machine, although the underlying purpose of the value is the same. + +| Value | Description | +| ----- | ----------- | +| [1] 22892 | the process number; the value is dependent on your machine and will be different | +| ASSETCHAINS_SUPPLY 1000 | the number of coins when the blockchain initiates for its first time | +| MAX_MONEY 106320417438 1063.20417438 | this value is not important at this time; it states that 100 billion coins is the maximum possible amount the blockchain can mathematically support | +| Created (/home/mylo/.komodo/RT1/RT1.conf) | the location of the configuration file | +| call komodo_args.(./komodod) NOTARY_PUBKEY.() | this value specifies where the new coins from block rewards are sent; by default, the coins will be sent to your node's local wallet | +| >>>>>>>>>> RT1: p2p.13100 rpc.13101 magic.fd772ab9 4252445369 1000 coins | the blockchain name, its network ports and RPC controls; the magic number is used in Komodo networking and the number of coins derives from the ac_supply parameter included at runtime | +| initialized RT1 at 1555581638 | the time in seconds, past epoch, when the blockchain was initialized | +| finished loading blocks RT1 | informational | +| fAddressIndex.0/0 fSpentIndex.0/0 | informational and can be ignored for now | +| height.0 slowflag.1 possible.1 cmp.0 | informational and can be ignored for now | + +### Querying the Blockchain Using komodo-cli + +With the regtest Smart Chain operational we are prepared to execute our first API call. + +#### Access a Daemon via komodo-cli on a Smart Chain + +When using `komodo-cli` to access the daemon of a Smart Chain, we must add an additional argument to each terminal input. + +This required argument is the name of the Smart Chain for which the user desires `komodo-cli` to connect. The name is provided in the same format used to launch the chain. + +In our tutorial, the argument is: `-ac_name=RT1` + +Furthermore, as we are using the regtest feature, we must also include the `-regtest` argument with each terminal input. + +Therefore, each `komodo-cli` terminal input will begin with the following: + +```bash +./komodo-cli -regtest -ac_name=RT1 INSERT_API_CALL_HERE INSERT_ARGUMENTS_HERE +``` + +#### Using the getinfo API Method + +The [getinfo](../komodo-api/control.html#getinfo) API method does not require any additional parameters when called and provides useful information about our chain. + +To execute the method in the terminal we can use the `komodo-cli` software. + +#### Command + +```bash +./komodo-cli -regtest -ac_name=RT1 getinfo +``` + +#### Response + +```json +{ + "version": 2001526, + "protocolversion": 170007, + "KMDversion": "0.3.3b", + "notarized": 0, + "prevMoMheight": 0, + "notarizedhash": "0000000000000000000000000000000000000000000000000000000000000000", + "notarizedtxid": "0000000000000000000000000000000000000000000000000000000000000000", + "notarizedtxid_height": "mempool", + "KMDnotarized_height": 0, + "notarized_confirms": 0, + "walletversion": 60000, + "balance": 0.00000000, + "blocks": 0, + "longestchain": 0, + "timeoffset": 0, + "tiptime": 1296688602, + "connections": 0, + "proxy": "", + "difficulty": 1, + "testnet": false, + "keypoololdest": 1555581641, + "keypoolsize": 101, + "paytxfee": 0.00000000, + "relayfee": 0.00000100, + "errors": "", + "name": "RT1", + "sapling": -1, + "p2pport": 13100, + "rpcport": 13101, + "magic": -42521927, + "premine": 1000 +} +``` + +Note the `blocks` count of zero `0` and the `balance` sum of `0`. While our regtest chain's daemon is operational, we have yet to mine the genesis block and collect the initial coin value. + +### Querying the Blockchain Using curl + +Alternatively, we can execute the [getinfo](../komodo-api/control.html#getinfo) method using the Unix `curl` command. + +##### Sourcing the Configuration File + +The `curl` command will also need information about which Smart Chain daemon the user desires to connect. However, the `curl` command will receive these instructions in a different manner. + +The user must provide the `myrpcuser`, `myrpcpassword`, and `myrpcport` values from the Smart Chain's configuration file. + +The configuration file is automatically generated on Smart Chain creation, and is formatted for use with the Unix `source` command. + +To import all values into our terminal process environment, execute the following: + +```bash +source ~/.komodo/RT1/RT1.conf +``` + +We can test that the variables were loaded correctly with the following commands: + +```bash +echo $rpcuser $rpcpassword $rpcport +``` + +The terminal should return the values from the configuration file. + +##### Executing the curl Command + +With these variables set we can now easily use the `curl` command to execute the `getinfo` API method: + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ +``` + +We execute the `curl` command with `-s` silent option; this mutes irrelevant response data. + +The `$rpcuser:$rpcpassword` and the `...$rpcport` arguments utilize our sourced environment variables. + +The HTTP header `-H`, `--data-binary`, and `content-type: text/plain;` arguments instruct `curl` to reply with a json object. + +Without further intervention, the returned json response will be unformatted and difficult to read. + +To improve readability, the developer may optionally install and utilize the `jq` terminal software. + +[Link to download and install jq](https://stedolan.github.io/jq/download/) + +Once installed, add a `|` pipe and a ` jq '.'` reference at the end of the curl command: + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getinfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + +This should return a well formatted json object. + +## Preparing Your Local Wallet + +The wallet is not part of the blockchain. Rather, it is a separate application that tracks your private keys and grants access to them upon user request. This separate application is built into the Komodo daemon and can be accessed using the API. + +Common API commands include the following: + +| Command | Description | +| ------- | ----------- | +|[getnewaddress](../komodo-api/wallet.html#getnewaddress) | get a new address | +| [validateaddress](../komodo-api/util.html#validateaddress) | get the public key of the new address; used often when developing a custom application-specific blockchain | +| [dumpprivkey](../komodo-api/wallet.html#dumpprivkey) | get the private key of an address | + +We save details from each response, so that we may avoid continually obtaining new wallet keys. + +The next two sections demonstrate how to obtain a new private key. The first section uses `komodo-cli` software, and the second section repeats the same API steps using the `curl` command. + +### Preparing Your Wallet Using komodo-cli + +#### getnewaddress + +To obtain a new address, we use the `getnewaddress` API method: + +```bash +./komodo-cli -regtest -ac_name=RT1 getnewaddress +``` + +Response: + +```json +RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs +``` + +Your response will be a different address of the same format. + +#### validateaddress + +To obtain the public key, also called the "pubkey", we use the `validateaddress` API method. + +``` +./komodo-cli -regtest -ac_name=RT1 validateaddress RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs +``` + +Response: + +``` +{ + "isvalid": true, + "address": "RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs", + "scriptPubKey": "76a91457afccfe042ee068257f95873e1fd3cd4aa210ad88ac", + "segid": 28, + "ismine": true, + "iswatchonly": false, + "isscript": false, + "pubkey": "0350dd9b828e92600166dd74e521ac8510eb39064dfb30111c990396864542ce56", + "iscompressed": true, + "account": "" +} +``` + +Make a note of the `pubkey` value. We will use it towards the end of the tutorial. + +#### dumpprivkey + +Use the response from `getnewaddress` as an argument for the `dumpprivkey` API method. + +```bash +./komodo-cli -regtest -ac_name=RT1 dumpprivkey RWbzxx8tKncvcVBzBCetMsPRrcB3YFsXhw +``` + +```json +REDACTED_FOR_TUTORIAL +``` +The response is the private key for this address. + +The private key should never be shared under any circumstances. We have redacted the response for this tutorial. + +### Preparing Your Wallet Using curl + +#### getnewaddress + +A `curl` command to obtain a new address using the `getnewaddress` API method. + +##### Command + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getnewaddress", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + +##### Response + +```json +{ + "result": "RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B", + "error": null, + "id": "curltest" +} +``` + +#### validateaddress + +A `curl` command to obtain the `pubkey` using the `validateaddress` API method. + +##### Command + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "validateaddress", "params": ["RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + +##### Response + +```json +{ + "result": { + "isvalid": true, + "address": "RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B", + "scriptPubKey": "76a914fd3ca56e0dc10a080c1d351b42c75bd82fc76d2288ac", + "segid": 56, + "ismine": true, + "iswatchonly": false, + "isscript": false, + "pubkey": "03cb108cdb893a4a6c72c2fe23768929ada335103c6fa2bea428f5204bd051dacc", + "iscompressed": true, + "account": "" + }, + "error": null, + "id": "curltest" +} +``` + +#### dumpprivkey + +A `curl` command to obtain the `pubkey` using the `validateaddress` API method. + +##### Command + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "dumpprivkey", "params": ["RYNBgpcanNdfy4oGLbnVYnPPtu5JWcZM8B"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + +##### Response + +```json +{ + "result": "REDACTED_FOR_TUTORIAL", + "error": null, + "id": "curltest" +} +``` + +## Generating Blocks and Getting the New Coins + +When connecting to an existing blockchain that already has a populated network of miners or stakers, the user does not need to be concerned about how blocks are generated. + +However, in this tutorial we are running a regtest chain, and therefore we must instruct the daemon to generate new blocks. + +This also provides us with a useful opportunity to discuss the nature of simple mining in the Komodo ecosystem. The methods we discuss here reflect mining on a proof-of-work based Smart Chain. + +The reader should be aware that Komodo also offers proof-of-stake mining, and hybrid models that blend proof-of-work with proof-of-stake. For more information, the reader may turn to the [ac_staked](../installations/asset-chain-parameters.html#ac-staked) feature. + +Here are several common API methods for mining: + +| Command | Description | +| ------- | ----------- | +| [generate](../komodo-api/generate.html#generate) | the number of blocks to generate | +| [getblock](../komodo-api/blockchain.html#getblock) | query information about a block | +| [gettransaction](../komodo-api/wallet.html#gettransaction) | query a transaction | + +In a moment, we will use these commands to generate new blocks on our regtest chain, and in the process of generating, the blockchain will create new coins. + +#### Understanding the Coinbase Transaction + +The reader should be aware of the manner in which a blockchain creates new coins. + +When a blockchain initiates for the first time, and before it has mined the first block, the total sum of coins on the blockchain is always `0`. + +To add coins into the total coin supply, the blockchain must mint new coins. This minting process occurs in a special transaction that is included as the first transaction in each block of the blockchain. + +This transaction is called the `coinbase` transaction. + +While every other transaction on the blockchain can only take coins from the existing supply, the `coinbase` transaction may create new coins from nothing. + +These new coins can be sent to any number of locations. The rules of the blockchain, as set by the blockchain's developer, determine how many coins are minted, and who receives the coins. + +For more information about how to customize your `coinbase` transactions on a Komodo Smart Chain, observe the many different customization parameters in the [Custom Smart Chain Parameters](../installations/asset-chain-parameters.html#ac-name) documentation. + +For example, read about [ac_reward](../installations/asset-chain-parameters.html#ac-reward), [ac_eras](../installations/asset-chain-parameters.html#ac-eras), [ac_founders](../installations/asset-chain-parameters.html#ac-founders), and many others. + +In our tutorial, when we mine our first block, all of the `1000` new coins we indicated will be mined in the first block's `coinbase` transaction. By default, these coins are distributed immediately into our own local wallet. + +### Generating Blocks Using komodo-cli + +#### generate + +We now generate a few blocks using the `generate` API method. + +##### Command + +```bash +./komodo-cli -regtest -ac_name=RT1 generate 2 +``` + +##### Response + +```json +[ + "0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab", + "0de2bb48b3a3ef47d5ece90b1ffeccc81b9609879ab86cc03a77cf248adea25d" +] +``` + +The response contains an array of blockhashes. These are the hashes of the blocks generated. + +#### getblock + +To inspect the particular information about any given block, we use the `getblock` API method and include our desired blockhash as an argument. + +```bash +./komodo-cli -regtest -ac_name=RT1 getblock 0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab +``` + +Alternatively, with `getblock` we can instead include the desired block `height` of the block we wish to inspect. + +In our case, we desire to inspect the genesis block, which is the first block ever mined on our Smart Chain. Therefore, the block `height` will be `1`. + +##### Command + +```bash +./komodo-cli -regtest -ac_name=RT1 getblock 1 +``` + +##### Response + +```json +{ + "hash": "0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab", + "confirmations": 2, + "rawconfirmations": 2, + "size": 276, + "height": 1, + "version": 4, + "merkleroot": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", + "segid": -1, + "finalsaplingroot": "3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb", + "tx": [ + "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006" + ], + "time": 1555589136, + "nonce": "0000d66a538f8cc7de721633f23e5d52649e5031a3f0a90e9821189e5b530056", + "solution": "01de6014269f75bae931362838b75c5fc3e318c620d2a203d65b9d52691b3d056ae753fc", + "bits": "200f0f0f", + "difficulty": 1, + "chainwork": "0000000000000000000000000000000000000000000000000000000000000022", + "anchor": "59d2cde5e65c1414c32ba54f0fe4bdb3d67618125286e6a191317917c812c6d7", + "blocktype": "mined", + "valuePools": [ + { + "id": "sprout", + "monitored": true, + "chainValue": 0.00000000, + "chainValueZat": 0, + "valueDelta": 0.00000000, + "valueDeltaZat": 0 + }, + { + "id": "sapling", + "monitored": true, + "chainValue": 0.00000000, + "chainValueZat": 0, + "valueDelta": 0.00000000, + "valueDeltaZat": 0 + } + ], + "previousblockhash": "029f11d80ef9765602235e1bc9727e3eb6ba20839319f761fee920d63401e327", + "nextblockhash": "0de2bb48b3a3ef47d5ece90b1ffeccc81b9609879ab86cc03a77cf248adea25d" +} +``` + +Note in the response the `tx` value. + +```json + + ... + + "tx": [ + "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006" + ], + + ... + +``` + +This value is an array containing all transactions performed within this block. Because it is the genesis block, and because we did not send any transactions on our blockchain, the only transaction is our `coinbase` transaction, wherein the `1000` coins were minted and sent to our local wallet. + +#### gettransaction + +To observe this transaction, we use the [gettransaction](../komodo-api/wallet.html#gettransaction) API method. + +##### Command + +```bash +./komodo-cli -regtest -ac_name=RT1 gettransaction 4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006 +``` + +##### Response + +```json +{ + "amount": 1000.07809721, + "rawconfirmations": 2, + "generated": true, + "confirmations": 2, + "blockhash": "0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab", + "blockindex": 0, + "blocktime": 1555589136, + "expiryheight": 0, + "txid": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", + "walletconflicts": [ + ], + "time": 1555589136, + "timereceived": 1555589136, + "vjoinsplit": [ + ], + "details": [ + { + "account": "", + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "category": "generate", + "amount": 1000.07809721, + "vout": 0, + "size": 98 + } + ], + "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff01b912ee4817000000232103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac1068b85c" +} +``` + +Note that the `amount` value is slightly higher than `1000`. This is normal. It is due to the internal mathematical complexities of a blockchain. + +### Generating Blocks Using curl + +#### generate + +We have already generated the genesis block. The following is a sample of using `curl` with the `generate` API method to generate 5 blocks. + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "generate", "params": [5]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + + + +#### getblock + +Here is a sample of using `curl` with the `getblock` API method on the blockhash of the genesis block. + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["0d2701895c90f48d80156fbe349bda661c80f38ad6b75acc2294763e348b4eab"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + +To use the block `height` instead, the `curl` command is formatted as follows. + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblock", "params": ["1"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + + + +#### gettransaction + +Here is the `curl` command to retrieve the first block's `coinbase` transaction. + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "gettransaction", "params": ["4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006"]}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + + + + +## Inspecting the wallet + +We have generated blocks and received the value from the `coinbase` transactions. Now, we would like to inspect the contents of our wallet. We will execute the [listunspent]() method for this purpose. + +However, before we execute this command, the reader should familiarize themselves with the way a blockchain stores value in a wallet. The title of the technical concept to understand is, "utxo." This stands for "unspent transaction." + +The way a utxo works is often difficult to understand for newcomers to blockchain technology. We have provided an article that explains this concept in more detail here, and we recommend the reader study it before proceeding. + +[Click Here to Read Our Explanation of the Utxo](https://komodoplatform.com/whats-utxo/) + +Also, the reader may turn to Chapter 6, Section 3 of the Komodo whitepaper. Search for the section titled, "The Utxo: An elusive, yet fundamental concept." + +[Click Here to Read the Komodo Whitepaper; Search for Chapter 6, Section 3](https://komodoplatform.com/whitepaper) + +In blockchain technology, all value is contained within utxos. Every transaction consumes a utxo and creates new utxos. + +Once you are comfortably familiar with the concept, you are prepared to continue with the tutorial. + +### Listing Unspent Transactions Using komodo-cli + +A developer should be able to easily validate ownership of a utxo, as only the owner of a utxo is able to spend it. + +#### listunspent + +For this purpose, we turn to the [listunspent](../komodo-api/wallet.html#listunspent) API method: + +```bash +./komodo-cli -regtest -ac_name=RT1 listunspent +``` + +The response is an array of transactions ids, called `txid` for brevity's sake. + +```json +[ + { + "txid": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 1000.07809721, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 7, + "confirmations": 7, + "spendable": true + }, + { + "txid": "148d8970e3c7e113bd3b4038c1efdd273a6d975f45b194b4257fda6acec4b14a", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 5, + "confirmations": 5, + "spendable": true + }, + { + "txid": "a0e13cad677b4fede6211c78069aed9345880147ea79edb647383787eb15fe51", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 6, + "confirmations": 6, + "spendable": true + }, + { + "txid": "01be6fa42a897009477f7a7248c538896ad39a24e132e9bcba00138c781fd57b", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 1, + "confirmations": 1, + "spendable": true + }, + { + "txid": "73ba44853735808e0b07c45bb1e1acd7c0323bc72e872d4bae92428ad03899be", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 3, + "confirmations": 3, + "spendable": true + }, + { + "txid": "78a401c6bb7765d73fedf1e2c033935db281a94a58d35f33e6986bda36e57bd5", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 2, + "confirmations": 2, + "spendable": true + }, + { + "txid": "d81523ef05f9d19abca61982f8c0d5374eb61ecb88c923226277bc0d3e7120e6", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 4, + "confirmations": 4, + "spendable": true + } +] +``` + +### Listing Unspent Transactions Using curl + +With `curl`, the terminal command for `listunspent` is as follows: + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "listunspent", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + + + +## Setting the pubkey Parameter + +Observe this first `txid` returned from the `listunspent` transaction: + +```json + ... + + { + "txid": "4ceb1e5818ab6be66035d330217be1722212a1255bfda3c8a7eef832df20c006", + "vout": 0, + "generated": true, + "address": "RDyVsyEJGvSm8HaUHfihsJoXvCzekruzrn", + "segid": 47, + "amount": 1000.07809721, + "interest": 0.00000000, + "scriptPubKey": "2103f5eccb583425e781216f27b1f6e244f15b1989eecbb8695f6948a26f5a3bfe3cac", + "rawconfirmations": 7, + "confirmations": 7, + "spendable": true + }, + + ... +``` + +Notice that the address to which these `1000` coins were sent is not the address we generated earlier. Rather, it is an entirely new address. At the moment we may not mind, because the coins were sent to an address that the wallet automatically generated and which we own. + +However, what if we want to control the address to which coins are sent when mining? When this is the case, we turn to the [pubkey](../installations/common-runtime-parameters.html#pubkey) launch parameter. + +The `pubkey` we input into this parameter can be the same `pubkey` we generated earlier in the tutorial. + +#### Stopping the Daemon Using komodo-cli + +To place this pubkey at startup, we must first stop the Smart Chain. + +For this we use the [stop](../komodo-api/control.html#stop) API method. + +##### Command + +```bash +./komodo-cli -regtest -ac_name=RT1 stop +``` + +##### Response + +``` +RT1 server stopping +``` + +#### Stopping the Daemon Using curl + +Using `curl` to stop the daemon. + +##### Command + +```bash +curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "stop", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq '.' +``` + +##### Response + +```json +{ + "result": "RT1 server stopping", + "error": null, + "id": "curltest" +} +``` + +#### Restarting the Smart Chain With the pubkey Parameter + +Execute the following to relaunch `komodod` with the `pubkey` we saved at the beginning of the tutorial. + +##### Command + +```bash +./komodod -regtest -ac_name=RT1 -ac_supply=1000 -pubkey=0350dd9b828e92600166dd74e521ac8510eb39064dfb30111c990396864542ce56 & +``` + +Now, when we generate new blocks, the `coinbase` transaction sends new coins to the new address associated with our `pubkey`. + +First, we generate a new block using komodo-cli. + +```bash +./komodo-cli -regtest -ac_name=RT1 generate 1 +``` + +Response: + +```json +[ + "06a639d7821f6ee803c6c53fe53a6b1dfe65063240ebc3a2907f7658cad8301e" +] +``` + +We can repeat the `getblock` method on the blockhash returned above to see the `coinbase` transaction. + +With that `coinbase` transaction, we can the execute `gettransaction` to see the address to which the new coins were sent. + +After executing these previously explained methods, here is a snippet of the final result: + + +```json +... + { + "txid": "2411800f0e9c15f5233453ffc17ff301f43043c70887c256a041945d341796f0", + "vout": 0, + "generated": true, + "address": "RHGqU4BPHsTve4jUJtJobAaf8SieYUzeFs", + "segid": 28, + "account": "", + "amount": 0.00010000, + "interest": 0.00000000, + "scriptPubKey": "210350dd9b828e92600166dd74e521ac8510eb39064dfb30111c990396864542ce56ac", + "rawconfirmations": 1, + "confirmations": 1, + "spendable": true + } +...snipped +``` + +Note that the `address` in this output is the one associated with our desired `pubkey`. + +## Closing + +Some of the fundamental blockchain and API skills we have learned include the following: + +- How to create a new Komodo Smart Chain +- How to make a single-node regtest chain, for development purposes +- How to launch with the pubkey set +- How to generate new blocks +- How to obtain information about blocks and transactions +- The nature of a utxo +- The nature of a coinbase transaction + +Having completed this tutorial, the developer should be able to explore the many API methods in the Komodo documentation. + +# Introduction to AtomicDEX + +Welcome to the AtomicDEX technical documentation. + +#### About the AtomicDEX Section + +This documentation is intended for developers utilizing the AtomicDEX API. + +Users who are not interested in development-related activities, but are searching for documentation assistance, can find support in the Komodo Support Center. + +[Link to Komodo Support Center](https://support.komodoplatform.com/support/home) + +#### Conceptual Overview + +A brief conceptual overview of AtomicDEX can be found in the Start Here > Product Introductions > AtomicDEX section. + +[Link to "AtomicDEX" Introduction](../basic-docs/start-here/about-komodo-platform/product-introductions.html#AtomicDEX) + +The [AtomicDEX Tutorials](../basic-docs/atomicdex/atomicdex-tutorials/introduction-to-atomicdex.md) section contains a more thorough conceptual explanation of AtomicDEX. + +Please consult our [Learning Path Outlines](../basic-docs/start-here/learning-launchpad/learning-path-outlines.html#type-b-developers-smart-chains) section for more details on approaches to learning AtomicDEX from both a conceptual and technical perspective. + +#### About AtomicDEX Setup + +The AtomicDEX Setup section contains basic information about setting up and using an AtomicDEX-enabled environment. + +#### About AtomicDEX Tutorials + +The AtomicDEX Tutorials section contains various tutorials that provide instruction for AtomicDEX usage and creation. + +For a walkthrough covering multiple tutorials in a targeted fashion, please see the [Learning Launchpad](../basic-docs/start-here/learning-launchpad/learning-path-outlines.html) section. + +#### About AtomicDEX API + +The AtomicDEX API section contains all available API commands. + +These API commands can also be called Remote Procedure Calls, or RPCs. +# DEX API + +## Note About Current Limitations + +This API documentation currently only features RPC methods that are available in MarketMaker 2.0 (MM2). There are many commands from the legacy Market Maker 1.0 that Komodo intends to import to MM2 as soon as possible. For now, these commands are available at [this external website.](https://docs.komodoplatform.com/mmV1/api/introduction.html) + +## buy + +**buy base rel price volume** + +The `buy` method issues a buy request and attempts to match an order from the orderbook based on the provided arguments. + +::: tip + +Buy and sell methods always create the `taker` order first. Therefore, you must pay an additional 1/777 fee of the trade amount during the swap when taking liquidity from the market. If your order is not matched in 30 seconds, the order is automatically converted to a `maker` request and stays on the orderbook until the request is matched or cancelled. To always act as a maker, please use the [setprice method.](../atomic-swap-dex/dex-api.html#setprice) + +::: + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| base | string | the name of the coin the user desires to receive | +| rel | string | the name of the coin the user desires to sell | +| price | string (numeric) | the price in `rel` the user is willing to pay per one unit of the `base` coin | +| volume | string (numeric) | the amount of coins the user is willing to receive of the `base` coin | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | object | the resulting order object | +| result.action | string | the action of the request (`Buy`) | +| result.base | string | the base currency of request | +| result.base_amount | string | the resulting amount of base currency that will be received if the order matches | +| result.rel | string | the rel currency of the request | +| result.rel_amount | string | the maximum amount of `rel` coin that will be spent to buy the `base_amount` (according to `price`) | +| result.method | string | this field is used for internal P2P interactions; the value is always equal to "request" | +| result.dest_pub_key | string | reserved for future use. `dest_pub_key` will allow the user to choose the P2P node that will be eligible to match with the request. This value defaults to a "zero pubkey", which means `anyone` can be a match | +| result.sender_pubkey | string | the public key of this node | +| result.uuid | string | the request uuid | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"buy\",\"base\":\"HELLO\",\"rel\":\"WORLD\",\"volume\":\"1\",\"price\":\"1\"}" +``` + +
+ + + +
+ +## cancel_all_orders + +**cancel_order cancel_by** + +The `cancel_all_orders` cancels the active orders created by the MM2 node by specified condition. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| cancel_by | object | orders matching this condition will be cancelled | +| cancel_by.type | string | `All` to cancel all orders or `Pair` to cancel all orders for specific coins pair | +| cancel_by.data | object | additional data of cancel condition, present only for `Pair` type | +| cancel_by.data.base | string | base coin of the pair | +| cancel_by.data.rel | string | rel coin of the pair | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | object | | +| result.cancelled | array of strings (uuids) | uuids of cancelled orders | +| result.currently_matching | array of strings (uuids) | uuids of the orders being matched with other orders; these are not cancelled even if they fit cancel condition | + +#### :pushpin: Examples + +#### Command (All orders) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"cancel_all_orders\",\"cancel_by\":{\"type\":\"All\"}}" +``` + +#### Command (Cancel by pair) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"cancel_all_orders\",\"cancel_by\":{\"type\":\"Pair\",\"data\":{\"base\":\"RICK\",\"rel\":\"MORTY\"}}}" +``` + +
+ + + +
+ +## cancel_order + +**cancel_order uuid** + +The `cancel_order` cancels the active order created by the MM2 node. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| uuid | string | the uuid of the order the user desires to cancel | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | string | indicates the status of operation | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"cancel_order\",\"uuid\":\"6a242691-6c05-474a-85c1-5b3f42278f41\"}" +``` + +
+ + + +
+ +## coins_needed_for_kick_start + +**coins_needed_for_kick_start()** + +If MM2 is stopped while making a swap/having the active order it will attempt to kick-start them on next launch and continue from the point where it's stopped. `coins_needed_for_kick_start` returns the tickers of coins that should be activated ASAP after MM2 is started to continue the interrupted swaps. Consider calling this method on MM2 startup and activate the returned coins using `enable` or `electrum` methods. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (none) | | | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | array of strings | tickers of coins that should be activated to kick-start swaps and orders | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"coins_needed_for_kick_start\"}" +``` + +
+ + + +
+ +## electrum + +**electrum coin servers (mm2 tx_history=false)** + +::: warning Important + +This command must be executed at the initiation of each MM2 instance. Also, AtomicDEX software requires the `mm2` parameter to be set for each `coin`; the methods to activate the parameter vary. See below for further information. + +::: + +::: tip + +Electrum mode is available for utxo-based coins only; this includes Bitcoin and Bitcoin-based forks. Electrum mode is not available for ETH/ERC20. + +::: + +The `electrum` method enables a `coin` by connecting the user's software instance to the `coin` blockchain using electrum technology (e.g. lite mode). This allows the user to avoid syncing the entire blockchain to their local machine. + +Each `coin` can be enabled only once, and in either Electrum or Native mode. The DEX software does not allow a `coin` to be active in both modes at once. + +#### Notes on the MM2 Parameter + +For each `coin`, Komodo software requires the user/developer to set the `mm2` parameter. This can be achieved either in the [coins](../atomic-swap-dex/dex-walkthrough.md#setting-up-coin-list) for more details), or via the [electrum](../atomic-swap-dex/dex-api.html#electrum) and [enable](../atomic-swap-dex/dex-api.html#enable) methods. + +The value of the `mm2` parameter informs the software as to whether the `coin` is expected to function. + +- `0` = `non-functioning` +- `1` = `functioning` + +::: tip + +GUI software developers may refer to the `coins` file [in this link](https://github.com/jl777/coins) for the default coin json configuration. + +::: + +Volunteers are welcome to test coins with AtomicDEX software at any time. After testing a coin, please create a pull request with the desired coin configuration and successful swap details using the guide linked below. + +[Guide to Submitting Coin Test Results](https://github.com/jl777/coins#0-the-coin-must-be-tested-with-barterdex-atomic-swaps) + + +##### Examples of the Parameter Settings + +Set the value of the `mm2` parameter in the [coins](../atomic-swap-dex/dex-walkthrough.md#setting-up-coin-list) file as follows: + +```bash +mm2=1 +``` + +For terminal interface examples, see the examples section below. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin you want to enable | +| servers | array of objects | the list of Electrum servers to which you want to connect | +| servers.url | string | server url | +| servers.protocol | string | the transport protocol that MM2 will use to connect to the server. Possible values: `TCP`, `SSL`. Default value: `TCP` | +| servers.disable_cert_verification | bool | when set to true, this disables server SSL/TLS certificate verification (e.g. to use self-signed certificate). Default value is `false`. Use at your own risk | +| mm2 | number (required if not set in the `coins` file) | this property informs the AtomicDEX software as to whether the coin is expected to function; accepted values are either `0` or `1` | +| tx_history| bool | whether the node should enable `tx_history` preloading as a background process; this must be set to `true` if you plan to use the `my_tx_history` API | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| address | string | the address of the user's `coin` wallet, based on the user's passphrase | +| balance | string (numeric) | the amount of `coin` the user holds in their wallet | +| result | string | the result of the request; this will be either `success`, or will indicate an error or failure otherwise | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"HELLOWORLD\",\"servers\":[{\"url\":\"localhost:20025\",\"protocol\":\"SSL\",\"disable_cert_verification\":true},{\"url\":\"localhost:10025\"}]}" +``` + +
+ + + +
+ +#### Command (With `mm2` argument) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"HELLOWORLD\",\"servers\":[{\"url\":\"localhost:20025\",\"protocol\":\"SSL\",\"disable_cert_verification\":true},{\"url\":\"localhost:10025\"}],\"mm2\":1}" +``` + +
+ + + +
+ +## enable + +**enable coin (urls swap_contract_address mm2 tx_history=false)** + +::: warning Important + +AtomicDEX software requires the `mm2` parameter to be set for each `coin`; the methods to activate the parameter vary. See below for further information. + +::: + +The `enable` method enables a coin by connecting the user's software instance to the `coin` blockchain using the `native` coin daemon. + +Each `coin` can be enabled only once, and in either Electrum or Native mode. The DEX software does not allow a `coin` to be active in both modes at once. + +For utxo-based coins the daemon of this blockchain must also be running on the user's machine for `enable` to function. + +ETH/ERC20 coins are also enabled by the `enable` method, but a local installation of an ETH node is not required. + +#### Notes on the mm2 Parameter + +Please refer to the `mm2` explanatory section in the `electrum` method for information about setting the `mm2` parameter and testing new coins. + +[Link to `mm2` explanatory section](../atomic-swap-dex/dex-api.html#notes-on-the-mm2-parameter) + +For terminal interface examples using the `mm2` parameter with the `enable` method, see the examples section below. + +#### Using AtomicDEX Software on an ETH-Based Network + +The following information can assist the user/developer in connecting AtomicDEX software to the Ethereum network: + +- Swap smart contract on the ETH mainnet: [0x8500AFc0bc5214728082163326C2FF0C73f4a871](https://etherscan.io/address/0x8500AFc0bc5214728082163326C2FF0C73f4a871) + - Main-net nodes maintained by the Komodo team: http://eth1.cipig.net:8555, http://eth2.cipig.net:8555, http://eth3.cipig.net:8555 +- Swap smart contract on the Ropsten testnet: [0x7Bc1bBDD6A0a722fC9bffC49c921B685ECB84b94](https://ropsten.etherscan.io/address/0x7bc1bbdd6a0a722fc9bffc49c921b685ecb84b94) + - Ropsten node maintained by the Komodo team: http://195.201.0.6:8545 + +To use AtomicDEX software on another Ethereum-based network, such as the Kovan testnet or ETC, deploy the Etomic swap contract code from the repository linked below. Use of this code requires either an ETH node setup or access to a public service such as [Infura.](https://infura.io/) + +[Link to repository code for Ethereum-based networks](https://github.com/artemii235/etomic-swap) + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin the user desires to enable | +| urls | array of strings (required for ETH/ERC20) | urls of Ethereum RPC nodes to which the user desires to connect | +| swap_contract_address | string (required for ETH/ERC20) | address of etomic swap smart contract | +| gas_station_url | string (optional for ETH/ERC20) | url of [ETH gas station API](https://docs.ethgasstation.info/); MM2 uses [eth_gasPrice RPC API](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gasprice) by default; when this parameter is set, MM2 will request the current gas price from Station for new transactions, and this often results in lower fees | +| mm2 | number (required if not set in the `coins` file) | this property informs the AtomicDEX software as to whether the coin is expected to function; accepted values are either `0` or `1` | +| tx_history| bool | whether the node should enable `tx_history` preloading as a background process; this must be set to `true` if you plan to use the `my_tx_history` API | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| address | string | the address of the user's `coin` wallet, based on the user's passphrase | +| balance | string (numeric) | the amount of `coin` the user holds in their wallet | +| result | string | the result of the request; this will be either `success`, or will indicate an error or failure otherwise | + +#### :pushpin: Examples + +#### Command (for Bitcoin-based blockchains) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"HELLOWORLD\"}" +``` + +
+ + + +
+ +#### Command (for Ethereum and ERC20-based blockchains) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\",\"urls\":[\"http://195.201.0.6:8545\"],\"swap_contract_address\":\"0x7Bc1bBDD6A0a722fC9bffC49c921B685ECB84b94\"}" +``` + +
+ + + +
+ +#### Command (for Ethereum and ERC20-based blockchains with gas_station_url) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"ETH\",\"urls\":[\"http://195.201.0.6:8545\"],\"swap_contract_address\":\"0x7Bc1bBDD6A0a722fC9bffC49c921B685ECB84b94\",\"gas_station_url\":\"https://ethgasstation.info/json/ethgasAPI.json\"}" +``` + +
+ + + +
+ +#### Command (With `mm2` argument) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"enable\",\"coin\":\"HELLOWORLD\",\"mm2\":1}" +``` + +
+ + + +
+ +## get_enabled_coins + +**get_enabled_coins** + +The `get_enabled_coins` method returns data of coins that are currently enabled on the user's MM2 node. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (none) | | | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | array of objects | tickers and addresses of enabled coins | +| result.address | string | the user's address for this coin | +| result.ticker | string | the ticker name of this coin | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_enabled_coins\"}" +``` + +
+ + + +
+ +## get_trade_fee + +**get_trade_fee coin** + +The `get_trade_fee` method returns the approximate amount of the miner fee that will be paid per swap transaction. + +This amount should be multiplied by 2 and deducted from the volume on `buy/sell` calls when the user is about to trade the entire balance of the selected coin. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin for the requested trade fee | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | object | an object containing the relevant information | +| result.coin | string | the fee will be paid from the user's balance of this coin. This coin name may differ from the requested coin. For example ERC20 fees are paid by ETH (gas) | +| result.amount | string (numeric) | the approximate fee amount to be paid per swap transaction | + +#### :pushpin: Examples + +#### Command (BTC) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_trade_fee\",\"coin\":\"BTC\"}" +``` + +
+ + + +
+ +#### Command (ETH) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_trade_fee\",\"coin\":\"ETH\"}" +``` + +
+ + + +
+ +#### Command (ERC20) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_trade_fee\",\"coin\":\"BAT\"}" +``` + +
+ + + +
+ +## help + +**help()** + +The `help` method returns the full API documentation in the terminal. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (none) | | | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (returns the full docs in terminal) | | | + +## my_balance + +**my_balance coin** + +The `my_balance` method returns the current balance of the specified `coin`. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin to retrieve the balance | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| address | string | the address that holds the coins | +| balance | string (numeric) | the number of coins in the address | +| coin | string | the name of the coin | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"my_balance\",\"coin\":\"HELLOWORLD\"}" +``` + +
+ + + +
+ +## my_orders + +**my_orders()** + +The `my_orders` method returns the data of all active orders created by the MM2 node. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (none) | | | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| maker_orders | map of objects | orders that are currently active in market maker mode | +| taker_orders | map of objects | orders that are currently active in market taker mode | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"my_orders\"}" +``` + +
+ + + +
+ +## my_recent_swaps + +**(from_uuid limit=10)** + +The `my_recent_swaps` method returns the data of the most recent atomic swaps executed by the MM2 node. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| limit | number | limits the number of returned swaps | +| from_uuid | string | MM2 will skip records until this uuid, skipping the `from_uuid` as well | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| swaps | array of objects | swaps data; each record has the format of the `my_swap_status` response | +| from_uuid | string | the from_uuid that was set in the request; this value is null if nothing was set | +| skipped | number | the number of skipped records (i.e. the position of `from_uuid` in the list + 1; the value is 0 if `from_uuid` was not set | +| limit | number | the limit that was set in the request; note that the actual number of swaps can differ from the specified limit (e.g. on the last page) | +| total | number | total number of swaps available | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"my_recent_swaps\",\"from_uuid\":\"e299c6ece7a7ddc42444eda64d46b163eaa992da65ce6de24eb812d715184e4c\",\"limit\":2}" +``` + +
+ + + +
+ +## my_swap_status + +**uuid** + +The `my_swap_status` method returns the data of an atomic swap executed on a MM2 node. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| params uuid | string | the uuid of swap, typically received from the buy/sell call | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| events | array of objects | the events that occurred during the swap | +| success_events | array of strings | a list of events that gained a `success` swap state; the contents are listed in the order in which they should occur in the `events` array | +| error_events | array of strings | a list of events that fell into an `error` swap state; if at least 1 of the events happens, the swap is considered a failure | +| type | string | whether the node acted as a market `Maker` or `Taker` | +| uuid | string | swap uuid | +| my_info | object | this object maps event data to make displaying swap data in a GUI simpler (`my_coin`, `my_amount`, etc.) | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"method\":\"my_swap_status\",\"params\":{\"uuid\":\"d14452bb-e82d-44a0-86b0-10d4cdcb8b24\"},\"userpass\":\"$userpass\"}" +``` + +
+ + + +
+ +## my_tx_history + +**(from_id limit=10)** + +The `my_tx_history` method returns the blockchain transactions involving the MM2 node's coin address. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin for the history request | +| limit | number | limits the number of returned transactions | +| from_id | string | MM2 will skip records until it reaches this ID, skipping the `from_id` as well; track the `internal_id` of the last displayed transaction to find the value of this field for the next page | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| transactions | array of objects | transactions data | +| from_id | string | the from_id specified in the request; this value is null if from_id was not set | +| skipped | number | the number of skipped records (i.e. the position of `from_id` in the list + 1); this value is 0 if `from_id` was not set | +| limit | number | the limit that was set in the request; note that the actual number of transactions can differ from the specified limit (e.g. on the last page) | +| total | number | the total number of transactions available | +| current_block | number | the number of the latest block of coin blockchain | +| sync_status | object | provides the information that helps to track the progress of transaction history preloading at background | +| sync_status.state | string | current state of sync; possible values: `NotEnabled`, `NotStarted`, `InProgress`, `Error`, `Finished` | +| sync_status.additional_info | object | additional info that helps to track the progress; present for `InProgress` and `Error` states only | +| sync_status.additional_info.blocks_left | number | present for ETH/ERC20 coins only; displays the number of blocks left to be processed for `InProgress` state | +| sync_status.additional_info.transactions_left | number | present for UTXO coins only; displays the number of transactions left to be processed for `InProgress` state | +| sync_status.additional_info.code | number | displays the error code for `Error` state | +| sync_status.additional_info.message | number | displays the error message for `Error` state | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"my_tx_history\",\"coin\":\"RICK\",\"limit\":1,\"from_id\":\"1d5c1b67f8ebd3fc480e25a1d60791bece278f5d1245c5f9474c91a142fee8e1\"}" +``` + +
+ + + +
+ +## order_status + +**order_status uuid** + +The `order_status` method returns the data of the active order with the selected `uuid` created by the MM2 node. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| uuid | string | uuid of order to display | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| type | string | type of the order ("Maker" or "Taker") | +| order | object | order data | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"order_status\",\"uuid\":\"c3b3105c-e914-4ed7-9f1c-604783b054a1\"}" +``` + +
+ + + +
+ +## orderbook + +**orderbook base rel (duration=number)** + +The `orderbook` method requests from the network the currently available orders for the specified trading pair. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| base | string | base currency of a pair | +| rel | string | "related" currency, also can be called "quote currency" according to exchange terms | +| duration | number | `deprecated` | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| bids | array | an array of objects containing outstanding bids (from Alice nodes) | +| numbids | number | the number of outstanding bids | +| biddepth | number | `deprecated` | +| asks | array | an array of objects containing outstanding asks (from Bob nodes) | +| coin | string | the name of the `base` coin; the user desires this | +| address | string | the address offering the trade | +| price | number | the price in `rel` the user is willing to pay per one unit of the `base` coin | +| numutxos | number | `deprecated` the number of utxos the offer provider has in their wallet | +| avevolume | number | `deprecated` the average volume of `coin` per utxo | +| maxvolume | number | the total amount of `base` coins the offer provider has in their wallet | +| depth | number | `deprecated` | +| pubkey | string | the pubkey of the offer provider | +| age | number | the age of the offer | +| zcredits | number | the zeroconf deposit amount | +| numasks | number | the total number of asks | +| askdepth | number | the depth of the ask requests | +| base | string | the name of the coin the user desires to receive | +| rel | string | the name of the coin the user will trade | +| timestamp | number | the timestamp of the orderbook request | +| netid | number | the id of the network on which the request is made (default is `0`) | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"HELLO\",\"rel\":\"WORLD\"}" +``` + +
+ + + +
+ +## sell + +**sell base rel price volume** + +The `sell` method issues a sell request and attempts to match an order from the orderbook based on the provided arguments. + +::: tip + +Buy and sell methods always create the `taker` order first. Therefore, you must pay an additional 1/777 fee of the trade amount during the swap when taking liquidity from market. If your order is not matched in 30 seconds, the order is automatically converted to a `maker` request and stays on the orderbook until the request is matched or cancelled. To always act as a maker, please use the [setprice method.](../atomic-swap-dex/dex-api.html#setprice) + +::: + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| base | string | the name of the coin the user desires to sell | +| rel | string | the name of the coin the user desires to receive | +| price | string (numeric) | the price in `rel` the user is willing to receive per one unit of the `base` coin | +| volume | string (numeric) | the amount of coins the user is willing to sell of the `base` coin | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | object | the resulting order object | +| result.action | string | the action of the request (`Sell`) | +| result.base | string | the base currency of the request | +| result.base_amount | string | the resulting amount of base currency that will be sold if the order matches | +| result.rel | string | the rel currency of the request | +| result.rel_amount | string | the minimum amount of `rel` coin that will be received to sell the `base_amount` of `base` (according to `price`) | +| result.method | string | this field is used for internal P2P interactions; the value is always equal to "request" | +| result.dest_pub_key | string | reserved for future use. The `dest_pub_key` will allow the user to choose the P2P node that is be eligible to match with the request. This value defaults to "zero pubkey", which means that `anyone` can match | +| result.sender_pubkey | string | the public key of our node | +| result.uuid | string | the request uuid | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"BASE\",\"rel\":\"REL\",\"volume\":\"1\",\"price\":\"1\"}" +``` + +
+ + + +
+ +## send_raw_transaction + +**send_raw_transaction coin tx_hex** + +The `send_raw_transaction` method broadcasts the transaction to the network of selected coin. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin network on which to broadcast the transaction | +| tx_hex | string | the transaction bytes in hexadecimal format; this is typically generated by the `withdraw` method | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| tx_hash | string | the hash of the broadcast transaction | + +#### :pushpin: Examples + +#### Command + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"method\":\"send_raw_transaction\",\"coin\":\"KMD\",\"tx_hex\":\"0400008085202f8902d6a5b976db5e5c9e8f9ead50713b25f22cd061edc8ff0ff1049fd2cd775ba087000000006b483045022100bf2073c1ecfef3fc78f272045f46a722591401f61c2d2fac87fc474a17df7c3102200ca1bd0664ba75f3383e5cbbe96127ad534a86238dbea256e000b0fe2067ab8c012102031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3ffffffffd04d4e07ac5dacd08fb76e08d2a435fc4fe2b16eb0158695c820b44f42f044cb010000006a47304402200a0c21e8c0ae4a740f3663fe08aeff02cea6495157d531045b58d2dd79fb802702202f80dddd264db33f55e49799363997a175d39a91242a95f268c40f7ced97030b012102031d4256c4bc9f99ac88bf3dba21773132281f65f9bf23a59928bce08961e2f3ffffffff0200e1f505000000001976a91405aab5342166f8594baf17a7d9bef5d56744332788acc3b3ca27000000001976a91405aab5342166f8594baf17a7d9bef5d56744332788ac00000000000000000000000000000000000000\",\"userpass\":\"$userpass\"}" +``` + +
+ + + +
+ +## setprice + +**setprice base rel price (volume max cancel_previous=true)** + +The `setprice` method places an order on the orderbook, and it relies on this node acting as a `maker`, also called a `Bob` node. + +The `setprice` order is always considered a `sell`, for internal implementation convenience. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| base | string | the name of the coin the user desires to sell | +| rel | string | the name of the coin the user desires to receive | +| price | string (numeric) | the price in `rel` the user is willing to receive per one unit of the `base` coin | +| volume | string (numeric) | the maximum amount of `base` coin available for the order, ignored if max is `true` | +| max | bool | MM2 will use the entire coin balance for the order, taking `0.001` coins into reserve to account for fees | +| cancel_previous | bool | MM2 will cancel all existing orders for the selected pair by default; set this value to `false` to prevent this behavior | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| result | object | the resulting order object | +| result.base | string | the base coin of the order | +| result.rel | string | the rel coin of the order | +| result.price | string (numeric) | the expected amount of `rel` coin to be received per 1 unit of `base` coin, returned as a string to avoid floating point representation errors | +| result.max_base_vol | string (numeric) | the maximum volume of base coin available to trade, returned as a string to avoid floating point representation errors | +| result.min_base_vol | string (numeric) | MM2 won't match with other orders that attempt to trade less than `min_base_vol`; returned as a string to avoid floating point representation errors | +| result.created_at | number | unix timestamp in milliseconds, indicating the order creation time | +| result.matches | object | contains the map of ongoing matches with other orders, empty as the order was recently created | +| result.started_swaps | array of strings | uuids of swaps that were initiated by the order | +| result.uuid | string | uuid of the created order | + +#### :pushpin: Examples + +#### Command (with volume) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"BASE\",\"rel\":\"REL\",\"price\":\"0.9\",\"volume\":\"1\"} +``` + +#### Command (max = true) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"BASE\",\"rel\":\"REL\",\"price\":\"0.9\",\"max\":true} +``` + +
+ + + +
+ +## stop + +**stop()** + +The `stop` method stops the MM2 software if there are no swaps in process. + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (none) | | | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| (none) | | | + +## withdraw + +**withdraw coin to (amount max)** + +The `withdraw` method generates, signs, and returns a transaction that transfers the `amount` of `coin` to the address indicated in the `to` argument. + +This method generates a raw transaction which should then be broadcast using [send_raw_transaction](../atomic-swap-dex/dex-api.html#send-raw-transaction). + +#### Arguments + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| coin | string | the name of the coin the user desires to withdraw | +| to | string | coins will be withdrawn to this address | +| amount | string (numeric) | the amount the user desires to withdraw, ignored when `max=true` | +| max | bool | withdraw the maximum available amount | + +#### Response + +| Structure | Type | Description | +| --------- | -------- | ----------- | +| from | array of strings | coins will be withdrawn from this address; the array contains a single element, but transactions may be sent from several addresses (UTXO coins) | +| to | array of strings | coins will be withdrawn to this address; this may contain the `my_address` address, where change from UTXO coins is sent | +| my_balance_change | number | the expected balance of change, after the transaction broadcasts | +| received_by_me | number | the amount of coins received by `my_address` after the transaction broadcasts; the value may be above zero when the transaction requires that MM2 send change to `my_address` | +| spent_by_me | number | the amount of coins spent by `my_address`; this value differ from the request amount, as the transaction fee is added here | +| total_amount | number | the total amount of coins transferred | +| fee_details | object | the fee details of the generated transaction; this value differs for utxo and ETH/ERC20 coins, check the examples for more details | +| tx_hash | string | the hash of the generated transaction | +| tx_hex | string | transaction bytes in hexadecimal format; use this value as input for the `send_raw_transaction` method | + +#### :pushpin: Examples + +#### Command (BTC, KMD, and other BTC-based forks) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"method\":\"withdraw\",\"coin\":\"KMD\",\"to\":\"RJTYiYeJ8eVvJ53n2YbrVmxWNNMVZjDGLh\",\"amount\":\"10\",\"userpass\":\"$userpass\"}" +``` + +
+ + + +
+ +#### Command (ETH, ERC20, and other ETH-based forks) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"method\":\"withdraw\",\"coin\":\"ETH\",\"to\":\"0xbab36286672fbdc7b250804bf6d14be0df69fa28\",\"amount\":10,\"userpass\":\"$userpass\"}" +``` + +
+ + + +
+ +#### Command (max = true) + +```bash +curl --url "http://127.0.0.1:7783" --data "{\"method\":\"withdraw\",\"coin\":\"ETH\",\"to\":\"0xbab36286672fbdc7b250804bf6d14be0df69fa28\",\"max\":true,\"userpass\":\"$userpass\"}" +``` + +
+ + + +
+ +# Installing AtomicDEX Software (MM2) + +### Minimum Requirements for Installation + +* MacOS, Windows (see note below), and Linux (see note below) + +* 64-bit (see note below for 32-bit) + +* Minimum 2GB of free RAM + +* Normal user account with admin/root privileges + +::: warning Note +If you would prefer to avoid building MM2 from source, you can download our pre-built nightly binary [from this link](http://195.201.0.6/mm2/). +::: + +### Note about Linux + +For Linux users, much of the following documentation assumes that you are building and running MM2 on a Debian 9/10 or Ubuntu 18.04 host. If you have questions about other releases or distributions, [please reach out to us on the #dev-marketmaker channel on Discord](https://komodoplatform.com/discord). + +### Note about Installing on Windows + +Developing software on Windows typically requires an installation of Git Bash. + +Git Bash is a terminal shell based on Unix. It is similar to the Windows Shell or Windows Command Prompt, but uses Unix-based syntax. + +All instructions in the MarketMaker 2.0 documentation are given with Unix-based syntax, and therefore we recommend installing Git Bash before proceeding. + +You may download and install Git Bash for Windows here: + +[Download Git Bash for Windows](https://git-scm.com/download/win) + +The download should begin automatically. + +Double-click the downloaded `.exe` file and follow the Installation Wizard. + +Once Git Bash is open and running on your machine, you may continue. + +### Note About 32-bit Operating Systems + +We are currently testing 32-bit operating system functionality. As 32-bit machines can often be comparatively older hardware, we cannot guarantee that MarketMaker 2.0 will run successfully by default. + +We invite users of 32-bit operating systems to test the software and [report any errors to our team on the #dev-marketmaker channel on Discord](https://komodoplatform.com/discord). + +### Installing Dependencies + +#### Rust + +Install [Rust](https://www.rust-lang.org/tools/install): + +```bash +curl https://sh.rustup.rs -sSf | sh +``` + +#### cmake Version 3.12 or Higher + +Download the cmake software here: [download link](https://cmake.org/download/) + +Unpack and follow the instructions here: [instructions link](https://cmake.org/install/) + +#### Build Tools for Your OS + +##### Linux: + +```bash +sudo apt-get install build-essential +``` + +##### Windows: [Follow these instructions for MSVC](https://docs.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=vs-2017) + +##### MacOS: [Install XCode via the App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) + +#### Install Additional Dependencies + +Install the following additional dependencies using the terminal. + +```bash +sudo apt-get install -y build-essential git llvm-3.9-dev libclang-3.9-dev clang-3.9 libssl-dev pkg-config +``` + +#### Install Additional Rust Components + +Install additional Rust components: + +```bash +rustup install nightly-2019-06-26 +``` + +```bash +rustup default nightly-2019-06-26 +``` + +```bash +rustup component add rustfmt-preview +``` + +#### Install jq + +`jq` is an optional, but useful addition to our needed software. `jq` can provide a more readable format of JSON output in the terminal, which helps us more quickly digest mm2's data. + +##### Linux: + +``` +sudo apt-get install jq +``` + +##### MacOS: + +Download the appropriate file from [this link.](https://stedolan.github.io/jq/download/) + +In your terminal, make the file executable by changing into the directory where the file downloaded and executing: + +``` +chmod +x jq +``` + +Then execute the file. + +##### Windows: + +Download and execute the appropriate file from [this link.](https://stedolan.github.io/jq/download/) + +### Build MM2 + +Clone the MM2 repository: + +```bash +cd ~ +git clone https://github.com/artemii235/SuperNET.git --branch mm2 --single-branch && cd SuperNET +``` + +Compile the source code: + +```bash +cargo build --features native -vv +``` + +If everything installs successfully you will see something similar: + +``` +“Finished dev [optimized + debuginfo] target(s) in 3m 33s” +``` + +The MM2 executable is now built and available here: `~/SuperNET/target/debug/mm2` +# Additional Notes + +## A Back End for Front-End Implementations + +AtomicDEX software is built to have a core component that can serve many front-end graphical-user interfaces (GUIs). + +The core component is called MarketMaker 2.0, or MM2 for brevity. + +Various front-end GUIs exist in our ecosystem, some of them built by the volunteer efforts of our community members. We are also working to release a Komodo-supported User Experience and User Interface, in coordination with Ideas By Nature, a UX/UI design firm. + +This also allows developers and entrepreneurs the freedom to create your own front-end implementation for your own purposes. For example, you can create your own front-end implementation that acts on the same atomic-swap network as other communities. Or, you could make a front-end implementation for your own private network. + +The documentation here only concerns the core component, MarketMaker 2.0 (MM2). This component is typically accessed via an API or a terminal interface. + +Documentation for a GUI for MM2 is not yet available. + +## New Features of MarketMaker 2.0 (Desktop) + +Users who worked with the previous version of the MM software, MarketMaker 1.0 (MM1), will note several differences with the new release. + +### New Off-Chain Technology + +MM1 used nanomsg technology for its off-chain network layer (e.g. orderbook propagation, ordermatching, client traffic routing, and other technologies that are not active on the blockchain itself). + +MM2 replaced nanomsg with Rust TCP implementation and also uses `libtorrent` as a torrent/DHT network system for the off-chain network layer. This p2p software is widely used and highly reliable, granting a greater development experience. + +### Rust Implementation + +MM1 was based on ANSI C. + +For MM2 we ported the system to Rust, utilizing the cargo ecosystem. Internal benchmarks prove this to be more efficient. Furthermore, the Rust code base supports mobile devices, including Android & iOS. This is a key benefit, as we expect mobile devices to be a key component of MM2 adoption. + +### Multi-Threading and Other Multi-Tasking Improvements + +MM1 had limited multi-tasking capabilities. Also, the bob-side technology was not reliable when using MM1 in lite mode (SPV), wherein blockchain syncing is not required for end-users. + +MM2 has multi-threading. This allows it to reliably manage multiple concurrent requests. + +## MarketMaker 2.0 for Mobile (New!) + +Komodo is pleased to announce that MarketMaker 2.0 is preparing for release on compatible Android and iOS devices. The software is currently undergoing quality tests and external reviews before publication. + +Notable aspects of the Mobile MM2 software include: + +- Optimization for low-data usage and CPU consumption +- Low storage requirements (less than 50 MB) +- Integrates seamlessly with the desktop MarketMaker 2.0 software + +Through the Komodo API, mobile-device developers can integrate MM2 for Mobile into other software packages. + +Please reach out to our team on [Discord](https://komodoplatform.com/discord) to be involved with the software release. + +## Add Your Coin to MarketMaker 2.0 + +All coins that are built on the BTC and ETH core software can be added to MarketMaker 2.0 (MM2) quickly and simply. Coins built on other software frameworks may be able to be added as well, depending on specific details. Specifically, a coin must support functionality that is similar to the "CheckLockTimeVerify" of the Bitcoin protocol, wherein a utxo can be locked for a specific amount of time and then released in a manner determined by the developer. For more information, please reach out to our team on Discord. + +To add your BTC or ETH-based coin to MM2, first follow the linked checklist below: + +[Link to checklist for adding coin to MM2](https://github.com/jl777/coins#0-the-coin-must-be-tested-with-barterdex-atomic-swaps) + +Upon completing the checklist, please submit your proposed coin configuration files to the same repository with a pull request. + +## Features Carried From MM1 + +##### SPV-based Trading + +AtomicDEX holds support for [SPV Electrum-based](https://en.bitcoin.it/wiki/Electrum) coins. This feature allows a user to trade with their coins without downloading their coins' blockchain data. This feature is available for all Bitcoin-protocol based coins running native-coin daemons, Ethereum, and Ethereum-based ERC20 tokens. The AtomicDEX API is built to handle the nature of the SPV requirements, providing additional functionality to developers. + +##### Liquidity Multiplication + +AtomicDEX also enables a feature known as Liquidity Multiplication, a protocol that allows the same funds to be used in multiple requests on AtomicDEX "orderbooks." The first request to fill completes the trade, and all outstanding requests are immediately cancelled. This feature is available to the user when providing liquidity to the exchange (called a "Bob-side" trade). + +Liquidity Multiplication therefore allows an initial amount of funding to create an exponentially higher amount of liquidity on the exchange. This also provides a special advantage for traders that like to wait for below-market dumps. While this feature is something that any other exchange could implement, few do. + +On AtomicDEX, all orderbook entries are 100% backed by real funds, as opposed to a centralized exchange’s vouchers, which may be one reason why AtomicDEX can more readily offer this feature. + +# DEX Walkthrough + +Now that you have MarketMaker 2.0 (MM2) installed you are ready for your first atomic swap! + +Since we're testing MM2 as a back end, we're going to be doing a few things that a normal user will not be expected to do once we have a GUI or TUI/CLI available. We are working with Ideas By Nature, a user-experience and user-interface design firm, to facilitate this. + +Let's open up the terminal and get started. + +## Setting Up the Coin List + +In the Komodo ecosystem we use two blockchain coins, RICK and MORTY, for testing purposes. These coins are freely distributed and have no blockchain scarcity, so you don't want to treat these coins as real currency. Also, if you lose them or destroy them, there's no need to stress. You can always grab more from our faucet. + +Let's set up a file in the `~/KomodoPlatform/target/debug` directory to import the settings for these test coins. Make a file called `coins` and place the following text into it: + +``` +[{"coin":"RICK","asset":"RICK","fname":"RICK (TESTCOIN)","rpcport":28223,"mm2":1},{"coin":"MORTY","asset":"MORTY","fname":"MORTY (TESTCOIN)","rpcport":63812,"mm2":1}] +``` + +Save this file. MM2 will search for it automatically on launch. + +::: tip +The `coins` file in [this linked repository](https://github.com/jl777/coins) contains the standard coin configuration file used in GUI software. +::: + +#### RPC password + +We also need to choose a password. + +Make it a secure one by including at least 8 characters, both uppercase and lowercase letters, and a few numbers and symbols. + +Write this down in a safe location where you won't lose it. + +We have our initial materials, let's launch the software. + +## Initiate MarketMaker 2.0 + +Look at the following command below, but don't execute it yet: + +``` +stdbuf -oL ./mm2 "{\"gui\":\"MM2GUI\",\"netid\":9999, \"userhome\":\"/${HOME#"/"}\", \"passphrase\":\"YOUR_PASSPHRASE_HERE\", \"rpc_password\":\"YOUR_PASSWORD_HERE\"}" & +``` + +Replace `YOUR_PASSPHRASE_HERE` and `YOUR_PASSWORD_HERE` with your actual passphrase and password, and then execute the command in the terminal. + +Here is an approximate interpretation of the arguments in the command, to help you see what's happening: + +| Argument | (Value) | Description | +| -------- | ------- | ----------- | +| gui | MM2GUI | this is a flag that can be ignored for now | +| netid | 9999 | this tells MM2 which network to join. 9999 is a private test network we use here. 0 is the default network. | +| passphrase | YOUR_PASSPHRASE_HERE | your passphrase; this is the source of each of your coins' private keys | +| rpc_password | YOUR_PASSWORD_HERE | your password for protected RPC methods (userpass) | +| userhome | /${HOME#"/"} | the path to your home, called from your environment variables and entered as a regular expression | + +Having executed the command, you should see output similar to the following: + +``` +29 19:39:41, lp_coins:796] ticker = "BTC", method = Some("enable"), block_count = 0 😅 2019-01-29 20:39:41 +0100 [coin KMD no-conf] Warning, coin KMD is used without a corresponding configuration. +cant open.(/root/.komodo/komodo.conf) +29 19:39:41, lp_coins:796] ticker = "KMD", method = Some("enable"), block_count = 0 +RPCport.7783 remoteport.7782, nanoports 47762 47772 47782 +29 19:39:41, peers:942] initialize] netid 9999 public key ab44ae49d2ff89295ee9a0574e89a2bdd7bfbb4f1a34f7d5c0256cf06e89485d preferred port 47773 drill false +connected to push.(tcp://333.333.333.333:47762) pushsock.0 valid.1 | connected to sub.(tcp://333.333.333.333:47772) subsock.1 valid.1 numactive.1 +connected to push.(tcp://333.333.333.333:47762) pushsock.2 valid.1 | connected to sub.(tcp://333.333.333.333:47772) subsock.3 valid.1 numactive.1 +_LPaddpeer 333.333.333.333 -> numpeers.2 mypubsock.-1 other.(0) +29 19:39:41, rpc:334] >>>>>>>>>> DEX stats 127.0.0.1:7783 DEX stats API enabled at unixtime.1548790781 <<<<<<<<< +· 2019-01-29 20:39:41 +0100 [dht-boot] DHT bootstrap ... Done. +New priority.1 max_Reserved_msgs.1 +29 19:40:01, lp_signatures:613] lp_notify_recv] hailed by peer: 127.0.0.85 +29 19:40:01, peers:996] investigate_peer] ip 127.0.0.85 preferred port 7803 +29 19:40:01, peers:355] Sending a ping to V4(127.0.0.85:7803)… +connected to push.(tcp://127.0.0.85:7793) pushsock.4 valid.1 | connected to sub.(tcp://127.0.0.85:7803) subsock.5 valid.1 numactive.2 +_LPaddpeer 127.0.0.85 -> numpeers.3 +``` + +The terminal will then repeat similar output to the following every so often: + +``` +04 21:28:47, peers:996] investigate_peer] ip 54.36.126.42 preferred port 7803 +04 21:28:47, peers:355] Sending a ping to V4(54.36.126.42:7803)… +04 21:29:08, lp_signatures:613] lp_notify_recv] hailed by peer: 54.36.126.42 +``` + +If you see something similar, MarketMaker 2.0 is up and running! + +## Setting userpass Environment Variable + +::: tip +Userpass will be renamed to rpc_password for clarity in the near future +::: + +Make a new file in the `~/KomodoPlatform/target/debug` directory called `userpass` and enter the following text, including the `rpc_password` you specified earlier: + +``` +export userpass="RPC_PASSWORD" +``` + +Save it, and then in the terminal execute: + +``` +source userpass +``` + +Test it by executing: + +``` +echo $userpass +``` + +You should see your userpass as a returned value. + +::: tip +The `userpass` environment variable will remain in our terminal's memory until we close the session. When we open up a new session later, we need to create the `userpass` environment variable again. Later, a GUI designer can create functionality to perform this automatically. +::: + +## Connect to the Relevant Coin Networks + +While we did set up the coins' configuration properties in the internal files, MM2 isn't going to connect to their blockchain networks immediately. + +One reason for this is that if you trade between many coins, the startup process would require connecting to every coin all at once. + +We'll tell MM2 that we're ready to activate these coins now. + +Execute the following command: + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"RICK\",\"servers\":[{\"url\":\"electrum1.cipig.net:10017\"},{\"url\":\"electrum2.cipig.net:10017\"},{\"url\":\"electrum3.cipig.net:10017\"}]}" +``` + +You should get a similar response: + +``` +{"address":"RLgAgBFHFbG2ma9MDTHyKL5vovftMepBkE","coin":"RICK",balance":16.95595733,"result":"success"} +``` + +You are now connected to the RICK test-blockchain network. + +Let's connect to MORTY (note it uses a different Electrum port). + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"electrum\",\"coin\":\"MORTY\",\"servers\":[{\"url\":\"electrum1.cipig.net:10018\"},{\"url\":\"electrum2.cipig.net:10018\"},{\"url\":\"electrum3.cipig.net:10018\"}]}" +``` + +You should get a similar response: + +``` +{"address":"RLgAgBFHFbG2ma9MDTHyKL5vovftMepBkE","coin":"MORTY","balance":11.27710708,"result":"success"} +``` + +You are now connected to the MORTY test-blockchain network. + +## Get MORTY From a Faucet + +Note that in the examples the address, `RLgAgBFHFbG2ma9MDTHyKL5vovftMepBkE`, is present in both returned responses. + +You will see a different address in your returned responses. + +This address is unique to you and you will use it for our trades here. + +We don't recommend placing anything valuable in this address for now, as MM2 is still in testing. + +On the other hand, RICK and MORTY have no real value, so you can place as much in here as you like! + +Let's retrieve some MORTY. + +[Click on this link](https://www.atomicexplorer.com/#/faucet/morty) and you should see an address input box. + +Place your address in there, fill out the reCaptcha to prove you're a human, and hit `OK`. + +In a minute or so a few MORTY coins will arrive in your address. + +You can check by executing this command: + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"my_balance\",\"coin\":\"MORTY\"}" +``` + +You should see a similar response: + +``` +{"address":"RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ","balance":77.7,"coin":"MORTY"} +``` + +You now have MORTY. + +## Observing the Orderbook + +MarketMaker 2.0 uses a decentralized orderbook to allow users to buy and sell from each other without having to rely on a centralized service. This gives it an increased level of security, as there is no central agency that can manipulate prices. This also prevents "wash" trading, where trading activity is faked. + +To see the orderbook's current state, execute the following command: + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"RICK\",\"rel\":\"MORTY\"}" +``` + +This sends a request to MM2 to see who is willing to give up RICK for MORTY. + +The call will return a similar result: + +``` +{"bids":[],"numbids":0,"biddepth":0,"asks":[{"coin":"RICK","address":"RJTYiYeJ8eVvJ53n2YbrVmxWNNMVZjDGLh","price":0.89999998,"numutxos":0,"avevolume":0,"maxvolume":10855.85028615,"depth":0,"pubkey":"5a2f1c468b7083c4f7649bf68a50612ffe7c38b1d62e1ece3829ca88e7e7fd12","age":5,"zcredits":0}],"numasks":1,"askdepth":0,"base":"RICK","rel":"MORTY","timestamp":1549319941,"netid":9999} +``` + +This is the current orderbook. + +Now, you'll notice that the output isn't easily readable. Here's where we should start using `jq`. + +You may remember that we installed software called `jq` during the setup process. `jq` is optional, but it is recommended as it makes reading the output in the terminal easier. + +To activate `jq`, simply add the following to the end of any command: ` | jq`. + +For example: + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"RICK\",\"rel\":\"MORTY\"}" | jq +``` + +(If using `jq` gives you troubles, you can remove it from any of the commands without issue. It is only here for convenience.) + +Here's the response: + +``` + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 505 100 377 100 128 122k 42666 --:--:-- --:--:-- --:--:-- 246k +{ + "bids": [], + "numbids": 0, + "biddepth": 0, + "asks": [ + { + "coin": "RICK", + "address": "RJTYiYeJ8eVvJ53n2YbrVmxWNNMVZjDGLh", + "price": 1, + "numutxos": 0, + "avevolume": 0, + "maxvolume": 10855.85028615, + "depth": 0, + "pubkey": "5a2f1c468b7083c4f7649bf68a50612ffe7c38b1d62e1ece3829ca88e7e7fd12", + "age": 9, + "zcredits": 0 + } + ], + "numasks": 1, + "askdepth": 0, + "base": "RICK", + "rel": "MORTY", + "timestamp": 1549320152, + "netid": 9999 +} +``` + +That's much easier to read. We can easily see someone with the address `RJTYiYeJ8eVvJ53n2YbrVmxWNNMVZjDGLh`. + +``` +"address": "RJTYiYeJ8eVvJ53n2YbrVmxWNNMVZjDGLh", +``` + +They are willing to give up RICK for MORTY. + +``` +"base": "RICK", +"rel": "MORTY", +``` + +They are asking for `1` MORTY for every 1 RICK. + +``` +"price": 1, +``` + +They have a total of `10855.85028615` available to trade. + +``` +"maxvolume": 10855.85028615, +``` + +## Initiate a Swap + +Let's create a RICK/MORTY `buy` order + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"buy\",\"base\":\"RICK\",\"rel\":\"MORTY\",\"volume\":\"1\",\"price\":\"1\"}" | jq +``` + +You should receive a similar response: + +``` +{ + "result": { + "action": "Buy", + "base": "RICK", + "base_amount": "1", + "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000", + "method": "request", + "rel": "MORTY", + "rel_amount": "1", + "sender_pubkey": "c213230771ebff769c58ade63e8debac1b75062ead66796c8d793594005f3920", + "uuid": "288743e2-92a5-471e-92d5-bb828a2303c3" + } +} +``` + +If you see order data in the response, the order was successfully submitted to the network. + +Your swap is not yet started, however. + +From here, everything is automated. + +If your order is matched you will see something similar in terminal output: + +``` +26 10:51:50, lp_ordermatch:333] Entering the taker_swap_loop RICK/MORTY +26 10:51:51, lp_ordermatch:490] CONNECTED.({"dest_pub_key":"c213230771ebff769c58ade63e8debac1b75062ead66796c8d793594005f3920","maker_order_uuid":"cbe664e7-3be5-4b45-9bd0-03c6a785e636","method":"connected","sender_pubkey":"199fe4169c30f464bc022273de0c893b4e2864128cdc9f7126fa24bc0910fd0e","taker_order_uuid":"c4d1b840-ebe8-4e44-9cb8-f6c767d3972f"}) +26 10:52:12, lp_swap:1629] Received 'negotiation@c4d1b840-ebe8-4e44-9cb8-f6c767d3972f' (69 bytes, crc 794323698) +26 10:52:12, lp_swap:1658] Sending 'negotiation-reply@c4d1b840-ebe8-4e44-9cb8-f6c767d3972f' (69 bytes, crc 2294558621) +26 10:52:53, lp_swap:1665] Received 'negotiated@c4d1b840-ebe8-4e44-9cb8-f6c767d3972f' (1 bytes, crc 2768625435) +26 10:53:00, lp_swap:1731] Taker fee tx hash 2e019f6eb2e43b4d96c6400c86c0b65364024a21e8feb555aa108d3c9518989c +26 10:53:00, lp_swap:1740] Sending 'taker-fee@c4d1b840-ebe8-4e44-9cb8-f6c767d3972f' (244 bytes, crc 3461506896) +26 10:53:44, lp_swap:1748] Received 'maker-payment@c4d1b840-ebe8-4e44-9cb8-f6c767d3972f' (242 bytes, crc 2227964296) +26 10:53:44, lp_swap:1764] Got maker payment 5648da6db5143551fa6ceffe7ef7b0a21b2a4dd479cb7a12dd46f73f2fd87597 +26 10:53:45, rpc_clients:111] Waiting for tx 5648da6db5143551fa6ceffe7ef7b0a21b2a4dd479cb7a12dd46f73f2fd87597 confirmations, now 0, required 1 +26 10:53:56, rpc_clients:111] Waiting for tx 5648da6db5143551fa6ceffe7ef7b0a21b2a4dd479cb7a12dd46f73f2fd87597 confirmations, now 0, required 1 +26 10:54:06, rpc_clients:111] Waiting for tx 5648da6db5143551fa6ceffe7ef7b0a21b2a4dd479cb7a12dd46f73f2fd87597 confirmations, now 0, required 1 +26 10:54:16, rpc_clients:111] Waiting for tx 5648da6db5143551fa6ceffe7ef7b0a21b2a4dd479cb7a12dd46f73f2fd87597 confirmations, now 0, required 1 +26 10:54:27, rpc_clients:111] Waiting for tx 5648da6db5143551fa6ceffe7ef7b0a21b2a4dd479cb7a12dd46f73f2fd87597 confirmations, now 0, required 1 +26 10:54:43, lp_swap:1863] Taker payment tx hash 368a9ee2db36feb6870266695be72e8ed8d1beb2afd95d62920f1d620941fff2 +26 10:54:44, lp_swap:1885] Sending 'taker-payment@c4d1b840-ebe8-4e44-9cb8-f6c767d3972f' (242 bytes, crc 3588913089) +26 10:57:11, lp_swap:1902] Taker payment spend tx 364c0df46028be2439f15a31ddae534a98d0e20ec22464c69a9086807f3afc89 +26 10:57:14, lp_swap:1949] Maker payment spend tx b8c2a30f23cebb48f0d8fe0a048a65755ca5b8f56f4c68f80d044acd0f8e1ce6 +· 2019-06-26 17:57:14 +0700 [swap uuid=c4d1b840-ebe8-4e44-9cb8-f6c767d3972f] Finished + Maker payment spent... + Taker payment spent... + Taker payment sent... + Maker payment validated and confirmed... + Maker payment wait confirm started... + Maker payment received... + Taker fee sent... + Negotiated... + Started... +``` + +When you see that last line, you know that your swap went through: + +``` +29 22:48:03, lp_ordermatch:781] Swap finished successfully +``` + +Let's check by looking at your RICK balance. Execute this command: + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"my_balance\",\"coin\":\"RICK\"}" | jq +``` + +You should receive a similar response, the balance will be a bit less than volume set on trade as you have to pay the fee to mine your swap transaction: + +``` + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 192 100 77 100 115 377 563 --:--:-- --:--:-- --:--:-- 945 +{ + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": 0.99999, + "coin": "RICK" +} +``` + +Congratulations! You are one of the first people in history to trade a currency without any help from a middleman and without even having to know your trading partner. + +When you are finished, exit using the following command: + +``` +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"stop\"}" +``` + +Please reach out to us [on Discord](https://komodoplatform.com/discord) and tell us about your experience. +# Introduction to AtomicDEX + +One of Komodo's blockchain tools is an atomic-swap powered, decentralized exchange (DEX), called AtomicDEX. + +Komodo’s AtomicDEX software is entirely separate from the `komodod` software that powers the rest of Komodo. + +Because AtomicDEX is built on atomic swaps, developers and users can rely on it to exchange cryptocurrencies at will, and without any middleman involvement. Users of this software maintain full control over the private keys of their assets at all times. This dramatically increases the security of the exchange process. + +This software is capable of facilitating atomic-swap exchanges between approximately 99% of the coins listed on [coinmarketcap.com](https://coinmarketcap.com). All coins were listed without charge. + +## Why is AtomicDEX Special? + +When it comes to DEX technology, Komodo has a remarkable story. + +In April 2014, Komodo’s lead developer experimented with his first atomic-swap prototypes. By August of 2017, Komodo released version 1.0 of the atomic-swap DEX software, allowing anonymous Internet users to perform over 100,000 atomic swaps via automation. These are but two examples of how Komodo has led the way in atomic-swap DEX technology since the beginning. + +To understand AtomicDEX, one must first understand what a decentralized exchange is, why it is important, and how atomic swaps come into play. + +This discussion requires a small amount of foundational knowledge. The reader should be generally familiar with blockchain technology and should understand the basic ideas of the Komodo project. If an overview of Komodo is needed, head to the documentation introduction, ["Why Komodo?"](../start-here/outline-for-new-developers.html#why-komodo) For a more thorough understanding of general blockchain technology, check out [Part I of the Komodo whitepaper.](https://komodoplatform.com/whitepaper) This section of the whitepaper gives an overview of how a blockchain works and why it matters. After reading those articles, the following discussion should be attainable. + +## Understanding the Most Common Method of Cryptocurrency Exchange + +In the world of cryptocurrency, the goods we are trading are our digital assets. These can be coins, tokens, or other forms of digital rights and property. By nature, each digital asset is bound to the individual blockchain that secures its transaction history. + +### Trading Between Blockchains is a Challenge + +So long as a user exchanges these assets within their parent blockchains the normal methods of conducting transactions are sufficient for trading. However, questions arise once the user wants to exchange assets on one blockchain for assets on an entirely separate blockchain. + +Typically, separate blockchains have separate demographics of miners and stakers securing the history. When a user trades value between the two blockchains, by default there is no inter-chain security mechanism that can ensure that the user's trading partner does not cheat, and that technical difficulties do not destroy the user's assets. + +### The Centralized Exchange as a Method + +The simplest solution is to abandon decentralization during this process and trust a third party. This describes a normal "centralized exchange" (CEX), such as Coinbase, Kraken, and Binance. + +To conduct an exchange using a CEX the user must entrust their digital assets to the CEX's care during the process. The user sends their digital assets to the CEX, and the CEX then issues the user "I Owe You" (IOU) tokens that represent the user's ownership of these assets. + +The user is then within a single environment that is controlled by a centralized authority. This grants all the benefits of the old system to the trading process, including greater speed of development and design. + +Throughout this experience the user relies on the security of a centralized third party to ensure that their purchases and sales are conducted honestly and accurately. When the user is finished exchanging, they hand back their IOUs and tell the CEX the address where they would like to export their purchases. + +Once the user receives their digital assets back into an address which they control, they are again truly the "owner" of these assets. + +### Problems with Centralized Exchanges + +Assuming all goes as intended, a CEX is an efficient and effective tool for trading cryptocurrencies. However, reliable CEX's readily state that this model carries great risk. Many of the highest quality CEX's are looking to change their model to mitigate these dangers. + +The primary concern for a CEX is security. When a user places their assets on a centralized exchange, the private keys to these assets are held in a database that, by nature, must have some kind of connection to the public Internet. As the database must always be available online, an attacker can penetrate an individual user's account and gain control over the IOUs even when the user is offline. The attacker can then trade these IOUs at malicious prices into an account the attacker controls and withdraw the true assets. + +Furthermore, this database holds the assets of thousands of other users. Having a large amount of vulnerable funds on the Internet is an additional incentive for attackers. [As reported by IG Group studies,](https://www.group-ib.com/resources/threat-research/2018-report.html) from 2017 to 2018, nearly 1 billion US dollar's worth of digital assets were stolen from major exchanges around the world. + +A CEX has several challenges to consider as a result of this danger. From a legal perspective, [the infamous Mt. Gox case](https://www.coindesk.com/mississippi-doctors-sued-mt-gox-for-bitcoin-loss-now-worth-135-million) illustrates how users may attempt to hold the CEX liable in the event of a theft. A CEX may struggle to find an insurance provider that will protect them. Also, compared to fiat currency, government authorities can do little to assist in recovering stolen funds. + +### Pros and Cons of the Centralized Exchange + +| Perspective | Pros | Cons | +| ----------- | ----- | ---- | +| User | The IOU exchange process is high-speed, simple, and often has a pleasant interface | Compromising the user's individual account is achievable for a determined hacker, and there are effectively no methods to recover funds stolen from a CEX | +| User | Because the CEX model has many users, a CEX is more likely to achieve high liquidity | The high user population motivates sophisticated attackers to compromise the entire site | +| User | A large CEX can handle the complexities of holding and using cryptocurrencies | Once a user gives up control over their funds to the CEX, the user can only trust that the funds will be returned | +| Exchange Owner | Without decentralization, business development is often faster | In holding thousands of user's personal funds, the exchange owners assume an enormous amount of liability | +| Exchange Owner | The automated aspect of cryptocurrency allows for fast profits through small fees | The owner must be wary of thieves even among their own employees | + +In light of these concerns, many reputable and established CEX's are turning to decentralized technologies. For example, Binance, one of the most popular CEX's on the Internet, [is moving swiftly into DEX technology](https://www.theblockcrypto.com/2019/02/07/binance-moves-away-from-ethereum-as-it-prepares-to-launch-dex/) to enhance both security and functionality for their users. + +## A Decentralized Exchange Can Bring Greater Safety + +To understand why a CEX may wish to implement decentralized technologies, one must first understand how a typical decentralized exchange (DEX) works. There are many types of DEX's, each having a unique technical structure. Perhaps the most popular DEX format is a decentralized gateway. + +### Types of Decentralized Exchanges + +| Type | Summary | Examples | +| ---- | ------- | -------- | +| Decentralized Gateway | A decentralized network of gateway keepers hold user funds in escrow and issue IOUs for trading | InstantDEX, Bitshares, Binance DEX | +| On-Chain Token Exchange | Tokens created on the parent blockchain are traded within the consensus rules; by adding gateway nodes, this can also extend to become a decentralized gateway | EtherDelta, 0x | +| Non-Custodial Exchange | A centralized website arranges for a moderately secure, but non-decentralized trade between liquidity providers and purchasers; there is no order book and the exchange's control over user funds is limited | ShapeShift, Changelly | + +A decentralized gateway can be thought of as a cryptocurrency holding station that is owned and controlled by several different parties. The gateway performs two functions: it holds the assets that users send to it, and it issues IOUs. + +The IOUs issued to the user do not derive from a centralized database. Rather, they are managed through a blockchain. The user maintains control over the private keys to their IOUs at all times. While this method is not as secure as having access to the private keys to the true digital assets, the method does provide some protection. Assuming the user knows how to secure their private keys, when the user is offline their IOUs are not vulnerable to attackers. This is one improvement over the CEX model. + +The user trades their IOUs with other users in much the same way as on a CEX. When a user is finished trading, they send their IOUs back to the gateway, and with this transaction they include an external address to which they would like their funds withdrawn. + +Now comes another key difference. The actual assets that the gateway is holding are contained in a special type of blockchain address. It is special because it is owned and controlled not by one person or central authority, but rather by several people or parties working together. This address can collect funds from anywhere and from anyone. However, it can only release funds when several of the address’s owners grant permission. This special type of blockchain address is called a “multi-signature” address. + +Because a multi-signature address requires several different parties to sign the release of funds, the gateway is able to provide an improved measure of security. For an attacker to succeed, they must compromise several different parties, rather than a central authority. + +In many ways, this popular DEX model is an improvement over the CEX model, and this is why many CEX's are expanding into this territory. Users have control over their IOUs, making them responsible for individual attacks, rather than the exchange owners. The risk of an exchange-wide attack is also shared across multiple parties. + +### The Decentralized Gateway + +| Pros | Cons | +| ---- | ---- | +| Tokens can be issued for any asset, including both cryptocurrency and fiat | This method requires a wide network of trustworthy and technically proficient business partners | +| Users maintain ownership over their IOUs at all times, limiting attackers' capabilities | All true assets are still in the ownership of a small group of people, albeit somewhat decentralized, and therefore susceptible to attacks, errors, and corruption | +| IOUs are on-chain, and therefore buying and selling funds can be performed at high speeds | Maintenance and improvements to the DEX are highly technical, time consuming, and cost prohibitive | + +For a developer and entrepreneur, the DEX method is more secure than the CEX model, but there remain many difficulties on technical and political levels. The entrepreneur must find trustworthy partners to be co-owners of the multi-signature address. The developer must ensure that their partners' infrastructure and other technical contributions are secure, as a failure by the partners can reflect poorly on the developer and entrepreneur's own brand. + +Furthermore, from the user's perspective, the primary danger persists in this DEX model. Once the user sends their assets to the gateway, the user loses control and responsibility over their true assets. + +## Atomic Swaps are a Significantly Superior Basis for Exchange + +What if there was a way to trade different types of cryptocurrencies without the user ever transferring control until the trade is complete? Could a user keep the private keys to their assets, and only deal directly with their trading partner and not with a third party? + +This is the idea of an atomic swap. It is simply a trade of assets between two users where, assuming both behave honestly, ownership over the assets is not released until both sides are secure in receiving a fair outcome. If one side tries to cheat or makes any kind of mistake, they cannot receive a financial reward from it, and the non-offending side cannot be penalized or lose their funds. + +An atomic swap can do everything else that both the DEX and CEX models can do. Atomic swaps can be conducted quickly; users may form networks of high liquidity trading; nearly all types of cryptocurrencies can be exchanged. + +However, the nature of an atomic swap is unique in comparison with the opposing models, as an atomic swap does not require third-party intervention. This can provide simplicity for both the user, the entrepreneur, and even the developer. Depending on the application, the cost may also be dramatically cheaper, as far less infrastructure and manpower is required. + +### Technical Comparisons + +| Capability | Atomic Swap | Decentralized Gateway | Centralized Exchange | +| ---------- | ----------- | --------------------- | -------------------- | +| Third party is not required | Yes: The entire exchange happens between two users; no third party is required | No: The exchange relies on a decentralized network of gateway nodes, who must be trusted | No: Users depend on a centralized company to maintain and secure their funds | +| An exchange can be set up by anyone | Yes: Requires only two users and an Internet connection | No: Requires sufficient technical knowledge, funding, and committed business partners to serve as gateway nodes | No: Requires sufficient technical knowledge, funding, and a higher level of business and legal knowledge | +| Users maintain control over the funds throughout the process | Yes: Users maintain control over their funds until the trade is completed, at which point ownership is swapped atomically | No: Users relinquish ownership to the gateway nodes, although users do hold private keys to IOUs | No: Once the user sends funds to the CEX, they only own their funds in theory until the funds are returned | +| User funds remain distributed and decentralized throughout process | Yes: As users maintain ownership over their funds at all times, all funds in the exchange process are never in a central location | No: User funds are held in a collection of multi-signature addresses that are maintained by a small group of people | No: User funds are held in a centralized database, managed by company employees | + +This is probably enough to get the basic idea. If the reader desires a more thorough understanding of the atomic swap process, read Part III of [the Komodo whitepaper,](https://komodoplatform.com/whitepaper) or [this blog post for a condensed explanation.](https://komodoplatform.com/atomic-swaps/) + +The underlying ideas of atomic swaps were invented by Tier Nolan in 2013. He posted his ideas on an online community forum where Komodo's lead developer and primary visionary, JL777, or "James" for short, was also exploring blockchain technology. Here’s where Komodo enters the picture. + +### Komodo's Leadership in Atomic-Swap Technology + +Upon reading Nolan’s discussion, James began experimenting. In April 2014 he wrote his first experimental software for allowing anonymous users on the Internet to conduct on-chain atomic swaps between two assets on the NXT blockchain. + +In September 2015, James performed an experimental atomic swap between Bitcoin and NXT. Like all Bitcoin-based atomic swaps performed during this time period, James's atomic swap could not be considered secure as Bitcoin software lacked a feature called "Check Lock Time Verify." This feature was added in November 2015, and James performed a secure atomic swap shortly thereafter. + +At this time, James also began the creation of his current endeavor, the Komodo ecosystem. Additional team members were hired, money was raised, and large-scale software and company development began. + +From its foundation, the Komodo ecosystem is designed to facilitate blockchain interoperability and scalability, and our atomic-swap software plays a key role. In August 2017, Komodo released version 1.0 of the first atomic-swap based DEX to the public. Releasing this entirely new DEX software to the masses was an endeavor many years in the making, and countless volunteer developers and other dreamers contributed. + +Upon release of Komodo’s DEX 1.0, hundreds of members of the Komodo open-source community collectively performed over 100,000 atomic swaps. It was the first time in history that users with no coding knowledge could trade assets without either a third-party acting as an arbiter, or even without any public knowledge of who was trading with whom. + +Another point to mention is that while AtomicDEX is built upon atomic swaps, other software in the Komodo ecosystem is able to perform the rest of the functionality necessary to run other types of decentralized exchanges. As all Komodo software is natively integrated, this provides the Komodo entrepreneur with perhaps the widest range of DEX software packages in existence. + +### Capabilities of Komodo Software + +| Atomic Swaps | Decentralized Gateway | On-Chain Token Exchange | Cross-Chain Asset Transfers | ... and more! | +| -- | -- | -- | -- | -- | +| Check! | Check! | Check! | Check! | Check! | + +Today, Komodo developers took what they learned from version 1.0 and rewrote the code from the ground up to enhance essentially all aspects of the user experience. This is the AtomicDEX 2.0 software. Komodo is also partnered with Ideas By Nature, a UX/UI design and development firm, to create a well designed atomic-swap trading experience. + +Recently, yet again Komodo forged into new territory with atomic swaps. In February of 2019, the Komodo team performed the first mobile-based atomic swap. The mobile version of AtomicDEX is available for Android and iOS devices, and the software interfaces seamlessly with our desktop software. + +While the code behind Komodo's technology is complex, the good news is, the code takes care of itself. A developer and entrepreneur building on Komodo can simply fire up the software and access its functionalities through the API. + +## AtomicDEX Software is an Industry-Wide Invitation + +AtomicDEX is open source, meaning that we do not keep the software's source code private. Also, the Komodo team is creating a network that is open to other financially motivated businesses and organizations seeking profit in the cryptocurrency-exchange industry. + +Many opportunities are available for cryptocurrency-exchange entrepreneurs to build their own audiences and businesses using Komodo software. Entrepreneurs can create their own market places on the main Komodo network for trading, or they can create their own private and public networks. Developers can use Komodo's back-end software API to feature atomic-swap DEX functionality in their existing or upcoming software innovations, including mobile software. Enterprise and other large-scale companies can reach out to Komodo for integration with Komodo technology, or even for consulting services. + +[Please reach out to the Komodo team for further information.](https://komodoplatform.com/contact-us/) + diff --git a/utils/parse_api_docs.py b/utils/parse_api_docs.py deleted file mode 100755 index c89b006d4..000000000 --- a/utils/parse_api_docs.py +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env python3 -import os -import sys -import json -import urllib.request - -userpass="userpass" -REPO = "KomodoPlatform" -BRANCH = "master" - -SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)) -BASE_URL = f'https://raw.githubusercontent.com/{REPO}/developer-docs/{BRANCH}/docs/basic-docs/atomicdex' -API_DOCS_PATH = f"{os.path.expanduser('~')}/GITHUB/KP/developer-docs/docs/basic-docs/atomicdex" - -legacy_methods_files = ["atomicdex-api.md"] -v2_methods_files = [ - "trade_preimage.md", - "withdraw.md", - "add_node_to_version_stat.md", - "remove_node_from_version_stat.md", - "start_version_stat_collection.md" -] - - - -for fn in legacy_methods_files: - url = f"{BASE_URL}/{fn}" - urllib.request.urlretrieve(url, f"{SCRIPT_PATH}/{fn}") - reading = False - reading_command = True - with open(f"{SCRIPT_PATH}/{fn}", "r") as f: - # strip everything not within ``` - lines = f.readlines() - json_bits = '' - for line in lines: - if '```' in line: - if not reading: - reading = True - else: - reading = False - elif reading and line != '': - json_bits += line.strip() - - - json_bits = json_bits.replace( - 'curl --url "http://127.0.0.1:7783" --data ', '' - ).replace( - 'curl --url "http://127.0.0.1:7783/" --data ', '' - ).replace( - '""$userpass""', '"userpass"' - ).replace( - "'$userpass'", "'userpass'" - ).replace( - "$userpass", "userpass" - ).replace( - "'{", "{" - ).replace( - "}'", "}" - ).replace( - '"{', "{" - ).replace( - '}"', "}" - ).replace( - '"[', '[' - ).replace( - ']"', ']' - ).replace( - '\\"', '"' - ).replace( - ',}', '}' - ).replace( - ',]', ']' - ).replace( - '"\'userpass\'"', '"userpass"' - ).replace( - '}mm2" : 1{', '}{' - ).replace( - '}logevents=1txindex=1addressindex=1{', '}{' - ).replace( - 'taker_swap:547] "taker_swap:543] timeout (180.0 > 180.0)"', 'taker_swap:547] taker_swap:543] timeout (180.0 > 180.0)' - ).replace( - '"lp_swap:1981] utxo:891] rpc_clients:738] JsonRpcError { request: JsonRpcRequest { jsonrpc: "2.0", id: "67", method: "blockchain.transaction.broadcast", params: [String("0400008085202f890182b342c114f806c5325f23f7e78dae5d186221ab502c86302c2c8082fa110f0a00000000d7473044022035791ea5548f87484065c9e1f0bdca9ebc699f2c7f51182c84f360102e32dc3d02200612ed53bca52d9c2568437f087598531534badf26229fe0f652ea72ddf03ca501201b8886b8a2cdb62505699400b694ac20f04d7bd4abd80e1ab154aa8d861fc093004c6b630420c1395db17521031bb83b58ec130e28e0a6d5d2acf2eb01b0d3f1670e021d47d31db8a858219da8ac6782012088a9143669eb83a007a3c507448d79f45a9f06ec2f36a888210326846707a52a233cfc49a61ef51b1698bbe6aa78fa8b8d411c02743c09688f0aac68ffffffff01460ec000000000001976a914444f0e1099709ba4d742454a7d98a5c9c162ceab88ac967e395d000000000000000000000000000000")] }, error: Transport("rpc_clients:668] All electrums are currently disconnected") }', '"nothing to see here"' - ).replace( - '"lp_swap:1888] eth:654] RPC error: Error { code: ServerError(-32010), message: "Transaction with the same hash was already imported.", data: None }', '"nothing to see here"' - ) - - - - - - i = 0 - json_bits_list = json_bits.split("}{") - for bit in json_bits_list: - if i == 0: - json_bits_list[i] = bit+"}" - elif i == len(json_bits_list)-1: - json_bits_list[i] = "{"+bit - else: - json_bits_list[i] = "{"+bit+"}" - i += 1 - - i = 0 - j = 0 - sub_bits_list = [] - for bit in json_bits_list: - #print(bit) - if "][" in json_bits_list[i]: - sub_bits_list = json_bits_list[i].split("][") - for sub_bit in sub_bits_list: - if j == 0: - sub_bits_list[j] = sub_bit+"]" - elif j == len(sub_bits_list)-1: - sub_bits_list[j] = "["+sub_bit - else: - sub_bits_list[j] = "["+sub_bit+"]" - j += 1 - - json_bits_list[i] = None - i += 1 - json_bits_list += sub_bits_list - - - i = 0 - j = 0 - sub_bits_list = [] - for bit in json_bits_list: - if json_bits_list[i]: - if "]{" in json_bits_list[i]: - sub_bits_list = json_bits_list[i].split("]{") - - for sub_bit in sub_bits_list: - if j == 0: - sub_bits_list[j] = sub_bit+"]" - elif j == len(sub_bits_list)-1: - sub_bits_list[j] = "{"+sub_bit - else: - sub_bits_list[j] = "{"+sub_bit+"]" - j += 1 - - json_bits_list[i] = None - i += 1 - - json_bits_list += sub_bits_list - - - i = 0 - j = 0 - sub_bits_list = [] - for bit in json_bits_list: - if json_bits_list[i]: - if "}[" in json_bits_list[i]: - sub_bits_list = json_bits_list[i].split("}[") - - for sub_bit in sub_bits_list: - if j == 0: - sub_bits_list[j] = sub_bit+"}" - elif j == len(sub_bits_list)-1: - sub_bits_list[j] = "["+sub_bit - else: - sub_bits_list[j] = "["+sub_bit+"}" - j += 1 - - json_bits_list[i] = None - i += 1 - - json_bits_list += sub_bits_list - - - with open(f"{SCRIPT_PATH}/parsed_methods_{fn}", "w+") as parsed_methods: - with open(f"{SCRIPT_PATH}/parsed_responses_{fn}", "w+") as parsed_responses: - for bit in json_bits_list: - if bit: - try: - if "method" in bit: - print(json.loads(bit)) - parsed_methods.write(line) - else: - parsed_responses.write(line) - - except Exception as e: - print(e) - print(bit) - sys.exit() - - os.remove(f"{SCRIPT_PATH}/{fn}") diff --git a/yarn.lock b/yarn.lock index 91fa473f2..4aed900eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,426 +2,405 @@ # yarn lockfile v1 -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== - dependencies: - "@jridgewell/gen-mapping" "^0.1.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/highlight" "^7.12.13" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.0", "@babel/compat-data@^7.20.1": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733" - integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g== +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.15", "@babel/compat-data@^7.13.8", "@babel/compat-data@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.0.tgz#a901128bce2ad02565df95e6ecbf195cf9465919" + integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q== "@babel/core@^7.11.0", "@babel/core@^7.8.4": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.5.tgz#45e2114dc6cd4ab167f81daf7820e8fa1250d113" - integrity sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.5" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-module-transforms" "^7.20.2" - "@babel/helpers" "^7.20.5" - "@babel/parser" "^7.20.5" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.0.tgz#47299ff3ec8d111b493f1a9d04bf88c04e728d88" + integrity sha512-8YqpRig5NmIHlMLw09zMlPTvUVMILjqCOtVgu+TVNWEBvy9b5I3RRyhqnrV4hjgEK7n8P9OqvkWJAFmEL6Wwfw== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.0" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-module-transforms" "^7.14.0" + "@babel/helpers" "^7.14.0" + "@babel/parser" "^7.14.0" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.1" + json5 "^2.1.2" semver "^6.3.0" + source-map "^0.5.0" -"@babel/generator@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.5.tgz#cb25abee3178adf58d6814b68517c62bdbfdda95" - integrity sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA== +"@babel/generator@^7.14.0": + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.1.tgz#1f99331babd65700183628da186f36f63d615c93" + integrity sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ== dependencies: - "@babel/types" "^7.20.5" - "@jridgewell/gen-mapping" "^0.3.2" + "@babel/types" "^7.14.1" jsesc "^2.5.1" + source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== +"@babel/helper-annotate-as-pure@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" + integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.12.13" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" - integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz#6bc20361c88b0a74d05137a65cac8d3cbf6f61fc" + integrity sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA== dependencies: - "@babel/helper-explode-assignable-expression" "^7.18.6" - "@babel/types" "^7.18.9" + "@babel/helper-explode-assignable-expression" "^7.12.13" + "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.0", "@babel/helper-compilation-targets@^7.9.6": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" - integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.16", "@babel/helper-compilation-targets@^7.13.8", "@babel/helper-compilation-targets@^7.9.6": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" + integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== dependencies: - "@babel/compat-data" "^7.20.0" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" + "@babel/compat-data" "^7.13.15" + "@babel/helper-validator-option" "^7.12.17" + browserslist "^4.14.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.5.tgz#327154eedfb12e977baa4ecc72e5806720a85a06" - integrity sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-member-expression-to-functions" "^7.18.9" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.19.1" - "@babel/helper-split-export-declaration" "^7.18.6" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" - integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.2.1" - -"@babel/helper-define-polyfill-provider@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" - integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== - dependencies: - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-plugin-utils" "^7.16.7" +"@babel/helper-create-class-features-plugin@^7.13.0", "@babel/helper-create-class-features-plugin@^7.13.11", "@babel/helper-create-class-features-plugin@^7.14.0": + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz#1fe11b376f3c41650ad9fedc665b0068722ea76c" + integrity sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-member-expression-to-functions" "^7.13.12" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-split-export-declaration" "^7.12.13" + +"@babel/helper-create-regexp-features-plugin@^7.12.13": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz#a2ac87e9e319269ac655b8d4415e94d38d663cb7" + integrity sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.12.13" + regexpu-core "^4.7.1" + +"@babel/helper-define-polyfill-provider@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz#a640051772045fedaaecc6f0c6c69f02bdd34bf1" + integrity sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw== + dependencies: + "@babel/helper-compilation-targets" "^7.13.0" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/traverse" "^7.13.0" debug "^4.1.1" lodash.debounce "^4.0.8" resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-explode-assignable-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" - integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== +"@babel/helper-explode-assignable-expression@^7.12.13": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz#17b5c59ff473d9f956f40ef570cf3a76ca12657f" + integrity sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA== dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-member-expression-to-functions@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz#1531661e8375af843ad37ac692c132841e2fd815" - integrity sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg== - dependencies: - "@babel/types" "^7.18.9" - -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.8.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" - integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.1" - "@babel/types" "^7.20.2" - -"@babel/helper-optimise-call-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" - integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== - -"@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" - integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-wrap-function" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz#e1592a9b4b368aa6bdb8784a711e0bcbf0612b78" - integrity sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-member-expression-to-functions" "^7.18.9" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/traverse" "^7.19.1" - "@babel/types" "^7.19.0" - -"@babel/helper-simple-access@^7.19.4", "@babel/helper-simple-access@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" - integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== - dependencies: - "@babel/types" "^7.20.2" - -"@babel/helper-skip-transparent-expression-wrappers@^7.18.9": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" - integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== - dependencies: - "@babel/types" "^7.20.0" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== - -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== - -"@babel/helper-wrap-function@^7.18.9": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" - integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== - dependencies: - "@babel/helper-function-name" "^7.19.0" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - -"@babel/helpers@^7.20.5": - version "7.20.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.6.tgz#e64778046b70e04779dfbdf924e7ebb45992c763" - integrity sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" + "@babel/types" "^7.13.0" -"@babel/parser@^7.18.10", "@babel/parser@^7.18.4", "@babel/parser@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" - integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== +"@babel/helper-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" + integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.12.13" -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" - integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/types" "^7.12.13" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.9.tgz#a11af19aa373d68d561f08e0a57242350ed0ec50" - integrity sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg== +"@babel/helper-hoist-variables@^7.13.0": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz#1b1651249e94b51f8f0d33439843e33e39775b30" + integrity sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" - "@babel/plugin-proposal-optional-chaining" "^7.18.9" + "@babel/traverse" "^7.13.15" + "@babel/types" "^7.13.16" -"@babel/plugin-proposal-async-generator-functions@^7.20.1": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.1.tgz#352f02baa5d69f4e7529bdac39aaa02d41146af9" - integrity sha512-Gh5rchzSwE4kC+o/6T8waD0WHEQIsDmjltY8WnWRXHUdH8axZhuH86Ov9M72YhJfDrZseQwuuWaaIT/TmePp3g== +"@babel/helper-member-expression-to-functions@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" + integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/types" "^7.13.12" + +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12", "@babel/helper-module-imports@^7.8.3": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz#8fcf78be220156f22633ee204ea81f73f826a8ad" + integrity sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw== + dependencies: + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-simple-access" "^7.13.12" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-validator-identifier" "^7.14.0" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" + +"@babel/helper-optimise-call-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" + integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== + +"@babel/helper-remap-async-to-generator@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz#376a760d9f7b4b2077a9dd05aa9c3927cadb2209" + integrity sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-wrap-function" "^7.13.0" + "@babel/types" "^7.13.0" + +"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.0", "@babel/helper-replace-supers@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" + integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.13.12" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.12" + +"@babel/helper-simple-access@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" + integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-skip-transparent-expression-wrappers@^7.12.1": + version "7.12.1" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz#462dc63a7e435ade8468385c63d2b84cce4b3cbf" + integrity sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA== + dependencies: + "@babel/types" "^7.12.1" + +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-validator-identifier@^7.12.11", "@babel/helper-validator-identifier@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== + +"@babel/helper-validator-option@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== + +"@babel/helper-wrap-function@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz#bdb5c66fda8526ec235ab894ad53a1235c79fcc4" + integrity sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA== + dependencies: + "@babel/helper-function-name" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" + +"@babel/helpers@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.0.tgz#ea9b6be9478a13d6f961dbb5f36bf75e2f3b8f62" + integrity sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg== + dependencies: + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.14.0" + +"@babel/highlight@^7.12.13": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" + integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.0" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.12.13", "@babel/parser@^7.14.0": + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.1.tgz#1bd644b5db3f5797c4479d89ec1817fe02b84c47" + integrity sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q== + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz#a3484d84d0b549f3fc916b99ee4783f26fabad2a" + integrity sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ== + dependencies: + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.13.12" + +"@babel/plugin-proposal-async-generator-functions@^7.13.15": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz#80e549df273a3b3050431b148c892491df1bcc5b" + integrity sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA== + dependencies: + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-remap-async-to-generator" "^7.13.0" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.18.6", "@babel/plugin-proposal-class-properties@^7.8.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== +"@babel/plugin-proposal-class-properties@^7.13.0", "@babel/plugin-proposal-class-properties@^7.8.3": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz#146376000b94efd001e57a40a88a525afaab9f37" + integrity sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-proposal-class-static-block@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.6.tgz#8aa81d403ab72d3962fc06c26e222dacfc9b9020" - integrity sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw== +"@babel/plugin-proposal-class-static-block@^7.13.11": + version "7.13.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.13.11.tgz#6fcbba4a962702c17e5371a0c7b39afde186d703" + integrity sha512-fJTdFI4bfnMjvxJyNuaf8i9mVcZ0UhetaGEUHaHV9KEnibLugJkZAtXikR8KcYj+NYmI4DZMS8yQAyg+hvfSqg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-class-static-block" "^7.12.13" "@babel/plugin-proposal-decorators@^7.8.3": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.20.5.tgz#28ba1a0e5044664a512967a19407d7fc26925394" - integrity sha512-Lac7PpRJXcC3s9cKsBfl+uc+DYXU5FD06BrTFunQO6QIQT+DwyzDPURAowI3bcvD1dZF/ank1Z5rstUJn3Hn4Q== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-replace-supers" "^7.19.1" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/plugin-syntax-decorators" "^7.19.0" - -"@babel/plugin-proposal-dynamic-import@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" - integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.13.15.tgz#e91ccfef2dc24dd5bd5dcc9fc9e2557c684ecfb8" + integrity sha512-ibAMAqUm97yzi+LPgdr5Nqb9CMkeieGHvwPg1ywSGjZrZHQEGqE01HmOio8kxRpA/+VtOHouIVy2FMpBbtltjA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.13.11" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-decorators" "^7.12.13" + +"@babel/plugin-proposal-dynamic-import@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz#876a1f6966e1dec332e8c9451afda3bebcdf2e1d" + integrity sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ== + dependencies: + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" - integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== +"@babel/plugin-proposal-export-namespace-from@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz#393be47a4acd03fa2af6e3cde9b06e33de1b446d" + integrity sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" - integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== +"@babel/plugin-proposal-json-strings@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz#bf1fb362547075afda3634ed31571c5901afef7b" + integrity sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.9.tgz#8148cbb350483bf6220af06fa6db3690e14b2e23" - integrity sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q== +"@babel/plugin-proposal-logical-assignment-operators@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz#93fa78d63857c40ce3c8c3315220fd00bfbb4e1a" + integrity sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" - integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz#3730a31dafd3c10d8ccd10648ed80a2ac5472ef3" + integrity sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" - integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== +"@babel/plugin-proposal-numeric-separator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz#bd9da3188e787b5120b4f9d465a8261ce67ed1db" + integrity sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.2.tgz#a556f59d555f06961df1e572bb5eca864c84022d" - integrity sha512-Ks6uej9WFK+fvIMesSqbAto5dD8Dz4VuuFvGJFKgIGSkJuRGcrwGECPA1fDgQK3/DbExBJpEkTeYeB8geIFCSQ== +"@babel/plugin-proposal-object-rest-spread@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz#5d210a4d727d6ce3b18f9de82cc99a3964eed60a" + integrity sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g== dependencies: - "@babel/compat-data" "^7.20.1" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/compat-data" "^7.13.8" + "@babel/helper-compilation-targets" "^7.13.8" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.20.1" + "@babel/plugin-transform-parameters" "^7.13.0" -"@babel/plugin-proposal-optional-catch-binding@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" - integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== +"@babel/plugin-proposal-optional-catch-binding@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz#3ad6bd5901506ea996fc31bdcf3ccfa2bed71107" + integrity sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz#e8e8fe0723f2563960e4bf5e9690933691915993" - integrity sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w== +"@babel/plugin-proposal-optional-chaining@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz#ba9feb601d422e0adea6760c2bd6bbb7bfec4866" + integrity sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" - integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== +"@babel/plugin-proposal-private-methods@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz#04bd4c6d40f6e6bbfa2f57e2d8094bad900ef787" + integrity sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-proposal-private-property-in-object@^7.18.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135" - integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ== +"@babel/plugin-proposal-private-property-in-object@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.0.tgz#b1a1f2030586b9d3489cc26179d2eb5883277636" + integrity sha512-59ANdmEwwRUkLjB7CRtwJxxwtjESw+X2IePItA+RGQh+oy5RmpCh/EvVVvh5XQc3yxsm5gtv0+i9oBZhaDNVTg== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-create-class-features-plugin" "^7.14.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-private-property-in-object" "^7.14.0" -"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" - integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== +"@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba" + integrity sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -437,19 +416,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== +"@babel/plugin-syntax-class-static-block@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.12.13.tgz#8e3d674b0613e67975ceac2776c97b60cafc5c9c" + integrity sha512-ZmKQ0ZXR0nYpHZIIuj9zE7oIqCx2hw9TKi+lIo73NNrMPAZGHfS92/VRV0ZmPj6H2ffBgyFHXvJ5NYsNeEaP2A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-decorators@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.19.0.tgz#5f13d1d8fce96951bea01a10424463c9a5b3a599" - integrity sha512-xaBZUEDntt4faL1yN8oIFlhfXeQAWJW7CLKYsHTUqriCUbj8xOra8bfxxKGi/UwExPFBuPdH4XfHc9rGQhrVkQ== +"@babel/plugin-syntax-decorators@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.12.13.tgz#fac829bf3c7ef4a1bc916257b403e58c6bdaf648" + integrity sha512-Rw6aIXGuqDLr6/LoBBYE57nKOzQpz/aDkKlMqEwH+Vp0MXbG6H/TfRjaY343LKxzAKAMXIHsQ8JzaZKuDZ9MwA== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" @@ -465,13 +444,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-assertions@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" - integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== - dependencies: - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" @@ -480,11 +452,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.2.0", "@babel/plugin-syntax-jsx@^7.8.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" - integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.13.tgz#044fb81ebad6698fe62c478875575bcbb9b70f15" + integrity sha512-d4HM23Q1K7oq/SLNmG6mRt85l2csmQ0cHRaxRXjKW0YFdEXqlZ5kzFQKH5Uc3rDJECgu+yCRgPkG04Mm98R/1g== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -528,314 +500,310 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== +"@babel/plugin-syntax-private-property-in-object@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.0.tgz#762a4babec61176fec6c88480dec40372b140c0b" + integrity sha512-bda3xF8wGl5/5btF794utNOL0Jw+9jE5C1sLZcoK7c4uonE/y3iQiyG+KbkF3WBV/paX58VCpjhxLPkdj5Fe4w== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== +"@babel/plugin-syntax-top-level-await@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" + integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-arrow-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz#19063fcf8771ec7b31d742339dac62433d0611fe" - integrity sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ== +"@babel/plugin-transform-arrow-functions@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz#10a59bebad52d637a027afa692e8d5ceff5e3dae" + integrity sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-async-to-generator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz#ccda3d1ab9d5ced5265fdb13f1882d5476c71615" - integrity sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag== +"@babel/plugin-transform-async-to-generator@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz#8e112bf6771b82bf1e974e5e26806c5c99aa516f" + integrity sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg== dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-remap-async-to-generator" "^7.18.6" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-remap-async-to-generator" "^7.13.0" -"@babel/plugin-transform-block-scoped-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" - integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== +"@babel/plugin-transform-block-scoped-functions@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz#a9bf1836f2a39b4eb6cf09967739de29ea4bf4c4" + integrity sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-block-scoping@^7.20.2": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.5.tgz#401215f9dc13dc5262940e2e527c9536b3d7f237" - integrity sha512-WvpEIW9Cbj9ApF3yJCjIEEf1EiNJLtXagOrL5LNWEZOo3jv8pmPoYTSNJQvqej8OavVlgOoOPw6/htGZro6IkA== +"@babel/plugin-transform-block-scoping@^7.14.1": + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.1.tgz#ac1b3a8e3d8cbb31efc6b9be2f74eb9823b74ab2" + integrity sha512-2mQXd0zBrwfp0O1moWIhPpEeTKDvxyHcnma3JATVP1l+CctWBuot6OJG8LQ4DnBj4ZZPSmlb/fm4mu47EOAnVA== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-classes@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.2.tgz#c0033cf1916ccf78202d04be4281d161f6709bb2" - integrity sha512-9rbPp0lCVVoagvtEyQKSo5L8oo0nQS/iif+lwlAz29MccX2642vWDlSZK+2T2buxbopotId2ld7zZAzRfz9j1g== +"@babel/plugin-transform-classes@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b" + integrity sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-replace-supers" "^7.19.1" - "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-replace-supers" "^7.13.0" + "@babel/helper-split-export-declaration" "^7.12.13" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.9.tgz#2357a8224d402dad623caf6259b611e56aec746e" - integrity sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw== +"@babel/plugin-transform-computed-properties@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz#845c6e8b9bb55376b1fa0b92ef0bdc8ea06644ed" + integrity sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-destructuring@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.2.tgz#c23741cfa44ddd35f5e53896e88c75331b8b2792" - integrity sha512-mENM+ZHrvEgxLTBXUiQ621rRXZes3KWUv6NdQlrnr1TkWVw+hUjQBZuP2X32qKlrlG2BzgR95gkuCRSkJl8vIw== +"@babel/plugin-transform-destructuring@^7.13.17": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz#678d96576638c19d5b36b332504d3fd6e06dea27" + integrity sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" - integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== +"@babel/plugin-transform-dotall-regex@^7.12.13", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz#3f1601cc29905bfcb67f53910f197aeafebb25ad" + integrity sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-duplicate-keys@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" - integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== +"@babel/plugin-transform-duplicate-keys@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz#6f06b87a8b803fd928e54b81c258f0a0033904de" + integrity sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-exponentiation-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" - integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== +"@babel/plugin-transform-exponentiation-operator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz#4d52390b9a273e651e4aba6aee49ef40e80cd0a1" + integrity sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-for-of@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" - integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== +"@babel/plugin-transform-for-of@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz#c799f881a8091ac26b54867a845c3e97d2696062" + integrity sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" - integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== +"@babel/plugin-transform-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz#bb024452f9aaed861d374c8e7a24252ce3a50051" + integrity sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ== dependencies: - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" - integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== +"@babel/plugin-transform-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz#2ca45bafe4a820197cf315794a4d26560fe4bdb9" + integrity sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-member-expression-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" - integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== +"@babel/plugin-transform-member-expression-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz#5ffa66cd59b9e191314c9f1f803b938e8c081e40" + integrity sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-modules-amd@^7.19.6": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.19.6.tgz#aca391801ae55d19c4d8d2ebfeaa33df5f2a2cbd" - integrity sha512-uG3od2mXvAtIFQIh0xrpLH6r5fpSQN04gIVovl+ODLdUMANokxQLZnPBHcjmv3GxRjnqwLuHvppjjcelqUFZvg== +"@babel/plugin-transform-modules-amd@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz#589494b5b290ff76cf7f59c798011f6d77026553" + integrity sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ== dependencies: - "@babel/helper-module-transforms" "^7.19.6" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-module-transforms" "^7.14.0" + "@babel/helper-plugin-utils" "^7.13.0" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.19.6": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.19.6.tgz#25b32feef24df8038fc1ec56038917eacb0b730c" - integrity sha512-8PIa1ym4XRTKuSsOUXqDG0YaOlEuTVvHMe5JCfgBMOtHvJKw/4NGovEGN33viISshG/rZNVrACiBmPQLvWN8xQ== +"@babel/plugin-transform-modules-commonjs@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz#52bc199cb581e0992edba0f0f80356467587f161" + integrity sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ== dependencies: - "@babel/helper-module-transforms" "^7.19.6" - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/helper-simple-access" "^7.19.4" + "@babel/helper-module-transforms" "^7.14.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-simple-access" "^7.13.12" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.19.6": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.6.tgz#59e2a84064b5736a4471b1aa7b13d4431d327e0d" - integrity sha512-fqGLBepcc3kErfR9R3DnVpURmckXP7gj7bAlrTQyBxrigFqszZCkFkcoxzCp2v32XmwXLvbw+8Yq9/b+QqksjQ== +"@babel/plugin-transform-modules-systemjs@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz#6d066ee2bff3c7b3d60bf28dec169ad993831ae3" + integrity sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A== dependencies: - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.19.6" - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-hoist-variables" "^7.13.0" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-identifier" "^7.12.11" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" - integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== +"@babel/plugin-transform-modules-umd@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz#2f8179d1bbc9263665ce4a65f305526b2ea8ac34" + integrity sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-module-transforms" "^7.14.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.19.1": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" - integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz#2213725a5f5bbbe364b50c3ba5998c9599c5c9d9" + integrity sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.20.5" - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" -"@babel/plugin-transform-new-target@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" - integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== +"@babel/plugin-transform-new-target@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz#e22d8c3af24b150dd528cbd6e685e799bf1c351c" + integrity sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-object-super@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" - integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== +"@babel/plugin-transform-object-super@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz#b4416a2d63b8f7be314f3d349bd55a9c1b5171f7" + integrity sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" -"@babel/plugin-transform-parameters@^7.20.1": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.5.tgz#f8f9186c681d10c3de7620c916156d893c8a019e" - integrity sha512-h7plkOmcndIUWXZFLgpbrh2+fXAi47zcUX7IrOQuZdLD0I0KvjJ6cvo3BEcAOsDOcZhVKGJqv07mkSqK0y2isQ== +"@babel/plugin-transform-parameters@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz#8fa7603e3097f9c0b7ca1a4821bc2fb52e9e5007" + integrity sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-property-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" - integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== +"@babel/plugin-transform-property-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz#4e6a9e37864d8f1b3bc0e2dce7bf8857db8b1a81" + integrity sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-regenerator@^7.18.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" - integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== +"@babel/plugin-transform-regenerator@^7.13.15": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz#e5eb28945bf8b6563e7f818945f966a8d2997f39" + integrity sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" - regenerator-transform "^0.15.1" + regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" - integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== +"@babel/plugin-transform-reserved-words@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz#7d9988d4f06e0fe697ea1d9803188aa18b472695" + integrity sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-transform-runtime@^7.11.0": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.19.6.tgz#9d2a9dbf4e12644d6f46e5e75bfbf02b5d6e9194" - integrity sha512-PRH37lz4JU156lYFW1p8OxE5i7d6Sl/zV58ooyr+q1J1lnQPyg5tIiXlIwNVhJaY4W3TmOtdc8jqdXQcB1v5Yw== - dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.19.0" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.13.15.tgz#2eddf585dd066b84102517e10a577f24f76a9cd7" + integrity sha512-d+ezl76gx6Jal08XngJUkXM4lFXK/5Ikl9Mh4HKDxSfGJXmZ9xG64XT2oivBzfxb/eQ62VfvoMkaCZUKJMVrBA== + dependencies: + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-plugin-utils" "^7.13.0" + babel-plugin-polyfill-corejs2 "^0.2.0" + babel-plugin-polyfill-corejs3 "^0.2.0" + babel-plugin-polyfill-regenerator "^0.2.0" semver "^6.3.0" -"@babel/plugin-transform-shorthand-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" - integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== +"@babel/plugin-transform-shorthand-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz#db755732b70c539d504c6390d9ce90fe64aff7ad" + integrity sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-spread@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.19.0.tgz#dd60b4620c2fec806d60cfaae364ec2188d593b6" - integrity sha512-RsuMk7j6n+r752EtzyScnWkQyuJdli6LdO5Klv8Yx0OfPVTcQkIUfS8clx5e9yHXzlnhOZF3CbQ8C2uP5j074w== +"@babel/plugin-transform-spread@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz#84887710e273c1815ace7ae459f6f42a5d31d5fd" + integrity sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" -"@babel/plugin-transform-sticky-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" - integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== +"@babel/plugin-transform-sticky-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz#760ffd936face73f860ae646fb86ee82f3d06d1f" + integrity sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-template-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" - integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== +"@babel/plugin-transform-template-literals@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz#a36049127977ad94438dee7443598d1cefdf409d" + integrity sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-typeof-symbol@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" - integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== +"@babel/plugin-transform-typeof-symbol@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz#785dd67a1f2ea579d9c2be722de8c84cb85f5a7f" + integrity sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-unicode-escapes@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" - integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== +"@babel/plugin-transform-unicode-escapes@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz#840ced3b816d3b5127dd1d12dcedc5dead1a5e74" + integrity sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-unicode-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" - integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== +"@babel/plugin-transform-unicode-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz#b52521685804e155b1202e83fc188d34bb70f5ac" + integrity sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/preset-env@^7.11.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.20.2.tgz#9b1642aa47bb9f43a86f9630011780dab7f86506" - integrity sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg== - dependencies: - "@babel/compat-data" "^7.20.1" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-async-generator-functions" "^7.20.1" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.18.6" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.9" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.20.2" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.18.6" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.1.tgz#b55914e2e68885ea03f69600b2d3537e54574a93" + integrity sha512-0M4yL1l7V4l+j/UHvxcdvNfLB9pPtIooHTbEhgD/6UGyh8Hy3Bm1Mj0buzjDXATCSz3JFibVdnoJZCrlUCanrQ== + dependencies: + "@babel/compat-data" "^7.14.0" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-option" "^7.12.17" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.13.12" + "@babel/plugin-proposal-async-generator-functions" "^7.13.15" + "@babel/plugin-proposal-class-properties" "^7.13.0" + "@babel/plugin-proposal-class-static-block" "^7.13.11" + "@babel/plugin-proposal-dynamic-import" "^7.13.8" + "@babel/plugin-proposal-export-namespace-from" "^7.12.13" + "@babel/plugin-proposal-json-strings" "^7.13.8" + "@babel/plugin-proposal-logical-assignment-operators" "^7.13.8" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.13.8" + "@babel/plugin-proposal-numeric-separator" "^7.12.13" + "@babel/plugin-proposal-object-rest-spread" "^7.13.8" + "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" + "@babel/plugin-proposal-optional-chaining" "^7.13.12" + "@babel/plugin-proposal-private-methods" "^7.13.0" + "@babel/plugin-proposal-private-property-in-object" "^7.14.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-class-static-block" "^7.12.13" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.20.0" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" @@ -843,52 +811,52 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.18.6" - "@babel/plugin-transform-async-to-generator" "^7.18.6" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.20.2" - "@babel/plugin-transform-classes" "^7.20.2" - "@babel/plugin-transform-computed-properties" "^7.18.9" - "@babel/plugin-transform-destructuring" "^7.20.2" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.9" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.18.8" - "@babel/plugin-transform-function-name" "^7.18.9" - "@babel/plugin-transform-literals" "^7.18.9" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.19.6" - "@babel/plugin-transform-modules-commonjs" "^7.19.6" - "@babel/plugin-transform-modules-systemjs" "^7.19.6" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.20.1" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.18.6" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.19.0" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.9" - "@babel/plugin-transform-typeof-symbol" "^7.18.9" - "@babel/plugin-transform-unicode-escapes" "^7.18.10" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.20.2" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - core-js-compat "^3.25.1" + "@babel/plugin-syntax-private-property-in-object" "^7.14.0" + "@babel/plugin-syntax-top-level-await" "^7.12.13" + "@babel/plugin-transform-arrow-functions" "^7.13.0" + "@babel/plugin-transform-async-to-generator" "^7.13.0" + "@babel/plugin-transform-block-scoped-functions" "^7.12.13" + "@babel/plugin-transform-block-scoping" "^7.14.1" + "@babel/plugin-transform-classes" "^7.13.0" + "@babel/plugin-transform-computed-properties" "^7.13.0" + "@babel/plugin-transform-destructuring" "^7.13.17" + "@babel/plugin-transform-dotall-regex" "^7.12.13" + "@babel/plugin-transform-duplicate-keys" "^7.12.13" + "@babel/plugin-transform-exponentiation-operator" "^7.12.13" + "@babel/plugin-transform-for-of" "^7.13.0" + "@babel/plugin-transform-function-name" "^7.12.13" + "@babel/plugin-transform-literals" "^7.12.13" + "@babel/plugin-transform-member-expression-literals" "^7.12.13" + "@babel/plugin-transform-modules-amd" "^7.14.0" + "@babel/plugin-transform-modules-commonjs" "^7.14.0" + "@babel/plugin-transform-modules-systemjs" "^7.13.8" + "@babel/plugin-transform-modules-umd" "^7.14.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.13" + "@babel/plugin-transform-new-target" "^7.12.13" + "@babel/plugin-transform-object-super" "^7.12.13" + "@babel/plugin-transform-parameters" "^7.13.0" + "@babel/plugin-transform-property-literals" "^7.12.13" + "@babel/plugin-transform-regenerator" "^7.13.15" + "@babel/plugin-transform-reserved-words" "^7.12.13" + "@babel/plugin-transform-shorthand-properties" "^7.12.13" + "@babel/plugin-transform-spread" "^7.13.0" + "@babel/plugin-transform-sticky-regex" "^7.12.13" + "@babel/plugin-transform-template-literals" "^7.13.0" + "@babel/plugin-transform-typeof-symbol" "^7.12.13" + "@babel/plugin-transform-unicode-escapes" "^7.12.13" + "@babel/plugin-transform-unicode-regex" "^7.12.13" + "@babel/preset-modules" "^0.1.4" + "@babel/types" "^7.14.1" + babel-plugin-polyfill-corejs2 "^0.2.0" + babel-plugin-polyfill-corejs3 "^0.2.0" + babel-plugin-polyfill-regenerator "^0.2.0" + core-js-compat "^3.9.0" semver "^6.3.0" -"@babel/preset-modules@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" - integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== +"@babel/preset-modules@^0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" + integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" @@ -897,86 +865,43 @@ esutils "^2.0.2" "@babel/runtime@^7.11.0", "@babel/runtime@^7.8.4": - version "7.20.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3" - integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== - dependencies: - regenerator-runtime "^0.13.11" - -"@babel/template@^7.0.0", "@babel/template@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" - integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.10" - "@babel/types" "^7.18.10" - -"@babel/traverse@^7.0.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.5.tgz#78eb244bea8270fdda1ef9af22a5d5e5b7e57133" - integrity sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.5" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.5" - "@babel/types" "^7.20.5" + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" + integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA== + dependencies: + regenerator-runtime "^0.13.4" + +"@babel/template@^7.0.0", "@babel/template@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/traverse@^7.0.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.13.15", "@babel/traverse@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.0.tgz#cea0dc8ae7e2b1dec65f512f39f3483e8cc95aef" + integrity sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.0" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.14.0" + "@babel/types" "^7.14.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.4.4": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.5.tgz#e206ae370b5393d94dfd1d04cd687cace53efa84" - integrity sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg== +"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.16", "@babel/types@^7.14.0", "@babel/types@^7.14.1", "@babel/types@^7.4.4": + version "7.14.1" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.1.tgz#095bd12f1c08ab63eff6e8f7745fa7c9cc15a9db" + integrity sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA== dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== - dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== - -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== - -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/trace-mapping@^0.3.9": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" - integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== - dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" - "@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" @@ -1011,184 +936,38 @@ dependencies: defer-to-connect "^1.0.1" -"@types/body-parser@*": - version "1.19.2" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/connect-history-api-fallback@*": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" - integrity sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw== - dependencies: - "@types/express-serve-static-core" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.35" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== - dependencies: - "@types/node" "*" - -"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": - version "4.17.31" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f" - integrity sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express@*": - version "4.17.14" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.14.tgz#143ea0557249bc1b3b54f15db4c81c3d4eb3569c" - integrity sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" - "@types/qs" "*" - "@types/serve-static" "*" - "@types/glob@^7.1.1": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" - integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== + version "7.1.3" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" + integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== dependencies: "@types/minimatch" "*" "@types/node" "*" -"@types/highlight.js@^9.7.0": - version "9.12.4" - resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.4.tgz#8c3496bd1b50cc04aeefd691140aa571d4dbfa34" - integrity sha512-t2szdkwmg2JJyuCM20e8kR2X59WCE5Zkl4bzm1u1Oukjm79zpbiAv+QjnwLnuuV0WHEcX2NgUItu0pAMKuOPww== - -"@types/http-proxy@^1.17.5": - version "1.17.9" - resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" - integrity sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw== - dependencies: - "@types/node" "*" - "@types/json-schema@^7.0.5": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== - -"@types/linkify-it@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" - integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== - -"@types/markdown-it@^10.0.0": - version "10.0.3" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-10.0.3.tgz#a9800d14b112c17f1de76ec33eff864a4815eec7" - integrity sha512-daHJk22isOUvNssVGF2zDnnSyxHhFYhtjeX4oQaKD6QzL3ZR1QSgiD1g+Q6/WSWYVogNXYDXODtbgW/WiFCtyw== - dependencies: - "@types/highlight.js" "^9.7.0" - "@types/linkify-it" "*" - "@types/mdurl" "*" - highlight.js "^9.7.0" - -"@types/mdurl@*": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" - integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== - -"@types/mime@*": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" - integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/minimatch@*": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" - integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" + integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== "@types/node@*": - version "18.11.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.13.tgz#dff34f226ec1ac0432ae3b136ec5552bd3b9c0fe" - integrity sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w== + version "15.0.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67" + integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA== "@types/q@^1.5.1": - version "1.5.5" - resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.5.tgz#75a2a8e7d8ab4b230414505d92335d1dcb53a6df" - integrity sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ== - -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/serve-static@*": - version "1.15.0" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155" - integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg== - dependencies: - "@types/mime" "*" - "@types/node" "*" - -"@types/source-list-map@*": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" - integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== - -"@types/tapable@^1": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310" - integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ== + version "1.5.4" + resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" + integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== -"@types/uglify-js@*": - version "3.17.1" - resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.17.1.tgz#e0ffcef756476410e5bce2cb01384ed878a195b5" - integrity sha512-GkewRA4i5oXacU/n4MA9+bLgt5/L3F1mKrYvFGm7r2ouLXhRKjuWwo9XHNnbx6WF3vlGW21S3fCvgqxvxXXc5g== - dependencies: - source-map "^0.6.1" - -"@types/webpack-dev-server@^3": - version "3.11.6" - resolved "https://registry.yarnpkg.com/@types/webpack-dev-server/-/webpack-dev-server-3.11.6.tgz#d8888cfd2f0630203e13d3ed7833a4d11b8a34dc" - integrity sha512-XCph0RiiqFGetukCTC3KVnY1jwLcZ84illFRMbyFzCcWl90B/76ew0tSqF46oBhnLC4obNDG7dMO0JfTN0MgMQ== - dependencies: - "@types/connect-history-api-fallback" "*" - "@types/express" "*" - "@types/serve-static" "*" - "@types/webpack" "^4" - http-proxy-middleware "^1.0.0" - -"@types/webpack-sources@*": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b" - integrity sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg== - dependencies: - "@types/node" "*" - "@types/source-list-map" "*" - source-map "^0.7.3" - -"@types/webpack@^4": - version "4.41.33" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.33.tgz#16164845a5be6a306bcbe554a8e67f9cac215ffc" - integrity sha512-PPajH64Ft2vWevkerISMtnZ8rTs4YmRbs+23c402J0INmxDKCrhZNvwZYtzx96gY2wAtXdrK1BS2fiC8MlLr3g== - dependencies: - "@types/node" "*" - "@types/tapable" "^1" - "@types/uglify-js" "*" - "@types/webpack-sources" "*" - anymatch "^3.0.0" - source-map "^0.6.0" - -"@vue/babel-helper-vue-jsx-merge-props@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz#8d53a1e21347db8edbe54d339902583176de09f2" - integrity sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA== +"@vue/babel-helper-vue-jsx-merge-props@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz#31624a7a505fb14da1d58023725a4c5f270e6a81" + integrity sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA== "@vue/babel-helper-vue-transform-on@^1.0.2": version "1.0.2" @@ -1196,9 +975,9 @@ integrity sha512-hz4R8tS5jMn8lDq6iD+yWL6XNB699pGIVLk7WSJnn1dbpjaazsjZQkieJoRX6gW5zpYSCFqQ7jUquPNY65tQYA== "@vue/babel-plugin-jsx@^1.0.3": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.1.1.tgz#0c5bac27880d23f89894cd036a37b55ef61ddfc1" - integrity sha512-j2uVfZjnB5+zkcbc/zsOc0fSNGCMMjaEXP52wdwdIfn0qjFfEYpYZBFKFg+HHnQeJCVrjOeO0YxgaL7DMrym9w== + version "1.0.6" + resolved "https://registry.yarnpkg.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.0.6.tgz#184bf3541ab6efdbe5079ab8b20c19e2af100bfb" + integrity sha512-RzYsvBhzKUmY2YG6LoV+W5PnlnkInq0thh1AzCmewwctAgGN6e9UFon6ZrQQV1CO5G5PeME7MqpB+/vvGg0h4g== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/plugin-syntax-jsx" "^7.0.0" @@ -1210,22 +989,22 @@ html-tags "^3.1.0" svg-tags "^1.0.0" -"@vue/babel-plugin-transform-vue-jsx@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.4.0.tgz#4d4b3d46a39ea62b7467dd6e26ce47f7ceafb2fe" - integrity sha512-Fmastxw4MMx0vlgLS4XBX0XiBbUFzoMGeVXuMV08wyOfXdikAFqBTuYPR0tlk+XskL19EzHc39SgjrPGY23JnA== +"@vue/babel-plugin-transform-vue-jsx@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.2.1.tgz#646046c652c2f0242727f34519d917b064041ed7" + integrity sha512-HJuqwACYehQwh1fNT8f4kyzqlNMpBuUK4rSiSES5D4QsYncv5fxFsLyrxFPG2ksO7t5WP+Vgix6tt6yKClwPzA== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/plugin-syntax-jsx" "^7.2.0" - "@vue/babel-helper-vue-jsx-merge-props" "^1.4.0" + "@vue/babel-helper-vue-jsx-merge-props" "^1.2.1" html-tags "^2.0.0" lodash.kebabcase "^4.1.1" svg-tags "^1.0.0" "@vue/babel-preset-app@^4.1.2": - version "4.5.19" - resolved "https://registry.yarnpkg.com/@vue/babel-preset-app/-/babel-preset-app-4.5.19.tgz#baee457da0065c016f74fac4149f7c97631ba5a7" - integrity sha512-VCNRiAt2P/bLo09rYt3DLe6xXUMlhJwrvU18Ddd/lYJgC7s8+wvhgYs+MTx4OiAXdu58drGwSBO9SPx7C6J82Q== + version "4.5.12" + resolved "https://registry.yarnpkg.com/@vue/babel-preset-app/-/babel-preset-app-4.5.12.tgz#c3a23cf33f6e5ea30536f13c0f9b1fc7e028b1c1" + integrity sha512-8q67ORQ9O0Ms0nlqsXTVhaBefRBaLrzPxOewAZhdcO7onHwcO5/wRdWtHhZgfpCZlhY7NogkU16z3WnorSSkEA== dependencies: "@babel/core" "^7.11.0" "@babel/helper-compilation-targets" "^7.9.6" @@ -1245,109 +1024,98 @@ semver "^6.1.0" "@vue/babel-preset-jsx@^1.2.4": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-preset-jsx/-/babel-preset-jsx-1.4.0.tgz#f4914ba314235ab097bc4372ed67473c0780bfcc" - integrity sha512-QmfRpssBOPZWL5xw7fOuHNifCQcNQC1PrOo/4fu6xlhlKJJKSA3HqX92Nvgyx8fqHZTUGMPHmFA+IDqwXlqkSA== - dependencies: - "@vue/babel-helper-vue-jsx-merge-props" "^1.4.0" - "@vue/babel-plugin-transform-vue-jsx" "^1.4.0" - "@vue/babel-sugar-composition-api-inject-h" "^1.4.0" - "@vue/babel-sugar-composition-api-render-instance" "^1.4.0" - "@vue/babel-sugar-functional-vue" "^1.4.0" - "@vue/babel-sugar-inject-h" "^1.4.0" - "@vue/babel-sugar-v-model" "^1.4.0" - "@vue/babel-sugar-v-on" "^1.4.0" - -"@vue/babel-sugar-composition-api-inject-h@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.4.0.tgz#187e1389f8871d89ece743bb50aed713be9d6c85" - integrity sha512-VQq6zEddJHctnG4w3TfmlVp5FzDavUSut/DwR0xVoe/mJKXyMcsIibL42wPntozITEoY90aBV0/1d2KjxHU52g== + version "1.2.4" + resolved "https://registry.yarnpkg.com/@vue/babel-preset-jsx/-/babel-preset-jsx-1.2.4.tgz#92fea79db6f13b01e80d3a0099e2924bdcbe4e87" + integrity sha512-oRVnmN2a77bYDJzeGSt92AuHXbkIxbf/XXSE3klINnh9AXBmVS1DGa1f0d+dDYpLfsAKElMnqKTQfKn7obcL4w== + dependencies: + "@vue/babel-helper-vue-jsx-merge-props" "^1.2.1" + "@vue/babel-plugin-transform-vue-jsx" "^1.2.1" + "@vue/babel-sugar-composition-api-inject-h" "^1.2.1" + "@vue/babel-sugar-composition-api-render-instance" "^1.2.4" + "@vue/babel-sugar-functional-vue" "^1.2.2" + "@vue/babel-sugar-inject-h" "^1.2.2" + "@vue/babel-sugar-v-model" "^1.2.3" + "@vue/babel-sugar-v-on" "^1.2.3" + +"@vue/babel-sugar-composition-api-inject-h@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.2.1.tgz#05d6e0c432710e37582b2be9a6049b689b6f03eb" + integrity sha512-4B3L5Z2G+7s+9Bwbf+zPIifkFNcKth7fQwekVbnOA3cr3Pq71q71goWr97sk4/yyzH8phfe5ODVzEjX7HU7ItQ== dependencies: "@babel/plugin-syntax-jsx" "^7.2.0" -"@vue/babel-sugar-composition-api-render-instance@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-render-instance/-/babel-sugar-composition-api-render-instance-1.4.0.tgz#2c1607ae6dffdab47e785bc01fa45ba756e992c1" - integrity sha512-6ZDAzcxvy7VcnCjNdHJ59mwK02ZFuP5CnucloidqlZwVQv5CQLijc3lGpR7MD3TWFi78J7+a8J56YxbCtHgT9Q== +"@vue/babel-sugar-composition-api-render-instance@^1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-render-instance/-/babel-sugar-composition-api-render-instance-1.2.4.tgz#e4cbc6997c344fac271785ad7a29325c51d68d19" + integrity sha512-joha4PZznQMsxQYXtR3MnTgCASC9u3zt9KfBxIeuI5g2gscpTsSKRDzWQt4aqNIpx6cv8On7/m6zmmovlNsG7Q== dependencies: "@babel/plugin-syntax-jsx" "^7.2.0" -"@vue/babel-sugar-functional-vue@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.4.0.tgz#60da31068567082287c7337c66ef4df04e0a1029" - integrity sha512-lTEB4WUFNzYt2In6JsoF9sAYVTo84wC4e+PoZWSgM6FUtqRJz7wMylaEhSRgG71YF+wfLD6cc9nqVeXN2rwBvw== +"@vue/babel-sugar-functional-vue@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.2.2.tgz#267a9ac8d787c96edbf03ce3f392c49da9bd2658" + integrity sha512-JvbgGn1bjCLByIAU1VOoepHQ1vFsroSA/QkzdiSs657V79q6OwEWLCQtQnEXD/rLTA8rRit4rMOhFpbjRFm82w== dependencies: "@babel/plugin-syntax-jsx" "^7.2.0" -"@vue/babel-sugar-inject-h@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.4.0.tgz#bf39aa6631fb1d0399b1c49b4c59e1c8899b4363" - integrity sha512-muwWrPKli77uO2fFM7eA3G1lAGnERuSz2NgAxuOLzrsTlQl8W4G+wwbM4nB6iewlKbwKRae3nL03UaF5ffAPMA== +"@vue/babel-sugar-inject-h@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.2.2.tgz#d738d3c893367ec8491dcbb669b000919293e3aa" + integrity sha512-y8vTo00oRkzQTgufeotjCLPAvlhnpSkcHFEp60+LJUwygGcd5Chrpn5480AQp/thrxVm8m2ifAk0LyFel9oCnw== dependencies: "@babel/plugin-syntax-jsx" "^7.2.0" -"@vue/babel-sugar-v-model@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.4.0.tgz#a51d986609f430c4f70ada3a93cc560a2970f720" - integrity sha512-0t4HGgXb7WHYLBciZzN5s0Hzqan4Ue+p/3FdQdcaHAb7s5D9WZFGoSxEZHrR1TFVZlAPu1bejTKGeAzaaG3NCQ== +"@vue/babel-sugar-v-model@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.2.3.tgz#fa1f29ba51ebf0aa1a6c35fa66d539bc459a18f2" + integrity sha512-A2jxx87mySr/ulAsSSyYE8un6SIH0NWHiLaCWpodPCVOlQVODCaSpiR4+IMsmBr73haG+oeCuSvMOM+ttWUqRQ== dependencies: "@babel/plugin-syntax-jsx" "^7.2.0" - "@vue/babel-helper-vue-jsx-merge-props" "^1.4.0" - "@vue/babel-plugin-transform-vue-jsx" "^1.4.0" + "@vue/babel-helper-vue-jsx-merge-props" "^1.2.1" + "@vue/babel-plugin-transform-vue-jsx" "^1.2.1" camelcase "^5.0.0" html-tags "^2.0.0" svg-tags "^1.0.0" -"@vue/babel-sugar-v-on@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.4.0.tgz#43b7106a9672d8cbeefc0eb8afe1d376edc6166e" - integrity sha512-m+zud4wKLzSKgQrWwhqRObWzmTuyzl6vOP7024lrpeJM4x2UhQtRDLgYjXAw9xBXjCwS0pP9kXjg91F9ZNo9JA== +"@vue/babel-sugar-v-on@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.2.3.tgz#342367178586a69f392f04bfba32021d02913ada" + integrity sha512-kt12VJdz/37D3N3eglBywV8GStKNUhNrsxChXIV+o0MwVXORYuhDTHJRKPgLJRb/EY3vM2aRFQdxJBp9CLikjw== dependencies: "@babel/plugin-syntax-jsx" "^7.2.0" - "@vue/babel-plugin-transform-vue-jsx" "^1.4.0" + "@vue/babel-plugin-transform-vue-jsx" "^1.2.1" camelcase "^5.0.0" -"@vue/compiler-sfc@2.7.14": - version "2.7.14" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz#3446fd2fbb670d709277fc3ffa88efc5e10284fd" - integrity sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA== - dependencies: - "@babel/parser" "^7.18.4" - postcss "^8.4.14" - source-map "^0.6.1" - "@vue/component-compiler-utils@^3.1.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz#f9f5fb53464b0c37b2c8d2f3fbfe44df60f61dc9" - integrity sha512-97sfH2mYNU+2PzGrmK2haqffDpVASuib9/w2/noxiFi31Z54hW+q3izKQXXQZSNhtiUpAI36uSuYepeBe4wpHQ== + version "3.2.0" + resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.2.0.tgz#8f85182ceed28e9b3c75313de669f83166d11e5d" + integrity sha512-lejBLa7xAMsfiZfNp7Kv51zOzifnb29FwdnMLa96z26kXErPFioSf9BMcePVIQ6/Gc6/mC0UrPpxAWIHyae0vw== dependencies: consolidate "^0.15.1" hash-sum "^1.0.2" lru-cache "^4.1.2" merge-source-map "^1.1.0" - postcss "^7.0.36" + postcss "^7.0.14" postcss-selector-parser "^6.0.2" source-map "~0.6.1" vue-template-es2015-compiler "^1.9.0" optionalDependencies: - prettier "^1.18.2 || ^2.0.0" + prettier "^1.18.2" -"@vuepress/core@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.9.7.tgz#a23388377f84322b933fc97b6cca32a90d8f5ce2" - integrity sha512-u5eb1mfNLV8uG2UuxlvpB/FkrABxeMHqymTsixOnsOg2REziv9puEIbqaZ5BjLPvbCDvSj6rn+DwjENmBU+frQ== +"@vuepress/core@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.8.2.tgz#4f5bafc894691bfea4146294a582a129483daf2a" + integrity sha512-lh9BLC06k9s0wxTuWtCkiNj49fkbW87enp0XSrFZHEoyDGSGndQjZmMMErcHc5Hx7nrW1nzc33sPH1NNtJl0hw== dependencies: "@babel/core" "^7.8.4" "@vue/babel-preset-app" "^4.1.2" - "@vuepress/markdown" "1.9.7" - "@vuepress/markdown-loader" "1.9.7" - "@vuepress/plugin-last-updated" "1.9.7" - "@vuepress/plugin-register-components" "1.9.7" - "@vuepress/shared-utils" "1.9.7" - "@vuepress/types" "1.9.7" + "@vuepress/markdown" "1.8.2" + "@vuepress/markdown-loader" "1.8.2" + "@vuepress/plugin-last-updated" "1.8.2" + "@vuepress/plugin-register-components" "1.8.2" + "@vuepress/shared-utils" "1.8.2" autoprefixer "^9.5.1" babel-loader "^8.0.4" - bundle-require "2.1.8" cache-loader "^3.0.0" chokidar "^2.0.3" connect-history-api-fallback "^1.5.0" @@ -1355,7 +1123,6 @@ core-js "^3.6.4" cross-spawn "^6.0.5" css-loader "^2.1.1" - esbuild "0.14.7" file-loader "^3.0.1" js-yaml "^3.13.1" lru-cache "^5.1.1" @@ -1379,21 +1146,21 @@ webpack-merge "^4.1.2" webpackbar "3.2.0" -"@vuepress/markdown-loader@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.9.7.tgz#acd4fa13f1e48f153d509996ccd2895a0dcb5ee2" - integrity sha512-mxXF8FtX/QhOg/UYbe4Pr1j5tcf/aOEI502rycTJ3WF2XAtOmewjkGV4eAA6f6JmuM/fwzOBMZKDyy9/yo2I6Q== +"@vuepress/markdown-loader@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.8.2.tgz#b2a58291a967f2bbe0af6e58f9542f5911879233" + integrity sha512-mWzFXikCUcAN/chpKkqZpRYKdo0312hMv8cBea2hvrJYV6y4ODB066XKvXN8JwOcxuCjxWYJkhWGr+pXq1oTtw== dependencies: - "@vuepress/markdown" "1.9.7" + "@vuepress/markdown" "1.8.2" loader-utils "^1.1.0" lru-cache "^5.1.1" -"@vuepress/markdown@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.9.7.tgz#6310458b7e2ea08a14d31349209d0b54455e957a" - integrity sha512-DFOjYkwV6fT3xXTGdTDloeIrT1AbwJ9pwefmrp0rMgC6zOz3XUJn6qqUwcYFO5mNBWpbiFQ3JZirCtgOe+xxBA== +"@vuepress/markdown@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.8.2.tgz#50ea5a1962591a436b26d1aa2b111df37eb9ea8a" + integrity sha512-zznBHVqW+iBkznF/BO/GY9RFu53khyl0Ey0PnGqvwCJpRLNan6y5EXgYumtjw2GSYn5nDTTALYxtyNBdz64PKg== dependencies: - "@vuepress/shared-utils" "1.9.7" + "@vuepress/shared-utils" "1.8.2" markdown-it "^8.4.1" markdown-it-anchor "^5.0.2" markdown-it-chain "^1.3.0" @@ -1401,56 +1168,43 @@ markdown-it-table-of-contents "^0.4.0" prismjs "^1.13.0" -"@vuepress/plugin-active-header-links@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.9.7.tgz#11b3b148d50ebd0a9a9d9e97aa34d81ae04e7307" - integrity sha512-G1M8zuV9Og3z8WBiKkWrofG44NEXsHttc1MYreDXfeWh/NLjr9q1GPCEXtiCjrjnHZHB3cSQTKnTqAHDq35PGA== - dependencies: - "@vuepress/types" "1.9.7" - lodash.debounce "^4.0.8" - -"@vuepress/plugin-back-to-top@^1.8.2": +"@vuepress/plugin-active-header-links@1.8.2": version "1.8.2" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-back-to-top/-/plugin-back-to-top-1.8.2.tgz#e9794409d1d589e4952b0700291270d2696e6d01" - integrity sha512-htAf2m8+6cGmYQexWerznGBY10y1E4TBfebYC3Y3wqNjFjvXUmRKcAG/u6Yxvey4OFkQUxbth2ilKi/GlIW8aQ== + resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.8.2.tgz#0cb9b29c826dd97d35357a9b09c962ef782cb793" + integrity sha512-JmXAQg8D7J8mcKe2Ue3BZ9dOCzJMJXP4Cnkkc/IrqfDg0ET0l96gYWZohCqlvRIWt4f0VPiFAO4FLYrW+hko+g== dependencies: lodash.debounce "^4.0.8" -"@vuepress/plugin-last-updated@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.9.7.tgz#9f2d78fe7ced618d0480bf40a3e32b40486bac6d" - integrity sha512-FiFBOl49dlFRjbLRnRAv77HDWfe+S/eCPtMQobq4/O3QWuL3Na5P4fCTTVzq1K7rWNO9EPsWNB2Jb26ndlQLKQ== +"@vuepress/plugin-last-updated@1.8.2", "@vuepress/plugin-last-updated@^1.5.0": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.8.2.tgz#7ce689f8d5050cf0213949bc2e5aa879c09ff4b1" + integrity sha512-pYIRZi52huO9b6HY3JQNPKNERCLzMHejjBRt9ekdnJ1xhLs4MmRvt37BoXjI/qzvXkYtr7nmGgnKThNBVRTZuA== dependencies: - "@vuepress/types" "1.9.7" cross-spawn "^6.0.5" -"@vuepress/plugin-nprogress@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.9.7.tgz#76d8368fa26c190ee23c399401a71ec78ffb9744" - integrity sha512-sI148igbdRfLgyzB8PdhbF51hNyCDYXsBn8bBWiHdzcHBx974sVNFKtfwdIZcSFsNrEcg6zo8YIrQ+CO5vlUhQ== +"@vuepress/plugin-nprogress@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.8.2.tgz#dc6c082925420c8c59ecb7fc2d4a9401f6d4664a" + integrity sha512-3TOBee2NM3WLr1tdjDTGfrAMggjN+OlEPyKyv8FqThsVkDYhw48O3HwqlThp9KX7UbL3ExxIFBwWRFLC+kYrdw== dependencies: - "@vuepress/types" "1.9.7" nprogress "^0.2.0" -"@vuepress/plugin-register-components@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.9.7.tgz#0234f887b32c1d836fa68cdd06d7e851397fd268" - integrity sha512-l/w1nE7Dpl+LPMb8+AHSGGFYSP/t5j6H4/Wltwc2QcdzO7yqwC1YkwwhtTXvLvHOV8O7+rDg2nzvq355SFkfKA== +"@vuepress/plugin-register-components@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.8.2.tgz#2fb45a68b0a1efb8822670d95c3b231a2d0eb74d" + integrity sha512-6SUq3nHFMEh9qKFnjA8QnrNxj0kLs7+Gspq1OBU8vtu0NQmSvLFZVaMV7pzT/9zN2nO5Pld5qhsUJv1g71MrEA== dependencies: - "@vuepress/shared-utils" "1.9.7" - "@vuepress/types" "1.9.7" + "@vuepress/shared-utils" "1.8.2" -"@vuepress/plugin-search@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.9.7.tgz#37a4714973ccac8c28837fc72a38ae0888d874bf" - integrity sha512-MLpbUVGLxaaHEwflFxvy0pF9gypFVUT3Q9Zc6maWE+0HDWAvzMxo6GBaj6mQPwjOqNQMf4QcN3hDzAZktA+DQg== - dependencies: - "@vuepress/types" "1.9.7" +"@vuepress/plugin-search@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.8.2.tgz#74b92f663acf6b4560e15dc0442a84c4e874e206" + integrity sha512-JrSJr9o0Kar14lVtZ4wfw39pplxvvMh8vDBD9oW09a+6Zi/4bySPGdcdaqdqGW+OHSiZNvG+6uyfKSBBBqF6PA== -"@vuepress/shared-utils@1.9.7", "@vuepress/shared-utils@^1.2.0": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.9.7.tgz#f1203c7f48e9d546078f5f9b2ec5200b29da481b" - integrity sha512-lIkO/eSEspXgVHjYHa9vuhN7DuaYvkfX1+TTJDiEYXIwgwqtvkTv55C+IOdgswlt0C/OXDlJaUe1rGgJJ1+FTw== +"@vuepress/shared-utils@1.8.2", "@vuepress/shared-utils@^1.2.0": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.8.2.tgz#5ec1601f2196aca34ad82eed7c9be2d7948f705b" + integrity sha512-6kGubc7iBDWruEBUU7yR+sQ++SOhMuvKWvWeTZJKRZedthycdzYz7QVpua0FaZSAJm5/dIt8ymU4WQvxTtZgTQ== dependencies: chalk "^2.3.2" escape-html "^1.0.3" @@ -1462,15 +1216,14 @@ toml "^3.0.0" upath "^1.1.0" -"@vuepress/theme-default@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.9.7.tgz#9e928b724fdcb12715cc513fdbc27b965944c4a1" - integrity sha512-NZzCLIl+bgJIibhkqVmk/NSku57XIuXugxAN3uiJrCw6Mu6sb3xOvbk0En3k+vS2BKHxAZ6Cx7dbCiyknDQnSA== +"@vuepress/theme-default@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.8.2.tgz#7f474036c752c1f9801b83f68f5c70c092b182b4" + integrity sha512-rE7M1rs3n2xp4a/GrweO8EGwqFn3EA5gnFWdVmVIHyr7C1nix+EqjpPQF1SVWNnIrDdQuCw38PqS+oND1K2vYw== dependencies: - "@vuepress/plugin-active-header-links" "1.9.7" - "@vuepress/plugin-nprogress" "1.9.7" - "@vuepress/plugin-search" "1.9.7" - "@vuepress/types" "1.9.7" + "@vuepress/plugin-active-header-links" "1.8.2" + "@vuepress/plugin-nprogress" "1.8.2" + "@vuepress/plugin-search" "1.8.2" docsearch.js "^2.5.2" lodash "^4.17.15" stylus "^0.54.8" @@ -1478,15 +1231,6 @@ vuepress-plugin-container "^2.0.2" vuepress-plugin-smooth-scroll "^0.0.3" -"@vuepress/types@1.9.7": - version "1.9.7" - resolved "https://registry.yarnpkg.com/@vuepress/types/-/types-1.9.7.tgz#aeb772fd0f7c2a10c6ec1d3c803a2e4b1d756c24" - integrity sha512-moLQzkX3ED2o18dimLemUm7UVDKxhcrJmGt5C0Ng3xxrLPaQu7UqbROtEKB3YnMRt4P/CA91J+Ck+b9LmGabog== - dependencies: - "@types/markdown-it" "^10.0.0" - "@types/webpack-dev-server" "^3" - webpack-chain "^6.0.0" - "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -1647,13 +1391,13 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== +accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" + mime-types "~2.1.24" + negotiator "0.6.2" acorn@^6.4.1: version "6.4.2" @@ -1663,7 +1407,7 @@ acorn@^6.4.1: agentkeepalive@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-2.2.0.tgz#c5d1bd4b129008f1163f236f86e5faea2026e2ef" - integrity sha512-TnB6ziK363p7lR8QpeLC8aMr8EGYBKZTpgzQLfqTs3bR0Oo5VbKdwKf8h0dSzsYrB7lSCgfJnMZKqShvlq5Oyg== + integrity sha1-xdG9SxKQCPEWPyNvhuX66iAm4u8= ajv-errors@^1.0.0: version "1.0.1" @@ -1709,14 +1453,14 @@ algoliasearch@^3.24.5: alphanum-sort@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" - integrity sha512-0FcBfdcmaumGPQ0qPn7Q5qTgz/ooXgIyp1rf8ik5bGX8mpE2YHjC0P/eyQvxu1GURYQgq9ozf2mteQ5ZD9YiyQ== + integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= ansi-align@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" - integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" + integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== dependencies: - string-width "^4.1.0" + string-width "^3.0.0" ansi-colors@^3.0.0: version "3.2.4" @@ -1730,25 +1474,30 @@ ansi-escapes@^4.1.0: dependencies: type-fest "^0.21.3" -ansi-html-community@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" - integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== +ansi-html@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" + integrity sha1-gTWEAhliqenm/QOflA0S9WynhZ4= ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" - integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" @@ -1772,10 +1521,10 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@^3.0.0, anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== +anymatch@~3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -1795,7 +1544,7 @@ argparse@^1.0.7: arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.1.0: version "1.1.0" @@ -1805,12 +1554,12 @@ arr-flatten@^1.1.0: arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= array-flatten@^2.1.0: version "2.1.2" @@ -1820,30 +1569,19 @@ array-flatten@^2.1.0: array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng== + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - -array.prototype.reduce@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" - integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= asn1.js@^5.2.0: version "5.4.1" @@ -1856,16 +1594,16 @@ asn1.js@^5.2.0: safer-buffer "^2.1.0" asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + 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" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assert@^1.1.1: version "1.5.0" @@ -1878,7 +1616,7 @@ assert@^1.1.1: assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= async-each@^1.0.1: version "1.0.3" @@ -1890,7 +1628,7 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async@^2.6.4: +async@^2.6.2: version "2.6.4" resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== @@ -1900,7 +1638,7 @@ async@^2.6.4: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.2: version "2.1.2" @@ -1915,22 +1653,22 @@ autocomplete.js@0.36.0: immediate "^3.2.3" autoprefixer@^9.5.1: - version "9.8.8" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.8.tgz#fd4bd4595385fa6f06599de749a4d5f7a474957a" - integrity sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA== + version "9.8.6" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f" + integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg== dependencies: browserslist "^4.12.0" caniuse-lite "^1.0.30001109" + colorette "^1.2.1" normalize-range "^0.1.2" num2fraction "^1.2.2" - picocolors "^0.2.1" postcss "^7.0.32" postcss-value-parser "^4.1.0" aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: version "1.11.0" @@ -1938,12 +1676,12 @@ aws4@^1.8.0: integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== babel-loader@^8.0.4: - version "8.3.0" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8" - integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== + version "8.2.2" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" + integrity sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g== dependencies: find-cache-dir "^3.3.1" - loader-utils "^2.0.0" + loader-utils "^1.4.0" make-dir "^3.1.0" schema-utils "^2.6.5" @@ -1954,29 +1692,29 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-polyfill-corejs2@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" - integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== +babel-plugin-polyfill-corejs2@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz#686775bf9a5aa757e10520903675e3889caeedc4" + integrity sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg== dependencies: - "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.3" + "@babel/compat-data" "^7.13.11" + "@babel/helper-define-polyfill-provider" "^0.2.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" - integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== +babel-plugin-polyfill-corejs3@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz#f4b4bb7b19329827df36ff56f6e6d367026cb7a2" + integrity sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - core-js-compat "^3.25.1" + "@babel/helper-define-polyfill-provider" "^0.2.0" + core-js-compat "^3.9.1" -babel-plugin-polyfill-regenerator@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" - integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== +babel-plugin-polyfill-regenerator@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz#853f5f5716f4691d98c84f8069c7636ea8da7ab8" + integrity sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" + "@babel/helper-define-polyfill-provider" "^0.2.0" balanced-match@^1.0.0: version "1.0.2" @@ -2004,12 +1742,12 @@ base@^0.11.1: batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" - integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== + integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" @@ -2051,32 +1789,30 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== bn.js@^5.0.0, bn.js@^5.1.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +body-parser@1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== dependencies: - bytes "3.1.2" + bytes "3.1.0" content-type "~1.0.4" debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" + depd "~1.1.2" + http-errors "1.7.2" iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" bonjour@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" - integrity sha512-RaVTblr+OnEli0r/ud8InrU7D+G0y6aJhlxaLa6Pwty4+xoxboF1BsUI45tujvRpbj9dQVoglChqonGAsjEBYg== + integrity sha1-jokKGD2O6aI5OzhExpGkK897yfU= dependencies: array-flatten "^2.1.0" deep-equal "^1.0.1" @@ -2088,7 +1824,7 @@ bonjour@^3.5.0: boolbase@^1.0.0, boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= boxen@^4.2.0: version "4.2.0" @@ -2128,7 +1864,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.2, braces@~3.0.2: +braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2138,7 +1874,7 @@ braces@^3.0.2, braces@~3.0.2: brorand@^1.0.1, brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" @@ -2201,20 +1937,21 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.21.3, browserslist@^4.21.4: - version "4.21.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" - integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.16.6: + version "4.16.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" + integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== dependencies: - caniuse-lite "^1.0.30001400" - electron-to-chromium "^1.4.251" - node-releases "^2.0.6" - update-browserslist-db "^1.0.9" + caniuse-lite "^1.0.30001219" + colorette "^1.2.2" + electron-to-chromium "^1.3.723" + escalade "^3.1.1" + node-releases "^1.1.71" buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + 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-indexof@^1.0.0: version "1.1.1" @@ -2229,7 +1966,7 @@ buffer-json@^2.0.0: buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^4.3.0: version "4.9.2" @@ -2243,27 +1980,22 @@ buffer@^4.3.0: builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== - -bundle-require@2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-2.1.8.tgz#28f6de9d4468a6b7b76fb5c9bf52e70f5091245d" - integrity sha512-oOEg3A0hy/YzvNWNowtKD0pmhZKseOFweCbgyMqTIih4gRY1nJWsvrOCT27L9NbIyL5jMjTFrAUpGxxpW68Puw== + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw== + integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== cac@^6.5.6: - version "6.7.14" - resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" - integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + version "6.7.3" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.3.tgz#10410b8611677990cc2e3c8b576d471c1d71b768" + integrity sha512-ECVqVZh74qgSuZG9YOt2OJPI3wGcf+EwwuF/XIOYqZBD0KZYLtgPWqFPxmDPQ6joxI1nOlvVgRV6VT53Ooyocg== cacache@^12.0.2, cacache@^12.0.3: version "12.0.4" @@ -2335,33 +2067,33 @@ call-bind@^1.0.0, call-bind@^1.0.2: get-intrinsic "^1.0.2" call-me-maybe@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" - integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== + 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 sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ== + 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 sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A== + 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 sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ== + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" - integrity sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w== + integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= dependencies: no-case "^2.2.0" upper-case "^1.1.1" @@ -2372,9 +2104,9 @@ camelcase@^5.0.0, camelcase@^5.2.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + version "6.2.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-api@^3.0.0: version "3.0.0" @@ -2386,15 +2118,26 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001400: - version "1.0.30001439" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz#ab7371faeb4adff4b74dad1718a6fd122e45d9cb" - integrity sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219: + version "1.0.30001223" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001223.tgz#39b49ff0bfb3ee3587000d2f66c47addc6e14443" + integrity sha512-k/RYs6zc/fjbxTjaWZemeSmOjO0JJV+KguOBA3NwPup8uzxM1cMhR2BD9XmO86GuqaqTCO8CgkgH9Rz//vdDiA== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chalk@^1.1.3: + version "1.1.3" + 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" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" chalk@^2.0.0, chalk@^2.3.2, chalk@^2.4.1: version "2.4.2" @@ -2413,14 +2156,6 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chokidar@^2.0.3, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -2441,19 +2176,19 @@ chokidar@^2.0.3, chokidar@^2.1.8: fsevents "^1.2.7" chokidar@^3.4.1: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + version "3.5.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== dependencies: - anymatch "~3.1.2" + anymatch "~3.1.1" braces "~3.0.2" - glob-parent "~5.1.2" + glob-parent "~5.1.0" is-binary-path "~2.1.0" is-glob "~4.0.1" normalize-path "~3.0.0" - readdirp "~3.6.0" + readdirp "~3.5.0" optionalDependencies: - fsevents "~2.3.2" + fsevents "~2.3.1" chownr@^1.1.1: version "1.1.4" @@ -2470,10 +2205,10 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef" - integrity sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog== +ci-info@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.1.1.tgz#9a32fcefdf7bcdb6f0a7e1c0f8098ec57897b80a" + integrity sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -2494,9 +2229,9 @@ class-utils@^0.3.5: static-extend "^0.1.1" clean-css@4.2.x: - version "4.2.4" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.4.tgz#733bf46eba4e607c6891ea57c24a989356831178" - integrity sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A== + version "4.2.3" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.3.tgz#507b5de7d97b48ee53d84adb0160ff6216380f78" + integrity sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA== dependencies: source-map "~0.6.0" @@ -2515,9 +2250,9 @@ cliui@^5.0.0: wrap-ansi "^5.1.0" clone-response@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" - integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= dependencies: mimic-response "^1.0.0" @@ -2533,12 +2268,12 @@ coa@^2.0.2: collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0, color-convert@^1.9.3: +color-convert@^1.9.0, color-convert@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -2555,28 +2290,33 @@ color-convert@^2.0.1: color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^1.6.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4" - integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg== +color-string@^1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.5.tgz#65474a8f0e7439625f3d27a6a19d89fc45223014" + integrity sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" color@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" - integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== + version "3.1.3" + resolved "https://registry.yarnpkg.com/color/-/color-3.1.3.tgz#ca67fb4e7b97d611dcde39eceed422067d91596e" + integrity sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ== dependencies: - color-convert "^1.9.3" - color-string "^1.6.0" + color-convert "^1.9.1" + color-string "^1.5.4" + +colorette@^1.2.1, colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" @@ -2603,7 +2343,7 @@ commander@~2.19.0: commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= component-emitter@^1.2.1: version "1.3.0" @@ -2682,14 +2422,14 @@ consolidate@^0.15.1: constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== dependencies: - safe-buffer "5.2.1" + safe-buffer "5.1.2" content-type@~1.0.4: version "1.0.4" @@ -2697,19 +2437,21 @@ content-type@~1.0.4: integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== copy-concurrently@^1.0.0: version "1.0.5" @@ -2726,7 +2468,7 @@ copy-concurrently@^1.0.0: copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= copy-webpack-plugin@^5.0.2: version "5.1.2" @@ -2746,27 +2488,23 @@ copy-webpack-plugin@^5.0.2: serialize-javascript "^4.0.0" webpack-log "^2.0.0" -core-js-compat@^3.25.1, core-js-compat@^3.6.5: - version "3.26.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.1.tgz#0e710b09ebf689d719545ac36e49041850f943df" - integrity sha512-622/KzTudvXCDLRw70iHW4KKs1aGpcRcowGWyYJr2DEBfRrd6hNJybxSWJFuZYD4ma86xhrwDDHxmDaIq4EA8A== +core-js-compat@^3.6.5, core-js-compat@^3.9.0, core-js-compat@^3.9.1: + version "3.12.0" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.12.0.tgz#a031e51fe411085e33cb629bfee2acaa53bc309a" + integrity sha512-vvaN8EOvYBEjrr+MN3vCKrMNc/xdYZI+Rt/uPMROi4T5Hj8Fz6TiPQm2mrB9aZoQVW1lCFHYmMrv99aUct9mkg== dependencies: - browserslist "^4.21.4" + browserslist "^4.16.6" + semver "7.0.0" core-js@^3.6.4, core-js@^3.6.5: - version "3.26.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.1.tgz#7a9816dabd9ee846c1c0fe0e8fcad68f3709134e" - integrity sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA== + version "3.12.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.12.0.tgz#62bac86f7d7f087d40dba3e90a211c2c3c8559ea" + integrity sha512-SaMnchL//WwU2Ot1hhkPflE8gzo7uq1FGvUJ8GKmi3TOU7rGTHIU+eir1WGf6qOtTyxdfdcp10yPdGZ59sQ3hw== -core-util-is@1.0.2: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cosmiconfig@^5.0.0: version "5.2.1" @@ -2845,7 +2583,7 @@ crypto-random-string@^2.0.0: css-color-names@0.0.4, 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 sha512-zj5D7X1U2h2zsXOAM8EyUREBnnts6H+Jm+d1M2DbiQQcUtnqgQsMrdo8JW9R80YFUmIdBZeMu5wvYM7hcgWP/Q== + integrity sha1-gIrcLnnPhHOAabZGyyDsJ762KeA= css-declaration-sorter@^4.0.1: version "4.0.1" @@ -2875,7 +2613,7 @@ css-loader@^2.1.1: css-parse@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-2.0.0.tgz#a468ee667c16d81ccf05c58c38d2a97c780dbfd4" - integrity sha512-UNIFik2RgSbiTwIW1IsFwXWn6vs+bYdq83LKTSOsx7NJR7WII9dxewkHLltfTLVppoUApHV0118a4RZRI9FLwA== + integrity sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q= dependencies: css "^2.0.0" @@ -2884,7 +2622,7 @@ css-select-base-adapter@^0.1.1: resolved "https://registry.yarnpkg.com/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz#3b2ff4972cc362ab88561507a95408a1432135d7" integrity sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w== -css-select@^2.0.0: +css-select@^2.0.0, css-select@^2.0.2: version "2.1.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.1.0.tgz#6a34653356635934a81baca68d0255432105dbef" integrity sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ== @@ -2894,17 +2632,6 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" -css-select@^4.1.3: - version "4.3.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" - integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== - dependencies: - boolbase "^1.0.0" - css-what "^6.0.1" - domhandler "^4.3.1" - domutils "^2.8.0" - nth-check "^2.0.1" - css-tree@1.0.0-alpha.37: version "1.0.0-alpha.37" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.37.tgz#98bebd62c4c1d9f960ec340cf9f7522e30709a22" @@ -2926,11 +2653,6 @@ css-what@^3.2.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" integrity sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ== -css-what@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" - integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== - css@^2.0.0: version "2.2.4" resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" @@ -2985,12 +2707,12 @@ cssnano-preset-default@^4.0.8: cssnano-util-get-arguments@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz#ed3a08299f21d75741b20f3b81f194ed49cc150f" - integrity sha512-6RIcwmV3/cBMG8Aj5gucQRsJb4vv4I4rn6YjPbVWd5+Pn/fuG+YseGvXGk00XLkoZkaj31QOD7vMUpNPC4FIuw== + integrity sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8= cssnano-util-get-match@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz#c0e4ca07f5386bb17ec5e52250b4f5961365156d" - integrity sha512-JPMZ1TSMRUPVIqEalIBNoBtAYbi8okvcFns4O0YIhcdGebeYZK7dMyHJiQ6GqNBA9kE0Hym4Aqym5rPdsV/4Cw== + integrity sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0= cssnano-util-raw-cache@^4.0.1: version "4.0.1" @@ -3021,27 +2743,22 @@ csso@^4.0.2: dependencies: css-tree "^1.1.2" -csstype@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" - integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== - cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" - integrity sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A== + integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" de-indent@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" - integrity sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg== + integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" @@ -3050,7 +2767,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: dependencies: ms "2.0.0" -debug@^3.2.7: +debug@^3.1.1, debug@^3.2.6: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -3058,9 +2775,9 @@ debug@^3.2.7: ms "^2.1.1" debug@^4.1.0, debug@^4.1.1: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== dependencies: ms "2.1.2" @@ -3074,17 +2791,17 @@ debug@~3.1.0: decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= decode-uri-component@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= dependencies: mimic-response "^1.0.0" @@ -3123,25 +2840,24 @@ defer-to-connect@^1.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== +define-properties@^1.1.2, define-properties@^1.1.3: + 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: - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" + object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" @@ -3169,17 +2885,12 @@ del@^4.1.1: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= des.js@^1.0.0: version "1.0.1" @@ -3189,15 +2900,15 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= detect-node@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== + version "2.0.5" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" + integrity sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw== diffie-hellman@^5.0.0: version "5.0.3" @@ -3218,7 +2929,7 @@ dir-glob@^2.0.0, dir-glob@^2.2.2: dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" - integrity sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg== + integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= dns-packet@^1.3.1: version "1.3.4" @@ -3231,7 +2942,7 @@ dns-packet@^1.3.1: dns-txt@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6" - integrity sha512-Ix5PrWjphuSoUXV/Zv5gaFHjnaJtb02F2+Si3Ht9dyJ87+Z/lMmy+dpNHtTGraNK958ndXq2i+GLkWsWHcKaBQ== + integrity sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY= dependencies: buffer-indexof "^1.0.0" @@ -3248,7 +2959,7 @@ docsearch.js@^2.5.2: to-factory "^1.0.0" zepto "^1.2.0" -dom-converter@^0.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== @@ -3263,15 +2974,6 @@ dom-serializer@0: domelementtype "^2.0.1" entities "^2.0.0" -dom-serializer@^1.0.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" - integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.2.0" - entities "^2.0.0" - dom-walk@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" @@ -3282,24 +2984,24 @@ domain-browser@^1.1.1: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domelementtype@1: +domelementtype@1, domelementtype@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== -domelementtype@^2.0.1, domelementtype@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== +domelementtype@^2.0.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57" + integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A== -domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" - integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ== +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== dependencies: - domelementtype "^2.2.0" + domelementtype "1" -domutils@^1.7.0: +domutils@^1.5.1, domutils@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== @@ -3307,15 +3009,6 @@ domutils@^1.7.0: dom-serializer "0" domelementtype "1" -domutils@^2.5.2, domutils@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" - integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.2.0" - domhandler "^4.2.0" - dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -3329,9 +3022,9 @@ dotenv@^8.0.0: integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== duplexer3@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" - integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" @@ -3346,7 +3039,7 @@ duplexify@^3.4.2, duplexify@^3.6.0: ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" @@ -3354,12 +3047,12 @@ ecc-jsbn@~0.1.1: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.4.251: - version "1.4.284" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" - integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== +electron-to-chromium@^1.3.723: + version "1.3.727" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz#857e310ca00f0b75da4e1db6ff0e073cc4a91ddf" + integrity sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg== elliptic@^6.5.3: version "6.5.4" @@ -3387,7 +3080,7 @@ emoji-regex@^8.0.0: emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng== + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= emojis-list@^3.0.0: version "3.0.0" @@ -3397,7 +3090,7 @@ emojis-list@^3.0.0: encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.4" @@ -3415,16 +3108,16 @@ enhanced-resolve@^4.5.0: memory-fs "^0.5.0" tapable "^1.0.0" +entities@^1.1.1, 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== + entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== -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== - envify@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/envify/-/envify-4.1.0.tgz#f39ad3db9d6801b4e6b478b61028d3f0b6819f7e" @@ -3452,41 +3145,27 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.20.4: - version "1.20.5" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.5.tgz#e6dc99177be37cacda5988e692c3fa8b218e95d2" - integrity sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ== +es-abstract@^1.17.2, es-abstract@^1.18.0-next.2: + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" - function.prototype.name "^1.1.5" - get-intrinsic "^1.1.3" - get-symbol-description "^1.0.0" - gopd "^1.0.1" + get-intrinsic "^1.1.1" has "^1.0.3" - has-property-descriptors "^1.0.0" - has-symbols "^1.0.3" - internal-slot "^1.0.3" - is-callable "^1.2.7" - is-negative-zero "^2.0.2" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.2" - is-string "^1.0.7" - is-weakref "^1.0.2" - object-inspect "^1.12.2" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.2" + is-string "^1.0.5" + object-inspect "^1.9.0" object-keys "^1.1.1" - object.assign "^4.1.4" - regexp.prototype.flags "^1.4.3" - safe-regex-test "^1.0.0" - string.prototype.trimend "^1.0.6" - string.prototype.trimstart "^1.0.6" - unbox-primitive "^1.0.2" - -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" es-to-primitive@^1.2.1: version "1.2.1" @@ -3502,114 +3181,6 @@ es6-promise@^4.1.0: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== -esbuild-android-arm64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.7.tgz#8c78cbb617f9f216abfb5a84cca453b51421a1b6" - integrity sha512-9/Q1NC4JErvsXzJKti0NHt+vzKjZOgPIjX/e6kkuCzgfT/GcO3FVBcGIv4HeJG7oMznE6KyKhvLrFgt7CdU2/w== - -esbuild-darwin-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.7.tgz#7424bdb64c104556d36b7429af79ab51415ab8f4" - integrity sha512-Z9X+3TT/Xj+JiZTVlwHj2P+8GoiSmUnGVz0YZTSt8WTbW3UKw5Pw2ucuJ8VzbD2FPy0jbIKJkko/6CMTQchShQ== - -esbuild-darwin-arm64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.7.tgz#6a243dc0132aeb11c1991f968a6a9e393f43c6bc" - integrity sha512-68e7COhmwIiLXBEyxUxZSSU0akgv8t3e50e2QOtKdBUE0F6KIRISzFntLe2rYlNqSsjGWsIO6CCc9tQxijjSkw== - -esbuild-freebsd-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.7.tgz#e7281e50522e724c4da502504dcd75be0db46c94" - integrity sha512-76zy5jAjPiXX/S3UvRgG85Bb0wy0zv/J2lel3KtHi4V7GUTBfhNUPt0E5bpSXJ6yMT7iThhnA5rOn+IJiUcslQ== - -esbuild-freebsd-arm64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.7.tgz#31e513098efd181d76a3ba3ea285836d37f018a3" - integrity sha512-lSlYNLiqyzd7qCN5CEOmLxn7MhnGHPcu5KuUYOG1i+t5A6q7LgBmfYC9ZHJBoYyow3u4CNu79AWHbvVLpE/VQQ== - -esbuild-linux-32@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.7.tgz#82cf96accbf55d3007c3338dc3b3144efa9ae108" - integrity sha512-Vk28u409wVOXqTaT6ek0TnfQG4Ty1aWWfiysIaIRERkNLhzLhUf4i+qJBN8mMuGTYOkE40F0Wkbp6m+IidOp2A== - -esbuild-linux-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.7.tgz#67bdfe23a6ca918a0bb8e9558a3ee0fdf98c0bc0" - integrity sha512-+Lvz6x+8OkRk3K2RtZwO+0a92jy9si9cUea5Zoru4yJ/6EQm9ENX5seZE0X9DTwk1dxJbjmLsJsd3IoowyzgVg== - -esbuild-linux-arm64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.7.tgz#f79c69ff0c176559c418de8e59aa3cf388fff992" - integrity sha512-kJd5beWSqteSAW086qzCEsH6uwpi7QRIpzYWHzEYwKKu9DiG1TwIBegQJmLpPsLp4v5RAFjea0JAmAtpGtRpqg== - -esbuild-linux-arm@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.7.tgz#3d665b35e1c27dbe1c9deb8bf956d7d1f191a21b" - integrity sha512-OzpXEBogbYdcBqE4uKynuSn5YSetCvK03Qv1HcOY1VN6HmReuatjJ21dCH+YPHSpMEF0afVCnNfffvsGEkxGJQ== - -esbuild-linux-mips64le@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.7.tgz#226114a0cc6649ba0ffd3428118a8f622872f16d" - integrity sha512-mFWpnDhZJmj/h7pxqn1GGDsKwRfqtV7fx6kTF5pr4PfXe8pIaTERpwcKkoCwZUkWAOmUEjMIUAvFM72A6hMZnA== - -esbuild-linux-ppc64le@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.7.tgz#5c67ae56517f2644d567b2ca5ecb97f9520cfc49" - integrity sha512-wM7f4M0bsQXfDL4JbbYD0wsr8cC8KaQ3RPWc/fV27KdErPW7YsqshZZSjDV0kbhzwpNNdhLItfbaRT8OE8OaKA== - -esbuild-netbsd-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.7.tgz#69dc0469ea089013956d8c6aa71c9e7fc25fc567" - integrity sha512-J/afS7woKyzGgAL5FlgvMyqgt5wQ597lgsT+xc2yJ9/7BIyezeXutXqfh05vszy2k3kSvhLesugsxIA71WsqBw== - -esbuild-openbsd-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.7.tgz#3a9d04ecf820708e2e5b7d26fa7332e3f19f6b6c" - integrity sha512-7CcxgdlCD+zAPyveKoznbgr3i0Wnh0L8BDGRCjE/5UGkm5P/NQko51tuIDaYof8zbmXjjl0OIt9lSo4W7I8mrw== - -esbuild-sunos-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.7.tgz#7c33a682f0fd9565cae7df165d0e8736b7b62623" - integrity sha512-GKCafP2j/KUljVC3nesw1wLFSZktb2FGCmoT1+730zIF5O6hNroo0bSEofm6ZK5mNPnLiSaiLyRB9YFgtkd5Xg== - -esbuild-windows-32@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.7.tgz#24ec706a5f25b4499048f56146bcff0ed3839dce" - integrity sha512-5I1GeL/gZoUUdTPA0ws54bpYdtyeA2t6MNISalsHpY269zK8Jia/AXB3ta/KcDHv2SvNwabpImeIPXC/k0YW6A== - -esbuild-windows-64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.7.tgz#dd6d5b5bace93cd7a9174d31fbd727ba21885abf" - integrity sha512-CIGKCFpQOSlYsLMbxt8JjxxvVw9MlF1Rz2ABLVfFyHUF5OeqHD5fPhGrCVNaVrhO8Xrm+yFmtjcZudUGr5/WYQ== - -esbuild-windows-arm64@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.7.tgz#ecfd9ac289606f26760c4f737caaeeadfff3cfe3" - integrity sha512-eOs1eSivOqN7cFiRIukEruWhaCf75V0N8P0zP7dh44LIhLl8y6/z++vv9qQVbkBm5/D7M7LfCfCTmt1f1wHOCw== - -esbuild@0.14.7: - version "0.14.7" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.7.tgz#e85cead55b0e1001abf1b2ce4a11c1d4d709d13c" - integrity sha512-+u/msd6iu+HvfysUPkZ9VHm83LImmSNnecYPfFI01pQ7TTcsFR+V0BkybZX7mPtIaI7LCrse6YRj+v3eraJSgw== - optionalDependencies: - esbuild-android-arm64 "0.14.7" - esbuild-darwin-64 "0.14.7" - esbuild-darwin-arm64 "0.14.7" - esbuild-freebsd-64 "0.14.7" - esbuild-freebsd-arm64 "0.14.7" - esbuild-linux-32 "0.14.7" - esbuild-linux-64 "0.14.7" - esbuild-linux-arm "0.14.7" - esbuild-linux-arm64 "0.14.7" - esbuild-linux-mips64le "0.14.7" - esbuild-linux-ppc64le "0.14.7" - esbuild-netbsd-64 "0.14.7" - esbuild-openbsd-64 "0.14.7" - esbuild-sunos-64 "0.14.7" - esbuild-windows-32 "0.14.7" - esbuild-windows-64 "0.14.7" - esbuild-windows-arm64 "0.14.7" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -3623,12 +3194,12 @@ escape-goat@^2.0.0: escape-html@^1.0.3, escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@^1.0.5: +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 sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escape-string-regexp@^2.0.0: version "2.0.0" @@ -3661,9 +3232,9 @@ estraverse@^4.1.1: integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== esutils@^2.0.2: version "2.0.3" @@ -3673,7 +3244,7 @@ esutils@^2.0.2: etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= eventemitter3@^4.0.0: version "4.0.7" @@ -3683,17 +3254,19 @@ eventemitter3@^4.0.0: events@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - integrity sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw== + integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= events@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -eventsource@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508" - integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA== +eventsource@^1.0.7: + version "1.1.1" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.1.tgz#4544a35a57d7120fba4fa4c86cb4023b2c09df2f" + integrity sha512-qV5ZC0h7jYIAOhArFJgSfdyz6rALJyb270714o7ZtNnw2WSJ+eexhKtE0O8LYPRsHZHf2osHKZBxGPvm3kPkCA== + dependencies: + original "^1.0.0" evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" @@ -3719,7 +3292,7 @@ execa@^1.0.0: expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -3730,38 +3303,37 @@ expand-brackets@^2.1.4: to-regex "^3.0.1" express@^4.17.1: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== dependencies: - accepts "~1.3.8" + accepts "~1.3.7" array-flatten "1.1.1" - body-parser "1.20.1" - content-disposition "0.5.4" + body-parser "1.19.0" + content-disposition "0.5.3" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.4.0" cookie-signature "1.0.6" debug "2.6.9" - depd "2.0.0" + depd "~1.1.2" encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.2.0" + finalhandler "~1.1.2" fresh "0.5.2" - http-errors "2.0.0" merge-descriptors "1.0.1" methods "~1.1.2" - on-finished "2.4.1" + on-finished "~2.3.0" parseurl "~1.3.3" path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.11.0" + proxy-addr "~2.0.5" + qs "6.7.0" range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" @@ -3769,14 +3341,14 @@ express@^4.17.1: extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" @@ -3803,12 +3375,12 @@ extglob@^2.0.4: extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= fast-deep-equal@^3.1.1: version "3.1.3" @@ -3832,10 +3404,10 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -faye-websocket@^0.11.3, faye-websocket@^0.11.4: - version "0.11.4" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" - integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== +faye-websocket@^0.11.3: + version "0.11.3" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e" + integrity sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA== dependencies: websocket-driver ">=0.5.1" @@ -3867,7 +3439,7 @@ file-uri-to-path@1.0.0: fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" @@ -3881,17 +3453,17 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== dependencies: debug "2.6.9" encodeurl "~1.0.2" escape-html "~1.0.3" - on-finished "2.4.1" + on-finished "~2.3.0" parseurl "~1.3.3" - statuses "2.0.1" + statuses "~1.5.0" unpipe "~1.0.0" find-cache-dir@^2.1.0: @@ -3904,9 +3476,9 @@ find-cache-dir@^2.1.0: pkg-dir "^3.0.0" find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== dependencies: commondir "^1.0.1" make-dir "^3.0.2" @@ -3936,24 +3508,24 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= foreach@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.6.tgz#87bcc8a1a0e74000ff2bf9802110708cfb02eb6e" - integrity sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg== + 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 sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: version "2.3.3" @@ -3964,27 +3536,27 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + 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 sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g== + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= dependencies: inherits "^2.0.1" readable-stream "^2.0.0" @@ -4001,7 +3573,7 @@ fs-extra@^7.0.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 sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA== + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= dependencies: graceful-fs "^4.1.2" iferr "^0.1.5" @@ -4011,7 +3583,7 @@ fs-write-stream-atomic@^1.0.8: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^1.2.7: version "1.2.13" @@ -4021,7 +3593,7 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@~2.3.2: +fsevents@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -4031,21 +3603,6 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" - integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - functions-have-names "^1.2.2" - -functions-have-names@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" - integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -4056,14 +3613,14 @@ get-caller-file@^2.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" - integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== dependencies: function-bind "^1.1.1" has "^1.0.3" - has-symbols "^1.0.3" + has-symbols "^1.0.1" get-own-enumerable-property-symbols@^3.0.0: version "3.0.2" @@ -4084,35 +3641,27 @@ get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA== + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@~5.1.2: +glob-parent@~5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -4122,17 +3671,17 @@ glob-parent@~5.1.2: 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 sha512-Iozmtbqv0noj0uDDqoL0zNq0VBEfK2YFoMAZoxJe4cwphvLR+JskfF30QhXHOR4m3KrE6NLRYw+U9MRXvifyig== + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= glob@^7.0.3, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.1.1" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" @@ -4159,7 +3708,7 @@ globals@^11.1.0: globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - integrity sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw== + integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= dependencies: array-union "^1.0.1" glob "^7.0.3" @@ -4170,7 +3719,7 @@ globby@^6.1.0: globby@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" - integrity sha512-yANWAN2DUcBtuus5Cpd+SKROzXHs2iVXFZt/Ykrfz6SAXqacLX25NZpltE+39ceMexYF4TtEadjuSTw8+3wX4g== + integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA= dependencies: array-union "^1.0.1" dir-glob "^2.0.0" @@ -4193,13 +3742,6 @@ globby@^9.2.0: pify "^4.0.1" slash "^2.0.0" -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" - got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -4218,9 +3760,9 @@ got@^9.6.0: url-parse-lax "^3.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + version "4.2.6" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== gray-matter@^4.0.1: version "4.0.3" @@ -4240,7 +3782,7 @@ handle-thing@^2.0.0: har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.3: version "5.1.5" @@ -4250,44 +3792,37 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" -has-bigints@^1.0.1, has-bigints@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" - integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== +has-ansi@^2.0.0: + version "2.0.0" + 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-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" - integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== - dependencies: - get-intrinsic "^1.1.1" - -has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -4296,7 +3831,7 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -4305,12 +3840,12 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" @@ -4339,12 +3874,7 @@ hash-base@^3.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 sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA== - -hash-sum@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/hash-sum/-/hash-sum-2.0.0.tgz#81d01bb5de8ea4a214ad5d6ead1b523460b0b45a" - integrity sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg== + integrity sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ= hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" @@ -4354,7 +3884,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -he@1.2.x, he@^1.2.0: +he@1.2.x, he@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -4364,15 +3894,10 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highlight.js@^9.7.0: - version "9.18.5" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.5.tgz#d18a359867f378c138d6819edfc2a8acd5f29825" - integrity sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA== - hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -4381,7 +3906,7 @@ hmac-drbg@^1.0.1: hogan.js@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd" - integrity sha512-RqGs4wavGYJWE07t35JQccByczmNUXQT0E12ZYV1VKYu5UiAU9lsos/yBAcf840+zrUQQxgVduCR5/B8nNtibg== + integrity sha1-TNnhq9QpQUbnZ55B14mHMrAse/0= dependencies: mkdirp "0.3.0" nopt "1.0.10" @@ -4389,7 +3914,7 @@ hogan.js@^3.0.2: hpack.js@^2.1.6: version "2.1.6" resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" - integrity sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ== + integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI= dependencies: inherits "^2.0.1" obuf "^1.0.0" @@ -4399,12 +3924,12 @@ hpack.js@^2.1.6: hsl-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" - integrity sha512-M5ezZw4LzXbBKMruP+BNANf0k+19hDQMgpzBIYnya//Al+fjNct9Wf3b1WedLqdEs2hKBvxq/jh+DsHJLj0F9A== + integrity sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4= hsla-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hsla-regex/-/hsla-regex-1.0.0.tgz#c1ce7a3168c8c6614033a4b5f7877f3b225f9c38" - integrity sha512-7Wn5GMLuHBjZCb2bTmnDOycho0p/7UVaAeqXZGbHrBCl6Yd/xDhQJAXe6Ga9AXJH2I5zY1dEdYw2u1UptnSBJA== + integrity sha1-wc56MWjIxmFAM6S194d/OyJfnDg= html-entities@^1.3.1: version "1.4.0" @@ -4427,22 +3952,24 @@ html-minifier@^3.2.3: html-tags@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-2.0.0.tgz#10b30a386085f43cede353cc8fa7cb0deeea668b" - integrity sha512-+Il6N8cCo2wB/Vd3gqy/8TZhTD3QvcVeQLCnZiGkGCH3JP28IgGAY41giccp2W4R3jfyJPAP318FQTa1yU7K7g== + integrity sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos= html-tags@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.2.0.tgz#dbb3518d20b726524e4dd43de397eb0a95726961" - integrity sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg== - -htmlparser2@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" - integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.0.0" - domutils "^2.5.2" - entities "^2.0.0" + version "3.1.0" + resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140" + integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg== + +htmlparser2@^3.10.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" http-cache-semantics@^4.0.0: version "4.1.0" @@ -4452,33 +3979,44 @@ http-cache-semantics@^4.0.0: http-deceiver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" - integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== + integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" http-errors@~1.6.2: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= dependencies: depd "~1.1.2" inherits "2.0.3" setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + http-parser-js@>=0.5.1: - version "0.5.8" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" - integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== + version "0.5.3" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" + integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== http-proxy-middleware@0.19.1: version "0.19.1" @@ -4490,18 +4028,7 @@ http-proxy-middleware@0.19.1: lodash "^4.17.11" micromatch "^3.1.10" -http-proxy-middleware@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.3.1.tgz#43700d6d9eecb7419bf086a128d0f7205d9eb665" - integrity sha512-13eVVDYS4z79w7f1+NPllJtOQFx/FdUW4btIvVRMaRlUY9VGstAbo5MOhLEuUgZFRHn3x50ufn25zkj/boZnEg== - dependencies: - "@types/http-proxy" "^1.17.5" - http-proxy "^1.18.1" - is-glob "^4.0.1" - is-plain-obj "^3.0.0" - micromatch "^4.0.2" - -http-proxy@^1.17.0, http-proxy@^1.18.1: +http-proxy@^1.17.0: version "1.18.1" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== @@ -4513,7 +4040,7 @@ http-proxy@^1.17.0, http-proxy@^1.18.1: http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -4522,7 +4049,7 @@ http-signature@~1.2.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 sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= iconv-lite@0.4.24: version "0.4.24" @@ -4534,7 +4061,7 @@ iconv-lite@0.4.24: 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 sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg== + integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0= icss-utils@^4.1.0: version "4.1.1" @@ -4551,7 +4078,7 @@ ieee754@^1.1.4: iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" - integrity sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA== + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= ignore@^3.3.5: version "3.3.10" @@ -4571,14 +4098,14 @@ immediate@^3.2.3: import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" - integrity sha512-Ew5AZzJQFqrOV5BTW3EIoHAnoie1LojZLXKcCQ/yTRyVZosBhK1x1ViYjHGf5pAFOq8ZyChZp6m/fSN7pJyZtg== + 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 sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg== + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= dependencies: caller-path "^2.0.0" resolve-from "^3.0.0" @@ -4586,14 +4113,14 @@ import-fresh@^2.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 sha512-0vdnLL2wSGnhlRmzHJAg5JHjt1l2vYhzJ7tNLGbeVg0fse56tpGaH0uzH+r9Slej+BSXXEHvBKDEnVSLLE9/+w== + 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 sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A== + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= import-local@^2.0.0: version "2.0.0" @@ -4606,12 +4133,12 @@ import-local@^2.0.0: imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indexes-of@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" - integrity sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA== + integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= infer-owner@^1.0.3: version "1.0.4" @@ -4621,7 +4148,7 @@ infer-owner@^1.0.3: inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -4634,12 +4161,12 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA== + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@1.3.7: version "1.3.7" @@ -4659,24 +4186,15 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw== + integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= ip@^1.1.0, ip@^1.1.5: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48" - integrity sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg== + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= ipaddr.js@1.9.1, ipaddr.js@^1.9.0: version "1.9.1" @@ -4686,7 +4204,7 @@ ipaddr.js@1.9.1, ipaddr.js@^1.9.0: 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 sha512-vOx7VprsKyllwjSkLV79NIhpyLfr3jAp7VaTCMXOJHu4m0Ew1CZ2fcjASwmV1jI3BWuWHB013M48eyeldk9gYg== + integrity sha1-UFMN+4T8yap9vnhS6Do3uTufKqY= is-absolute-url@^3.0.3: version "3.0.3" @@ -4696,7 +4214,7 @@ is-absolute-url@^3.0.3: is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" @@ -4708,17 +4226,16 @@ is-accessor-descriptor@^1.0.0: kind-of "^6.0.0" is-arguments@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" + integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + call-bind "^1.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 sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-arrayish@^0.3.1: version "0.3.2" @@ -4726,16 +4243,14 @@ is-arrayish@^0.3.1: integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" + integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= dependencies: binary-extensions "^1.0.0" @@ -4747,22 +4262,21 @@ is-binary-path@~2.1.0: binary-extensions "^2.0.0" is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" + integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + call-bind "^1.0.0" is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-callable@^1.1.4, is-callable@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" - integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== +is-callable@^1.1.4, is-callable@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" + integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== is-ci@^2.0.0: version "2.0.0" @@ -4774,7 +4288,7 @@ is-ci@^2.0.0: is-color-stop@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" - integrity sha512-H1U8Vz0cfXNujrJzEcvvwMDW9Ra+biSYA3ThdQvAnMLJkEHQXn6bWzLkxHtVYJ+Sdbx0b6finn3jZiaVe7MAHA== + integrity sha1-z/9HGu5N1cnhWFmPvhKWe1za00U= dependencies: css-color-names "^0.0.4" hex-color-regex "^1.1.0" @@ -4783,17 +4297,17 @@ is-color-stop@^1.0.0: rgb-regex "^1.0.1" rgba-regex "^1.0.0" -is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== +is-core-module@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.3.0.tgz#d341652e3408bca69c4671b79a0954a3d349f887" + integrity sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw== dependencies: has "^1.0.3" is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" @@ -4805,11 +4319,9 @@ is-data-descriptor@^1.0.0: kind-of "^6.0.0" is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.3.tgz#4c0802ae9c8097939ea8001eaae3c502f3dbe72f" + integrity sha512-tDpEUInNcy2Yw3lNSepK3Wdw1RnXLcIVienz6Ou631Acl15cJyRWK4dgA1vCmOEgIbtOV0W7MHg+AR2Gdg1NXQ== is-descriptor@^0.1.0: version "0.1.6" @@ -4832,12 +4344,12 @@ is-descriptor@^1.0.0, is-descriptor@^1.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 sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw== + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" @@ -4849,12 +4361,12 @@ is-extendable@^1.0.1: is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -4864,14 +4376,14 @@ is-fullwidth-code-point@^3.0.0: is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw== + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== dependencies: is-extglob "^2.1.1" @@ -4883,10 +4395,10 @@ is-installed-globally@^0.3.1: global-dirs "^2.0.1" is-path-inside "^3.0.1" -is-negative-zero@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" - integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== is-npm@^4.0.0: version "4.0.0" @@ -4894,16 +4406,14 @@ is-npm@^4.0.0: integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== is-number-object@^1.0.4: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" - integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== - dependencies: - has-tostringtag "^1.0.0" + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" + integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" @@ -4949,12 +4459,7 @@ is-path-inside@^3.0.1: is-plain-obj@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - -is-plain-obj@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" - integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" @@ -4963,13 +4468,13 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-regex@^1.0.4, is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== +is-regex@^1.0.4, is-regex@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" + integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== dependencies: call-bind "^1.0.2" - has-tostringtag "^1.0.0" + has-symbols "^1.0.1" is-regexp@^2.0.0: version "2.1.0" @@ -4981,43 +4486,27 @@ is-resolvable@^1.0.0: resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== -is-shared-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" - integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== - dependencies: - call-bind "^1.0.2" - is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== dependencies: - has-symbols "^1.0.2" + has-symbols "^1.0.1" is-typedarray@^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 sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - -is-weakref@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== - dependencies: - call-bind "^1.0.2" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-windows@^1.0.2: version "1.0.2" @@ -5027,7 +4516,7 @@ is-windows@^1.0.2: is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw== + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= is-yarn-global@^0.3.0: version "0.3.0" @@ -5037,7 +4526,7 @@ is-yarn-global@^0.3.0: isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isarray@^2.0.1: version "2.0.5" @@ -5047,29 +4536,29 @@ isarray@^2.0.1: isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= javascript-stringify@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" - integrity sha512-fnjC0up+0SjEJtgmmG+teeel68kutkvzfctO/KxE3qJlbunkJYAshgH3boU++gSBHP8z5/r0ts0qRIrHf0RTQQ== + integrity sha1-FC0RHzpuPa6PSpr9d9RYVbWpzOM= javascript-stringify@^2.0.1: version "2.1.0" @@ -5092,7 +4581,7 @@ js-yaml@^3.13.1: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsesc@^2.5.1: version "2.5.2" @@ -5102,12 +4591,12 @@ jsesc@^2.5.1: jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-buffer@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" @@ -5119,20 +4608,25 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== +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= 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 sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json3@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" + integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw== + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= json5@^1.0.1: version "1.0.1" @@ -5141,26 +4635,28 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +json5@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.4.0" + json-schema "0.2.3" verror "1.10.0" keyv@^3.0.0: @@ -5178,14 +4674,14 @@ killable@^1.0.1: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" @@ -5224,7 +4720,7 @@ linkify-it@^2.0.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 sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA== + integrity sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ= loader-runner@^2.4.0: version "2.4.0" @@ -5234,31 +4730,22 @@ loader-runner@^2.4.0: loader-utils@^0.2.16: version "0.2.17" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" - integrity sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug== + 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, loader-utils@^1.2.3: - version "1.4.2" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" - integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== +loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" + integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" - integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -5277,42 +4764,27 @@ locate-path@^5.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 sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== + integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== - -lodash.defaultsdeep@4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" - integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== - -lodash.findindex@4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.findindex/-/lodash.findindex-4.6.0.tgz#a3245dee61fb9b6e0624b535125624bb69c11106" - integrity sha1-oyRd7mH7m24GJLU1ElYku2nBEQY= - -lodash.isempty@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" - integrity sha1-b4bL7di+TsmHvpqvM8loTbGzHn4= + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= lodash.kebabcase@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" - integrity sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g== + integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY= lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== + integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= lodash.template@^4.5.0: version "4.5.0" @@ -5329,35 +4801,25 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.trimend@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.trimend/-/lodash.trimend-4.5.1.tgz#12804437286b98cad8996b79414e11300114082f" - integrity sha1-EoBENyhrmMrYmWt5QU4RMAEUCC8= - -lodash.trimstart@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.trimstart/-/lodash.trimstart-4.5.1.tgz#8ff4dec532d82486af59573c39445914e944a7f1" - integrity sha1-j/TexTLYJIavWVc8OURZFOlEp/E= - lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" - integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3, lodash@^4.17.5: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.3, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== loglevel@^1.6.8: - version "1.8.1" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.1.tgz#5c621f83d5b48c54ae93b6156353f555963377b4" - integrity sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg== + version "1.7.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" + integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" - integrity sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA== + integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" @@ -5402,12 +4864,12 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" @@ -5426,12 +4888,12 @@ markdown-it-chain@^1.3.0: 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 sha512-IxPOaq2LzrGuFGyYq80zaorXReh2ZHGFOB1/Hen429EJL1XkPI3FJTpx9TsJeua+j2qTru4h3W1TiCRdeivMmA== + 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 sha512-QCz3Hkd+r5gDYtS2xsFXmBYrgw6KuWcJZLCEkdfAuwzZbShCmCfta+hwAMq4NX/4xPzkSHduMKgMkkPUJxSXNg== + integrity sha1-m+4OmpkKljupbfaYDE/dsF37Tcw= markdown-it-table-of-contents@^0.4.0: version "0.4.4" @@ -5471,12 +4933,12 @@ mdn-data@2.0.4: mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== + 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 sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= medium-zoom@^1.0.4: version "1.0.6" @@ -5486,7 +4948,7 @@ medium-zoom@^1.0.4: memory-fs@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ== + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= dependencies: errno "^0.1.3" readable-stream "^2.0.1" @@ -5502,7 +4964,7 @@ memory-fs@^0.5.0: merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= merge-source-map@^1.1.0: version "1.1.0" @@ -5519,7 +4981,7 @@ merge2@^1.2.3: methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" @@ -5540,14 +5002,6 @@ micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.2: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -5556,17 +5010,17 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== +mime-db@1.47.0, "mime-db@>= 1.43.0 < 2": + version "1.47.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" + integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== -mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: + version "2.1.30" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" + integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== dependencies: - mime-db "1.52.0" + mime-db "1.47.0" mime@1.6.0: version "1.6.0" @@ -5574,9 +5028,9 @@ mime@1.6.0: integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== mime@^2.0.3, mime@^2.4.4: - version "2.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" - integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== + version "2.5.2" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" + integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" @@ -5586,7 +5040,7 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= dependencies: dom-walk "^0.1.0" @@ -5608,19 +5062,19 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: 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 sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.4: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimist@^1.2.0, minimist@^1.2.6: - version "1.2.7" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" - integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mississippi@^3.0.0: version "3.0.0" @@ -5649,29 +5103,29 @@ mixin-deep@^1.2.0: mkdirp@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" - integrity sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew== + integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4= -mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.6, mkdirp@~0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: - minimist "^1.2.6" + minimist "^1.2.5" mkdirp@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -moment@^2.29.4: - version "2.29.4" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" - integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== +moment@^2.29.2: + version "2.29.2" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4" + integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg== move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" - integrity sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ== + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= dependencies: aproba "^1.1.1" copy-concurrently "^1.0.0" @@ -5683,14 +5137,19 @@ move-concurrently@^1.0.1: ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.1.1: +ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -5698,7 +5157,7 @@ ms@2.1.3, ms@^2.1.1: multicast-dns-service-types@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" - integrity sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ== + integrity sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE= multicast-dns@^6.0.1: version "6.2.3" @@ -5709,14 +5168,9 @@ multicast-dns@^6.0.1: thunky "^1.0.2" nan@^2.12.1: - version "2.17.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" - integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== - -nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + version "2.14.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" + integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== nanomatch@^1.2.9: version "1.2.13" @@ -5735,10 +5189,10 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -negotiator@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== neo-async@^2.5.0, neo-async@^2.6.1: version "2.6.2" @@ -5791,22 +5245,22 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +node-releases@^1.1.71: + version "1.1.71" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" + integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== nopt@1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg== + integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= dependencies: abbrev "1" normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" @@ -5818,7 +5272,7 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" - integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== + integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= normalize-url@^2.0.1: version "2.0.1" @@ -5835,21 +5289,21 @@ normalize-url@^3.0.0: integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== + version "4.5.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== 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 sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" nprogress@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1" - integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA== + integrity sha1-y480xTIT2JVyP8urkH6UIq28r7E= nth-check@^1.0.2: version "1.0.2" @@ -5858,17 +5312,10 @@ nth-check@^1.0.2: dependencies: boolbase "~1.0.0" -nth-check@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" - integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== - 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 sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg== + integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= oauth-sign@~0.9.0: version "0.9.0" @@ -5878,21 +5325,21 @@ oauth-sign@~0.9.0: object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.12.2, object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.9.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.2.tgz#b6385a3e2b7cae0b5eafcf90cddf85d128767f30" + integrity sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA== object-is@^1.0.1: version "1.1.5" @@ -5902,7 +5349,7 @@ object-is@^1.0.1: call-bind "^1.0.2" define-properties "^1.1.3" -object-keys@^1.0.11, object-keys@^1.1.0, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.0, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -5910,55 +5357,55 @@ object-keys@^1.0.11, object-keys@^1.1.0, object-keys@^1.1.1: object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" -object.assign@^4.1.0, object.assign@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" - integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== +object.assign@^4.1.0, object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - has-symbols "^1.0.3" + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: - version "2.1.5" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" - integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== dependencies: - array.prototype.reduce "^1.0.5" call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" object.values@^1.1.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" - integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== + version "1.1.3" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.3.tgz#eaa8b1e17589f02f698db093f7c62ee1699742ee" + integrity sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + has "^1.0.3" obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= dependencies: ee-first "1.1.1" @@ -5970,7 +5417,7 @@ on-headers@~1.0.2: once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" @@ -5987,17 +5434,24 @@ opn@^5.5.0: is-wsl "^1.1.0" optimize-css-assets-webpack-plugin@^5.0.1: - version "5.0.8" - resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.8.tgz#cbccdcf5a6ef61d4f8cc78cf083a67446e5f402a" - integrity sha512-mgFS1JdOtEGzD8l+EuISqL57cKO+We9GcoiQEmdCWRqqck+FGNmYJtx9qfAPzEz+lRrlThWMuGDaRkI/yWNx/Q== + version "5.0.4" + resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.4.tgz#85883c6528aaa02e30bbad9908c92926bb52dc90" + integrity sha512-wqd6FdI2a5/FdoiCNNkEvLeA//lHHfG24Ln2Xm2qqdIk4aOlsR18jwpyOihqQ8849W3qu2DX8fOYxpvTMj+93A== dependencies: cssnano "^4.1.10" last-call-webpack-plugin "^3.0.0" +original@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" + integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== + dependencies: + url-parse "^1.4.3" + os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= p-cancelable@^1.0.0: version "1.1.0" @@ -6007,7 +5461,7 @@ p-cancelable@^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 sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.2.1: version "2.3.0" @@ -6074,7 +5528,7 @@ parallel-transform@^1.1.0: param-case@2.1.x: version "2.1.1" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" - integrity sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w== + integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= dependencies: no-case "^2.2.0" @@ -6092,7 +5546,7 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" @@ -6105,7 +5559,7 @@ parseurl@~1.3.2, parseurl@~1.3.3: pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-browserify@0.0.1: version "0.0.1" @@ -6115,12 +5569,12 @@ path-browserify@0.0.1: path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== + 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 sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-exists@^4.0.0: version "4.0.0" @@ -6130,19 +5584,19 @@ path-exists@^4.0.0: 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 sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w== + 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 sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.7: +path-parse@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -6150,7 +5604,7 @@ path-parse@^1.0.7: path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= path-type@^3.0.0: version "3.0.0" @@ -6173,32 +5627,27 @@ pbkdf2@^3.0.3: performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= picocolors@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d" + integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg== pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pify@^4.0.1: version "4.0.1" @@ -6208,14 +5657,14 @@ pify@^4.0.1: pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw== + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg== + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pkg-dir@^3.0.0: version "3.0.0" @@ -6232,18 +5681,18 @@ pkg-dir@^4.1.0: find-up "^4.0.0" portfinder@^1.0.13, portfinder@^1.0.26: - version "1.0.32" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.32.tgz#2fe1b9e58389712429dc2bea5beb2146146c7f81" - integrity sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg== + version "1.0.28" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778" + integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== dependencies: - async "^2.6.4" - debug "^3.2.7" - mkdirp "^0.5.6" + async "^2.6.2" + debug "^3.1.1" + mkdirp "^0.5.5" 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 sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= postcss-calc@^7.0.1: version "7.0.5" @@ -6540,9 +5989,9 @@ postcss-selector-parser@^3.0.0: uniq "^1.0.1" postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: - version "6.0.11" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc" - integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g== + version "6.0.5" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz#042d74e137db83e6f294712096cb413f5aa612c4" + integrity sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" @@ -6571,11 +6020,11 @@ postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.0, postcss-value-parser@^ integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + version "4.1.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" + integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== -postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6: +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: version "7.0.39" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== @@ -6583,24 +6032,15 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.2 picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.4.14: - version "8.4.20" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.20.tgz#64c52f509644cecad8567e949f4081d98349dc56" - integrity sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -"prettier@^1.18.2 || ^2.0.0": - version "2.8.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" - integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== +prettier@^1.18.2: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== pretty-error@^2.0.2: version "2.1.2" @@ -6616,9 +6056,9 @@ pretty-time@^1.1.0: integrity sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA== prismjs@^1.13.0: - version "1.29.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.29.0.tgz#f113555a8fa9b57c35e637bba27509dcf802dd12" - integrity sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q== + version "1.27.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" + integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== process-nextick-args@~2.0.0: version "2.0.1" @@ -6628,35 +6068,35 @@ process-nextick-args@~2.0.0: process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== +proxy-addr@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== dependencies: - forwarded "0.2.0" + forwarded "~0.1.2" ipaddr.js "1.9.1" prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== public-encrypt@^4.0.0: version "4.0.3" @@ -6698,12 +6138,12 @@ pumpify@^1.3.3: punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= punycode@^1.2.4: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" @@ -6720,19 +6160,17 @@ pupa@^2.0.1: q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + 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@^5.0.1: version "5.1.1" @@ -6746,12 +6184,12 @@ query-string@^5.0.1: 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 sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= querystringify@^2.1.1: version "2.2.0" @@ -6778,17 +6216,17 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== dependencies: - bytes "3.1.2" - http-errors "2.0.0" + bytes "3.1.0" + http-errors "1.7.2" iconv-lite "0.4.24" unpipe "1.0.0" -rc@1.2.8, rc@^1.2.8: +rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -6811,7 +6249,7 @@ rc@1.2.8, rc@^1.2.8: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.6, readable-stream@^3.6.0: +readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -6829,10 +6267,10 @@ readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== dependencies: picomatch "^2.2.1" @@ -6843,27 +6281,27 @@ reduce@^1.0.1: dependencies: object-keys "^1.1.0" -regenerate-unicode-properties@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" - integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== +regenerate-unicode-properties@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" + integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== dependencies: - regenerate "^1.4.2" + regenerate "^1.4.0" -regenerate@^1.4.2: +regenerate@^1.4.0: version "1.4.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.11: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== +regenerator-runtime@^0.13.4: + version "0.13.7" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" + integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== -regenerator-transform@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" - integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== +regenerator-transform@^0.14.2: + version "0.14.5" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" + integrity sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw== dependencies: "@babel/runtime" "^7.8.4" @@ -6875,33 +6313,32 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" - integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== +regexp.prototype.flags@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" + integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== dependencies: call-bind "^1.0.2" define-properties "^1.1.3" - functions-have-names "^1.2.2" -regexpu-core@^5.2.1: - version "5.2.2" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" - integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== +regexpu-core@^4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.1.tgz#2dea5a9a07233298fbf0db91fa9abc4c6e0f8ad6" + integrity sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ== dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsgen "^0.7.1" - regjsparser "^0.9.1" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.1.0" + regenerate "^1.4.0" + regenerate-unicode-properties "^8.2.0" + regjsgen "^0.5.1" + regjsparser "^0.6.4" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.2.0" registry-auth-token@^4.0.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.2.tgz#f02d49c3668884612ca031419491a13539e21fac" - integrity sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg== + version "4.2.1" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" + integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== dependencies: - rc "1.2.8" + rc "^1.2.8" registry-url@^5.0.0: version "5.1.0" @@ -6910,43 +6347,38 @@ registry-url@^5.0.0: dependencies: rc "^1.2.8" -regjsgen@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.7.1.tgz#ee5ef30e18d3f09b7c369b76e7c2373ed25546f6" - integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== +regjsgen@^0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" + integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== +regjsparser@^0.6.4: + version "0.6.9" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.9.tgz#b489eef7c9a2ce43727627011429cf833a7183e6" + integrity sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ== 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 sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== - -remove-markdown@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/remove-markdown/-/remove-markdown-0.3.0.tgz#5e4b667493a93579728f3d52ecc1db9ca505dc98" - integrity sha1-XktmdJOpNXlyjz1S7MHbnKUF3Jg= + integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= renderkid@^2.0.4: - version "2.0.7" - resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.7.tgz#464f276a6bdcee606f4a15993f9b29fc74ca8609" - integrity sha512-oCcFyxaMrKsKcTY59qnCAtmDVSLfPbrv6A3tVbPdFMMrv5jaK10V6m40cKsoPNhAqN6rmHW9sswW4o3ruSrwUQ== - dependencies: - css-select "^4.1.3" - dom-converter "^0.2.0" - htmlparser2 "^6.1.0" - lodash "^4.17.21" - strip-ansi "^3.0.1" + version "2.0.5" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.5.tgz#483b1ac59c6601ab30a7a596a5965cabccfdd0a5" + integrity sha512-ccqoLg+HLOHq1vdfYNm4TBeaCDIi1FLt3wGojTDSvdewUv65oTmI3cnT2E4hRjl1gzKZIPK+KZrXzlUYKnR+vQ== + dependencies: + css-select "^2.0.2" + dom-converter "^0.2" + htmlparser2 "^3.10.1" + lodash "^4.17.20" + strip-ansi "^3.0.0" repeat-element@^1.1.2: version "1.1.4" @@ -6956,7 +6388,7 @@ repeat-element@^1.1.2: repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= request@^2.87.0: version "2.88.2" @@ -6987,7 +6419,7 @@ request@^2.87.0: require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-main-filename@^2.0.0: version "2.0.0" @@ -6997,38 +6429,37 @@ require-main-filename@^2.0.0: requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" - integrity sha512-ccu8zQTrzVr954472aUVPLEcB3YpKSYR3cg/3lo1okzobPBM+1INXBbBZlDbnI/hbEocnf8j0QVo43hQKrbchg== + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= dependencies: resolve-from "^3.0.0" resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw== + integrity sha1-six699nWiBvItuZTM17rywoYh0g= resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.14.2, resolve@^1.22.0: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== +resolve@^1.14.2, resolve@^1.2.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" + is-core-module "^2.2.0" + path-parse "^1.0.6" responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ== + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= dependencies: lowercase-keys "^1.0.0" @@ -7040,17 +6471,17 @@ ret@~0.1.10: retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" - integrity sha512-gDK5mkALDFER2YLqH6imYvK6g02gpNGM4ILDZ472EwWfXZnC2ZEpoB2ECXTyOVUKuk/bPJZMzwQPBYICzP+D3w== + integrity sha1-wODWiC3w4jviVKR16O3UGRX+rrE= rgba-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" - integrity sha512-zgn5OjNQXLUTdq8m17KdaicF6w89TZs8ZU8y0AYENIU6wG8GG6LLm0yLSiPY8DmaYmHdgRW8rnApjoT0fQRfMg== + integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" @@ -7070,7 +6501,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: 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 sha512-ntymy489o0/QQplUDnpYAYUsO50K9SBrIVaKCWDOJzYJts0f9WH9RFJkyagebkw5+y1oi00R7ynNW/d12GBumg== + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= dependencies: aproba "^1.1.1" @@ -7079,24 +6510,15 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-regex-test@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" - integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.3" - is-regex "^1.1.4" - safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" @@ -7139,12 +6561,12 @@ section-matter@^1.0.0: select-hose@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" - integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== + integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= selfsigned@^1.10.8: - version "1.10.14" - resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.14.tgz#ee51d84d9dcecc61e07e4aba34f229ab525c1574" - integrity sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA== + version "1.10.11" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.11.tgz#24929cd906fe0f44b6d01fb23999a739537acbe9" + integrity sha512-aVmbPOfViZqOZPgRBT0+3u4yZFHpmnIghLMlAcb5/xhp5ZtB/RVnKhz5vl2M32CLXAqR4kha9zfhNg0Lf/sxKA== dependencies: node-forge "^0.10.0" @@ -7155,6 +6577,11 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" +semver@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" + integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== + semver@^5.1.0, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -7165,24 +6592,31 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semve resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== dependencies: debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" + 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 "2.0.0" + http-errors "~1.7.2" mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" + ms "2.1.1" + on-finished "~2.3.0" range-parser "~1.2.1" - statuses "2.0.1" + statuses "~1.5.0" + +serialize-javascript@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-3.1.0.tgz#8bf3a9170712664ef2561b44b691eafe399214ea" + integrity sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg== + dependencies: + randombytes "^2.1.0" serialize-javascript@^4.0.0: version "4.0.0" @@ -7191,17 +6625,10 @@ serialize-javascript@^4.0.0: dependencies: randombytes "^2.1.0" -serialize-javascript@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - serve-index@^1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" - integrity sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw== + integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= dependencies: accepts "~1.3.4" batch "0.6.1" @@ -7211,20 +6638,20 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.18.0" + send "0.17.1" set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" @@ -7239,17 +6666,17 @@ set-value@^2.0.0, set-value@^2.0.1: setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" @@ -7262,40 +6689,31 @@ sha.js@^2.4.0, sha.js@^2.4.8: shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg== + integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= dependencies: is-arrayish "^0.3.1" slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg== + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slash@^2.0.0: version "2.0.0" @@ -7338,29 +6756,30 @@ snapdragon@^0.8.1: use "^3.1.0" sockjs-client@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.6.1.tgz#350b8eda42d6d52ddc030c39943364c11dcad806" - integrity sha512-2g0tjOR+fRs0amxENLi/q5TiJTqY+WXFOzb5UwXndlK6TO3U/mirZznpx6w34HVMoc3g7cY24yC/ZMIYnDlfkw== + version "1.5.1" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.5.1.tgz#256908f6d5adfb94dabbdbd02c66362cca0f9ea6" + integrity sha512-VnVAb663fosipI/m6pqRXakEOw7nvd7TUgdr3PlR/8V2I95QIdwT8L4nMxhyU8SmDBHYXU1TOElaKOmKLfYzeQ== dependencies: - debug "^3.2.7" - eventsource "^2.0.2" - faye-websocket "^0.11.4" + debug "^3.2.6" + eventsource "^1.0.7" + faye-websocket "^0.11.3" inherits "^2.0.4" - url-parse "^1.5.10" + json3 "^3.3.3" + url-parse "^1.5.1" sockjs@^0.3.21: - version "0.3.24" - resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" - integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== + version "0.3.21" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.21.tgz#b34ffb98e796930b60a0cfa11904d6a339a7d417" + integrity sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw== dependencies: faye-websocket "^0.11.3" - uuid "^8.3.2" + uuid "^3.4.0" websocket-driver "^0.7.4" sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" - integrity sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg== + integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= dependencies: is-plain-obj "^1.0.0" @@ -7369,11 +6788,6 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -7386,9 +6800,9 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: urix "^0.1.0" source-map-support@~0.5.12: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -7401,12 +6815,12 @@ source-map-url@^0.4.0: source-map@0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - integrity sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA== + integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= -source-map@^0.5.6: +source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== + 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" @@ -7414,9 +6828,9 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== spdy-transport@^3.0.0: version "3.0.0" @@ -7451,12 +6865,12 @@ split-string@^3.0.1, split-string@^3.0.2: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -7490,27 +6904,22 @@ stack-utils@^1.0.1: static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -"statuses@>= 1.4.0 < 2": +"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= std-env@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/std-env/-/std-env-2.3.1.tgz#d42271908819c243f8defc77a140fc1fcee336a1" - integrity sha512-eOsoKTWnr6C8aWrqJJ2KAReXoa7Vn5Ywyw6uCXgA/xDhxPoaIsBa5aNJmISY04dLwXPBnDHW4diGM7Sn5K4R/g== + version "2.3.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-2.3.0.tgz#66d4a4a4d5224242ed8e43f5d65cfa9095216eee" + integrity sha512-4qT5B45+Kjef2Z6pE0BkskzsH0GO7GrND0wGlTM1ioUe3v0dGYx9ZJH0Aro/YyA8fqQ5EyIKDRjZojJYMFTflw== dependencies: - ci-info "^3.1.1" + ci-info "^3.0.0" stream-browserify@^2.0.1: version "2.0.2" @@ -7547,7 +6956,7 @@ stream-shift@^1.0.0: 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 sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" @@ -7559,31 +6968,29 @@ string-width@^3.0.0, string-width@^3.1.0: strip-ansi "^5.1.0" string-width@^4.0.0, string-width@^4.1.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" + strip-ansi "^6.0.0" -string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.1.3" -string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.1.3" string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" @@ -7599,10 +7006,10 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^3.0.1: +strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" @@ -7613,32 +7020,27 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== dependencies: - ansi-regex "^5.0.1" + ansi-regex "^5.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 sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g== + integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== - -striptags@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.1.1.tgz#c8c3e7fdd6fb4bb3a32a3b752e5b5e3e38093ebd" - integrity sha1-yMPn/db7S7OjKjt1LltePjgJPr0= + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= stylehacks@^4.0.0: version "4.0.3" @@ -7672,6 +7074,11 @@ stylus@^0.54.8: semver "^6.3.0" source-map "^0.7.3" +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -7693,15 +7100,10 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - svg-tags@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764" - integrity sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA== + integrity sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q= svgo@^1.0.0: version "1.3.2" @@ -7748,9 +7150,9 @@ terser-webpack-plugin@^1.4.3: worker-farm "^1.7.0" terser@^4.1.2: - version "4.8.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" - integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== + version "4.8.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" + integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== dependencies: commander "^2.20.0" source-map "~0.6.1" @@ -7759,7 +7161,7 @@ terser@^4.1.2: text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= through2@^2.0.0: version "2.0.5" @@ -7772,7 +7174,7 @@ through2@^2.0.0: through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= thunky@^1.0.2: version "1.1.0" @@ -7789,7 +7191,7 @@ timers-browserify@^2.0.4: timsort@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" - integrity sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A== + integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= tiny-cookie@^2.1.1: version "2.3.2" @@ -7799,22 +7201,22 @@ tiny-cookie@^2.1.1: to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA== + 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 sha512-JVYrY42wMG7ddf+wBUQR/uHGbjUHZbLisJ8N62AMm0iTZ0p8YTcZLzdtomU0+H+wa99VbkyvQGB3zxB7NDzgIQ== + 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 sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" @@ -7826,7 +7228,7 @@ to-readable-stream@^1.0.0: to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" @@ -7848,10 +7250,10 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +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== toml@^3.0.0: version "3.0.0" @@ -7861,7 +7263,7 @@ toml@^3.0.0: toposort@^1.0.0: version "1.0.7" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" - integrity sha512-FclLrw8b9bMWf4QlCJuHBEVhSRsqDj6u3nIjAzPeJvgl//1hBlffdlk0MALceL14+koWEdU4ofRAXofbODxQzg== + integrity sha1-LmhELZ9k7HILjMieZEOsbKqVACk= tough-cookie@~2.5.0: version "2.5.0" @@ -7874,19 +7276,19 @@ tough-cookie@~2.5.0: tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw== + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" 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 sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-fest@^0.21.3: version "0.21.3" @@ -7898,7 +7300,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-is@~1.6.18: +type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -7916,7 +7318,7 @@ typedarray-to-buffer@^3.1.5: typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" @@ -7931,38 +7333,38 @@ uglify-js@3.4.x: commander "~2.19.0" source-map "~0.6.1" -unbox-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" - integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== +unbox-primitive@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== dependencies: - call-bind "^1.0.2" - has-bigints "^1.0.2" - has-symbols "^1.0.3" + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" -unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== +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@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" - integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== +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: - unicode-canonical-property-names-ecmascript "^2.0.0" - unicode-property-aliases-ecmascript "^2.0.0" + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" -unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== +unicode-match-property-value-ecmascript@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" + integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== -unicode-property-aliases-ecmascript@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" - integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +unicode-property-aliases-ecmascript@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" + integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== union-value@^1.0.0: version "1.0.1" @@ -7977,12 +7379,12 @@ union-value@^1.0.0: uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - integrity sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA== + integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" - integrity sha512-mZdDpf3vBV5Efh29kMw5tXoup/buMgxLzOt/XKFKcVmi+15ManNQWr6HfZ2aiZTYlYixbdNJ0KFmIZIv52tHSQ== + integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= unique-filename@^1.1.1: version "1.1.1" @@ -8013,17 +7415,17 @@ universalify@^0.1.0: unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= unquote@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544" - integrity sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg== + integrity sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -8033,14 +7435,6 @@ upath@^1.1.0, upath@^1.1.1: resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== -update-browserslist-db@^1.0.9: - version "1.0.10" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - update-notifier@^4.0.0: version "4.1.3" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3" @@ -8063,7 +7457,7 @@ update-notifier@^4.0.0: upper-case@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" - integrity sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA== + integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= uri-js@^4.2.2: version "4.4.1" @@ -8075,7 +7469,7 @@ uri-js@^4.2.2: urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= url-loader@^1.0.1: version "1.1.2" @@ -8089,11 +7483,11 @@ url-loader@^1.0.1: url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ== + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= dependencies: prepend-http "^2.0.0" -url-parse@^1.5.10: +url-parse@^1.4.3, url-parse@^1.5.1: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== @@ -8104,7 +7498,7 @@ url-parse@^1.5.10: url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= dependencies: punycode "1.3.2" querystring "0.2.0" @@ -8117,7 +7511,7 @@ use@^3.1.0: util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util.promisify@1.0.0: version "1.0.0" @@ -8140,7 +7534,7 @@ util.promisify@~1.0.0: util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ== + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= dependencies: inherits "2.0.1" @@ -8154,27 +7548,22 @@ util@^0.11.0: utila@~0.4: version "0.4.0" resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" - integrity sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA== + integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.3.2: +uuid@^3.3.2, uuid@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= vendors@^1.0.0: version "1.0.4" @@ -8184,7 +7573,7 @@ vendors@^1.0.0: verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -8208,9 +7597,9 @@ vue-hot-reload-api@^2.3.0: integrity sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog== vue-loader@^15.7.1: - version "15.10.1" - resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.10.1.tgz#c451c4cd05a911aae7b5dbbbc09fb913fb3cca18" - integrity sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA== + version "15.9.6" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.9.6.tgz#f4bb9ae20c3a8370af3ecf09b8126d38ffdb6b8b" + integrity sha512-j0cqiLzwbeImIC6nVIby2o/ABAWhlppyL/m5oJ67R5MloP0hj/DtFgb0Zmq3J9CG7AJ+AXIvHVnJAPBvrLyuDg== dependencies: "@vue/component-compiler-utils" "^3.1.0" hash-sum "^1.0.2" @@ -8219,22 +7608,22 @@ vue-loader@^15.7.1: vue-style-loader "^4.1.0" vue-router@^3.4.5: - version "3.6.5" - resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.6.5.tgz#95847d52b9a7e3f1361cb605c8e6441f202afad8" - integrity sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ== + version "3.5.1" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.5.1.tgz#edf3cf4907952d1e0583e079237220c5ff6eb6c9" + integrity sha512-RRQNLT8Mzr8z7eL4p7BtKvRaTSGdCbTy2+Mm5HTJvLGYSSeG9gDzNasJPP/yOYKLy+/cLG/ftrqq5fvkFwBJEw== vue-server-renderer@^2.6.10: - version "2.7.14" - resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.7.14.tgz#986f3fdca63fbb38bb6834698f11e0d6a81f182f" - integrity sha512-NlGFn24tnUrj7Sqb8njhIhWREuCJcM3140aMunLNcx951BHG8j3XOrPP7psSCaFA8z6L4IWEjudztdwTp1CBVw== + version "2.6.12" + resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.6.12.tgz#a8cb9c49439ef205293cb41c35d0d2b0541653a5" + integrity sha512-3LODaOsnQx7iMFTBLjki8xSyOxhCtbZ+nQie0wWY4iOVeEtTg1a3YQAjd82WvKxrWHHTshjvLb7OXMc2/dYuxw== dependencies: - chalk "^4.1.2" - hash-sum "^2.0.0" - he "^1.2.0" + chalk "^1.1.3" + hash-sum "^1.0.2" + he "^1.1.0" lodash.template "^4.5.0" lodash.uniq "^4.5.0" - resolve "^1.22.0" - serialize-javascript "^6.0.0" + resolve "^1.2.0" + serialize-javascript "^3.1.0" source-map "0.5.6" vue-style-loader@^4.1.0: @@ -8246,12 +7635,12 @@ vue-style-loader@^4.1.0: loader-utils "^1.0.2" vue-template-compiler@^2.6.10: - version "2.7.14" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz#4545b7dfb88090744c1577ae5ac3f964e61634b1" - integrity sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ== + version "2.6.12" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz#947ed7196744c8a5285ebe1233fe960437fcc57e" + integrity sha512-OzzZ52zS41YUbkCBfdXShQTe69j1gQDZ9HIX8miuC9C3rBCk9wIRjLiZZLrmX9V+Ftq/YEyv1JaVr5Y/hNtByg== dependencies: de-indent "^1.0.2" - he "^1.2.0" + he "^1.1.0" vue-template-es2015-compiler@^1.9.0: version "1.9.1" @@ -8259,12 +7648,9 @@ vue-template-es2015-compiler@^1.9.0: integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== vue@^2.6.10: - version "2.7.14" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.14.tgz#3743dcd248fd3a34d421ae456b864a0246bafb17" - integrity sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ== - dependencies: - "@vue/compiler-sfc" "2.7.14" - csstype "^3.1.0" + version "2.6.12" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123" + integrity sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg== vuepress-html-webpack-plugin@^3.2.0: version "3.2.0" @@ -8279,19 +7665,6 @@ vuepress-html-webpack-plugin@^3.2.0: toposort "^1.0.0" util.promisify "1.0.0" -vuepress-plugin-autometa@^0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/vuepress-plugin-autometa/-/vuepress-plugin-autometa-0.1.13.tgz#44a63e9fefb4feff88c00678d4d2b3d8e413209d" - integrity sha512-yhd8smLhbCO0+gc3FRNjOyffdGl12gUkv60UqdtEUCojEy4s7APDJ2pt85cSLASMdnWaY7EcMibMRkqeUOVAKg== - dependencies: - lodash.defaultsdeep "4.6.1" - lodash.findindex "4.6.0" - lodash.isempty "4.4.0" - lodash.trimend "^4.5.1" - lodash.trimstart "^4.5.1" - remove-markdown "0.3.0" - striptags "3.1.1" - vuepress-plugin-container@^2.0.2: version "2.1.5" resolved "https://registry.yarnpkg.com/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz#37fff05662fedbd63ffd3a5463b2592c7a7f3133" @@ -8335,13 +7708,12 @@ vuepress-plugin-smooth-scroll@^0.0.3: smoothscroll-polyfill "^0.4.3" vuepress@^1.8.2: - version "1.9.7" - resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.9.7.tgz#2cd6709a2228f5cef588115aaeabf820ab9ed7cc" - integrity sha512-aSXpoJBGhgjaWUsT1Zs/ZO8JdDWWsxZRlVme/E7QYpn+ZB9iunSgPMozJQNFaHzcRq4kPx5A4k9UhzLRcvtdMg== + version "1.8.2" + resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.8.2.tgz#97e8bf979630611fc7b621fc4cc35b798ee5e847" + integrity sha512-BU1lUDwsA3ghf7a9ga4dsf0iTc++Z/l7BR1kUagHWVBHw7HNRgRDfAZBDDQXhllMILVToIxaTifpne9mSi94OA== dependencies: - "@vuepress/core" "1.9.7" - "@vuepress/theme-default" "1.9.7" - "@vuepress/types" "1.9.7" + "@vuepress/core" "1.8.2" + "@vuepress/theme-default" "1.8.2" cac "^6.5.6" envinfo "^7.2.0" opencollective-postinstall "^2.0.2" @@ -8405,11 +7777,11 @@ webpack-dev-middleware@^3.7.2: webpack-log "^2.0.0" webpack-dev-server@^3.5.1: - version "3.11.3" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.11.3.tgz#8c86b9d2812bf135d3c9bce6f07b718e30f7c3d3" - integrity sha512-3x31rjbEQWKMNzacUZRE6wXvUFuGpH7vr0lIEbYpMAG9BOxi0928QU1BBswOAP3kg3H1O4hiS+sq4YyAn6ANnA== + version "3.11.2" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.11.2.tgz#695ebced76a4929f0d5de7fd73fafe185fe33708" + integrity sha512-A80BkuHRQfCiNtGBS1EMf2ChTUs0x+B3wGDFmOeT4rmJOHhHTCH2naNxIHhmkr0/UillP4U3yeIyv1pNp+QDLQ== dependencies: - ansi-html-community "0.0.8" + ansi-html "0.0.7" bonjour "^3.5.0" chokidar "^2.1.8" compression "^1.7.4" @@ -8526,7 +7898,7 @@ websocket-extensions@>=0.1.1: when@~3.6.x: version "3.6.4" resolved "https://registry.yarnpkg.com/when/-/when-3.6.4.tgz#473b517ec159e2b85005497a13983f095412e34e" - integrity sha512-d1VUP9F96w664lKINMGeElWdhhb5sC+thXM+ydZGU3ZnaE09Wv6FaS+mpM9570kcDs/xMfcXJBTLsMdHEFYY9Q== + integrity sha1-RztRfsFZ4rhQBUl6E5g/CVQS404= which-boxed-primitive@^1.0.2: version "1.0.2" @@ -8542,7 +7914,7 @@ which-boxed-primitive@^1.0.2: which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.2.9: version "1.3.1" @@ -8577,7 +7949,7 @@ wrap-ansi@^5.1.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write-file-atomic@^3.0.0: version "3.0.3" @@ -8614,7 +7986,7 @@ y18n@^4.0.0: yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.2: version "3.1.1" @@ -8648,4 +8020,4 @@ yargs@^13.3.2: zepto@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98" - integrity sha512-C1x6lfvBICFTQIMgbt3JqMOno3VOtkWat/xEakLTOurskYIHPmzJrzd1e8BnmtdDVJlGuk5D+FxyCA8MPmkIyA== + integrity sha1-4Se9nmb9hGvl6rSME5SIL3wOT5g= From 2130b8efd751e99aae5b935a817bcbe1b6b556c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 09:14:56 +0000 Subject: [PATCH 6/6] Bump qs from 6.5.2 to 6.5.3 Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4aed900eb..93b232b58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6168,9 +6168,9 @@ qs@6.7.0: integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== 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== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== query-string@^5.0.1: version "5.1.1"