├── .dockerignore ├── .github └── workflows │ ├── deploy.yml │ └── test-deploy.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── Dockerfile ├── LICENSE ├── OLD_README.md ├── README.md ├── babel.config.js ├── build_container.sh ├── docs ├── apis │ ├── api-account-get-balance.mdx │ ├── api-blockchain-ds-block-listing.mdx │ ├── api-blockchain-get-blockchain-info.mdx │ ├── api-blockchain-get-current-ds-epoch.mdx │ ├── api-blockchain-get-current-mini-epoch.mdx │ ├── api-blockchain-get-ds-block-rate.mdx │ ├── api-blockchain-get-ds-block.mdx │ ├── api-blockchain-get-latest-ds-block.mdx │ ├── api-blockchain-get-latest-tx-block.mdx │ ├── api-blockchain-get-miner-info.mdx │ ├── api-blockchain-get-network-id.mdx │ ├── api-blockchain-get-num-ds-blocks.mdx │ ├── api-blockchain-get-num-tx-blocks.mdx │ ├── api-blockchain-get-num-tx.mdx │ ├── api-blockchain-get-prev-difficulty.mdx │ ├── api-blockchain-get-prev-ds-difficulty.mdx │ ├── api-blockchain-get-total-coin-supply.mdx │ ├── api-blockchain-get-tx-block-rate.mdx │ ├── api-blockchain-get-tx-block.mdx │ ├── api-blockchain-get-tx-rate.mdx │ ├── api-blockchain-tx-block-listing.mdx │ ├── api-contract-get-contractaddress-from-txid.mdx │ ├── api-contract-get-smartcontract-code.mdx │ ├── api-contract-get-smartcontract-init.mdx │ ├── api-contract-get-smartcontract-state.mdx │ ├── api-contract-get-smartcontract-substate.mdx │ ├── api-contract-get-smartcontracts.mdx │ ├── api-contract-get-state-proof.mdx │ ├── api-introduction.mdx │ ├── api-transaction-create-tx.mdx │ ├── api-transaction-get-minimum-gas-price.mdx │ ├── api-transaction-get-num-txns-dsepoch.mdx │ ├── api-transaction-get-num-txns-txepoch.mdx │ ├── api-transaction-get-pending-tx.mdx │ ├── api-transaction-get-pending-txs.mdx │ ├── api-transaction-get-recent-txs.mdx │ ├── api-transaction-get-transaction-status.mdx │ ├── api-transaction-get-tx.mdx │ ├── api-transaction-get-txbodies-for-txblock-ex.mdx │ ├── api-transaction-get-txbodies-for-txblock.mdx │ ├── api-transaction-get-txs-for-txblock-ex.mdx │ └── api-transaction-get-txs-for-txblock.mdx ├── basics │ ├── basics-intro-accounts.md │ ├── basics-intro-blockchain.md │ ├── basics-intro-consensus.md │ ├── basics-intro-gas.md │ ├── basics-intro-txns.md │ ├── basics-zil-consensus.md │ ├── basics-zil-contract.md │ ├── basics-zil-gas.md │ ├── basics-zil-nodes.mdx │ ├── basics-zil-reward.md │ ├── basics-zil-schnorr-signatures.md │ └── basics-zil-sharding.mdx ├── contributors │ ├── contribute-bug-bounty.md │ ├── contribute-buildzil.md │ ├── contribute-guidelines.md │ ├── contribute-standards.md │ ├── core-accounts.md │ ├── core-blacklist.md │ ├── core-broadcasting.mdx │ ├── core-coinbase.md │ ├── core-consensus.md │ ├── core-diagnostic-data.md │ ├── core-difficulty-adjustment.mdx │ ├── core-ds-mimo.md │ ├── core-ds-reputation.md │ ├── core-gas-computation.md │ ├── core-gossip.md │ ├── core-guard-mode.mdx │ ├── core-incremental-db.md │ ├── core-intro.md │ ├── core-isolated-server.md │ ├── core-lookup.md │ ├── core-message-dispatch.md │ ├── core-message-queues.md │ ├── core-messaging-limits.md │ ├── core-multipliers.md │ ├── core-multisignatures.md │ ├── core-node-operation.md │ ├── core-por.md │ ├── core-pow.md │ ├── core-rejoin-mechanism.md │ ├── core-schnorr.md │ ├── core-scilla-operation.md │ ├── core-status-server.md │ ├── core-transaction-dispatch.md │ ├── core-transaction-lifecycle.md │ ├── core-view-change.md │ └── core-websocket-server.md ├── dev │ ├── dev-education-videos.mdx │ ├── dev-keys-introduction.md │ ├── dev-keys-ledger.md │ ├── dev-keys-magic.mdx │ ├── dev-keys-moonlet.md │ ├── dev-keys-pkey.md │ ├── dev-keys-zilpay.md │ ├── dev-keys-zrc2-wallet-support.mdx │ ├── dev-rentonzilliqa-components.md │ ├── dev-rentonzilliqa-contract.mdx │ ├── dev-rentonzilliqa-frontend.mdx │ ├── dev-rentonzilliqa-introduction.mdx │ ├── dev-rentonzilliqa-library.md │ ├── dev-rentonzilliqa-modals.md │ ├── dev-rentonzilliqa-mutable-variables.md │ ├── dev-rentonzilliqa-pages.md │ ├── dev-rentonzilliqa-procedures.md │ ├── dev-rentonzilliqa-scripting.md │ ├── dev-rentonzilliqa-transitions.md │ ├── dev-section-navigation.mdx │ ├── dev-started-env.md │ ├── dev-started-helloworld.mdx │ ├── dev-started-introduction.mdx │ ├── dev-tools-ceres.mdx │ ├── dev-tools-cli.md │ ├── dev-tools-explorer.mdx │ ├── dev-tools-faucet.mdx │ ├── dev-tools-gozilliqa.md │ ├── dev-tools-java.md │ ├── dev-tools-neosavant.mdx │ ├── dev-tools-sdks.md │ ├── dev-tools-websockets.md │ ├── dev-tools-zilliqajs.md │ ├── dev-txn-broadcasting.mdx │ ├── dev-txn-confirmation.mdx │ ├── dev-txn-polling.mdx │ ├── dev-txn-receipt.md │ ├── dev-txn-signing.mdx │ ├── dev-upgrade-v8.md │ └── dev-wrapped-tokens.md ├── exchanges │ ├── exchange-account-management.md │ ├── exchange-introduction.mdx │ ├── exchange-ip-whitelisting.md │ ├── exchange-key-whitelisting-1.md │ ├── exchange-key-whitelisting-2.md │ ├── exchange-managing-zrc2-tokens.md │ ├── exchange-sending-transactions.md │ ├── exchange-tracking-deposits.md │ ├── exchange-transaction-receipts.md │ ├── rosetta-construction-combine.md │ ├── rosetta-construction-derive.md │ ├── rosetta-construction-hash.md │ ├── rosetta-construction-mempool-transaction.md │ ├── rosetta-construction-metadata.md │ ├── rosetta-construction-parse.md │ ├── rosetta-construction-payload.md │ ├── rosetta-construction-preprocess.md │ ├── rosetta-construction-submit.md │ ├── rosetta-construction.md │ ├── rosetta-data-account-balance.md │ ├── rosetta-data-block transaction.md │ ├── rosetta-data-block.md │ ├── rosetta-data-network-list.md │ ├── rosetta-data-network-options.md │ ├── rosetta-data-network-status.md │ ├── rosetta-introduction.mdx │ ├── rosetta-setting-up-no-seed-node.md │ ├── rosetta-setting-up-seed-node.md │ └── rosetta-unsupported-api.md ├── miners │ ├── mining-additional-info.md │ ├── mining-getting-started.md │ ├── mining-proxy.mdx │ ├── mining-zilclient.md │ └── mining-zilminer.md └── staking │ ├── disclaimer.md │ ├── overview.md │ └── phase1 │ ├── delegator │ ├── staking-delegator-gzil.md │ ├── staking-delegator-operations.md │ ├── staking-delegator-overview.mdx │ └── staking-delegator-reading-contract-state.md │ ├── general-information.mdx │ ├── overview.md │ ├── ssn-operator │ ├── staking-ssn-before-you-start.md │ ├── staking-ssn-commission-management.md │ ├── staking-ssn-enrollment.md │ ├── staking-ssn-maintainance.md │ ├── staking-ssn-setup.mdx │ └── staking-ssn-upgrading.md │ ├── staking-error-codes.md │ └── staking-phase11-notice.md ├── docusaurus.config.js ├── examples ├── dapp │ ├── query-data.js │ └── validate-address.js └── exchange │ ├── .gitignore │ ├── README.md │ ├── config.dev.json │ ├── hot_wallet_key.json │ ├── package-lock.json │ ├── package.json │ ├── scripts │ └── test-withdraw.sh │ ├── src │ ├── app.ts │ ├── config.ts │ ├── controllers │ │ ├── deposit.ts │ │ ├── index.ts │ │ └── withdrawal.ts │ ├── cron │ │ ├── deposit.ts │ │ └── index.ts │ ├── repositories │ │ ├── deposit.ts │ │ └── index.ts │ ├── routes │ │ ├── deposit.ts │ │ ├── index.ts │ │ └── withdraw.ts │ └── services │ │ ├── index.ts │ │ └── zilliqa.ts │ └── tsconfig.json ├── package.json ├── run_container.sh ├── scripts └── ci_build.sh ├── sidebars.js ├── src ├── css │ └── custom.css ├── pages │ ├── components │ │ ├── cards_img01.js │ │ ├── cards_img02.js │ │ ├── cards_img03.js │ │ ├── cards_img04.js │ │ └── cards_img05.js │ ├── index.js │ └── styles.module.css └── theme │ └── SiteMetadata │ └── index.js ├── static ├── .nojekyll ├── CNAME └── img │ ├── basics │ ├── networksharding.png │ ├── technical-stack.png │ └── txnsharding.png │ ├── chain_bg.png │ ├── contributors │ └── core │ │ ├── account-management │ │ ├── image01.png │ │ ├── image02.png │ │ ├── image03.png │ │ ├── image04.png │ │ └── image05.png │ │ ├── consensus-protocol │ │ └── image01.jpg │ │ ├── difficulty-adjustment │ │ ├── image01.png │ │ └── image02.png │ │ ├── guard-mode │ │ └── image01.png │ │ ├── multisignatures │ │ ├── image01.png │ │ └── image02.png │ │ ├── nat-resolver │ │ ├── image01.png │ │ ├── image02.png │ │ └── image03.png │ │ ├── network-layout │ │ └── image01.png │ │ ├── rejoin-recovery │ │ └── rejoin.jpg │ │ ├── scilla-operation │ │ ├── image01.png │ │ └── image02.png │ │ ├── transaction-lifecycle │ │ └── image01.png │ │ └── tree-based-cluster-broadcasting │ │ ├── broadcast.png │ │ └── image01.jpg │ ├── dev │ ├── dapps-overview.png │ ├── getting-started │ │ ├── neo-savant-step1.png │ │ ├── neo-savant-step2.png │ │ ├── neo-savant-step3.png │ │ ├── nucleus-faucet.png │ │ └── zilpay-change-network-btn.png │ ├── rentonzilliqa │ │ ├── account.png │ │ ├── create-listing.png │ │ ├── listing-1.png │ │ ├── listing-2.png │ │ ├── listings.png │ │ └── update-listing.png │ ├── tools │ │ ├── ceres.png │ │ ├── customNetworkDetails.png │ │ ├── deployContract.png │ │ ├── deployDevex.png │ │ ├── deploySuccess.png │ │ ├── devex.png │ │ ├── devexNetworkChange.png │ │ ├── downloadLinux.png │ │ ├── downloadMAC.png │ │ ├── downloadWindows.png │ │ ├── explorerStartService.png │ │ ├── faucetRequest.png │ │ ├── isolatedStartService.png │ │ ├── neosavant.png │ │ ├── scillaStartService.png │ │ └── viewblock.png │ └── wzil │ │ ├── burn_wzil_1.png │ │ ├── burn_wzil_2.png │ │ ├── import_contract_1.png │ │ ├── mint_wzil_1.png │ │ ├── mint_wzil_2.png │ │ ├── pillar_wzil.png │ │ └── wZIL.png │ ├── exchanges │ └── rosetta.png │ ├── favicon.png │ ├── hand.png │ ├── hand_light.png │ ├── logo.png │ └── miners │ └── proxy-mining.png ├── stop_container.sh └── yarn.lock /.dockerignore: -------------------------------------------------------------------------------- 1 | */node_modules 2 | *.log 3 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | # Deploy /build/ to Github Pages 2 | name: Deploy dev-portal to GitHub Pages 3 | 4 | # Here to force a workflow run 0 5 | 6 | on: 7 | push: 8 | branches: 9 | - master 10 | 11 | permissions: 12 | contents: read 13 | id-token: write 14 | pages: write 15 | 16 | jobs: 17 | deploy: 18 | name: Deploy to GitHub Pages 19 | runs-on: ubuntu-latest 20 | environment: 21 | name: github-pages 22 | url: ${{ steps.deployment.outputs.page_url }} 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: actions/setup-node@v2 26 | with: 27 | node-version: 16.x 28 | cache: yarn 29 | - name: Build website 30 | env: 31 | BASE_URL: ${{secrets.BASE_URL}} 32 | working-directory: docs 33 | run: | 34 | rm -rf node_modules && yarn cache clean 35 | yarn install --frozen-lockfile 36 | yarn build 37 | 38 | # Use github actions to deploy to github pages 39 | - name: Upload artifact 40 | uses: actions/upload-pages-artifact@v1 41 | with: 42 | path: './build' 43 | - name: Deploy to gh pages 44 | id: deployment 45 | uses: actions/deploy-pages@v1 46 | with: 47 | token: ${{ secrets.GITHUB_TOKEN }} 48 | 49 | -------------------------------------------------------------------------------- /.github/workflows/test-deploy.yml: -------------------------------------------------------------------------------- 1 | # Checks if the PR can be built 2 | name: Test if PR can be built 3 | 4 | on: 5 | pull_request: 6 | branches: 7 | - master 8 | 9 | jobs: 10 | build-n-test: 11 | name: Build & test PR 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v2 16 | with: 17 | node-version: 16.x 18 | cache: yarn 19 | - name: Test build 20 | working-directory: docs 21 | run: | 22 | rm -rf node_modules && yarn cache clean 23 | yarn install --frozen-lockfile 24 | yarn build 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | 22 | # Emacs backups 23 | *~ 24 | .\#* 25 | \#* 26 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | 2 | # Development folders and files # 3 | ################################# 4 | .tmp/ 5 | node_modules/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10.16 as build-stage 2 | 3 | WORKDIR /app 4 | COPY ./package.json ./ 5 | COPY ./yarn.lock ./ 6 | RUN yarn install 7 | COPY ./docusaurus.config.js ./ 8 | COPY . ./ 9 | RUN yarn build 10 | 11 | FROM nginx:stable-alpine as production-stage 12 | COPY --from=build-stage /app/build /usr/share/nginx/html 13 | COPY --from=build-stage /app/static /usr/share/nginx/html/static 14 | EXPOSE 80 15 | ENTRYPOINT ["nginx", "-g", "daemon off;"] 16 | -------------------------------------------------------------------------------- /OLD_README.md: -------------------------------------------------------------------------------- 1 | # Zilliqa Developer Portal 2 | 3 | [![Discord chat](https://img.shields.io/discord/370992535725932544.svg)](https://discord.gg/XMRE9tt) 4 | 5 | This repository holds the source files for Zilliqa's developer portal website. 6 | 7 | ### Installation 8 | 9 | ``` 10 | $ yarn 11 | ``` 12 | 13 | ### Local Development 14 | 15 | ``` 16 | $ yarn start 17 | ``` 18 | 19 | This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. 20 | 21 | ### Local Deployment via Docker container 22 | 23 | To build the docker container 24 | 25 | ``` 26 | ./build_container.sh 27 | ``` 28 | 29 | To run the container 30 | 31 | ``` 32 | ./run_container.sh 33 | ``` 34 | 35 | You can then access the site via 36 | 37 | ``` 38 | http://localhost:8080 39 | ``` 40 | 41 | To stop and remove the container 42 | 43 | ``` 44 | ./stop_container.sh 45 | ``` 46 | 47 | ### Build 48 | 49 | ``` 50 | $ yarn build 51 | ``` 52 | 53 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 54 | 55 | ### Deployment 56 | 57 | This is done via github actions. 58 | 59 | Docusaurus takes its `baseUrl` from the `BASE_URL` environment variable, which is taken from the `BASE_URL` secret for the `github-pages` environment. 60 | You will need to explicitly whitelist `master` in the allowed branches protection rules for `github-pages`, or deployment will fail with `Invalid deployment branch and no branch protection rules set in the environment`. 61 | 62 | If you don't specify a secret, we'll build for the root - suitable for a production deploying with a custom URL, but best to explicitly set a root as `/`, just in case. 63 | 64 | The staging site is held in a separate repository; push to it with `-f` and deploy to "ordinary" pages. 65 | If you do, we'll use that as the base URL - for the staging repo, set the `BASE_URL` secret to `//`. 66 | 67 | You can then issue a PR to the production repo against your staging repo with (hopefully!) the security that it will deploy correctly. 68 | 69 | 70 | ### Utilities 71 | 72 | #### Check all links return HTTP status 200 73 | 74 | ``` 75 | cd docs 76 | find */*.md -exec npx markdown-link-check {} \; 77 | ``` 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deprecation Notice 2 | 3 | This repository has been deprecated in favor of the [Zilliqa Developer Repo](https://github.com/Zilliqa/zilliqa-developer) 4 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /build_container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build -t dev-portal:1.0 . 4 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-current-ds-epoch.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-current-ds-epoch 3 | title: GetCurrentDSEpoch 4 | --- 5 | 6 | --- 7 | 8 | Returns the current number of DS blocks in the network. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetCurrentDSEpoch", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const currentDSEpoch = await zilliqa.blockchain.getCurrentDSEpoch(); 42 | console.log(currentDSEpoch.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep currentDSEpoch = client.getCurrentDSEpoch(); 53 | System.out.println(new Gson().toJson(currentDSEpoch)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetCurrentDSEpoch()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetCurrentDSEpoch() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetCurrentDSEpoch() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": "5898" 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | --------------------- | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetCurrentDSEpoch"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-current-mini-epoch.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-current-mini-epoch 3 | title: GetCurrentMiniEpoch 4 | --- 5 | 6 | --- 7 | 8 | Returns the current TX block number of the network. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetCurrentMiniEpoch", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const currentMiniEpoch = await zilliqa.blockchain.getCurrentMiniEpoch(); 42 | console.log(currentMiniEpoch.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep currentMiniEpoch = client.getCurrentMiniEpoch(); 53 | System.out.println(new Gson().toJson(currentMiniEpoch)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetCurrentMiniEpoch()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetCurrentMiniEpoch() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetCurrentMiniEpoch() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": "589793" 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ----------------------- | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetCurrentMiniEpoch"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-ds-block-rate.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-ds-block-rate 3 | title: GetDSBlockRate 4 | --- 5 | 6 | --- 7 | 8 | Returns the current Directory Service blockrate per second. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetDSBlockRate", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const dsBlockRate = await zilliqa.blockchain.getDSBlockRate(); 42 | console.log(dsBlockRate.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep dsBlockRate = client.getDSBlockRate(); 53 | System.out.println(new Gson().toJson(dsBlockRate)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetDSBlockRate()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetDSBlockRate() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetDSBlockRate() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": 0.00014142137245459714 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ------------------ | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetDSBlockRate"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-num-ds-blocks.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-num-ds-blocks 3 | title: GetNumDSBlocks 4 | --- 5 | 6 | --- 7 | 8 | Returns the current number of validated Directory Service blocks in the network. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetNumDSBlocks", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const numDsBlock = await zilliqa.blockchain.getNumDSBlocks(); 42 | console.log(numDsBlock.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep numDSBlocks = client.getNumDSBlocks(); 53 | System.out.println(new Gson().toJson(numDSBlocks)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetNumDSBlocks()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetNumDSBlocks() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetNumDSBlocks() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": "5899" 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ------------------ | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetNumDSBlocks"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-num-tx-blocks.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-num-tx-blocks 3 | title: GetNumTxBlocks 4 | --- 5 | 6 | --- 7 | 8 | Returns the current number of Transaction blocks in the network. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetNumTxBlocks", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const numTxBlock = await zilliqa.blockchain.getNumTxBlocks(); 42 | console.log(numTxBlock.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep numTxBlocks = client.getNumTxBlocks(); 53 | System.out.println(new Gson().toJson(numTxBlocks)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetNumTxBlocks()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetNumTxBlocks() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetNumTxBlocks() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": "589790" 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ------------------ | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetNumTxBlocks"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-num-tx.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-num-tx 3 | title: GetNumTransactions 4 | --- 5 | 6 | --- 7 | 8 | Returns the current number of validated Transactions in the network. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetNumTransactions", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const numTransactions = await zilliqa.blockchain.getNumTransactions(); 42 | console.log(numTransactions.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep numTransactions = client.getNumTransactions(); 53 | System.out.println(new Gson().toJson(numTransactions)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetNumTransactions()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetNumTransactions() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetNumTransactions() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": "4350695" 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ---------------------- | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetNumTransactions"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-prev-difficulty.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-prev-difficulty 3 | title: GetPrevDifficulty 4 | --- 5 | 6 | --- 7 | 8 | Returns the minimum shard difficulty of the previous block. This is represented as an `Number`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetPrevDifficulty", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const prevDifficulty = await zilliqa.blockchain.getPrevDifficulty(); 42 | console.log(prevDifficulty.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep prevDifficulty = client.getPrevDifficulty(); 53 | System.out.println(new Gson().toJson(prevDifficulty)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetPrevDifficulty()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetPrevDifficulty() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetPrevDifficulty() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": 91 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | --------------------- | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetPrevDifficulty"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-prev-ds-difficulty.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-prev-ds-difficulty 3 | title: GetPrevDSDifficulty 4 | --- 5 | 6 | --- 7 | 8 | Returns the minimum DS difficulty of the previous block. This is represented as an `Number`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetPrevDSDifficulty", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const prevDSDifficulty = await zilliqa.blockchain.getPrevDSDifficulty(); 42 | console.log(prevDSDifficulty.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep prevDSDifficulty = client.getPrevDSDifficulty(); 53 | System.out.println(new Gson().toJson(prevDSDifficulty)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetPrevDSDifficulty()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetPrevDSDifficulty() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetPrevDSDifficulty() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": 149 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ----------------------- | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetPrevDSDifficulty"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-tx-block-rate.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-tx-block-rate 3 | title: GetTxBlockRate 4 | --- 5 | 6 | --- 7 | 8 | Returns the current Transaction blockrate per second for the network. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetTxBlockRate", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const txBlockRate = await zilliqa.blockchain.getTxBlockRate(); 42 | console.log(txBlockRate.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep txBlockRate = client.getTxBlockRate(); 53 | System.out.println(new Gson().toJson(txBlockRate)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetTxBlockRate()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetTxBlockRate() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetTxBlockRate() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": 0.014138050978963283 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ------------------ | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetTxBlockRate"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-blockchain-get-tx-rate.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-blockchain-get-tx-rate 3 | title: GetTransactionRate 4 | --- 5 | 6 | --- 7 | 8 | Returns the current Transaction rate per second **(TPS)** of the network. This is represented as an `Number`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetTransactionRate", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const transactionRate = await zilliqa.blockchain.getTransactionRate(); 42 | console.log(transactionRate.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 52 | Rep transactionRate = client.getTransactionRate(); 53 | System.out.println(new Gson().toJson(transactionRate)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | ```python 62 | from pyzil.zilliqa import chain 63 | chain.set_active_chain(chain.MainNet) 64 | print(chain.active_chain.api.GetTransactionRate()) 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | ```go 72 | func GetTransactionRate() { 73 | provider := NewProvider("https://api.zilliqa.com/") 74 | response := provider.GetTransactionRate() 75 | result, _ := json.Marshal(response) 76 | fmt.Println(string(result)) 77 | } 78 | ``` 79 | 80 | 81 | 82 | 83 | ### Example Response 84 | 85 | ```json 86 | { 87 | "id": "1", 88 | "jsonrpc": "2.0", 89 | "result": 9.169180550334216 90 | } 91 | ``` 92 | 93 | ### HTTP Request 94 | 95 | | Chain(s) | URL(s) | 96 | | --------------------- | -------------------------------------------- | 97 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 98 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 99 | | **Local testnet** | http://localhost:4201/ | 100 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 101 | 102 | ### Arguments 103 | 104 | | Parameter | Type | Required | Description | 105 | | --------- | ------ | -------- | ---------------------- | 106 | | `id` | string | Required | `"1"` | 107 | | `jsonrpc` | string | Required | `"2.0"` | 108 | | `method` | string | Required | `"GetTransactionRate"` | 109 | | `params` | string | Required | Empty string `""` | 110 | -------------------------------------------------------------------------------- /docs/apis/api-introduction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-introduction 3 | title: Introduction 4 | keywords: 5 | - api 6 | - introduction 7 | description: Zilliqa JSON RPC API 8 | --- 9 | 10 | --- 11 | 12 | [JSON-RPC](https://en.wikipedia.org/wiki/JSON-RPC) is a remote procedure call protocol encoded in JSON. You can use this API to access data from the Zilliqa nodes. 13 | The JSON-RPC API server runs on: 14 | 15 | | Chain(s) | URL(s) | 16 | | --------------------- | -------------------------------------------- | 17 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 18 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 19 | | **Local testnet** | http://localhost:4201/ | 20 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 21 | 22 | You can use the following block explorers for the various networks 23 | 24 | | Chain(s) | Explorer link | 25 | | --------------------- | ----------------------------------------------------------------------------------------------------------------------- | 26 | | **Zilliqa mainnet** | https://viewblock.io/zilliqa
https://devex.zilliqa.com/ | 27 | | **Developer testnet** | https://viewblock.io/zilliqa?network=testnet
https://devex.zilliqa.com/?network=https%3A%2F%2Fdev-api.zilliqa.com | 28 | | **Local testnet** | https://devex.zilliqa.com/?network=http%3A%2F%2Flocalhost%3A4201%2F | 29 | | **Isolated server** | https://devex.zilliqa.com/?network=https%3A%2F%2Fzilliqa-isolated-server.zilliqa.com | 30 | 31 | All API calls are POST requests. 32 | 33 | All requests follow the standard JSON-RPC format and include 4 variables in the data object: 34 | 35 | | Data object | Example | 36 | | ----------- | :------------------ | 37 | | `id` | e.g. `"1"` | 38 | | `jsonrpc` | e.g. `"2.0"` | 39 | | `method` | e.g. `"GetBalance"` | 40 | | `params` | e.g. `["1"]` | 41 | -------------------------------------------------------------------------------- /docs/apis/api-transaction-get-minimum-gas-price.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-transaction-get-minimum-gas-price 3 | title: GetMinimumGasPrice 4 | --- 5 | 6 | --- 7 | 8 | Returns the minimum gas price for this DS epoch, measured in the smallest price unit **Qa** (or 10^-12 **Zil**) in Zilliqa. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetMinimumGasPrice", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const minimumGasPrice = await zilliqa.blockchain.getMinimumGasPrice(); 42 | console.log(minimumGasPrice.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com"); 52 | Rep minimumGasPrice = client.getMinimumGasPrice(); 53 | System.out.println(new Gson().toJson(minimumGasPrice)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | 62 | ```python 63 | from pyzil.zilliqa import chain 64 | chain.set_active_chain(chain.MainNet) 65 | print(chain.active_chain.api.GetMinimumGasPrice()) 66 | ``` 67 | 68 | 69 | 70 | 71 | 72 | ```go 73 | func GetMinimumGasPrice() { 74 | provider := NewProvider("https://api.zilliqa.com/") 75 | response := provider.GetMinimumGasPrice() 76 | result, _ := json.Marshal(response) 77 | fmt.Println(string(result)) 78 | } 79 | ``` 80 | 81 | 82 | 83 | 84 | ### Example Response 85 | 86 | ```json 87 | { 88 | "id": "1", 89 | "jsonrpc": "2.0", 90 | "result": "2000000000" 91 | } 92 | ``` 93 | 94 | ### HTTP Request 95 | 96 | | Chain(s) | URL(s) | 97 | | --------------------- | -------------------------------------------- | 98 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 99 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 100 | | **Local testnet** | http://localhost:4201/ | 101 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 102 | 103 | ### Arguments 104 | 105 | | Parameter | Type | Required | Description | 106 | | --------- | ------ | -------- | ---------------------- | 107 | | `id` | string | Required | `"1"` | 108 | | `jsonrpc` | string | Required | `"2.0"` | 109 | | `method` | string | Required | `"GetMinimumGasPrice"` | 110 | | `params` | string | Required | Empty string `""` | 111 | -------------------------------------------------------------------------------- /docs/apis/api-transaction-get-num-txns-dsepoch.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-transaction-get-num-txns-dsepoch 3 | title: GetNumTxnsDSEpoch 4 | --- 5 | 6 | --- 7 | 8 | Returns the number of validated transactions included in this DS epoch. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetNumTxnsDSEpoch", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const numTxnsDSEpoch = await zilliqa.blockchain.getNumTxnsDSEpoch(); 42 | console.log(numTxnsDSEpoch.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com"); 52 | Rep numTxnsDSEpoch = client.getNumTxnsDSEpoch(); 53 | System.out.println(new Gson().toJson(numTxnsDSEpoch)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | 62 | ```python 63 | from pyzil.zilliqa import chain 64 | chain.set_active_chain(chain.MainNet) 65 | print(chain.active_chain.api.GetNumTxnsDSEpoch()) 66 | ``` 67 | 68 | 69 | 70 | 71 | 72 | ```go 73 | func GetNumTxnsDSEpoch() { 74 | provider := NewProvider("https://api.zilliqa.com/") 75 | response := provider.GetNumTxnsDSEpoch() 76 | result, _ := json.Marshal(response) 77 | fmt.Println(string(result)) 78 | } 79 | ``` 80 | 81 | 82 | 83 | 84 | ### Example Response 85 | 86 | ```json 87 | { 88 | "id": "1", 89 | "jsonrpc": "2.0", 90 | "result": "416" 91 | } 92 | ``` 93 | 94 | ### HTTP Request 95 | 96 | | Chain(s) | URL(s) | 97 | | --------------------- | -------------------------------------------- | 98 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 99 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 100 | | **Local testnet** | http://localhost:4201/ | 101 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 102 | 103 | ### Arguments 104 | 105 | | Parameter | Type | Required | Description | 106 | | --------- | ------ | -------- | --------------------- | 107 | | `id` | string | Required | `"1"` | 108 | | `jsonrpc` | string | Required | `"2.0"` | 109 | | `method` | string | Required | `"GetNumTxnsDSEpoch"` | 110 | | `params` | string | Required | Empty string `""` | 111 | -------------------------------------------------------------------------------- /docs/apis/api-transaction-get-num-txns-txepoch.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: api-transaction-get-num-txns-txepoch 3 | title: GetNumTxnsTxEpoch 4 | --- 5 | 6 | --- 7 | 8 | Returns the number of validated transactions included in this Transaction epoch. This is represented as a `String`. 9 | 10 | ### Example Request 11 | 12 | import Tabs from '@theme/Tabs'; 13 | import TabItem from '@theme/TabItem'; 14 | 15 | 25 | 26 | 27 | 28 | ```shell 29 | curl -d '{ 30 | "id": "1", 31 | "jsonrpc": "2.0", 32 | "method": "GetNumTxnsTxEpoch", 33 | "params": [""] 34 | }' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/" 35 | ``` 36 | 37 | 38 | 39 | 40 | ```js 41 | const numTxnsTxEpoch = await zilliqa.blockchain.getNumTxnsTxEpoch(); 42 | console.log(numTxnsTxEpoch.result); 43 | ``` 44 | 45 | 46 | 47 | 48 | ```java 49 | public class App { 50 | public static void main(String[] args) throws IOException { 51 | HttpProvider client = new HttpProvider("https://api.zilliqa.com"); 52 | Rep numTxnsTxEpoch = client.getNumTxnsTxEpoch(); 53 | System.out.println(new Gson().toJson(numTxnsTxEpoch)); 54 | } 55 | } 56 | ``` 57 | 58 | 59 | 60 | 61 | 62 | ```python 63 | from pyzil.zilliqa import chain 64 | chain.set_active_chain(chain.MainNet) 65 | print(chain.active_chain.api.GetNumTxnsTxEpoch()) 66 | ``` 67 | 68 | 69 | 70 | 71 | 72 | ```go 73 | func GetNumTxnsTxEpoch() { 74 | provider := NewProvider("https://api.zilliqa.com/") 75 | response := provider.GetNumTxnsTxEpoch() 76 | result, _ := json.Marshal(response) 77 | fmt.Println(string(result)) 78 | } 79 | ``` 80 | 81 | 82 | 83 | 84 | ### Example Response 85 | 86 | ```json 87 | { 88 | "id": "1", 89 | "jsonrpc": "2.0", 90 | "result": "38" 91 | } 92 | ``` 93 | 94 | ### HTTP Request 95 | 96 | | Chain(s) | URL(s) | 97 | | --------------------- | -------------------------------------------- | 98 | | **Zilliqa mainnet** | https://api.zilliqa.com/ | 99 | | **Developer testnet** | https://dev-api.zilliqa.com/ | 100 | | **Local testnet** | http://localhost:4201/ | 101 | | **Isolated server** | https://zilliqa-isolated-server.zilliqa.com/ | 102 | 103 | ### Arguments 104 | 105 | | Parameter | Type | Required | Description | 106 | | --------- | ------ | -------- | --------------------- | 107 | | `id` | string | Required | `"1"` | 108 | | `jsonrpc` | string | Required | `"2.0"` | 109 | | `method` | string | Required | `"GetNumTxnsTxEpoch"` | 110 | | `params` | string | Required | Empty string `""` | 111 | -------------------------------------------------------------------------------- /docs/basics/basics-intro-accounts.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-intro-accounts 3 | title: Accounts 4 | keywords: 5 | - blockchain 6 | - accounts 7 | - contract account 8 | - user account 9 | description: Zilliqa types of accounts 10 | --- 11 | 12 | --- 13 | 14 | The Zilliqa blockchain follows an account-based model similar to Ethereum. 15 | Accounts can hold native assets such as $ZIL or app-layer tokens issued as 16 | Fungible or Non-Fungible assets. These assets can be transferred from one 17 | account to another. 18 | 19 | The collective state of all the accounts represents the global state of the 20 | blockchain. Each account is identified by its address which is a 20-byte 21 | string generated using a hash function. 22 | 23 | Similar to Ethereum, the Zilliqa network supports two types of accounts: 24 | 25 | ### 1. Externally-Owned Account (aka User Account) 26 | 27 | An account controlled by an end user who owns a public-private signature key pair. The address of an externally-owned account is essentially a truncated hash of the public key. 28 | 29 | ### 2. Contract Account 30 | 31 | An account that has a smart contract code associated withit. A contract account gets created by a user when she deploys a smart contract on the network. The address of a contract account is the hash of the address of the user account that deployed the contract and some other information. 32 | -------------------------------------------------------------------------------- /docs/basics/basics-intro-blockchain.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-intro-blockchain 3 | title: Blockchain 4 | keywords: 5 | - intro 6 | - blockchain 7 | - cryptocurrency 8 | - 101 9 | - zilliqa 10 | description: Blockchain Basics 11 | --- 12 | 13 | --- 14 | 15 | ## What is Blockchain? 16 | 17 | Blockchain is a **distributed ledger** that is **immutable**. It is a 18 | **ledger** in the sense that it is a global accounting system that keeps track 19 | of balance (and other data) of each account. It is **distributed** as it is not 20 | maintained by a single entity but rather by a distributed network of 21 | independent machines who are given the incentive to do so. It is **immutable** 22 | in the sense that it is not easy to change the chronological history of changes 23 | made to the ledger. 24 | 25 | ## Other Key Benefits 26 | 27 | Blockchains have some key properties that make them a powerful technology: 28 | 29 | ### 1. Decentralization 30 | 31 | Since the ledger is maintained by a decentralized network of machines that is 32 | open for anyone to join, it cannot be shutdown making blockchains resistant to 33 | any external control and censorship. 34 | 35 | ### 2. Permissionless 36 | 37 | Due to the public nature of blockchains, anyone (with sufficient resources) 38 | can join the network to maintain the ledger and can make use of the network. 39 | There is no need to get permission from any central entity making it open for 40 | anyone and everyone. 41 | 42 | ### 3. Public verifiability 43 | 44 | The entire chronological history is public for anyone to review. This provides 45 | transparency, trust and auditability allowing anyone to re-create the current 46 | state of the system from the historical data. 47 | -------------------------------------------------------------------------------- /docs/basics/basics-intro-consensus.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-intro-consensus 3 | title: Consensus mechanism 4 | keywords: 5 | - intro 6 | - conesnsus 7 | - mechanism 8 | - pbft 9 | - proof of work 10 | - proof of stake 11 | description: Types of Blockchain consensus mechanisms 12 | --- 13 | 14 | --- 15 | 16 | The blockchain network being decentralized has to have a mechanism to agree 17 | upon the next state of system. This is achieved via a _consensus protocol_. 18 | 19 | ## Types of Consensus Mechanism 20 | 21 | Over the last two decades, several new consensus protocols have been developed 22 | and used in the blockchain space. The most common ones are: 23 | 24 | ### BFT: Byzantine Fault Tolerance Protocol 25 | 26 | This is the most classical way to reach consensus which works on the assumption 27 | that the network has at most 1/3 of malicious nodes. The protocol requires each 28 | honest node to agree on the state via voting. This involves several rounds of 29 | communication among the nodes. 30 | 31 | ### Nakamoto Consensus 32 | 33 | Nakamoto consensus was pioneered by Bitcoin. It uses proof-of-work and 34 | longest-chain-win rule to reach consensus among all honest nodes. Using 35 | proof-of-work, each node is required to solve a computational puzzle and the node 36 | fastest to find a solution decides the next state of the system. In the 37 | longest-chain-win rule, the node will adopt the longest chain and extend it 38 | with new valid block. A block in the blockchain is deemed to be committed once 39 | there is a sufficient number of block mined after the block. 40 | 41 | ### PoS: Proof of Stake 42 | 43 | In Proof-of-Stake, nodes are required to stake an amount of assets (e.g., 44 | native currency of the blockchain). Those who stake are allowed to decide on 45 | the next state of the system. By putting a stake, the expectation is that they 46 | will not make detrimental decisions. And in fact, the probability that a 47 | certain node is chosen to propose the next state is proportional to its stake. 48 | -------------------------------------------------------------------------------- /docs/basics/basics-intro-gas.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-intro-gas 3 | title: Gas 4 | keywords: 5 | - gas 6 | - blockchain 7 | - zilliqa 8 | - fees 9 | description: Transaction gas 10 | --- 11 | 12 | --- 13 | 14 | As transactions require the network to commit resources (compute, memory, 15 | storage and bandwidth), it is important to ensure that the resources are not 16 | abused. 17 | 18 | To this end, the resources consumed to process each transaction is measured in 19 | a unit called "gas". Therefore, if a transaction handles a simple transfer of 20 | native tokens, it will lead to less gas consumed compared to a transaction that 21 | executes a complicated smart contract. 22 | 23 | Users issuing transactions then have to pay to the network to process their 24 | transactions. The cost is proportional to the gas consumed to process the 25 | transaction. 26 | -------------------------------------------------------------------------------- /docs/basics/basics-intro-txns.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-intro-txns 3 | title: Transactions 4 | keywords: 5 | - transactions 6 | - types 7 | - zilliqa 8 | description: Transaction types 9 | --- 10 | 11 | --- 12 | 13 | To interact with an account (externally-owned or contract), one has to 14 | issue transactions. Each transaction is a data package signed by an 15 | externally-owned account. 16 | 17 | ## Usage of Transactions 18 | 19 | 1. The simplest usage of a transaction is to transfer native assets (such as 20 | $ZIL) from one externally-owned account to another externally-owned account 21 | or a contract account. 22 | 23 | 2. A transaction is issued when an externally-owned account deploys a contract 24 | on the network. 25 | 26 | 3. A transaction may also be issued to call a function in the smart contract 27 | associated to a contract account which may in turn trigger calls to other 28 | contracts creating a call graph. Note that calls from one contract account to another 29 | happens via inter-contract message calls and are not using transactions per se. 30 | -------------------------------------------------------------------------------- /docs/basics/basics-zil-consensus.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-zil-consensus 3 | title: Consensus Mechanism 4 | keywords: 5 | - consensus 6 | - ds committee 7 | - pbft 8 | - zilliqa 9 | description: Zilliqa Consensus 10 | --- 11 | 12 | --- 13 | 14 | The Zilliqa network is composed of one DS Committee (a special type of shard), and `n` normal shards. Each shard has a number of nodes, with one node being a `leader` and `k` number of `backups`. 15 | 16 | Broadly, each shard runs an algorithm called [practical Byzantine fault tolerance (pBFT)](http://pmg.csail.mit.edu/papers/osdi99.pdf) to achieve consensus on the state of the blockchain at any point. A rough outline is as follows: 17 | 18 | 1. Pre-prepare: the `leader` announces the state of the blockchain it has to all `backup` nodes in the shard as a **pre-prepare** message. 19 | 2. Prepare: each node receives and validates the state received from the `leader` in the pre-prepare phase, and multicasts its decision as a **prepare** message to the rest of the nodes in the shard. 20 | 3. Commit: upon receiving a valid **prepare** message from a super majority (2/3) of nodes, it multicasts a **commit** message to all other nodes. Once a **commit** message is recieved from a super majority, the node records the new state. 21 | -------------------------------------------------------------------------------- /docs/basics/basics-zil-contract.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-zil-contract 3 | title: Smart Contract Layer 4 | keywords: 5 | - scilla 6 | - smart contract 7 | - pbft 8 | - zilliqa 9 | - scilla interpreter 10 | description: Zilliqa Smart Contracts 11 | --- 12 | 13 | --- 14 | 15 | Zilliqa comes with its own smart contract language called Scilla. Scilla short 16 | for Smart Contract Intermediate Level Language is designed as a principled 17 | language with smart contract safety in mind. 18 | 19 | Scilla imposes a structure on smart contracts that makes applications less 20 | vulnerable to attacks by eliminating certain known vulnerabilities directly at 21 | the language-level. Furthermore, the principled structure of Scilla makes 22 | applications inherently more secure and amenable to formal verification. 23 | 24 | Some of the design choices in Scilla include: 25 | 26 | 1. **Separation Between Computation and Communication:** Contracts in Scilla 27 | are structured as communicating automata: every in-contract computation 28 | (e.g., changing its balance or computing a value of a function) is implemented 29 | as a standalone, atomic transition, i.e., without involving any other parties. 30 | Whenever such involvement is required (e.g., for transferring control to 31 | another party), a transition would end, with an explicit communication, by 32 | means of sending and receiving messages. 33 | 34 | 2. **Separation Between Effectful and Pure Computations:** Any in-contract 35 | computation happening within a transition has to terminate, and have a 36 | predictable effect on the state of the contract and the execution. In order to 37 | achieve this, Scilla draws inspiration from functional programming with effects 38 | in distinguishing between pure expressions (e.g., expressions with primitive 39 | data types and maps), impure local state manipulations (i.e., reading/writing 40 | into contract fields), and blockchain reflection (e.g., reading current block 41 | number). 42 | 43 | ## Scilla Interpreter 44 | 45 | Scilla currently comes with an [interpreter](https://github.com/zilliqa/scilla) 46 | written in OCaml. The interpreter provides a calling interface that enables 47 | users to invoke transitions with specified inputs and obtain outputs. Execution 48 | of a transition with supplied inputs will result in a set of outputs, and a 49 | change in the smart contract mutable state. 50 | 51 | More details on the interpreter are available in [Scilla 52 | Docs](https://scilla.readthedocs.io/en/latest/interface.html). 53 | -------------------------------------------------------------------------------- /docs/basics/basics-zil-gas.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-zil-gas 3 | title: Gas Accounting 4 | keywords: 5 | - gas accounting 6 | - gas pricing 7 | - contract gas 8 | - zilliqa 9 | - minimum gas 10 | description: Zilliqa Gas 11 | --- 12 | 13 | --- 14 | 15 | ## Gas Pricer 16 | 17 | Zilliqa's consensus algorithm (i.e., PBFT) requires nodes to vote on each 18 | block and hence each transaction therein. Every transaction that goes to the 19 | network has a gas price -- which is the price (in $ZIL) per gas unit that the 20 | sender is willing to pay to the miners to process the transaction. 21 | 22 | In order to ensure that miners do not impose a gas price of their own which 23 | could make it impossible to agree on transactions, the Zilliqa protocol 24 | maintains a _global minimum gas price_ that all miners will accept. 25 | 26 | The network runs an algorithm to compute the acceptable global minimum gas 27 | price that the entire network will agree upon. The algorithm takes into 28 | account: a) the previous gas prices for the last few epochs b) the minimum 29 | gas price that each miner is willing to accept for the current epoch and, c) 30 | network congestion. 31 | 32 | Essentially, the algorithm decides on the gas price depending on the 33 | network congestion in the last few epochs. The rationale being that if the 34 | network congestion is high, then the miners get to have a say on the gas 35 | price, while if the network is not congested, then the gas price should not 36 | depend too much on the proposed gas prices. 37 | 38 | The current global minimum gas price is 0.002 ZIL. 39 | 40 | ## Payment Transactions 41 | 42 | Each payment transaction consumes 50 gas unit and therefore, the gas to be paid 43 | for a payment transaction is 0.1 ZIL. 44 | 45 | ## Smart Contract Transactions 46 | 47 | As smart contract transactions involve more compute and storage, the gas 48 | required to process a smart contract transaction depends on the complexity of 49 | the contract being called, the parameters being passed etc. Scilla comes with 50 | an in-built gas accounting module that keeps track of gas consumed as the 51 | Scilla interpreter executes a contract. 52 | 53 | Each usage of a Scilla literal, executing an expression and statement in Scilla 54 | have a deterministic associated cost. More details can be found the [gas 55 | accounting documentation](https://github.com/Zilliqa/scilla-docs/blob/master/docs/texsources/gas-costs/gas-doc.pdf) 56 | -------------------------------------------------------------------------------- /docs/basics/basics-zil-reward.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-zil-reward 3 | title: Reward Mechanism 4 | keywords: 5 | - base rewards 6 | - flexible rewards 7 | - coinbase reward 8 | - reward calculator 9 | - zilliqa 10 | description: Zilliqa Rewards 11 | --- 12 | 13 | --- 14 | 15 | In the Zilliqa network, rewards are split into: 16 | 17 | - **[20% of total] Base rewards** for all validating nodes (DS/shard) in the network. 18 | - **[40% of total] Cosignature-based rewards** that are based on the amount of valid and accepted (first 2/3 signers within a shard) signatures submitted by a node during a TX epoch while doing the pBFT consensus. 19 | 20 | Both base rewards and flexible rewards have the same weightage for both DS and shard nodes. All rewards are consolidated over an entire DS epoch and only distributed during the vacuous epoch (i.e., the last transaction epoch for a DS epoch). 21 | 22 | Do note that the last **40%** of the rewards are given to the Zilliqa seed node staking program. 23 | 24 | Say for example, if there are a total of `2400` nodes in the Zilliqa network and the `COINBASE_REWARD` is set at `20400` $ZIL per DS Epoch, the reward distribution will be: 25 | 26 | - For Base rewards: 27 | 28 | ```shell 29 | 204000 * 0.20 / 2400 30 | = 17 $ZIL per node per DS Epoch 31 | ``` 32 | 33 | - For cosignature-based rewards: (on a first-come-first-serve basis) 34 | 35 | ```shell 36 | 204000 * 0.40 / (2,400 * 2/3 [Successful signers] * 99 [TX blocks]) = ~0.0515 $ZIL per valid and accepted signature 37 | ``` 38 | 39 | :::note 40 | For the stability of this nascent network, Guard nodes by Zilliqa are deployed in the network, both in DS committee and across all shards. These Guard nodes always stays within the network without doing PoW, but they are not rewarded. However, the division of rewards before distribution does include the guard nodes in the count. Hence, there are no "bonus" rewards for non-guard nodes that manage to fufil the PoW requirements. 41 | ::: 42 | 43 | Find our your daily mining profitability by filling in the variables for the [**reward calculator**](https://4miners.pro/cryptocurrencies/item/320-Zilliqa-ZIL-calculator) 44 | -------------------------------------------------------------------------------- /docs/basics/basics-zil-schnorr-signatures.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: basics-zil-schnorr-signatures 3 | title: Schnorr Signatures 4 | keywords: 5 | - schnorr signatures 6 | - zilliqa 7 | description: Schnorr Signatures 8 | --- 9 | 10 | --- 11 | 12 | Zilliqa employs Elliptic Curve Based Schnorr Signature Algorithm (EC-Schnorr) as the base signing algorithm. Schnorr allows for multisignatures, is faster than ECDSA, and has a smaller signature size (64 bytes). 13 | 14 | The Schnorr algorithm was initially based on section 4.2.3 page 24 of version 1.0 of BSI TR-03111 Elliptic Curve Cryptography (ECC). A more complete discussion of the algorithm is also contained in the Zilliqa [whitepaper](https://docs.zilliqa.com/whitepaper.pdf). 15 | 16 | The Schnorr algorithm is used during the consensus protocol, message signing, and generally anywhere where a signature is needed within the protocol. Zilliqa nodes are also identified by their Schnorr public keys, alongside their IP information. 17 | -------------------------------------------------------------------------------- /docs/contributors/contribute-bug-bounty.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: contribute-bug-bounty 3 | title: Bug Bounty Program 4 | keywords: 5 | - contribution 6 | - bug bounty 7 | - security 8 | description: Contribution guide for bug bounty program. 9 | --- 10 | 11 | --- 12 | 13 | Developers can also contribute to the advancement of Zilliqa by reporting security bugs and vulnerabilities in our bug bounty program. 14 | 15 | We reward contributions with payouts of up to US$10,000 depending on the nature of the reported vulnerability. Our public bounty bug program is currently 16 | hosted by HackerOne and be accessed at https://hackerone.com/zilliqa. 17 | 18 | If you need to reach out to us on any security matters beyond the scope of the bug bounty program, please reach out to security[at]zilliqa.com. -------------------------------------------------------------------------------- /docs/contributors/contribute-buildzil.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: contribute-buildzil 3 | title: Building Zilliqa 4 | keywords: 5 | - contribution 6 | - core 7 | description: Contribution guide for Zilliqa core. 8 | --- 9 | 10 | --- 11 | 12 | The Zilliqa core is implemented in C++ and archived in our open-source [Github repository](https://github.com/Zilliqa/Zilliqa/). 13 | 14 | Zilliqa Research primarily maintains the code base and moderates contributions from external developers. 15 | 16 | While we have made great strides to realize the core protocol that runs the Zilliqa Mainnet, this continues to be a living, breathing endeavour. New features, improvements, and bug fixes are regularly pushed. Contributions from the developer community towards the advancement of this project are always welcome. 17 | 18 | ## Quickstart Guide 19 | 20 | Building the Zilliqa code base is officially supported on Ubuntu 18.04. 21 | 22 | Follow these steps to perform the build: 23 | 24 | 1. Install the required dependencies according to [this section](https://github.com/Zilliqa/Zilliqa/#build-dependencies) in the repository. 25 | 1. Clone the [Zilliqa repository](https://github.com/Zilliqa/Zilliqa/). 26 | 1. Build the source code according to [this section](https://github.com/Zilliqa/Zilliqa/#build-from-source-code). 27 | 28 | When successful, the outputs (including the `zilliqa` binary) will be created in the `build` subfolder of the working directory. 29 | 30 | ## Next Steps 31 | 32 | Once you are able to build the code base, there are several ways you can contribute: 33 | 34 | 1. Submit code changes as pull requests (please read the [guidelines](contribute-guidelines.md)) 35 | 1. Submit [proposals](contribute-standards.md) to improve the core protocol design 36 | 1. Submit bug reports and feature requests in the [repository issues](https://github.com/Zilliqa/Zilliqa/issues) 37 | 1. Submit security-related issues to our [bug bounty program](contribute-bug-bounty.md) 38 | 39 | ## Contributing to Scilla 40 | 41 | A fully functional Zilliqa node also includes the Scilla smart contract interpreter. If you are interested in contributing to that project, please refer to the [Scilla website](https://scilla-lang.org/#getinvolvedsection). 42 | 43 | ## Resources 44 | 45 | These are the available resources that help explain the core protocol: 46 | 47 | 1. The Zilliqa [whitepaper](https://docs.zilliqa.com/whitepaper.pdf) 48 | 1. The [Zilliqa architecture](../basics/basics-zil-nodes.mdx) and [Core protocol design](../contributors/core-node-operation.md) sections 49 | 1. The [Zilliqa Improvement Proposals](https://github.com/Zilliqa/ZIP/) repository 50 | 1. Monthly updates and tech writeups in the [official blog](https://blog.zilliqa.com/) 51 | 1. The developer community channels on our [official Discord server](https://discord.com/invite/XMRE9tt) 52 | -------------------------------------------------------------------------------- /docs/contributors/contribute-guidelines.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: contribute-guidelines 3 | title: Contribution Guidelines 4 | keywords: 5 | - development 6 | - guidelines 7 | description: Development guidelines for contributing to Zilliqa core. 8 | --- 9 | 10 | --- 11 | 12 | ## Development Process 13 | 14 | We keep our development process fairly simple and enforce any hard rules through automation. 15 | 16 | Before beginning, please familiarize yourself with these documents: 17 | 18 | 1. [Code of Conduct](https://github.com/Zilliqa/Zilliqa/blob/master/CODE_OF_CONDUCT.md) 19 | 1. [Coding Style](https://github.com/Zilliqa/Zilliqa/blob/master/CODING_STYLE.md) 20 | 1. [Coding and Review Guidelines](https://github.com/Zilliqa/Zilliqa/blob/master/CONTRIBUTING.md) 21 | 22 | These are the basic things to consider when contributing to the project: 23 | 24 | 1. The `master` branch is the main development branch of the Zilliqa repository. All new work must be created on a new branch off of the `master` branch. 25 | 1. When compiling code changes, use `./build.sh style` instead of just `./build.sh` in order for clang-format to automatically fix the code formatting. 26 | 1. Write or perform any tests for your code changes. The different supported tests are described in the [section](#testing) below. 27 | 1. When submitting a pull request, fill in the details requested in the [template](https://github.com/Zilliqa/Zilliqa/blob/master/.github/PULL_REQUEST_TEMPLATE.md). 28 | 29 | ## CI/CD Pipeline and Release Management 30 | 31 | Pull requests must get approval from at least 2 reviewers before they can be merged into the `master` branch. 32 | 33 | Additionally, pull requests must pass the automated checks on the code changes. These are done by Travis CI build jobs along both the branch and the merge with `master`. These checks include: 34 | 35 | 1. Code build 36 | 1. clang-format 37 | 1. clang-tidy 38 | 1. Code coverage 39 | 40 | New releases are periodically created, and these can be accessed by checking out release tags (e.g., `git checkout tags/v6.2.0`). 41 | These releases are accompanied by [release notes](https://github.com/Zilliqa/Zilliqa/releases) detailing the fixes, improvements, and any new features. 42 | 43 | Releases are also automatically made available as Docker images on our [Docker Hub repository](https://hub.docker.com/repository/docker/zilliqa/zilliqa). 44 | Node operators who are not on our officially supported operating systems may choose to run their nodes on these images instead. 45 | 46 | ## Testing 47 | 48 | There are several ways to test out the core protocol: 49 | 50 | 1. Writing [unit tests](https://github.com/Zilliqa/Zilliqa/tree/master/tests) targeted at specific parts of the code. Most unit tests are executed as part of the CI/CD pipeline to ensure non-regression. 51 | 1. Booting up a [local testnet](https://github.com/Zilliqa/Zilliqa#boot-up-a-local-testnet-for-development) to simulate the Zilliqa network on a local machine. 52 | 1. Launching a cloud-based testnet that approximates the actual Zilliqa Mainnet. Currently this method is available only to the Zilliqa Research team. Please coordinate with the team should your code changes require testing using this method. 53 | -------------------------------------------------------------------------------- /docs/contributors/contribute-standards.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: contribute-standards 3 | title: Protocol Standards 4 | keywords: 5 | - protocol 6 | - standards 7 | - ZIP 8 | - improvement 9 | - proposals 10 | description: Contribution guide to Zilliqa core protocol standards. 11 | --- 12 | 13 | --- 14 | 15 | Since the release of the initial [whitepaper](https://docs.zilliqa.com/whitepaper.pdf) in 2017, the Zilliqa core has evolved to address the functional, security, performance, deployment, and usability challenges encountered in our Zilliqa Mainnet. While it has gained a significant degree of maturity since its inception, the Zilliqa platform continues to be a work in progress as new developments in the blockchain space present opportunities for improvement. 16 | 17 | The Zilliqa core protocol encompasses the implementation in our [C++ code base](https://github.com/Zilliqa/Zilliqa/) as well as all related processes or conventions around it (e.g., data formats, API specifications, etc.). Many of these have been captured in our [design documents](core-intro.md) and other available resources, and collectively form our core protocol standards. 18 | 19 | In the spirit of open source development, contributions from the community towards the improvement of these standards are very much welcome. Our [Zilliqa Improvement Proposals](https://github.com/Zilliqa/ZIP/) repository provides a structured avenue for these contributions. Once peer-reviewed, proposals are implemented and eventually become part of the core protocol standards. 20 | 21 | Some examples of these proposals include: 22 | 23 | 1. Specifications 24 | - Zilliqa Address Standard ([ZIP-1](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-1.md)) 25 | - Zilliqa Internal Transactions ([ZIP-2](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-2.md)) 26 | 1. Feature updates 27 | - Zilliqa Scilla External Library Support ([ZIP-5](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-5.md)) 28 | - Adopting MPT for Contract State Hashing ([ZIP-8](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-8.md)) 29 | 1. Feature additions 30 | - Seed Node Staking Mechanism ([ZIP-3](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-3.md)) 31 | - Zilliqa Isolated Server ([ZIP-6](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-6.md)) 32 | 1. Usability and API standards 33 | - GetMinerNodes API ([ZIP-4](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-4.md)) 34 | - URL Scheme Format for Transaction Requests ([ZIP-7](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-7.md)) 35 | 36 | To get started, please read these resources in the repository: 37 | 38 | 1. [Introduction](https://github.com/Zilliqa/ZIP/#zip) 39 | 1. [Contribution Guidelines](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-0.md#what-is-a-zip) 40 | -------------------------------------------------------------------------------- /docs/contributors/core-blacklist.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-blacklist 3 | title: Blacklist 4 | keywords: 5 | - core 6 | - blacklist 7 | description: Core protocol design - blacklisting. 8 | --- 9 | 10 | --- 11 | 12 | Zilliqa has a blacklisting feature implemented in `libNetwork`. The idea is to keep track of IP addresses of peers that, for conditions listed below, can potentially disrupt the operation of the node. Once blacklisted, the peer is effectively excluded from further interactions with the node. 13 | 14 | ## Blacklisting Conditions 15 | 16 | - Socket write failure (according to `P2PComm::IsHostHavingNetworkIssue`) 17 | - Socket connect failure (according to `P2PComm::IsHostHavingNetworkIssue`) 18 | - Gossip message from peer exceeds `MAX_GOSSIP_MSG_SIZE_IN_BYTES` 19 | - Bytes read from peer exceeds `MAX_READ_WATERMARK_IN_BYTES` 20 | 21 | ## Blacklist Checking 22 | 23 | Outgoing 24 | 25 | - `Lookup::SendMessageToRandomSeedNode` 26 | - `P2PComm::SendMessageNoQueue` 27 | - `SendJob::SendMessageCore` 28 | - `SendJobPeer::DoSend` 29 | - `SendJobPeers::DoSend` 30 | 31 | Incoming 32 | 33 | - `P2PComm::AcceptConnectionCallback` 34 | 35 | ## Blacklist Exemptions 36 | 37 | Adding exclusion privilege 38 | 39 | 1. DS guards 40 | - When `NEWDSGUARDNETWORKINFO` is received (new IP) 41 | - Whenever DS committee is updated 42 | 1. Lookup nodes 43 | - Every time a message is sent out 44 | 1. Manual addition of an IP using `miner_info.py whitelist_add` 45 | 46 | Removing exclusion privilege 47 | 48 | 1. DS guards 49 | - When `NEWDSGUARDNETWORKINFO` is received (old IP) 50 | 1. Manual removal of an IP using `miner_info.py whitelist_remove` 51 | 52 | ## Blacklist Removal and Clearing 53 | 54 | - Non-lookup nodes remove `BLACKLIST_NUM_TO_POP` number of peers from the blacklist at the start of the DS epoch 55 | - Non-lookup nodes also remove all blacklisted seed nodes from the blacklist at the start of the DS epoch 56 | - Lookup nodes clear the entire blacklist upon receiving the DS Block 57 | 58 | ## Blacklist Enabling 59 | 60 | Blacklist is enabled by default, and is only temporarily disabled when doing node recovery (`RECOVERY_ALL_SYNC`). In that situation, the blacklist is re-enabled once the Tx block is processed. 61 | 62 | ## Relaxed Blacklist 63 | 64 | A peer can become unreachable if it temporarily goes down. In this case, socket connections to that peer would usually return `EHOSTDOWN` or `ECONNREFUSED` as the error message. When this occurs, we avoid blacklisting the peer in the "strict" sense as in the previously listed [conditions](#blacklisting-conditions). Instead, we blacklist the peer in the "relaxed" category. 65 | 66 | While all incoming and outgoing messages from/to a peer that is strictly blacklisted are blocked, only outgoing messages to the peer are blocked for a peer that is in the relaxed blacklist. This allows the peer to have itself be removed from everyone's blacklist by sending the request for removal once it has come back online. Such a request will be accepted if the peer is found to be in the relaxed blacklist. 67 | -------------------------------------------------------------------------------- /docs/contributors/core-broadcasting.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-broadcasting 3 | title: Broadcasting 4 | keywords: 5 | - core 6 | - broadcasting 7 | description: Core protocol design - broadcasting. 8 | --- 9 | 10 | --- 11 | 12 | import useBaseUrl from '@docusaurus/useBaseUrl'; 13 | 14 | Gossip is used widely in the Zilliqa network for messaging. However, the gossip protocol by design needs the information of all peers that must eventually receive the rumor. 15 | 16 | This basic requirement for peer information is usually available to a node, except at the point when a new DS block has been mined. The DS block contains the peer information for all shards, which is extracted by each node to initialize its peer list and restart the gossip engine. 17 | 18 | However, distributing the DS block itself is a problem that has to be dealt with in a different manner. The solution employed is **tree-based cluster broadcasting**. At the start of a new DS epoch, before DS block distribution, shard nodes don't know the information of the other nodes in the same shard. 19 | Thus, we leverage clustered multicasting in order to broadcast the DS block to all the nodes within a shard. 20 | 21 | ## Design 22 | 23 | 1. Assume that we have `X` nodes in a shard. We form clusters - each of `Y` nodes - out of these shard nodes. Each cluster, in turn, has `Z` child clusters. 24 | 1. Every node is assigned a sequence number `n` starting from `0`, such that `n/Y` represents the cluster it belongs to. For example, `2/10 = 0`, `11/10 = 1`. 25 | 1. Therefore, we should have a total of `X/Y` clusters, indexed from `0` to `X/Y-1`. A node `n` belonging to cluster `n/Y` is at level `log_Z(n/Y)`. 26 | 1. A node multicasts messages to nodes within the range `(n/Y * Z + 1)*Y` ~ `((n/Y * Z + Z + 1)* Y - 1)`. Bound checks on node index need to be done before multicasting. If the checks fail, we don’t broadcast. 27 | 28 | Broadcasting Image 1 34 | 35 | ## Application 36 | 37 | These are the parameters that control the broadcasting of DS blocks from DS committee nodes to shard nodes according to the design above. 38 | 39 | ```xml 40 | 41 | true 42 | 3 43 | 10 44 | 3 45 | 46 | ``` 47 | 48 | - `BROADCAST_TREEBASED_CLUSTER_MODE`: Toggles between tree-based cluster broadcasting or pure multicasting. 49 | - `NUM_FORWARDED_BLOCK_RECEIVERS_PER_SHARD`: The number of shard nodes to initially receive the DS block from DS committee nodes. 50 | - `MULTICAST_CLUSTER_SIZE`: The number of nodes in each cluster. 51 | - `NUM_OF_TREEBASED_CHILD_CLUSTERS`: The number of child clusters for a given cluster. 52 | -------------------------------------------------------------------------------- /docs/contributors/core-coinbase.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-coinbase 3 | title: Coinbase Rewards 4 | keywords: 5 | - core 6 | - coinbase 7 | - rewards 8 | description: Core protocol design - coinbase rewards. 9 | --- 10 | 11 | --- 12 | 13 | At each DS epoch, a total of `COINBASE_REWARD_PER_DS` QA is distributed to reward miners. Out of this amount, 20% is allocated as the base reward, 40% for cosignature-based reward and 40% for seed node staking rewards. 14 | 15 | The base reward is given to each node equally. Specifically, these nodes are those who gained membership into a shard or the DS committee by doing PoW. 16 | 17 | The lookup reward is distributed to all the lookup nodes equally. 18 | 19 | The cosignature-based reward is distributed to the same base reward recipients in a proportional manner with respect to the number of microblocks (in the case of a shard node) or transaction blocks (in the case of DS nodes) the nodes signed. 20 | 21 | :::note 22 | Guard nodes do not get rewarded. Their share of the reward is instead stored in the null address. 23 | ::: 24 | 25 | ## Distribution Process 26 | 27 | 1. The distribution of rewards takes place during the vacuous epoch (i.e., the last Tx epoch in the DS epoch) 28 | 1. The state change (i.e., the subtraction from null address and addition to a node's address) is reflected in the state delta of the DS committee's microblock 29 | 1. The DS performs consensus over the state delta and the rewards are hence recorded 30 | 1. Cosignatures from the first Tx epoch (of the current DS epoch) until before the vacuous epoch are considered for cosignature-based rewards distribution 31 | 1. Cosignatures from shards only are considered for the vacuous epoch (i.e., the Tx block cosignatures by the DS nodes are excluded). This is because the DS committee needs to calculate the coinbase reward distribution first before it performs the consensus that generates the Tx block (with the DS nodes' cosignatures) in the vacuous epoch 32 | 33 | ## Technical Note 34 | 35 | Developers need to take note that the coinbase rewarding data structure is managed in a bit unusual way. 36 | 37 | To keep track of cosignatures for cosignature-based rewarding, we use this convention: `m_coinbaseRewardees[EPOCH][SHARDID]-->{Cosigs}`. The epoch number, however, depends on whether the shard ID refers to an actual shard or the DS committee. 38 | 39 | For example, the cosignatures for `Epoch 5` with two shards (with ID `0` and `1`) are stored this way: 40 | 41 | ``` 42 | m_coinbaseRewardees[5][0] --> {Cosigs from Microblock proposed by shard 0} 43 | m_coinbaseRewardees[5][1] --> {Cosigs from Microblock proposed by shard 1} 44 | m_coinbaseRewardees[6][-1]--> {Cosigs from Tx block mined by DS Committee} 45 | ``` 46 | 47 | Notice that the shard ID for the DS committee is `-1`. Also, the epoch number is one higher than the epoch number for the shards. This is because `IncreaseEpochNum()` is called (inside `StoreFinalBlock()`) before `SaveCoinbase()`. 48 | -------------------------------------------------------------------------------- /docs/contributors/core-diagnostic-data.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-diagnostic-data 3 | title: Diagnostic Data 4 | keywords: 5 | - core 6 | - diagnostic 7 | description: Core protocol design - diagnostic data. 8 | --- 9 | 10 | --- 11 | 12 | ## Diagnostic Data 13 | 14 | We store in LevelDB a limited amount of some operational data about the network that is intended for use when diagnosing any issues with the mainnet. 15 | 16 | Globally, the amount of data stored is controlled by the constant `MAX_ENTRIES_FOR_DIAGNOSTIC_DATA`, which is usually set to either 25 or 50. 17 | 18 | This is the current data stored for diagnostic purposes: 19 | 20 | | LevelDB location | Data stored | Storage timing | Tool for data extraction | 21 | | --------------------------- | -------------------------------- | ------------------- | ------------------------ | 22 | | persistence/diagnosticNodes | DS and shard peers | Every vacuous epoch | getnetworkhistory | 23 | | persistence/diagnosticCoinb | Coinbase values and distribution | Every DS block | getrewardhistory | 24 | 25 | To use the diagnostic tools: 26 | 27 | 1. Make sure there is a `persistence` subfolder in your current directory 28 | 1. Make sure `persistence/diagnosticNodes` and `persistence/diagnosticCoinb` contain the data you want to extract 29 | 1. Run `getnetworkhistory ` or `getrewardhistory ` 30 | 1. Output CSV file will appear in the current directory. Use Excel or LibreOffice Calc to open it 31 | -------------------------------------------------------------------------------- /docs/contributors/core-ds-mimo.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-ds-mimo 3 | title: DS MIMO 4 | keywords: 5 | - core 6 | - directory 7 | - service 8 | - committee 9 | - membership 10 | description: Core protocol design - DS MIMO. 11 | --- 12 | 13 | --- 14 | 15 | :::note 16 | DS committee ejection has now been superseded by [DS Reputation](core-ds-reputation.md). 17 | ::: 18 | 19 | DS committee membership is maintained using a multiple-in multiple-out (MIMO) setup. This setup allows `n` nodes to join and leave the DS committee at every DS epoch. The steps are: 20 | 21 | 1. Nodes submit PoWs (for difficulty and DS difficulty) 22 | 1. DS leader composes DS Block 23 | - DS leader determines how many nodes to elect into DS committee by using `min(number of eligible pow submission, NUM_DS_ELECTION)` 24 | - Hence, number of incoming DS nodes ranges from 0 to `NUM_DS_ELECTION` 25 | 1. DS leader adds incoming DS members' information to the map inside DS Block 26 | 1. DS leader removes incoming DS members from `sortedPoWSolns` to ensure the incoming DS members do not get added into any of the shards 27 | 1. After composing DS Block, `ComputeDSBlockParameters()` returns the number of incoming DS members (to be used a later step) 28 | 1. Now, it is time to eject `n` number of (oldest) DS members from the DS committee and downgrade these to shard members 29 | 1. DS leader adds the ejected members into `m_allPoWConns` and `sortedPoWSolns` 30 | - As downgraded members do not perform PoWs, dummy PoW solutions are given to these 31 | - Dummy PoW solution in this case is calculated using `sha256(node’s pubkey)` 32 | 1. Now, it is time to compose the sharding structure. There is no major change to this portion 33 | 1. DS Block consensus begins and is successfully completed 34 | 1. DS leader and backups do the following 35 | - DS leader and backups run `UpdateDSCommitteeComposition()` first before doing `UpdateMyDSModeAndConsensusId()`. This is to be consistent with what the incoming members will do. Also, having such changes enable much easier calculation of `consensusMyID` 36 | - Add `n` number of incoming DS members inside the DS committee data structure in `mediator` 37 | - Pop `n` number of DS members from the DS committee data structure in `mediator` 38 | - The oldest `n` members are decided by `(consensusID + n incoming DS members) >= size of DS committee`. These nodes change their mode to `IDLE` 39 | - Other DS members increment their `consensusMyID` by `n` and update the status to either DS leader or backup 40 | 1. DS committee sends the DS Block and sharding structure to all PoW submitters 41 | 1. Incoming DS members receive the DS Block, process it, and update their DS `consensusMyID` based on the ordering found in the map in the DS Block. From here onwards, these nodes are part of the DS committee 42 | 1. Shard members process the DS Block and update their view of the DS committee 43 | -------------------------------------------------------------------------------- /docs/contributors/core-ds-reputation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-ds-reputation 3 | title: DS Reputation 4 | keywords: 5 | - core 6 | - directory 7 | - service 8 | - committee 9 | - reputation 10 | description: Core protocol design - DS reputation. 11 | --- 12 | 13 | --- 14 | 15 | The integration of the DS reputation within DS MIMO enables identification and removal of underperforming DS nodes instead of simply the oldest DS nodes. This encourages node owners to use better hardware for the DS nodes, improving the stability and efficiency of the network, particularly during consensus protocol. 16 | 17 | The steps are: 18 | 19 | 1. During DS Block consensus, the performance of each DS node is evaluated based on the rewards they received in the last DS epoch 20 | 1. DS leader calls `DetermineByzantineNodes()` to find out which DS nodes underperformed (according to the criteria set in `constants.xml`). The public keys of these underperforming nodes are included in DS Block consensus announcement 21 | 1. DS backup nodes call `VerifyRemovedByzantineNodes` when processing the announcement to verify that the DS nodes proposed for removal from the committee are really underperforming. Verification must pass for consensus to succeed; a view change will be triggered otherwise 22 | 1. After DS Block consensus, the underperforming DS nodes are removed from the DS committee and the blockchain network. They will need to do PoW again to rejoin the network 23 | 24 | ## References 25 | 26 | 1. [DS Reputation Proposal](https://github.com/nnamon/zilliqa-research/blob/master/ds_reputation/proposal.md) 27 | 2. [PR 1587](https://github.com/Zilliqa/Zilliqa/pull/1587) 28 | -------------------------------------------------------------------------------- /docs/contributors/core-intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-intro 3 | title: Introduction 4 | --- 5 | 6 | --- 7 | 8 | The documents in this section provide a detailed description on different aspects of the Zilliqa blockchain core protocol. 9 | 10 | Additional resources can be found [here](contribute-buildzil.md#resources). 11 | -------------------------------------------------------------------------------- /docs/contributors/core-isolated-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-isolated-server 3 | title: Isolated Server 4 | keywords: 5 | - core 6 | - isolated 7 | - server 8 | description: Core protocol design - isolated server. 9 | --- 10 | 11 | --- 12 | 13 | ## Overview 14 | 15 | The Isolated Server is a standalone Zilliqa seed node specifically configured to allow instantaneous blockchain operations (e.g., transaction creation) outside of any network (e.g., Zilliqa Mainnet). This makes it a very useful tool for dApp development and testing. 16 | 17 | These are the available documentation on Isolated Server: 18 | - Isolated server design and API list in [ZIP-6](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-6.md) 19 | - Isolated server build instructions in [Zilliqa Github Wiki](https://github.com/Zilliqa/Zilliqa/blob/master/ISOLATED_SERVER_setup.md) 20 | - Isolated server launch instructions in [Ceres documentation](../dev/dev-tools-ceres#isolated-server) 21 | 22 | ## Implementation Details 23 | 24 | The Isolated Server is built as a binary file `isolatedServer` (from source `isolated_server.cpp`) separate from `zilliqa` (from source `main.cpp`). While majority of the underlying source code is shared between the two CPP files, `isolated_server.cpp` is primarily different from `main.cpp` in these ways: 25 | - It instantiates an **IsolatedServer** object. The **IsolatedServer** class inherits from **LookupServer** and thus we are able to reuse most of the JSON-RPC API handler functions defined in **LookupServer**. 26 | - It does **not** instantiate a **Zilliqa** object, and therefore the `isolatedServer` process does not start listening to port 33133 for socket messages. All interactions are done through the **IsolatedServer** JSON-RPC port only (and additionally through the websocket port if enabled). 27 | 28 | Apart from these differences, developers just need to take note of the other features supported by the Isolated Server as described in detail in the other available documentation, namely: 29 | - Two ways to artificially produce blocks (i.e., using either automated block time or the `IncreaseBlocknum` API) 30 | - Ability to pre-generate accounts from an input JSON file 31 | - Ability to pre-load existing blockchain data during launch 32 | - Ability to pause the Isolated Server using the `TogglePause` API (which prevents automated block generation and disables `CreateTransaction` API) 33 | 34 | :::info 35 | In the Isolated Server there are no properly-formed DS or Tx blocks. While the artificially-produced blocks conform to the Tx block template, all the Tx block fields are not set properly. Only the transaction information is set in the block. 36 | ::: -------------------------------------------------------------------------------- /docs/contributors/core-lookup.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-lookup 3 | title: Lookup 4 | --- 5 | 6 | --- 7 | 8 | - API Server 9 | - [Websocket Server](core-websocket-server.md) 10 | - [Transaction Dispatch](core-transaction-dispatch.md) 11 | - [Multipliers](core-multipliers.md) 12 | -------------------------------------------------------------------------------- /docs/contributors/core-message-dispatch.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-message-dispatch 3 | title: Message Dispatch and Processing 4 | keywords: 5 | - core 6 | - message 7 | - dispatch 8 | - processing 9 | description: Core protocol design - message dispatch and processing. 10 | --- 11 | 12 | --- 13 | 14 | In `src/cmd/main.cpp`, we assign `Zilliqa::Dispatch` as the dispatcher inside `P2PComm::StartMessagePump`. Every message that is read from a socket by `P2PComm` then gets sent to `Zilliqa::Dispatch`. 15 | 16 | When Zilliqa starts to process a message, it will call `Zilliqa::ProcessMessage`. The first byte of any message defines the **message type**. 17 | 18 | :::note 19 | The “first byte” here refers to the payload part of a socket message. At the `P2PComm` level, each socket message consists of a predefined header plus the payload. 20 | ::: 21 | 22 | Depending on the type, `Zilliqa::ProcessMessage` will forward the message to the appropriate handler for it. The list of message types can be found in `enum MessageType` inside `src/common/Messages.h`. 23 | 24 | Any class that inherits from `Executable` will be a message handler. For example, type `0x01` means `DIRECTORY`, and this message will be handled by `libDirectoryService`. If you go into `libDirectoryService`, you will find a function `DirectoryService::Execute`. 25 | 26 | All classes that inherit from `Executable` will first check the second byte in the message, which defines the **instruction type**. The list of instruction types can be found in `src/common/Messages.h`. 27 | 28 | From there, `Execute()` will further forward the message to a private function inside the class, and these functions are all named `ProcessXXX`. 29 | -------------------------------------------------------------------------------- /docs/contributors/core-message-queues.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-message-queues 3 | title: Message Queues and Jobs 4 | keywords: 5 | - core 6 | - message 7 | - queues 8 | - jobs 9 | description: Core protocol design - message queues and jobs. 10 | --- 11 | 12 | --- 13 | 14 | Incoming and outgoing message queues are maintained between `P2PComm` and the rest of the Zilliqa core. This helps provide some ordering in the processing of messages, and it also adds some control over the number of messages that can be buffered. Once ready for processing, messages enter a thread pool, which regulates the number of messages that can be processed concurrently. 15 | 16 | After an incoming message is read from a socket, it is first inserted into `Zilliqa::m_msgQueue`, whose maximum size is controlled by `MSGQUEUE_SIZE`. When the queue reaches full capacity, any further incoming messages are dropped. A dedicated thread launched during startup manages dequeueing of messages and sending them to `Zilliqa::m_queuePool`, a thread pool limited by `MAXRECVMESSAGE`. Once assigned to a thread, the message gets dispatched according to the earlier section. 17 | 18 | Equivalently, before an outgoing message is written out to a socket, it is first inserted into `P2PComm::m_sendQueue`, whose maximum size is controlled by `SENDQUEUE_SIZE`. Any further outgoing messages are also dropped once the queue is full. A dedicated thread launched during startup also manages dequeueing of messages and sending them to `Zilliqa::m_SendPool`, which is also limited by `MAXSENDMESSAGE`. One assigned to a thread, the message gets sent out according to the `P2PComm::SendJob` settings for the message. 19 | -------------------------------------------------------------------------------- /docs/contributors/core-messaging-limits.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-messaging-limits 3 | title: Messaging Limits 4 | keywords: 5 | - core 6 | - messaging 7 | - limits 8 | description: Core protocol design - messaging limits. 9 | --- 10 | 11 | --- 12 | 13 | The volume and size of peer-to-peer communication for a Zilliqa node is controlled by several factors at different parts of the stack. 14 | 15 | ## Message Size 16 | 17 | - `MIN_READ_WATERMARK_IN_BYTES`: The minimum number of bytes read from the socket before we act on the data. It is basically the `lowmark` parameter required by the libevent function `bufferevent_setwatermark`. 18 | - `MAX_READ_WATERMARK_IN_BYTES`: The maximum number of bytes read from the socket before we stop accepting further input. It is basically the `highmark` parameter required by the libevent function `bufferevent_setwatermark`. 19 | - `MAX_GOSSIP_MSG_SIZE_IN_BYTES`: The maximum size of a socket message with start byte = `START_BYTE_GOSSIP`. If a message reaches this size, the sender is blacklisted. 20 | 21 | ## Message Count 22 | 23 | - `MAXSENDMESSAGE`: The number of active threads for the outgoing message pool. 24 | - `MAXRECVMESSAGE`: The number of active threads for the incoming message pool. 25 | - `SENDQUEUE_SIZE`: The maximum size of the outgoing message queue (before transfer to the outgoing pool), beyond which any further messages are dropped. 26 | - `MSGQUEUE_SIZE`: The maximum size of the incoming message queue (before transfer to the incoming pool), beyond which any further messages are dropped. 27 | 28 | ## Sending Frequency 29 | 30 | - `MAXRETRYCONN`: The maximum number of socket connection attempts to perform for sending messages to a peer. 31 | - `PUMPMESSAGE_MILLISECONDS`: The maximum wait time (minimum being 1 ms) before re-attempting socket connection. 32 | 33 | ## Active Connections 34 | 35 | - `MAX_PEER_CONNECTION`: The maximum number of active connections to a specific peer. 36 | -------------------------------------------------------------------------------- /docs/contributors/core-multipliers.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-multipliers 3 | title: Multipliers 4 | keywords: 5 | - core 6 | - multipliers 7 | description: Core protocol design - multipliers. 8 | --- 9 | 10 | --- 11 | 12 | The Zilliqa network - specifically, the DS committee and shard nodes - maintain a list of lookup nodes. All blockchain data generated by the network are forwarded to these lookup nodes, in order for them to function as [full nodes](../basics/basics-zil-nodes.mdx#lookup-nodes). 13 | 14 | On the other hand, the network has no direct knowledge of all existing [seed nodes](../basics/basics-zil-nodes.mdx#seed-nodes). Seed nodes, which are also full nodes, need to receive the same data as the lookup nodes to remain synced with the network. Among these seed nodes are the ones maintained by Zilliqa Research to service the public API, as well as the ones hosted by exchanges and ecosystem partners. 15 | 16 | To address this communication gap, multipliers play the role of receiving blockchain data-related messages from the network and forwarding them to seed nodes. In addition to the aforementioned lookup nodes, the network also maintains a list of these multiplier nodes, hence blockchain data is also sent to them. The Zilliqa Mainnet runs with several multipliers, each one configured to forward messages to a list of seed nodes identified by their IP address and port. 17 | 18 | The multiplier is a simple Go program that basically listens at a particular port for incoming messages and forwards the messages to the forwarding list. It periodically checks this list for any updates, enabling the addition or removal of seed nodes anytime. The multiplier uses hashes to prevent duplicate messsages from being forwarded repeatedly. It is robust enough to retry sending messages to recipients in the event of I/O timeout errors, which could happen due to network glitches on either end. 19 | -------------------------------------------------------------------------------- /docs/contributors/core-node-operation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-node-operation 3 | title: General Node Operation 4 | keywords: 5 | - core 6 | - node 7 | - operation 8 | description: Core protocol design - general node operation. 9 | --- 10 | 11 | --- 12 | 13 | A Zilliqa node requires the following information during launch: 14 | 15 | - Schnorr key pair 16 | - IP address and listening port 17 | - Sync type 18 | - Whether to retrieve persistence from S3 19 | 20 | Most other operational parameters are defined in the file `constants.xml`. 21 | 22 | During launch, a node will assume its [identity](../basics/basics-zil-nodes.mdx) as follows: 23 | 24 | - New, shard, or DS node based on sync type and bootstrap conditions (e.g., `DSInstructionType::SETPRIMARY`) 25 | - DS or shard guard node if `GUARD_MODE=true` and public key is in `ds_guard` or `shard_guard` list in `constants.xml` 26 | - Lookup node if `LOOKUP_NODE_MODE=true` 27 | - Seed node if `LOOKUP_NODE_MODE=true` and `ARCHIVAL_LOOKUP=true` 28 | 29 | A node will generally do the following upon startup: 30 | 31 | - Start the incoming and outgoing message queue managing threads 32 | - Populate some information (e.g., key and IP, list of guard nodes, list of initial DS committee nodes) 33 | - Set up the persistence (e.g., retrieve data from AWS S3) 34 | - Sync up according to sync type specified, and continue operation from there 35 | 36 | Refer to the other sections for an in-depth description of the operation of the various features. 37 | -------------------------------------------------------------------------------- /docs/contributors/core-por.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-por 3 | title: Proof of Reputation 4 | keywords: 5 | - core 6 | - por 7 | - proof 8 | - reputation 9 | description: Core protocol design - proof of reputation. 10 | --- 11 | 12 | --- 13 | 14 | The [DS reputation](core-ds-reputation.md) feature uses node performance to regulate node tenure within the DS committee. In a similar manner, the PoW submission selection process is designed to prioritize nodes that generated more cosignatures (i.e., actively perform consensus to generate blocks) during their time in the network. When the Mainnet is full (i.e., the 2400-node limit is reached), the PoW submissions from nodes with higher priority ratings will be processed first. This feature is referred to as Proof of Reputation (PoR). 15 | 16 | :::note 17 | Selection by reputation only takes effect when the number of PoW submissions exceeds `MAX_SHARD_NODE_NUM` in `constants.xml`. 18 | ::: 19 | 20 | ## PoR Procedure 21 | 22 | 1. When we bootstrap the system, the reputation of every node is 0 23 | 1. Every microblock or Tx block cosigned by a node increases its reputation by one. The reputation is capped at 4096 24 | 1. If in any DS epoch a node fails to join the network, its reputation will be reset to 0 25 | 1. At the beginning of each DS epoch, the DS leader calls `CalculateNodePriority()` to calculate the node priority based on the node reputation. The nodes with higher priority will be considered first for adding to the sharding structure 26 | 1. When the DS backups receive the DS block announcement, they call `VerifyNodePriority()` to calculate the node priority similarly and verify that the nodes in the sharding structure have met the minimum reputation/priority requirement 27 | 1. When a new DS leader is selected, the sharding structure is sent to it. The new DS leader can get the reputation of each node from the sharding structure 28 | -------------------------------------------------------------------------------- /docs/contributors/core-schnorr.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-schnorr 3 | title: Schnorr Algorithm 4 | --- 5 | 6 | --- 7 | 8 | TBD 9 | -------------------------------------------------------------------------------- /docs/contributors/core-status-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-status-server 3 | title: Status Server 4 | keywords: 5 | - core 6 | - status 7 | - server 8 | description: Core protocol design - status server. 9 | --- 10 | 11 | --- 12 | 13 | Every Zilliqa node has an API server listening on port `STATUS_RPC_PORT` (4301 by default). This server can only be accessed on localhost. 14 | 15 | This status server provides useful information about the operational parameters of the node. It also enables the user to control the behavior of the node along different aspects of its operation (e.g., stopping PoW mining at the end of the epoch). 16 | 17 | The utility script [miner_info.py](https://github.com/Zilliqa/Zilliqa/blob/master/scripts/miner_info.py) allows interacting with the status server. 18 | 19 | Among the available commands supported by the utility script are: 20 | 21 | - **checktxn**: Checks if a transaction is in the node's transaction memory pool 22 | - **difficulty**: Returns the latest difficulty for PoW mining 23 | - **disable_pow**: Prevents a node from performing PoW mining at the next epoch 24 | - **ds**: Returns the list of members of the DS committee 25 | - **ds_difficulty**: Returns the latest DS difficulty for PoW mining 26 | - **dsepoch**: Returns the latest DS epoch number 27 | - **epoch**: Returns the latest Tx epoch number 28 | - **state**: Returns the state of this node according to its state machine 29 | - **type**: Returns the node type (e.g., DS or shard) 30 | -------------------------------------------------------------------------------- /docs/contributors/core-transaction-dispatch.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-transaction-dispatch 3 | title: Transaction Dispatch 4 | keywords: 5 | - core 6 | - transaction 7 | - dispatch 8 | description: Core protocol design - transaction dispatch. 9 | --- 10 | 11 | --- 12 | 13 | From creation to confirmation, a transaction lifecycle proceeds in the following sequence: 14 | 15 | 1. An end user sends a `CreateTransaction` JSON request through the Zilliqa API. The transaction JSON contains the essential information about the transaction 16 | 1. The seed node that receives the request validates its contents and converts it into the core's transaction definition format 17 | 1. The seed node forwards this transaction (and other processed transaction requests) to a lookup node at intervals determined by `SEED_TXN_COLLECTION_TIME_IN_SEC` 18 | 1. The lookup node that receives the forwarded transaction decides which shard should process the transaction, and adds it to the transaction packet meant for that shard 19 | 1. At the start of every Tx epoch (plus a short delay determined by `LOOKUP_DELAY_SEND_TXNPACKET_IN_MS`), the lookup node dispatches its transaction packets to all the shards (including the DS committee) 20 | 1. The transaction packets are gossiped within the shards. Each node buffers the packet after receipt 21 | 1. Within the interval determined by `TX_DISTRIBUTE_TIME_IN_MS`, each node processes transaction packets buffered from the previous Tx epoch. Processing packets involves validating each transaction and adding these into the node's transaction memory pool 22 | 1. After the interval, the nodes (shards) first perform microblock, and then Tx block (DS committee) consensus. During consensus, transactions in the memory pool are consumed in a deterministic manner 23 | 1. After creation of the Tx block, the shard and DS nodes commit the transactions to the blockchain and forward the transaction receipts to the lookup nodes (and the seed nodes, through the [multipliers](core-multipliers.md)) 24 | 1. The end user queries the transaction status through the Zilliqa API. The seed node that receives the request uses the transaction receipt to inform the user of the transaction's status 25 | -------------------------------------------------------------------------------- /docs/contributors/core-transaction-lifecycle.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-transaction-lifecycle 3 | title: Transaction Lifecycle 4 | keywords: 5 | - core 6 | - account 7 | description: Core protocol design - transaction lifecycle. 8 | --- 9 | 10 | --- 11 | 12 | The diagram below illustrates how transactions flow within the Zilliqa network from user creation to Tx block generation. 13 | 14 | Contributors may also be interested to review these related documents: 15 | - [Types of Nodes](../basics/basics-zil-nodes) under the Basics section (for understanding the roles of nodes in the network) 16 | - [Transaction Lifecycle](../dev/dev-txn-signing) under the Developers section (for handling transactions at user level) 17 | - [Account Management](core-accounts#state-deltas) under the Contributors section (for the meaning of state deltas) 18 | 19 | In the diagram, it is worth emphasizing that epoch time has been optimized by configuring the lookup nodes to dispatch transaction packets (for next epoch) to shards during the time these shards are idle (i.e., while waiting for the Tx block after microblock generation), and to similarly dispatch transaction packets (for current epoch) to the DS committee during the time the committee is idle (i.e., while waiting for the shard microblocks after Tx block generation). This setup reduces network latency incurred by node-to-node communication. 20 | 21 | ![image01](/img/contributors/core/transaction-lifecycle/image01.png) 22 | -------------------------------------------------------------------------------- /docs/contributors/core-websocket-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: core-websocket-server 3 | title: WebSocket Server 4 | keywords: 5 | - core 6 | - websocket 7 | - server 8 | description: Core protocol design - websocket server. 9 | --- 10 | 11 | --- 12 | 13 | A lookup or seed node has the option (using `ENABLE_WEBSOCKET`) to enable a WebSocket server on port `WEBSOCKET_PORT` (4401 by default). The WebSocket server provides users (e.g., SDK clients) with a subscription-based data querying model as an alternative to polling. 14 | 15 | Interacting with the WebSocket server is detailed in our [Application Developers](../dev/dev-tools-websockets.md) section. 16 | 17 | The WebSocket server is implemented in [libServer](https://github.com/Zilliqa/Zilliqa/blob/master/src/libServer/WebsocketServer.h) in the Zilliqa core, using the [WebSocket++](https://github.com/zaphoyd/websocketpp) C++ library. 18 | -------------------------------------------------------------------------------- /docs/dev/dev-keys-introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-keys-introduction 3 | title: Introduction 4 | keywords: 5 | - key management 6 | - private key 7 | - zilpay 8 | - keystore 9 | - zilliqa 10 | description: Zilliqa User Key Management 11 | --- 12 | 13 | --- 14 | 15 | ## Getting Started with Key Management 16 | 17 | The following section describes a few key management strategies that you can use on the client-side of your Decentralised Application on Zilliqa. 18 | 19 | The following key management strategies will be discussed: 20 | 21 | - [ZilPay](dev-keys-zilpay.md) 22 | - [Keystore file & Private Key](dev-keys-pkey.md) 23 | - Ledger (Documentation coming soon) 24 | -------------------------------------------------------------------------------- /docs/dev/dev-keys-ledger.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-keys-ledger 3 | title: Ledger 4 | --- 5 | 6 | --- 7 | 8 | Ledger 9 | -------------------------------------------------------------------------------- /docs/dev/dev-keys-moonlet.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-keys-moonlet 3 | title: Moonlet 4 | --- 5 | 6 | --- 7 | 8 | Moonlet 9 | -------------------------------------------------------------------------------- /docs/dev/dev-keys-zilpay.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-keys-zilpay 3 | title: ZilPay 4 | keywords: 5 | - key management 6 | - zilpay 7 | - detect 8 | - connect 9 | - browser extension 10 | - wallet 11 | - access acounts 12 | - api 13 | - zilliqa 14 | description: Zilpay Zilliqa Browser Extension Wallet 15 | --- 16 | 17 | --- 18 | 19 | ZilPay is an [open source](https://github.com/zilpay/zil-pay) browser add-on that manages a user’s Zilliqa wallet and can be used on Chrome, Firefox and Opera browsers. 20 | It does not store any user's private keys on a remote server. Instead they are password protected and stored on browser storage. 21 | It is a non-custodial wallet, meaning, the user has full access and responsibility for their private key. 22 | 23 | ## Detecting ZilPay 24 | 25 | ZilPay injects a global API into websites visited by its users at 26 | `window.zilPay`. This API allows websites to request user login, load data from the blockchain and prompt the user to sign messages and transactions. 27 | 28 | To check if the user has ZilPay installed, here is a sample code 29 | 30 | ```typescript 31 | (typeof window.zilPay !== 'undefined') { /* do something */ } 32 | ``` 33 | 34 | ## Connecting Your dApp With ZilPay 35 | 36 | You need to ask once for the user's permission to connect your dApp to their ZilPay wallet. The following is a sample code for requesting the permission 37 | 38 | ```typescript 39 | window.zilPay.wallet.connect(); 40 | ``` 41 | 42 | This is a promise-returning method that resolves with a `Boolean` value. `true` value indicates that the user accepts your connect request and `false` value indicates rejection. 43 | 44 | ## Accessing User Accounts 45 | 46 | Once you have connected to a user's ZilPay wallet, you can check the current account information through `window.zilPay.wallet.defaultAccount`. 47 | 48 | If you will like to be notified when the user changes the account or network, you can subscribe to relevant events 49 | 50 | ```typescript 51 | window.zilPay.wallet.observableAccount().subscribe(function (account) { 52 | // ... When the user changes account 53 | }); 54 | window.zilPay.wallet.observableNetwork().subscribe(function (net) { 55 | // ... When the user changes network 56 | }); 57 | ``` 58 | 59 | ## API Reference 60 | 61 | ZilPay provides a set of documentation for your references 62 | 63 | - [Zilpay - Getting Started](https://zilpay.github.io/zilpay-docs/getting-started/#getting-started) 64 | -------------------------------------------------------------------------------- /docs/dev/dev-rentonzilliqa-contract.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-rentonzilliqa-contract 3 | title: Introduction 4 | keywords: 5 | - scilla 6 | - contract 7 | - rentonzilliqa 8 | description: The Scilla Contract for the RentOnZilliqa Application 9 | --- 10 | 11 | --- 12 | 13 | In this section, we will go through the process of writing the Scilla Contract for RentOnZilliqa. The contract will be deployed using the [Scilla IDE](https://ide.zilliqa.com). 14 | 15 | ## Contract Planning 16 | 17 | The logic of the contract is planned with the point of view of a renting platform. As such, we act as the renting platform and hence the owner of the contract. We collect a fixed commission from every rental transaction on the contract. The source code for the contract [can be found here](https://github.com/Quinence/zilliqa-fullstack-app-rentOnZilliqa/blob/main/src/scilla/RentOnZilliqa.scilla). 18 | 19 | ### Listings 20 | 21 | Listings are the houses that can be posted on the platform, which are subsequently made available to the renters. 22 | 23 | We allow the creation of user accounts to facilitate using the platform. The accounts can have one of two roles: 24 | 25 | - A Renter Account 26 | - A Host Account 27 | 28 | ### Renter Accounts 29 | 30 | Renter Accounts can rent listings that are created on the platform. When the correct amount is sent for booking an available listing, the listing is made available to the renter account. 31 | 32 | ### Host Accounts 33 | 34 | Host Accounts can create and manage listings on the platform. They can collect revenue from their listings. Hosts can also rent listings as long as they do not own the listing. 35 | 36 | Our contract has one immutable variable, i.e., `owner` of type `ByStr20`. We use this to store the wallet address of the contract owner. 37 | 38 | ### The Notion of Time 39 | 40 | Since listings can be rented for a limited amount of time, we need to devise a way of tracking the passage of time. We do this by measuring the change in the `BLOCKNUMBER`. In the following sections, we will see in detail how this is achieved. 41 | 42 | ## Building the Contract 43 | 44 | In the coming sections, we will build the contract. We will go through the following stages in detail: 45 | 46 | - [Library](dev-rentonzilliqa-library.md) 47 | - [Mutable Variables](dev-rentonzilliqa-mutable-variables.md) 48 | - [Procedures](dev-rentonzilliqa-procedures.md) 49 | - [Transitions](dev-rentonzilliqa-transitions.md) 50 | -------------------------------------------------------------------------------- /docs/dev/dev-section-navigation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-section-navigation 3 | title: Developer Section Navigation 4 | keywords: 5 | - navigation 6 | - developer section 7 | description: Developer Section Navigation 8 | --- 9 | 10 | --- 11 | 12 | This page will give you an idea of the contents of the `Developers` section of the developer portal. You can also use the search bar to find details about any specific topic you are looking for. 13 | 14 | ## Getting Started 15 | 16 | ### [Introduction](/docs/dev/dev-started-introduction) 17 | 18 | ### [Hello World](/docs/dev/dev-started-helloworld) 19 | 20 | ### [Development Environments](/docs/dev/dev-started-env) 21 | 22 | ## Building RentOnZilliqa 23 | 24 | ### [Introduction](/docs/dev/dev-rentonzilliqa-introduction) 25 | 26 | ### [Scilla Contract](/docs/dev/dev-rentonzilliqa-contract) 27 | 28 | ### [Frontend Application](/docs/dev/dev-rentonzilliqa-components) 29 | 30 | ## User Key Management 31 | 32 | ### [Introduction](/docs/dev/dev-keys-introduction) 33 | 34 | ### [Zilpay](/docs/dev/dev-keys-zilpay) 35 | 36 | ### [Private Key & Keystore File](/docs/dev/dev-keys-pkey) 37 | 38 | ### [ZRC2 Wallet Support](/docs/dev/dev-keys-zrc2-wallet-support) 39 | 40 | ### [Magic](/docs/dev/dev-keys-magic) 41 | 42 | ## Developer Toolings 43 | 44 | ### [Ceres](/docs/dev/dev-tools-ceres) 45 | 46 | ### [SDKs](/docs/dev/dev-tools-zilliqajs) 47 | 48 | ### [Websocket Server](/docs/dev/dev-tools-websockets) 49 | 50 | ### [CLI Tools](/docs/dev/dev-tools-cli) 51 | 52 | ### [Scilla IDEs](/docs/dev/dev-tools-ide) 53 | 54 | ### [Explorers](/docs/dev/dev-tools-explorer) 55 | 56 | ### [Faucet](/docs/dev/dev-tools-faucet) 57 | 58 | ## Transaction Lifecycle 59 | 60 | ### [Signing](/docs/dev/dev-txn-signing) 61 | 62 | ### [Broadcasting](/docs/dev/dev-txn-broadcasting) 63 | 64 | ### [Polling](/docs/dev/dev-txn-polling) 65 | 66 | ### [Confirmation](/docs/dev/dev-txn-confirmation) 67 | 68 | ### [Receipt](/docs/dev/dev-txn-receipt) 69 | 70 | ## Educational Resources 71 | 72 | ### [Zilliqa Development Videos](/docs/dev/dev-education-videos) 73 | -------------------------------------------------------------------------------- /docs/dev/dev-started-env.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-started-env 3 | title: Development Environments 4 | keywords: 5 | - development environments 6 | - isolated server 7 | - mainnet 8 | - testnet 9 | - api 10 | - chain id 11 | - websocket endpoint 12 | - zilliqa 13 | description: Zilliqa Development Environments - Testnet, Mainnet & Isolated Server 14 | --- 15 | 16 | --- 17 | 18 | ## Zilliqa Mainnet 19 | 20 | | | URL(s) | 21 | | :--------------------- | :--------------------------------------- | 22 | | **API URL** | `https://api.zilliqa.com/` | 23 | | **Block Explorer** | [**Link**](https://viewblock.io/zilliqa) | 24 | | **WebSocket endpoint** | `wss://api-ws.zilliqa.com` | 25 | | **Chain ID** | 1 | 26 | 27 | ## Developer Testnet 28 | 29 | | | URL(s) | 30 | | :--------------------- | :------------------------------------------------------- | 31 | | **API URL** | `https://dev-api.zilliqa.com/` | 32 | | **Faucet** | [**Link**](https://dev-wallet.zilliqa.com/home?network=testnet) | 33 | | **Block Explorer** | [**Link**](https://viewblock.io/zilliqa?network=testnet) | 34 | | **WebSocket endpoint** | `wss://dev-ws.zilliqa.com` | 35 | | **Chain ID** | 333 | 36 | 37 | ## Isolated Server 38 | 39 | Zilliqa Isolated Server is a test server for dApp developers to quickly test their applications. Transactions are validated immediately, hence improving the productivity for dApp developers. 40 | 41 | | | URL(s) | 42 | | :---------- | :--------------------------------------------- | 43 | | **API URL** | `https://zilliqa-isolated-server.zilliqa.com/` | 44 | -------------------------------------------------------------------------------- /docs/dev/dev-tools-explorer.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-tools-explorer 3 | title: Explorers 4 | keywords: 5 | - explorer 6 | - viewblock 7 | - devex 8 | - api 9 | - zilliqa 10 | - token 11 | description: Devex and ViewBlock Explorer 12 | --- 13 | 14 | --- 15 | 16 | import useBaseUrl from '@docusaurus/useBaseUrl'; 17 | 18 | ## Devex 19 | 20 | Viewblock 21 | 22 | Devex is a developer explorer that is maintained by Zilliqa Research. Devex is integrated directly into developer tools like Ceres and Scilla IDE. 23 | Devex allows you to look at blocks, address, transactions, status of the Zilliqa network as well as contract code, variables and any transition events. 24 | 25 | Viewblock 26 | 27 | Devex is available at this [link](https://devex.zilliqa.com/), by default, devex points to the Zilliqa mainnet but you can change the network by using the dropdown button at the top right corner. 28 | 29 | ## ViewBlock 30 | 31 | Viewblock 32 | 33 | ViewBlock allows you to look at blocks, address, transactions, status of the Zilliqa network, contract code and variables. 34 | 35 | | Network | Link | 36 | | ------- | -------------------------------------------- | 37 | | Mainnet | https://viewblock.io/zilliqa | 38 | | Testnet | https://viewblock.io/zilliqa?network=testnet | 39 | 40 | For example, [this](https://viewblock.io/zilliqa/tx/c4030c73d6dae558ff0c9d98237101e342888115f13219a00bb14a8ee46fa3be?network=testnet) 41 | is the link to a `getHello()` transition transaction. 42 | 43 | If you create a legit token and have a logo, head over to the [cryptometa](https://github.com/Ashlar/cryptometa) repository and follow the Readme instructions. 44 | 45 | ### Viewblock products 46 | 47 | [ViewBlock API](https://viewblock.io/api) - ViewBlock's API is a valuable resource for some additional methods that a developer might require for his application (e.g retrieving transactions sent by a particular address). 48 | 49 | [ViewBlock Zilliqa Stats](https://viewblock.io/zilliqa/stats) - ViewBlock's statistics provide statistical information about Zilliqa network such as difficulty over time, number of blocks over time and address growth over time. 50 | 51 | [ViewBlock Dashboard](https://dash.viewblock.io/d/zilliqa) - Is an advanced dashboard showing more statistics which allows you to select any time range you desire with a custom granularity 52 | -------------------------------------------------------------------------------- /docs/dev/dev-tools-faucet.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-tools-faucet 3 | title: Faucet 4 | keywords: 5 | - faucet 6 | - nucleus wallet 7 | - tester 8 | - zilliqa 9 | description: Zilliqa Testnet Faucet 10 | --- 11 | 12 | --- 13 | 14 | import useBaseUrl from '@docusaurus/useBaseUrl'; 15 | 16 | ## Testnet Faucet via Nucleus Wallet 17 | 18 | Nucleus Wallet Faucet 22 | 23 | In order to deploy a contract to Zilliqa's testnet and send transactions, you will need testnet $ZIL in your account. 24 | 25 | Enter the your wallet address on nucleus wallet's faucet website, you will receive 300 testnet $ZIL once the transaction is confirmed. 26 | 27 | The faucet is accessible at [https://dev-wallet.zilliqa.com/faucet](https://dev-wallet.zilliqa.com/faucet) 28 | 29 | ## Source Code 30 | 31 | If you are interested in looking into the implementation of the faucet, you can access the GitHub repository can be found at [https://github.com/Zilliqa/nucleus-wallet](https://github.com/Zilliqa/nucleus-wallet) 32 | -------------------------------------------------------------------------------- /docs/dev/dev-tools-sdks.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-tools-sdks 3 | title: Other SDKs 4 | keywords: 5 | - sdks 6 | - other 7 | - community 8 | - pyzil 9 | - python 10 | - viewblock sdk 11 | - moonlet core 12 | - ruby 13 | - php 14 | - dart 15 | - swift 16 | - go 17 | - js 18 | - Zesame 19 | - Zilliqa-API-CSharp 20 | - LaksaRuby 21 | - LaksaDart 22 | - zilean 23 | - zilliqa 24 | description: Zilliqa Community Maintained SDKs 25 | --- 26 | 27 | --- 28 | 29 | Zilliqa has a number of SDKs implemented in various programming languages. If yours is not 30 | listed here, please [create a PR](https://github.com/Zilliqa/dev-portal/pulls) 31 | on this repository. 32 | 33 | [zilliqa-js](https://github.com/Zilliqa/zilliqa-js), [gozilliqa (formerly laksago)](https://github.com/Zilliqa/gozilliqa-sdk) and [laksaj](https://github.com/FireStack-Lab/LaksaJ) are active SDKs maintained by the Zilliqa core team but the zilliqa community members also actively maintain multiple SDKs. 34 | 35 | ## SDKs Maintained By the Community 36 | 37 | **JavaScript/TypeScript** 38 | 39 | - [zilliqa-js/viewblock](https://github.com/Ashlar/zilliqa-js-viewblock) 40 | - [laksaj](https://github.com/FireStack-Lab/Laksa) 41 | - [moonlet-core](https://github.com/cryptolandtech/moonlet-core) 42 | - [mszbednarski/boost-zil](https://github.com/MszBednarski/boost-zil) 43 | 44 | **Python** 45 | 46 | - [pyzil](https://github.com/deepgully/pyzil) 47 | 48 | **C#** 49 | 50 | - [zilliqa-api-csharp](https://github.com/musenzi/Zilliqa-API-CSharp) 51 | 52 | **Swift** 53 | 54 | - [zesame](https://github.com/OpenZesame/Zesame) 55 | 56 | **Ruby** 57 | 58 | - [laksaruby](https://github.com/FireStack-Lab/LaksaRuby) 59 | 60 | **Dart** 61 | 62 | - [laksadart](https://github.com/FireStack-Lab/LaksaDart) 63 | 64 | **PHP** 65 | 66 | - [Zilliqa-PHP](https://github.com/defser/zilliqa-php) 67 | 68 | ## SDKs Discontinued 69 | 70 | Listed below are SDKs not longer maintained 71 | 72 | **Go** 73 | 74 | - [zilean](https://github.com/GincoInc/zillean) 75 | -------------------------------------------------------------------------------- /docs/dev/dev-txn-polling.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-txn-polling 3 | title: Polling 4 | keywords: 5 | - polling 6 | - transaction 7 | - zilliqa 8 | description: Zilliqa Transaction Polling 9 | --- 10 | 11 | --- 12 | 13 | If your transaction is successfully verified by the seed node, the transaction will be sent to the appropriate shard. Shard selection depends on a number of factors that are explained in detail in [this post](https://blog.zilliqa.com/provisioning-sharding-for-smart-contracts-a-design-for-zilliqa-cd8d012ee735). 14 | 15 | After sending the transaction object, there will be a `transaction id`. We can invoke the `GetTransaction` JSON RPC API with the `transaction id` periodically to check the transaction status. It is recommended to poll the seed node with `GetTransaction` for **3 Tx Epochs** (around 3-5 minutes). If the transaction is not confirmed after that, we can assume that it has not been included in any block and should be re-broadcasted. 16 | 17 | Example of transaction polling: 18 | 19 | import Tabs from '@theme/Tabs'; 20 | import TabItem from '@theme/TabItem'; 21 | 22 | 30 | 31 | 32 | ```js 33 | const txn = await zilliqa.blockchain.getTransaction( 34 | '1899b381d644a4892ca5ba5d8d60bbcc7bd121d511d55e438a8ddbdcc53272c4' 35 | ); 36 | console.log(JSON.stringify(txn)); 37 | ``` 38 | 39 | 40 | 41 | 42 | ```go 43 | provider := NewProvider("https://dev-api.zilliqa.com/") 44 | result, _ := provider.GetTransaction("c7d6550a6558edcddbf4b3c7cf14db9f1025200b89bcbcd6a570c84db58d554f") 45 | resStr,_ := json.Marshal(result) 46 | fmt.Println(string(resStr)) 47 | ``` 48 | 49 | 50 | 51 | 52 | ```java 53 | HttpProvider client = new HttpProvider("https://api.zilliqa.com/"); 54 | Transaction transaction = client.getTransaction("055294ba67b3073d66ef078fb149dfb0490b2d46156479a9f2c9327fb762f4e9").getResult(); 55 | System.out.println(new Gson().toJson(transaction)) 56 | ``` 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/dev/dev-txn-signing.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: dev-txn-signing 3 | title: Signing 4 | keywords: 5 | - signing 6 | - transitions 7 | - zilliqa 8 | description: Zilliqa Transaction Signing 9 | --- 10 | 11 | --- 12 | 13 | Before sending a transaction, one must first sign it with a **valid private key**. This can be done with one of the numerous SDKs provided by the Zilliqa team and community. 14 | 15 | Signing is done against the Protobuf-serialised version of the transaction's contents. This is the reason why all SDKs depend on Protobuf to function. This step is **transparent** to you as a developer. 16 | 17 | Example of providing a private key: 18 | 19 | import Tabs from '@theme/Tabs'; 20 | import TabItem from '@theme/TabItem'; 21 | 22 | 30 | 31 | 32 | ```js 33 | const { Zilliqa } = require('@zilliqa-js/zilliqa'); 34 | const { getAddressFromPrivateKey } = require('@zilliqa-js/crypto'); 35 | const zilliqa = new Zilliqa('https://dev-api.zilliqa.com'); 36 | 37 | const PRIVATE_KEY = 38 | '9afc1a1dab96127e902daaaec1a56c30346f007523c787c3bb62371c0e5a1be7'; 39 | 40 | zilliqa.wallet.addByPrivateKey(PRIVATE_KEY); 41 | ``` 42 | 43 | 44 | 45 | 46 | ```go 47 | import ( 48 | "github.com/Zilliqa/gozilliqa-sdk/account" 49 | ) 50 | 51 | wallet := account.NewWallet() 52 | wallet.AddByPrivateKey("e19d05c5452598e24caad4a0d85a49146f7be089515c905ae6a19e8a578a6930") 53 | ``` 54 | 55 | 56 | 57 | 58 | ```java 59 | package com.firestack.example; 60 | 61 | import com.firestack.laksaj.account.Wallet; 62 | 63 | public class TransactionOperation { 64 | public static void main(String[] args) throws IOException, NoSuchAlgorithmException { 65 | Wallet wallet = new Wallet(); 66 | String ptivateKey = "e19d05c5452598e24caad4a0d85a49146f7be089515c905ae6a19e8a578a6930"; 67 | String address = wallet.addByPrivateKey(ptivateKey); 68 | } 69 | } 70 | ``` 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /docs/exchanges/exchange-introduction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: exchange-getting-started 3 | title: Hosting Seed Nodes 4 | keywords: 5 | - exchanges 6 | - ip whitelisting 7 | - hardware requirements 8 | - docker setup 9 | - zilliqa 10 | description: Getting Started For Exchanges 11 | --- 12 | 13 | --- 14 | 15 | :::danger $ZIL Disclaimer 16 | Please read [$ZIL disclaimer](https://www.zilliqa.com/disclaimer) before proceeding. 17 | ::: 18 | 19 | ## Introduction 20 | 21 | While it's possible to use the public endpoint provided by Zilliqa to interact 22 | with the blockchain, we recommend that all exchanges that wish to support 23 | trading on the mainnet set up seed nodes. This section walks you through the 24 | basic steps needed to get the seed node up and running. 25 | 26 | ## Modes 27 | 28 | Running a seed node is possible through 3 different modes. Exchanges can use 29 | whichever mode is feasible for their case. 30 | 31 | - IP whitelisting 32 | - Key whitelisting (with and without open inbound port) 33 | 34 | ### IP Whitelisting Mode 35 | 36 | In IP whitelisting mode, blockchain data is pushed directly to exchanges in 37 | periodic intervals. As seed nodes using this mode receive data directly and do 38 | not otherwise pull data from peers, exchanges must be whitelisted by Zilliqa to 39 | receive these data broadcasts. This requires a static, public IP address with 40 | minimally two open ports (inbound and outbound) at which it can be reached. 41 | The [IP Whitelisting](exchange-ip-whitelisting) section contains information 42 | about running a node in IP whitelisting mode. 43 | 44 | ### Key Whitelisting Mode 45 | 46 | In key whitelisting mode, blockchain data is pulled by the seed from Zilliqa 47 | Research-hosted public seed nodes in periodic intervals. Exchanges using 48 | this mode generate a public-private key pair and share their public key with 49 | Zilliqa Research for whitelisting. At minimum, a port has to be opened for 50 | outbound traffic. Exchanges using this mode have the further option of 51 | configuring a second port for inbound traffic. The [Key Whitelisting](exchange-key-whitelisting-1) 52 | section contains information about running a node in key whitelisting mode. 53 | 54 | ## Minimum Hardware Requirements 55 | 56 | - x64 Linux operating system (e.g Ubuntu 18.04.5) 57 | - Recent dual core processor @ 2.2 GHZ. Examples: Intel Xeon (Skylake) 58 | - 8GB DRR3 RAM or higher 59 | - Public static IP address 60 | - 500GB Solid State Drive 61 | - 100MB/s upload and download bandwidth 62 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-derive.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-derive 3 | title: Derive 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - derive 12 | description: Derive 13 | --- 14 | 15 | --- 16 | 17 | ## Derive an Address from a Public Key 18 | 19 | Returns the address associated with the public key. Both `bech32` and checksummed `base16` format is returned. 20 | 21 | Request: 22 | 23 | ```json 24 | { 25 | "network_identifier": { 26 | "blockchain": "zilliqa", 27 | "network": "mainnet" 28 | }, 29 | "public_key": { 30 | "hex_bytes": "026c7f3b8ac6f615c00c34186cbe4253a2c5acdc524b1cfae544c629d8e3564cfc", 31 | "curve_type": "secp256k1" 32 | }, 33 | "metadata": { 34 | "type": "bech32" 35 | } 36 | } 37 | ``` 38 | 39 | Response: 40 | 41 | Sample 42 | 43 | ```json 44 | { 45 | "address": "zil1y9qmlzmdygfaf4eqfcka4wfx20wzghzl05xazc", 46 | "account_identifier": { 47 | "address": "zil1y9qmlzmdygfaf4eqfcka4wfx20wzghzl05xazc", 48 | "metadata": { 49 | "base16": "2141BF8B6D2213d4d7204E2DDAB92653dC245c5F" 50 | } 51 | } 52 | } 53 | ``` 54 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-hash.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-hash 3 | title: Hash 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - hash 12 | description: Hash 13 | --- 14 | 15 | --- 16 | 17 | ## Get the Hash of a Signed Transaction 18 | 19 | Returns the transaction hash for a signed transaction. 20 | 21 | Request: 22 | 23 | ```json 24 | { 25 | "network_identifier": { 26 | "blockchain": "zilliqa", 27 | "network": "testnet" 28 | }, 29 | "signed_transaction": "{\"amount\":2000000000000,\"code\":\"\",\"data\":\"\",\"gasLimit\":1,\"gasPrice\":1000000000,\"nonce\":186,\"pubKey\":\"02e44ef2c5c2031386faa6cafdf5f67318cc661871b0112a27458e65f37a35655e\",\"signature\":\"51c69af638ad7afd39841a7abf937d5df99e20adedc4287f43c8070d497ba78136c951192b3920914feb83b9272ccb2ca7facd835dfad10eff2b848b13616daf\",\"toAddr\":\"zil1f9uqwhwkq7fnzgh5x4djyzg4a7j3apx8dsnnc0\",\"version\":21823489}" 30 | } 31 | ``` 32 | 33 | Response: 34 | 35 | Sample 36 | 37 | ```json 38 | { 39 | "transaction_identifier": { 40 | "hash": "a17367c8bcd83cdc2d9ede4571c8e27ad74278ae195263f13e10ba84f12ab13c" 41 | } 42 | } 43 | ``` 44 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-mempool-transaction.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-mempool-transaction 3 | title: transaction 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - mempool 12 | - transaction 13 | description: transaction 14 | --- 15 | 16 | --- 17 | 18 | ## Get a Mempool Transaction 19 | 20 | Return transactions that are inside mempool. 21 | 22 | Request: 23 | 24 | ```json 25 | { 26 | "network_identifier": { 27 | "blockchain": "zilliqa", 28 | "network": "testnet" 29 | }, 30 | "transaction_identifier": { 31 | "hash": "af6e2a81812f7834312e8e2358b51f2f9d7ca696c4d315258102ed868389a7c1" 32 | } 33 | } 34 | ``` 35 | 36 | Response: 37 | 38 | Sample 39 | 40 | ```json 41 | { 42 | "code": 0, 43 | "message": "transaction not pending", 44 | "retriable": false 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-metadata.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-metadata 3 | title: Metadata 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - metadata 12 | description: Metadata 13 | --- 14 | 15 | --- 16 | 17 | ## Create a Request to Fetch Metadata 18 | 19 | Using the payload from `preprocess`, `metadata` return essential information required to construct a transaction. In Rosetta Zilliqa, information such as `nonce` and `version` is returned. 20 | 21 | Request: 22 | 23 | `options` is from `/construction/preprocess` 24 | 25 | ```json 26 | { 27 | "network_identifier": { 28 | "blockchain": "zilliqa", 29 | "network": "testnet" 30 | }, 31 | "options": { 32 | "amount": "2000000000000", 33 | "gasLimit": "50", 34 | "gasPrice": "2000000000", 35 | "senderAddr": "zil1n8uafq4thhzlq5nj50p55al9jvamr3s45hm49r", 36 | "toAddr": "zil1f9uqwhwkq7fnzgh5x4djyzg4a7j3apx8dsnnc0" 37 | }, 38 | "public_keys": [ 39 | { 40 | "hex_bytes": "02e44ef2c5c2031386faa6cafdf5f67318cc661871b0112a27458e65f37a35655e", 41 | "curve_type": "secp256k1" 42 | } 43 | ] 44 | } 45 | ``` 46 | 47 | Response: 48 | 49 | Sample 50 | 51 | ```json 52 | { 53 | "metadata": { 54 | "amount": "2000000000000", 55 | "gasLimit": "50", 56 | "gasPrice": "2000000000", 57 | "nonce": 187, 58 | "pubKey": "02e44ef2c5c2031386faa6cafdf5f67318cc661871b0112a27458e65f37a35655e", 59 | "senderAddr": "zil1n8uafq4thhzlq5nj50p55al9jvamr3s45hm49r", 60 | "toAddr": "zil1f9uqwhwkq7fnzgh5x4djyzg4a7j3apx8dsnnc0", 61 | "version": 21823489 62 | } 63 | } 64 | ``` 65 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-parse.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-parse 3 | title: Parse 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - parse 12 | description: Parse 13 | --- 14 | 15 | --- 16 | 17 | ## Parse a Transaction 18 | 19 | Parse is called on either unsigned or signed transactions to understand the intent of the formulated transaction. This is run as a sanity check before signing (after `/construction/payloads`) and before broadcast (after `/construction/combine`). 20 | 21 | :::info 22 | Set the `signed` flag accordingly to denote whether the transaction is signed or unsigned. 23 | ::: 24 | 25 | Request: 26 | 27 | ```json 28 | { 29 | "network_identifier": { 30 | "blockchain": "zilliqa", 31 | "network": "testnet" 32 | }, 33 | "signed": false, 34 | "transaction": "{\"amount\":2000000000000,\"code\":\"\",\"data\":\"\",\"gasLimit\":50,\"gasPrice\":2000000000,\"nonce\":467,\"pubKey\":\"02e819146a9685ab282e4cacc0de7c00e41d52111ad4092f7ccb266a37255f31ad\",\"senderAddr\":\"zil17jljwxdwh6mvt8gxe28cd7drjkhtfa3ds9c5en\",\"toAddr\":\"zil1rm988wdvdnue5we36tr2y0yyxufcfphqcxmj55\",\"version\":21823489}" 35 | } 36 | ``` 37 | 38 | Response: 39 | 40 | Sample 41 | 42 | ```json 43 | { 44 | "operations": [ 45 | { 46 | "operation_identifier": { 47 | "index": 0 48 | }, 49 | "type": "TRANSFER", 50 | "status": "", 51 | "account": { 52 | "address": "zil17jljwxdwh6mvt8gxe28cd7drjkhtfa3ds9c5en", 53 | "metadata": { 54 | "base16": "F4bf2719AEBEB6C59D06ca8f86f9a395aeB4F62d" 55 | } 56 | }, 57 | "amount": { 58 | "value": "-2000000000000", 59 | "currency": { 60 | "symbol": "ZIL", 61 | "decimals": 12 62 | } 63 | } 64 | }, 65 | { 66 | "operation_identifier": { 67 | "index": 1 68 | }, 69 | "related_operations": [ 70 | { 71 | "index": 0 72 | } 73 | ], 74 | "type": "TRANSFER", 75 | "status": "", 76 | "account": { 77 | "address": "zil1rm988wdvdnue5we36tr2y0yyxufcfphqcxmj55", 78 | "metadata": { 79 | "base16": "1Eca73B9ac6Cf99a3B31d2C6A23c8437138486e0" 80 | } 81 | }, 82 | "amount": { 83 | "value": "2000000000000", 84 | "currency": { 85 | "symbol": "ZIL", 86 | "decimals": 12 87 | } 88 | } 89 | } 90 | ] 91 | } 92 | ``` 93 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-preprocess.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-preprocess 3 | title: Preprocess 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - preprocess 12 | description: Preprocess 13 | --- 14 | 15 | --- 16 | 17 | ## Create a Request to Fetch Metadata 18 | 19 | Preprocess is called prior to /construction/payloads to construct a request for metadata (such as `nonce`) that are needed for transaction construction. 20 | The options object returned from `preprocess` will be sent to the `/construction/metadata`. 21 | 22 | Request: 23 | 24 | ```json 25 | { 26 | "network_identifier": { 27 | "blockchain": "zilliqa", 28 | "network": "testnet" 29 | }, 30 | "operations": [ 31 | { 32 | "operation_identifier": { 33 | "index": 0 34 | }, 35 | "type": "TRANSFER", 36 | "status": "", 37 | "account": { 38 | "address": "zil1n8uafq4thhzlq5nj50p55al9jvamr3s45hm49r", 39 | "metadata": { 40 | "base16": "99f9d482abbdC5F05272A3C34a77E5933Bb1c615" 41 | } 42 | }, 43 | "amount": { 44 | "value": "-2000000000000", 45 | "currency": { 46 | "symbol": "ZIL", 47 | "decimals": 12 48 | } 49 | } 50 | }, 51 | { 52 | "operation_identifier": { 53 | "index": 1 54 | }, 55 | "related_operations": [ 56 | { 57 | "index": 0 58 | } 59 | ], 60 | "type": "TRANSFER", 61 | "status": "", 62 | "account": { 63 | "address": "zil1f9uqwhwkq7fnzgh5x4djyzg4a7j3apx8dsnnc0", 64 | "metadata": { 65 | "base16": "4978075dd607933122f4355B220915EFa51E84c7" 66 | } 67 | }, 68 | "amount": { 69 | "value": "2000000000000", 70 | "currency": { 71 | "symbol": "ZIL", 72 | "decimals": 12 73 | } 74 | }, 75 | "metadata": { 76 | "senderPubKey": "0x02e44ef2c5c2031386faa6cafdf5f67318cc661871b0112a27458e65f37a35655e" 77 | } 78 | } 79 | ], 80 | "metadata": {} 81 | } 82 | ``` 83 | 84 | Response: 85 | 86 | Sample 87 | 88 | ```json 89 | { 90 | "options": { 91 | "amount": "2000000000000", 92 | "gasLimit": "50", 93 | "gasPrice": "2000000000", 94 | "senderAddr": "zil1n8uafq4thhzlq5nj50p55al9jvamr3s45hm49r", 95 | "toAddr": "zil1f9uqwhwkq7fnzgh5x4djyzg4a7j3apx8dsnnc0" 96 | }, 97 | "required_public_keys": [ 98 | { 99 | "address": "zil1n8uafq4thhzlq5nj50p55al9jvamr3s45hm49r", 100 | "metadata": { 101 | "base16": "99f9d482abbdC5F05272A3C34a77E5933Bb1c615" 102 | } 103 | } 104 | ] 105 | } 106 | ``` 107 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-construction-submit.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-construction-submit 3 | title: Submit 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - contruction 11 | - submit 12 | description: Submit 13 | --- 14 | 15 | --- 16 | 17 | ## Submit a Signed Transaction 18 | 19 | Submit a signed transaction to the Zilliqa network. This call is non-blocking and will return immediately with a transaction hash. 20 | 21 | :::info 22 | Before calling `/submit`, please call `/combine` to obtain the `signed_transaction` required for the request parameters. 23 | ::: 24 | 25 | Request: 26 | 27 | ```json 28 | { 29 | "network_identifier": { 30 | "blockchain": "zilliqa", 31 | "network": "testnet" 32 | }, 33 | "signed_transaction": "{\"amount\":2000000000000,\"code\":\"\",\"data\":\"\",\"gasLimit\":1,\"gasPrice\":2000000000,\"nonce\":187,\"pubKey\":\"02e44ef2c5c2031386faa6cafdf5f67318cc661871b0112a27458e65f37a35655e\",\"senderAddr\":\"zil1n8uafq4thhzlq5nj50p55al9jvamr3s45hm49r\",\"signature\":\"fcb93583d963a7c11f52f04b1ecbd129aa3df896e618b47ff163dc18c53b59afc4289851fd2d5a50eaa7d7ae0763eb912797b0b34e1cf1e6d3865a218e1066b7\",\"toAddr\":\"zil1f9uqwhwkq7fnzgh5x4djyzg4a7j3apx8dsnnc0\",\"version\":21823489}" 34 | } 35 | ``` 36 | 37 | Response: 38 | 39 | Sample 40 | 41 | ```json 42 | { 43 | "transaction_identifier": { 44 | "hash": "963a984ee255cfd881b337a52caf699d4f05799c45cc0948d8a8ce72a6a12d8e" 45 | } 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-data-account-balance.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-data-account-balance 3 | title: Balance 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - data 11 | - account 12 | - balance 13 | description: Balance 14 | --- 15 | 16 | --- 17 | 18 | ## Get an Account Balance 19 | 20 | Return the account balance and nonce of a particular account. 21 | 22 | Request: 23 | 24 | ```json 25 | { 26 | "network_identifier": { 27 | "blockchain": "zilliqa", 28 | "network": "testnet" 29 | }, 30 | "account_identifier": { 31 | "address": "2141bf8b6d2213d4d7204e2ddab92653dc245c5f", 32 | "sub_account": { 33 | "address": "empty" 34 | }, 35 | "metadata": {} 36 | }, 37 | "block_identifier": { 38 | "index": 0 39 | } 40 | } 41 | ``` 42 | 43 | Response: 44 | 45 | Sample 46 | 47 | ```json 48 | { 49 | "block_identifier": { 50 | "index": 0, 51 | "hash": "1947718b431d25dd65c226f79f3e0a9cc96a948899dab3422993def1494a9c95" 52 | }, 53 | "balances": [ 54 | { 55 | "value": "529909051575", 56 | "currency": { 57 | "symbol": "ZIL", 58 | "decimals": 12 59 | } 60 | } 61 | ], 62 | "metadata": { 63 | "nonce": 48 64 | } 65 | } 66 | ``` 67 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-data-network-list.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-data-network-list 3 | title: List 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - data 11 | - network 12 | - list 13 | description: List 14 | --- 15 | 16 | --- 17 | 18 | ## Get List of Available Networks 19 | 20 | Returns a list of NetworkIdentifiers that the Rosetta server supports, namely `testnet` and `mainnet`. 21 | 22 | Request: 23 | 24 | ```json 25 | { 26 | "metadata": {} 27 | } 28 | ``` 29 | 30 | Response: 31 | 32 | Sample 33 | 34 | ```json 35 | { 36 | "network_identifiers": [ 37 | { 38 | "blockchain": "zilliqa", 39 | "network": "mainnet" 40 | }, 41 | { 42 | "blockchain": "zilliqa", 43 | "network": "testnet" 44 | } 45 | ] 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-data-network-status.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-data-network-status 3 | title: Status 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - API 10 | - data 11 | - network 12 | - status 13 | description: Status 14 | --- 15 | 16 | --- 17 | 18 | ## Get Network Status 19 | 20 | Returns the current 21 | 22 | 1. Genesis block number and hash 23 | 2. Block number, hash and timestamp 24 | 25 | Request: 26 | 27 | ```json 28 | { 29 | "network_identifier": { 30 | "blockchain": "zilliqa", 31 | "network": "testnet" 32 | }, 33 | "metadata": {} 34 | } 35 | ``` 36 | 37 | Response: 38 | 39 | Sample 40 | 41 | ```json 42 | { 43 | "current_block_identifier": { 44 | "index": 1668170, 45 | "hash": "cfe255a521942588708213129f6cce4522820fb0aaaf1bb3934f2908ca94b738" 46 | }, 47 | "current_block_timestamp": 1596617124206, 48 | "genesis_block_identifier": { 49 | "index": 0, 50 | "hash": "1947718b431d25dd65c226f79f3e0a9cc96a948899dab3422993def1494a9c95" 51 | }, 52 | "peers": null 53 | } 54 | ``` 55 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-introduction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-introduction 3 | title: Introduction to Rosetta 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - Rosetta 10 | - Introduction 11 | description: Introduction to Rosetta 12 | --- 13 | 14 | --- 15 | 16 | import useBaseUrl from '@docusaurus/useBaseUrl'; 17 | 18 | Network sharding 19 | 20 | Rosetta is an open-source initiaitve by [Coinbase](https://blog.coinbase.com/introducing-rosetta-build-once-integrate-your-blockchain-everywhere-9b97d284f5b9). Today, one of the main issues for software developers is the ever increasing number of blockchains with different node and wallet APIs. The goal of Rosetta is to [standardize](https://github.com/coinbase/rosetta-specifications) how to interact with blockchains, making it easy for anyone to build on top of a blockchain for a variety of different use cases. 21 | 22 | For developers of new blockchain projects, the Rosetta interface makes it easier to ensure compatibility with exchanges that use Rosetta, and can dramatically speed up the time it takes exchanges to integrate with new blockchains and protect customer funds by ensuring specific security conditions are met. 23 | 24 | For the broader community of crypto developers, Rosetta makes it easier to build cross-blockchain applications such as block explorers, wallets and dapps. Instead of writing custom parsing for every supported blockchain, applications can use a blockchain project’s Rosetta implementation to read on-chain data and construct transactions in a standard format; minimizing code and simplifying maintenance. 25 | 26 | # Zilliqa Rosetta 27 | 28 | Zilliqa Rosetta is reference implementation of the Rosetta specification for Zilliqa blockchain platform. Data and construction API has been implemented. 29 | 30 | Latest release of Zilliqa Rosetta can be found at https://github.com/Zilliqa/zilliqa-rosetta 31 | 32 | ## Running Zilliqa Rosetta with Zilliqa seed node 33 | 34 | To run Zilliqa Rosetta, please refer to ["Setting up Zilliqa Rosetta with Seed node"](rosetta-setting-up-seed-node) section on instruction on how to set it up. You can choose to either run a seed node together Rosetta or connect Rosetta to our public endpoing, `api.zilliqa.com`. 35 | 36 | :::info 37 | For running a seed node option, whitelisting will be required and whitelisting is only given on a case by case basis. 38 | ::: 39 | 40 | ## Running Zilliqa Rosetta without Zilliqa seed node 41 | 42 | To run Zilliqa Rosetta connecting to Zilliqa public API endpoint, please refer to ["Setting up Zilliqa Rosetta connecting to public API endpoint"](rosetta-setting-up-no-seed-node) section. 43 | 44 | ## Interacting with Zilliqa Rosetta 45 | 46 | You can refer to the Zilliqa Rosetta APIs for the list of supported restful APIs. If need you need a SDK, the Rosetta project has provided a [Golang Rosetta SDK](https://github.com/coinbase/rosetta-sdk-go). 47 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-setting-up-no-seed-node.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-setting-up-no-seed-node 3 | title: Setting up Zilliqa Rosetta connecting to public API endpoint 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - rosetta 10 | - setup 11 | - public 12 | - api 13 | - endpoint 14 | - standalone 15 | description: Setting up Zilliqa Rosetta connecting to public API endpoint 16 | --- 17 | 18 | --- 19 | 20 | Zilliqa rosetta standalone provide the option of connecting to public seed node service such `api.zilliqa.com` and `dev-api.zilliqa.com` instead of running seed node on your end. 21 | 22 | ## Setup 23 | 24 | ### Step 1: Download `Zilliqa-rosetta` latest release from https://github.com/Zilliqa/zilliqa-rosetta/releases. 25 | 26 | ### Step 2: Build `Zilliqa-rosetta standalone` Docker image 27 | 28 | #### Running with the latest release of Zilliqa rosetta 29 | 30 | ```bash 31 | cd rosetta_standalone 32 | sh ./build_standalone.sh .sh 33 | ``` 34 | 35 | #### Running with a specific release of Zilliqa rosetta 36 | 37 | ```bash 38 | docker build \ 39 | --build-arg ROSETTA_COMMIT_OR_TAG= \ 40 | -f rosetta_standalone/Dockerfile_standalone 41 | -t rosetta_standalone:1.0 . 42 | ``` 43 | 44 | ### Step 3: Configuring `Zilliqa-rosetta` (optional) 45 | 46 | By default, Zilliqa-rosetta standalone will connect to public endpoint of Zilliqa testnet and mainnet. 47 | 48 | If you need to connect to other Zilliqa endpoints, you can mdoify `Zilliqa-rosetta` configurations yaml. The format is as follows: 49 | 50 | ```yaml 51 | * rosetta: 52 | * host: rosetta restful api host 53 | * port: resetta restful api port 54 | * version: rosetta sdk version 55 | * middleware_version: middleware version 56 | * networks: 57 | * : 58 | * api: api endpoint of mainnet 59 | * chain_id: chain id of mainnet 60 | * node_version: zilliqa node verion 61 | * : 62 | * api: api endpoint of mainnet 63 | * chain_id: chain id of mainnet 64 | * node_version: zilliqa node verion 65 | ``` 66 | 67 | Default configuration files for Zilliqa testnet and mainnet combined has been included in Rosetta root directory. 68 | 69 | | Network | Config file | 70 | | ---------------- | ------------------- | 71 | | Testnet, Mainnet | `config.local.yaml` | 72 | 73 | ### Step 4: Running `Zilliqa-rosetta` 74 | 75 | #### Running Zilliqa rosetta standalone with default configuration 76 | 77 | ```bash 78 | run_standalone.sh 79 | ``` 80 | 81 | #### Running Zilliqa rosetta standalone with custom configuration 82 | 83 | ```bash 84 | docker run -d -p 8080:8080 -v :/rosetta/config.local.yaml --name rosetta_standalone rosetta_standalone:1.0 85 | ``` 86 | 87 | ## Maintainance 88 | 89 | ### Restarting Zilliqa Rosetta 90 | 91 | ```bash 92 | docker stop 93 | docker start 94 | ``` 95 | -------------------------------------------------------------------------------- /docs/exchanges/rosetta-unsupported-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: rosetta-unsupported-api 3 | title: Unsupported Rosetta API 4 | keywords: 5 | - rosetta 6 | - middleware 7 | - exchanges 8 | - zilliqa 9 | - Rosetta 10 | - Unsupported 11 | - APIs 12 | description: Unsupported Rosetta API 13 | --- 14 | 15 | --- 16 | 17 | # Unsupported API 18 | 19 | Some of the API are not relevant or critical for interacting with Zilliqa blockchain. This list belows are the list of unsupported API 20 | 21 | | API | Reason | 22 | | -------------- | ------------------------------- | 23 | | /mempool | Zilliqa does not rely on monitoring the mempool | 24 | | /account/coins | Zilliqa is not UTXO-based chain | 25 | | Indexer APIs | Not yet implemented | 26 | -------------------------------------------------------------------------------- /docs/miners/mining-additional-info.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: mining-additional-info 3 | title: Additional Information 4 | keywords: 5 | - mining 6 | - pow 7 | - network difficulty 8 | - reward mechanism 9 | - epoch architecture 10 | - zilliqa 11 | description: Mining Additional Informantion 12 | --- 13 | 14 | --- 15 | 16 | ## Network Epoch Architecture 17 | 18 | ![Zilliqa Epoch Architecture](https://i.imgur.com/Da4t6FW.png) 19 | 20 | At the start of each DS Epoch, all mining candidates will run the Proof-of-Work (Ethash algorithm) cycle for a `60` seconds window to compete to join the Zilliqa network. 21 | 22 | - Nodes that fulfilled the `DS_POW_DIFFICULTY` parameter will qualify to join as DS nodes. 23 | - Nodes that fulfilled the `POW_DIFFICULTY` parameter will qualify to join as shard nodes. 24 | 25 | There are a total of `100` TX epochs (each 1-2 min) within each DS Epoch (2-3 hrs). Every 100th TX epoch is known as the **Vacuous epoch**. 26 | 27 | The vacuous epoch is solely for: 28 | 29 | - Distributing the coinbase rewards to all nodes. 30 | - Processing of the upgrade mechanism (as there are no forks in pBFT). 31 | - Writing of persistent state storage (updating of the nodes’ levelDB). 32 | 33 | During a vacuous epoch, the network does not process any transactions. 34 | 35 | ## Proof-of-Work Algorithm 36 | 37 | Zilliqa uses [**Ethash**](https://github.com/ethereum/wiki/wiki/Ethash) for its PoW algorithm. Hence, Zilliqa uses a DAG in its proof-of-work algorithm, which is generated at an incremental rate for each **DS epoch**. The bootstrap DAG size will be roughly `1.02GB`. 38 | 39 | Refer to the [Core Protocol Documentation](../contributors/core-pow.md) for more details on the Zilliqa PoW algorithm. 40 | 41 | ## Network Difficulty 42 | 43 | Refer to the [Core Protocol Documentation](../contributors/core-difficulty-adjustment.mdx) for more details on the difficulty adjustment algorithm. 44 | 45 | ## Network Reward Mechanism 46 | 47 | Refer to [Zilliqa Architecture - Reward mechanism](../basics/basics-zil-reward.md). 48 | -------------------------------------------------------------------------------- /docs/miners/mining-getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: mining-getting-started 3 | title: Getting Started 4 | keywords: 5 | - proxy mining 6 | - participating as miner 7 | - mining pools 8 | - zilliqa 9 | description: Mining Getting Started 10 | --- 11 | 12 | --- 13 | 14 | ## Participating as a Miner 15 | 16 | There are theoretically multiple ways to participate in the Zilliqa Mainnet as a miner. 17 | 18 | 1. Operating Zilliqa Client using the default settings for CPU mining 19 | 1. Operating Zilliqa Client using OpenCL or CUDA settings for GPU mining 20 | 1. Operating a proxy mining setup using Zilliqa Client, ZilMiner, and Zilliqa Mining Proxy 21 | 1. Participating in mining pools 22 | 23 | However, at the present level of mining difficulty in the Mainnet, the first two ways are no longer possible. 24 | 25 | :::note 26 | Mining difficulty on the Mainnet is high. Hence, it will not be feasible to mine using CPU or a single GPU (i.e, options 1 and 2 above). 27 | 28 | To enter the shard network requires >300 modern GPUs. As such, it will be advisable to participate in a mining pool if you do not have a sufficient amount of GPUs. 29 | ::: 30 | 31 | ### Proxy Mining 32 | 33 | To proceed with proxy mining: 34 | 35 | 1. An introduction to proxy mining is provided [here](mining-proxy.mdx) 36 | 1. The Zilliqa Client instructions can be found [here](mining-zilclient.md) 37 | 1. The ZilMiner instructions can be found [here](mining-zilminer.md) 38 | 39 | ### Mining Pools 40 | 41 | Zilliqa's use of Ethereum's Ethash algorithm for PoW allows existing mining pool operators to easily integrate mining on Zilliqa, giving retail miners another way to participate in the Zilliqa Mainnet. 42 | 43 | The Zilliqa page on [MiningPoolStats](https://miningpoolstats.stream/zilliqa) has a list of mining pools that support Zilliqa. Please refer to the pool's website for specific instructions on how to participate. 44 | -------------------------------------------------------------------------------- /docs/miners/mining-proxy.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: mining-proxy 3 | title: Proxy Mining 4 | keywords: 5 | - proxy mining 6 | - proxy mining setup 7 | - zilliqa 8 | description: Proxy Mining 9 | --- 10 | 11 | --- 12 | 13 | import useBaseUrl from '@docusaurus/useBaseUrl'; 14 | 15 | ## What is Proxy Mining? 16 | 17 | In contrast to Ethereum or Bitcoin, Zilliqa doesn’t employ PoW for its consensus protocol (such as is done in Nakamoto consensus). Instead, it leverages a pBFT-like variant as its consensus protocol and PoW as the identity creation to prevent Sybil attacks. 18 | 19 | As a consequence, Zilliqa requires GPUs for its PoW phase and CPUs for consensus and transaction verification. To participate in Zilliqa’s network, a node is required to submit a PoW submission that meets the difficulty level. After that, the node is assigned to a shard and contributes to transaction processing and consensus within the duration of its shard membership. 20 | 21 | In the normal case, then, a Zilliqa node requires both CPU and GPU. However, to abstract the entire process, we can split the system into two major components: a CPU cluster for transaction verification and consensus, and a GPU cluster for PoW as shown in the figure below. 22 | 23 | With the help from existing GPU miners, Zilliqa node operators can obtain thousands of powerful GPU cards to meet the hash rate required by the Zilliqa Mainnet for PoW. Similarly, we can also set up a dedicated GPU cluster together with a mining proxy. By decoupling the CPU and GPU components in this manner, we can easily manage thousands of nodes for the Mainnet. 24 | 25 | As the bridge, the mining proxy relays JSON-RPC messages from both sides, i.e., CPU cluster requests for mining responses provided by the GPU cluster. This request-response process is defined by the [Stratum mining protocol](https://en.bitcoin.it/wiki/Stratum_mining_protocol). 26 | 27 | Proxy Mining 28 | 29 | ## Proxy Mining Setup 30 | 31 | The following components are available for node operators who are interested in managing their proxy mining setup: 32 | 33 | 1. CPU cluster - [Zilliqa Client](https://github.com/Zilliqa/Zilliqa) 34 | 1. GPU cluster - [ZilMiner](https://github.com/DurianStallSingapore/ZILMiner) 35 | 1. Mining proxy - [Zilliqa Mining Proxy](https://github.com/DurianStallSingapore/Zilliqa-Mining-Proxy) 36 | 37 | In this mining setup: 38 | 39 | - A CPU node instance will run the **Zilliqa Client** and carry out the pBFT consensus process to receive rewards 40 | - The GPU rigs in the GPU cluster will run **ZilMiner** to do PoW mining and provide PoW solutions directly to the CPU node 41 | 42 | The detailed instructions on how to set up these components can be found in the ZilMiner and Zilliqa Mining Proxy repositories. 43 | -------------------------------------------------------------------------------- /docs/miners/mining-zilminer.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: mining-zilminer 3 | title: Running ZILMiner for Mining Rigs 4 | keywords: 5 | - mining steps 6 | - driver setup for zilminer 7 | - mining rigs 8 | - zilminer 9 | - zilliqa 10 | description: Running ZILMiner for Mining Rigs 11 | --- 12 | 13 | --- 14 | 15 | ## Hardware Requirements 16 | 17 | The [**ZilMiner**](https://github.com/DurianStallSingapore/ZILMiner) software is officially supported on both Ubuntu and Windows OS. 18 | 19 | Both **AMD** (with OpenCL) and **Nvidia** (with OpenCL or CUDA) GPUs are supported for the Zilliqa PoW process. 20 | 21 | The **minimum** requirements for running **ZilMiners** are: 22 | 23 | - x64 Operating system (Ubuntu or Windows) 24 | - Dual-core processor or later 25 | - 4GB DDR3 RAM or higher 26 | - Any GPUs with at least 2 GB RAM 27 | 28 | ## GPU Driver Setup for ZilMiner 29 | 30 | ### OpenCL Driver Setup (for AMD/Nvidia GPUs) 31 | 32 | If you wish to use OpenCL supported GPUs for PoW, please run the following to install the OpenCL developer package: 33 | 34 | ```shell 35 | sudo apt install ocl-icd-opencl-dev 36 | ``` 37 | 38 | You may need to reboot your PC for the installation to take effect. After reboot, check if your drivers are installed properly with the following command: 39 | 40 | ```shell 41 | clinfo 42 | ``` 43 | 44 | ### CUDA Driver Setup (for Nvidia GPUs only) 45 | 46 | If you wish to use CUDA supported GPU for PoW, please download and install CUDA package from the [**NVIDIA official webpage**](https://developer.nvidia.com/cuda-downloads). You may need to reboot your PC for the installation to take effect. 47 | 48 | ## Mining Steps 49 | 50 | 1. Install **ZilMiner** on your GPU rigs: 51 | 52 | - **For Windows OS:** [**DOWNLOAD THE LATEST RELEASE HERE**](https://github.com/DurianStallSingapore/ZILMiner/releases/) 53 | - **For Ubuntu OS:** [**DOWNLOAD THE LATEST RELEASE HERE**](https://github.com/DurianStallSingapore/ZILMiner/releases/) 54 | 55 | 2. Setup your **ZilMiner** on your GPU rigs with the following command: 56 | 57 | ```shell 58 | zilminer -P zil://wallet_address.worker_name@zil_node_ip:get_work_port 59 | ``` 60 | 61 | :::note 62 | You have to change the _wallet_address_, _worker_name_, _zil_node_ip_, and _get_work_port_ accordingly. 63 | ::: 64 | 65 | - For `wallet_address` : You can input any arbitrary Zilliqa address. This is only used by the pool master for accounting purposes. If you are mining solo, you can ignore this parameter. 66 | - For `worker_name` : You can input any arbitrary worker name you desire. 67 | - For `zil_node_ip` : Please input the IP address of the CPU node running the Zilliqa Client. 68 | - For `get_work_port` : Please input the port used in `GETWORK_SERVER_PORT`. Default is `4202`. 69 | 70 | ## Stopping the Mining Process 71 | 72 | To stop mining, you will need to kill your **ZilMiner** process on your GPU rigs. 73 | -------------------------------------------------------------------------------- /docs/staking/disclaimer.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-disclaimer 3 | title: Disclaimer 4 | keywords: 5 | - staking 6 | - disclaimer 7 | - zilliqa 8 | description: Disclaimer 9 | --- 10 | 11 | By participating in the staking of ZILs (“Staking Program”), each participating individual and organization ("Participant") accepts and agrees that, to the extent permitted by law, [Zilliqa] disclaims all liability, damages, cost, loss or expense (including, without limitation, legal fees, costs and expenses) to it in respect of its involvement in the Staking Program. Each Participant should carefully consider all factors involved in participating in the Staking Program, including, but not limited to, those listed below and, to the extent necessary, consult an appropriate professional or other expert (including an expert in cryptographic tokens or blockchain-based software systems). If any of the following considerations are unacceptable to a Participant, that Participant should not be involved in the Staking Program. These considerations are not intended to be exhaustive and should be used as guidance only. 12 | 13 | - The Staking Program is an open source protocol made available to the public, and Zilliqa expressly disclaims any liability in respect of any actions, programs, applications, developments, and operations of the Staking Program. 14 | - Hackers, individuals, other malicious groups or organisations may attempt to interfere with the Zilliqa Blockchain System, the ZILs and the Staking Program in a variety of ways such as cryptographic attacks, malware attacks, denial of service attacks, consensus-based attacks, Sybil attacks, smurfing and spoofing. 15 | - The regulatory status of cryptographic tokens, blockchain and distributed ledger technology as well as its applications are unclear or unsettled in many jurisdictions and it is difficult to predict how or whether governments or regulatory agencies may implement changes to law or apply existing regulation with respect to such technology and its applications, including the Zilliqa Blockchain System, the ZILs and the Staking Program. 16 | - The ZILs are not intended to represent any formal or legally binding investment. Cryptographic tokens that possess value in public markets, such as Ether and Bitcoin, have demonstrated extreme fluctuations in price over short periods of time on a regular basis. Participants should be prepared to expect similar fluctuations in the price of the ZILs and Participants may experience a complete and permanent loss of their initial purchase. 17 | 18 | The ZILs are not intended to be securities (or any other regulated instrument) under the laws of any jurisdiction where they are intended to be, or will be, purchased or sold and no action has been or will be taken in any jurisdiction by Zilliqa Research or any of its affiliates that would permit a public offering, or any other offering under circumstances not permitted by applicable law of the ZILs, in any country or jurisdiction where action for that purpose is required. Accordingly, the ZILs may not be offered or sold, directly or indirectly, by any holder, in or from any country or jurisdiction, except in circumstances which will result in compliance with all applicable rules and regulations of any such country or jurisdiction. 19 | -------------------------------------------------------------------------------- /docs/staking/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-overview 3 | title: Overview 4 | keywords: 5 | - staking 6 | - overview 7 | - ssn 8 | - seed node 9 | - zilliqa 10 | description: Zilliqa Seed Node Staking Overview 11 | --- 12 | 13 | Welcome to the seed node staking section. Staking in Zilliqa has been implemented in several phases. 14 | 15 | ## Phase 0 16 | 17 | Phase 0 is the initial, past phase of the seed node staking program. Phase 0 is formally described in [ZIP-3](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-3.md). 18 | 19 | The goals of phase 0 are: 20 | 21 | - Open up the seed nodes network to more operators 22 | - Introduce staking at the seed node operation level 23 | 24 | A seed node within the staking program is referred to as a **Staked Seed Node** or **SSN**. 25 | 26 | ## Phase 1 27 | 28 | Phase 1 is the past phase of SSN staking. Phase 1 is formally described in [ZIP-11](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-11.md). 29 | 30 | Phase 1 introduces: 31 | 32 | - A mechanism for stake delegation, which removes the need to deposit $ZIL with an intermediary custodian 33 | - Uncapped staking 34 | - Stake rewards in the form of gZIL token, a ZRC-2 compliant governance token 35 | - Bonding of stake amount 36 | 37 | ## Phase 1.1 38 | 39 | [Phase 1.1](phase1/overview.md) is the current phase of SSN staking. It build on top of phase 1 staking and is formally described in [ZIP-19](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-19.md). 40 | 41 | Phase 1.1 consists of all features from phase 1 and further introduces 42 | 43 | - transfer stake deposit between accounts 44 | - remove of custom ADT in `AssignStakeRewards` transition 45 | - proper removal of empty map entries 46 | - changes to staking parameters in conjuction with changes in Zilliqa `v8.0.0` 47 | -------------------------------------------------------------------------------- /docs/staking/phase1/delegator/staking-delegator-gzil.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-delegator-gzil 3 | title: gZIL Tokens 4 | keywords: 5 | - staking 6 | - ssn 7 | - smart contract 8 | - zilliqa 9 | - delegator 10 | - gzil 11 | description: $gZIL tokens 12 | --- 13 | 14 | --- 15 | 16 | [`$gZIL`](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-11.md#governance-tokens-aka-gzil), short for governance ZIL, is a ZRC-2 compliant fungible token contract. The rationale behind issuing gZIL is to capture long-term token holders and give them access to governance tokens that they can later use to make ecosystem-wide decisions. The contract code repository can be found [here](https://github.com/Zilliqa/staking-contract). 17 | 18 | :::note 19 | $gZIL will not be rewarded to SSN operators unless they themselves delegate their stake as a delegator. The commission does not have $gZIL component. 20 | ::: 21 | 22 | | Parameter | Value | 23 | | --------------- | ---------------------------------- | 24 | | Reward rate | 0.001 $gZIL per $ZIL reward earned | 25 | | Reward duration | ~1 year | 26 | | Max supply | 722,700 $gZIL | 27 | 28 | After the 1-year duration, no $gZIL will be minted. Hence, we encourage all users to withdraw their stake reward before the ~1-year duration is up. 29 | 30 | :::note 31 | It is very possible that all the 722,700 $gZIL may not get minted as the number of $gZIL that get minted depends on the frequency of stake reward withdrawals. 32 | ::: 33 | 34 | For integration with $gZIL, please refer to [ZRC-2 integration guide](../../../dev/dev-keys-zrc2-wallet-support). 35 | -------------------------------------------------------------------------------- /docs/staking/phase1/delegator/staking-delegator-overview.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-delegator-overview 3 | title: Overview 4 | keywords: 5 | - staking 6 | - ssn 7 | - smart contract 8 | - zilliqa 9 | - delegator 10 | - overview 11 | description: Overview 12 | --- 13 | 14 | --- 15 | 16 | The `Delegator` is a new role introduced since phase 1 of the Zilliqa seed node staking program. With the `Delegator`, there is a better separation of roles and privileges. 17 | 18 | Below we summarize the changes in the `SSN Operator` role between phases, as well as describe the role of the `Delegator`. 19 | 20 | **`SSN operator` in phase 0** 21 | 22 | - Manages the SSN operation 23 | - Receives stake deposits from stakers via out-of-band platform 24 | - Deposits stake into the staking smart contract 25 | - Receives stake rewards from the contract on behalf of all stakers 26 | - Distributes stake rewards via out-of-band platform 27 | - Commission or fees charged may not be transparent 28 | 29 | **`SSN operator` in phase 1 and 1.1** 30 | 31 | - Manages the SSN operation 32 | - No longer able to stake deposit 33 | - Sets commission fees on-chain 34 | - Updates commission fees on-chain (with restriction on the max commission rate change per reward cycle) 35 | - Receives commission on-chain 36 | 37 | **`Delegator` in phase 1 and 1.1** 38 | 39 | - Deposits stake directly into the staking smart contract 40 | - Able to delegate to one or more `SSN Operator` 41 | - Able to redelegate to another `SSN operator` 42 | - Withdraws rewards ($ZIL and $gZIL) on-chain 43 | - Withdraws stake deposit on-chain 44 | -------------------------------------------------------------------------------- /docs/staking/phase1/ssn-operator/staking-ssn-enrollment.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-ssn-enrollment 3 | title: Enrolment of SSN into Staking Smart Contract 4 | keywords: 5 | - staking 6 | - staked seed node 7 | - enrollment 8 | - smart contract 9 | - zilliqa 10 | description: Enrollment of SSN into staking smart contract 11 | --- 12 | 13 | --- 14 | 15 | We will need the following information in order to enrol your SSN into the smart contract. Enrollment of SSN operation can only be done by Zilliqa team. 16 | 17 | | Information | Type | Future Adjustment? | 18 | | ----------------- | ------- | ------------------ | 19 | | SSN address | ByStr20 | No | 20 | | SSN operator name | String | Contract admin | 21 | | URL (RAW) | String | Contract admin | 22 | | API URL | String | Contract admin | 23 | | Commission rate | Uint128 | SSN operator | 24 | 25 | For SSN address, please ensure this wallet address is secure eg. Ledger. We cannot changed it once enrolled. 26 | For both `URL (RAW)` and `API URL`, please provide the port number. 27 | 28 | To ensure fair competition among all existing SSN operators, the initial commission rate we allow an SSN to set will be bwtween 0- 20%. The SSN operator, however, can subsequently re-adjust the commission rate via [`UpdateComm`](staking-commission-management#update-commission-rate) transition. 29 | -------------------------------------------------------------------------------- /docs/staking/phase1/ssn-operator/staking-ssn-maintainance.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-ssn-maintenance 3 | title: SSN Maintenance (WIP) 4 | keywords: 5 | - staking 6 | - ssn 7 | - maintenance 8 | - resync node 9 | - zilliqa 10 | description: SSN Maintenance 11 | --- 12 | 13 | --- 14 | 15 | ## How to Resync Node 16 | 17 | The node might go out of sync if it fails to receive new blocks from the network. In this case, the node would ideally automatically sync without any manual intervention. 18 | 19 | However, if the node is unable to resync on its own, it will need to be launched again in a fresh mode (i.e. clean start). Please refer to the section [Preparing the node](staking-ssn-setup#preparing-the-node) at Getting started page 20 | 21 | :::caution 22 | Make sure to back up your keys. 23 | ::: 24 | -------------------------------------------------------------------------------- /docs/staking/phase1/ssn-operator/staking-ssn-upgrading.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: staking-ssn-upgrading 3 | title: SSN Upgrading (WIP) 4 | keywords: 5 | - staking 6 | - ssn 7 | - resync node 8 | - upgrading node 9 | - zilliqa 10 | description: SSN Upgrading 11 | --- 12 | 13 | --- 14 | 15 | ## Upgrading the Seed Node 16 | 17 | ### Docker 18 | 19 | Please refer to the section [Preparing the node for docker build](staking-ssn-setup#launching-the-node-using-docker). 20 | 21 | ### Native Build 22 | 23 | Please refer to the section [Preparing the node for native build](staking-ssn-setup#launching-the-node-using-docker). 24 | -------------------------------------------------------------------------------- /examples/dapp/query-data.js: -------------------------------------------------------------------------------- 1 | const { Zilliqa } = require("@zilliqa-js/zilliqa"); 2 | const { fromBech32Address } = require("@zilliqa-js/crypto"); 3 | 4 | const zilliqa = new Zilliqa("https://dev-api.zilliqa.com"); 5 | 6 | const getInit = async (address) => { 7 | // getSmartContractInit currently only supports ByStr20 addresses without 0x prefix 8 | const init = await zilliqa.blockchain.getSmartContractInit( 9 | fromBech32Address(address) 10 | .replace("0x","") 11 | ); 12 | 13 | if(init.error || !init.result) { 14 | console.log(`Error: Address ${address} is not a contract address`); 15 | throw new Error('Error: Failed to get Init'); 16 | } 17 | return init.result; 18 | } 19 | 20 | const getState = async (address) => { 21 | // getSmartContractState currently only supports ByStr20 addresses without 0x prefix 22 | const state = await zilliqa.blockchain.getSmartContractState( 23 | fromBech32Address(address) 24 | .replace("0x","") 25 | ); 26 | 27 | if(state.error | !state.result) { 28 | console.log(`Error: Address ${address} is not a contract address`); 29 | throw new Error('Error: Failed to get state'); 30 | } 31 | 32 | return state.result; 33 | } 34 | 35 | 36 | const main = async () => { 37 | 38 | const address = "zil1tyu0ezhcyfg26m83mgamjt625qzukfcht8es69"; 39 | 40 | console.log('Contract Init Parameters'); 41 | const init = await getInit(address); 42 | console.log(JSON.stringify(init, null, 2)); 43 | 44 | console.log('Contract State'); 45 | const state = await getState(address); 46 | console.log(JSON.stringify(state, null, 4)); 47 | 48 | console.log('Filtering items'); 49 | const balances = Array.from(state).filter((item) => item.vname === 'balances'); 50 | 51 | if(balances.length === 0) { 52 | throw new Error('Balance cannot be found'); 53 | } 54 | 55 | console.log(JSON.stringify(balances[0].value, null, 4)); 56 | 57 | }; 58 | 59 | main(); 60 | -------------------------------------------------------------------------------- /examples/dapp/validate-address.js: -------------------------------------------------------------------------------- 1 | const { Zilliqa } = require("@zilliqa-js/zilliqa"); 2 | 3 | const zilliqa = new Zilliqa("https://dev-api.zilliqa.com"); 4 | 5 | const isContract = async contractAddress => { 6 | const address = contractAddress.replace("0x", ""); // RPC server does not accept 0x prefix 7 | const init = await zilliqa.blockchain.getSmartContractInit(address); 8 | const result = init.result ? true : false; 9 | return result; 10 | }; 11 | 12 | const main = async () => { 13 | const addresses = []; 14 | addresses.push("573EC96638C8bB1c386394602E1460634F02aDdA"); // invalid contract address 15 | addresses.push("5865337a32F48a04F5B52507442f47FC558d9C2b"); // valid contract address 16 | 17 | /** 18 | * 0x5865337a32F48a04F5B52507442f47FC558d9C2b is a valid contract address 19 | * https://viewblock.io/zilliqa/address/zil1tpjnx73j7j9qfad4y5r5gt68l32cm8ptgus5n5?network=testnet 20 | */ 21 | 22 | for (let addr of addresses) { 23 | const result = await isContract(addr); 24 | console.log(`Is ${addr} a contract? ${result}`); 25 | } 26 | }; 27 | 28 | main(); 29 | 30 | /** 31 | * Expected return: 32 | * Is 573EC96638C8bB1c386394602E1460634F02aDdA a contract? false 33 | * Is 5865337a32F48a04F5B52507442f47FC558d9C2b a contract? true 34 | */ 35 | -------------------------------------------------------------------------------- /examples/exchange/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | -------------------------------------------------------------------------------- /examples/exchange/README.md: -------------------------------------------------------------------------------- 1 | # Basic Centralised Exchange 2 | 3 | ## Getting started 4 | 5 | ```shell 6 | npm install 7 | npm run build 8 | npm run serve 9 | ``` 10 | 11 | ## Testing 12 | 13 | ```shell 14 | ./scripts/test-withdraw.sh 15 | ``` 16 | -------------------------------------------------------------------------------- /examples/exchange/config.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "api": "https://stress-test-api.aws.z7a.xyz" 3 | } 4 | -------------------------------------------------------------------------------- /examples/exchange/hot_wallet_key.json: -------------------------------------------------------------------------------- 1 | {"address":"e3ea87d7838397fc4417f5ec449f2d2d7cdb6dd1","crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"67512791f24c2bca5c6a39fce8f1fbdd"},"ciphertext":"e52bade71c55a098df53ffcf0e3b148fd8732e19db05b32a1e54bef3dc6c47f6","kdf":"pbkdf2","kdfparams":{"salt":"b25b6c034824b6fb0ca387a9aa40cb7aecd2c3dbc301201cac46085953201114","n":8192,"c":262144,"r":8,"p":1,"dklen":32},"mac":"797fd1e0431de4f182a68e0830dd96f29b26c58f0aff60bb51d6b341885fb491"},"id":"38666666-3237-4434-a364-343666383731","version":3} -------------------------------------------------------------------------------- /examples/exchange/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zilliqa-exchange-tutorial", 3 | "version": "1.0.0", 4 | "description": "Basic Zilliqa integration for exchanges", 5 | "main": "build/app.js", 6 | "scripts": { 7 | "build": "tsc", 8 | "serve": "node build/app.js" 9 | }, 10 | "keywords": [ 11 | "zilliqa", 12 | "blockchain", 13 | "exchange", 14 | "web" 15 | ], 16 | "author": "ian@zilliqa.com", 17 | "license": "GPL-3.0", 18 | "dependencies": { 19 | "@zilliqa-js/util": "^0.5.0", 20 | "@zilliqa-js/zilliqa": "^0.5.2", 21 | "body-parser": "^1.18.3", 22 | "bootstrap": "^4.3.1", 23 | "chalk": "^2.4.2", 24 | "convict": "^4.4.1", 25 | "express": "^4.16.4", 26 | "lodash": "^4.17.21", 27 | "lusca": "^1.6.1", 28 | "morgan": "^1.9.1", 29 | "node-cron": "^2.0.3", 30 | "p-map": "^2.0.0", 31 | "pify": "^4.0.1", 32 | "pouchdb": "^7.0.0", 33 | "pouchdb-adapter-memory": "^7.0.0", 34 | "pouchdb-find": "^7.0.0" 35 | }, 36 | "devDependencies": { 37 | "@types/body-parser": "^1.17.0", 38 | "@types/convict": "^4.2.1", 39 | "@types/express": "^4.16.1", 40 | "@types/lodash": "^4.14.121", 41 | "@types/lusca": "^1.5.0", 42 | "@types/morgan": "^1.7.35", 43 | "@types/node-cron": "^2.0.1", 44 | "@types/pify": "^3.0.2", 45 | "@types/pouchdb": "^6.3.3", 46 | "ts-node": "^8.0.2", 47 | "tslint": "^5.12.1", 48 | "typescript": "^3.3.3" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /examples/exchange/scripts/test-withdraw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | amount=$1 4 | 5 | echo "Withdrawing $amount" 6 | curl -i \ 7 | -H "Content-Type: application/json" \ 8 | -d "{ \"amount\": \"$amount\" }" \ 9 | http://localhost:8080/withdraw 10 | 11 | -------------------------------------------------------------------------------- /examples/exchange/src/app.ts: -------------------------------------------------------------------------------- 1 | import parser from 'body-parser'; 2 | import express from 'express'; 3 | import lusca from 'lusca'; 4 | import morgan from 'morgan'; 5 | import PouchDB from 'pouchdb'; 6 | import pouchFind from 'pouchdb-find'; 7 | import pouchMemoryAdapter from 'pouchdb-adapter-memory'; 8 | 9 | import {config} from './config'; 10 | import * as controllers from './controllers'; 11 | import * as repositories from './repositories'; 12 | import * as routes from './routes'; 13 | import * as services from './services'; 14 | import * as crons from './cron'; 15 | 16 | const demoAddress = '8f4f6a13cbb1724800079d9f699b3a02c91246ba'; 17 | 18 | async function main() { 19 | const app = express(); 20 | const logger = morgan('combined'); 21 | const router = express.Router(); 22 | 23 | // In production, you would probably use a DI container to handle the 24 | // dependency graph. However, since this is a trivial example, we'll just go 25 | // with hand-wiring ;) 26 | 27 | // initialise data layer 28 | // use an in-memory db 29 | PouchDB.plugin(pouchFind); 30 | PouchDB.plugin(pouchMemoryAdapter); 31 | const depositDB = new PouchDB('deposits', {adapter: 'memory'}); 32 | depositDB.createIndex({index: {fields: ['address']}}); 33 | const depositRepo = new repositories.DepositRepository(depositDB); 34 | 35 | // initialise services 36 | const zilliqaSvc = new services.ZilliqaService( 37 | 'https://dev-api.zilliqa.com/', 38 | { 39 | [config.get('mnemonic')]: 8, 40 | }, 41 | ); 42 | 43 | // boot up cron jobs 44 | // these can also be destroyed 45 | const depositCron = new crons.DepositCron('* * * * *', zilliqaSvc, [demoAddress]); 46 | depositCron.start(); 47 | 48 | // instantiate controllers 49 | const depositController = new controllers.DepositController(depositRepo); 50 | const withdrawalController = await new controllers.WithdrawalController( 51 | zilliqaSvc, 52 | ); 53 | await withdrawalController.init(); 54 | 55 | // setup routes 56 | routes.deposit.get(router, depositController); 57 | routes.withdraw.create(router, withdrawalController); 58 | 59 | // setup middleware 60 | app.use(parser.json()); 61 | app.use(parser.urlencoded({extended: true})); 62 | app.use(logger); 63 | app.use(lusca.nosniff()); 64 | app.use(lusca.xframe('SAMEORIGIN')); 65 | app.use(lusca.xssProtection()); 66 | app.use(router); 67 | 68 | app.listen(8080, () => { 69 | console.log('Server listening on port 8080.'); 70 | }); 71 | } 72 | 73 | main(); 74 | -------------------------------------------------------------------------------- /examples/exchange/src/config.ts: -------------------------------------------------------------------------------- 1 | import convict from 'convict'; 2 | import * as path from 'path'; 3 | import { 4 | getPubKeyFromPrivateKey, 5 | getAddressFromPrivateKey, 6 | } from '@zilliqa-js/crypto'; 7 | 8 | export const config = convict({ 9 | api: { 10 | doc: 'The seed/lookup node URL.', 11 | default: 'https://community-api.aws.z7a.xyz', 12 | arg: 'api', 13 | format: 'url', 14 | }, 15 | env: { 16 | format: ['production', 'development', 'test'], 17 | default: 'development', 18 | env: 'NODE_ENV', 19 | }, 20 | port: { 21 | default: 8080, 22 | arg: 'port', 23 | format: 'port', 24 | }, 25 | mnemonic: { 26 | default: 27 | 'detail barely electric powder pear long such toddler abstract client oak shadow skirt repair income', 28 | }, 29 | keystore: { 30 | doc: 'Location of keystore file for hot wallet', 31 | default: '', 32 | format: String, 33 | }, 34 | }); 35 | 36 | config.loadFile(path.join(process.cwd(), 'config.dev.json')); 37 | config.set('keystore', path.join(process.cwd(), 'hot_wallet_key.json')); 38 | -------------------------------------------------------------------------------- /examples/exchange/src/controllers/deposit.ts: -------------------------------------------------------------------------------- 1 | import {DepositRepository} from '../repositories'; 2 | 3 | export class DepositController { 4 | repository: DepositRepository; 5 | 6 | constructor(repo: DepositRepository) { 7 | this.repository = repo; 8 | } 9 | 10 | /** 11 | * getDeposits 12 | * 13 | * @param {string} address 14 | * @returns {Deposit} 15 | */ 16 | async getDeposits(address: string) { 17 | return this.repository.list(address); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/exchange/src/controllers/index.ts: -------------------------------------------------------------------------------- 1 | export { DepositController } from './deposit'; 2 | export { WithdrawalController } from './withdrawal'; 3 | -------------------------------------------------------------------------------- /examples/exchange/src/controllers/withdrawal.ts: -------------------------------------------------------------------------------- 1 | import BN from 'bn.js'; 2 | import {getAddressFromPrivateKey} from '@zilliqa-js/crypto'; 3 | import {Request, Response} from 'express'; 4 | import {config} from '../config'; 5 | import {ZilliqaService} from '../services/zilliqa'; 6 | 7 | // in reality, you should of course, never do this. 8 | const HOT_WALLET_PASSPHRASE = 'stronk_passphrase'; 9 | 10 | export class WithdrawalController { 11 | address: string = ''; 12 | zsvc: ZilliqaService; 13 | 14 | // DI the service in. 15 | constructor(zsvc: ZilliqaService) { 16 | // add your hot wallet keys 17 | this.zsvc = zsvc; 18 | } 19 | 20 | async init() { 21 | const address = await this.zsvc.addKeystoreFile( 22 | config.get('keystore'), 23 | HOT_WALLET_PASSPHRASE, 24 | ); 25 | this.address = address; 26 | } 27 | 28 | withdraw(to: string, amount: BN) { 29 | return this.zsvc.withdraw(this.address, to, amount); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/exchange/src/cron/deposit.ts: -------------------------------------------------------------------------------- 1 | import {flatten, range} from 'lodash'; 2 | import pMap from 'p-map'; 3 | import * as cron from 'node-cron'; 4 | import {ZilliqaService} from '../services/zilliqa'; 5 | 6 | // this is a demo address. use your own! 7 | // in production, it's likely to be the address of your hot wallet(s) 8 | const demoAddress = '8f4f6a13cbb1724800079d9f699b3a02c91246ba'; 9 | 10 | export class DepositCron { 11 | addresses: string[]; 12 | frequency: string; 13 | svc: ZilliqaService; 14 | task!: cron.ScheduledTask; 15 | // you should persist the last fetched block to a database, and initialise 16 | // this cron job with that block number, to avoid fetch all blocks from 0 to 17 | // present. 18 | lastFetchedTxBlock: number = 0; 19 | 20 | constructor(frequency: string, svc: ZilliqaService, addresses: string[]) { 21 | this.frequency = frequency; 22 | this.svc = svc; 23 | this.addresses = addresses; 24 | this.task = cron.schedule(this.frequency, this.handler.bind(this)); 25 | } 26 | 27 | async handler() { 28 | const currentTxBlock = await this.svc.getTxBlock(); 29 | console.log('Current tx block: ', currentTxBlock); 30 | if (currentTxBlock > this.lastFetchedTxBlock) { 31 | // get transactions from lastFetchedTxBlock + 1 to current, and set 32 | // lastFetchedTxBlock to current 33 | const transactions = await pMap( 34 | range(this.lastFetchedTxBlock + 1, currentTxBlock), 35 | blk => this.svc.getDeposits(this.addresses, blk), 36 | ).then(flatten); 37 | 38 | this.lastFetchedTxBlock = currentTxBlock; 39 | 40 | // we are only logging to stdout, but in a real application, you would 41 | // be writing the result to the database. 42 | console.log(`Found ${transactions.length} deposits for ${this.addresses}`); 43 | } 44 | } 45 | 46 | start() { 47 | this.task.start(); 48 | } 49 | 50 | stop() { 51 | this.task.start(); 52 | } 53 | 54 | nuke() { 55 | this.task.destroy(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /examples/exchange/src/cron/index.ts: -------------------------------------------------------------------------------- 1 | export { DepositCron } from './deposit'; 2 | 3 | -------------------------------------------------------------------------------- /examples/exchange/src/repositories/deposit.ts: -------------------------------------------------------------------------------- 1 | import {TxParams} from '@zilliqa-js/account'; 2 | import PouchDB from 'pouchdb'; 3 | 4 | export class DepositRepository { 5 | db: PouchDB.Database; 6 | 7 | constructor(db: PouchDB.Database) { 8 | this.db = db; 9 | } 10 | 11 | /** 12 | * create 13 | * 14 | * Creates a deposit entry 15 | * 16 | * @param {TxParams} tx 17 | * @returns {Promise} 18 | */ 19 | async create(tx: TxParams) { 20 | const res = await this.db.put({ ...tx }); 21 | return res; 22 | } 23 | 24 | /** 25 | * list 26 | * 27 | * Returns a list of deposits for a given address 28 | * 29 | * @param {string} address 30 | * @returns {Promise} 31 | */ 32 | list(address: string) { 33 | return this.db.get(address); 34 | } 35 | 36 | /** 37 | * findOne 38 | * 39 | * Returns a single deposit given a txHash, or null if none is found 40 | * 41 | * @param {string} txHash 42 | * @returns {Promise} 43 | */ 44 | findOne(txHash: string) { 45 | return this.db.find({ 46 | selector: {txHash}, 47 | }); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/exchange/src/repositories/index.ts: -------------------------------------------------------------------------------- 1 | export { DepositRepository } from './deposit'; 2 | -------------------------------------------------------------------------------- /examples/exchange/src/routes/deposit.ts: -------------------------------------------------------------------------------- 1 | import {Handler, Router} from 'express'; 2 | import {DepositController} from '../controllers/deposit'; 3 | 4 | export const get = (router: Router, ctrl: DepositController) => { 5 | router.get('/deposits/:address', async (req, res, next) => { 6 | const {address} = req.params; 7 | const deposits = await ctrl.getDeposits(address); 8 | 9 | res.status(200).json({deposits}); 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /examples/exchange/src/routes/index.ts: -------------------------------------------------------------------------------- 1 | import * as deposit from './deposit'; 2 | import * as withdraw from './withdraw'; 3 | 4 | export {deposit, withdraw}; 5 | -------------------------------------------------------------------------------- /examples/exchange/src/routes/withdraw.ts: -------------------------------------------------------------------------------- 1 | import {toChecksumAddress} from '@zilliqa-js/crypto'; 2 | import BN from 'bn.js'; 3 | import {Handler, Router} from 'express'; 4 | import {WithdrawalController} from '../controllers'; 5 | 6 | const DEMO_WITHDRAWAL_ADDRESS = '444ad01a947cbae36602d920bd81b48050051dbe'; 7 | 8 | export const create = (router: Router, ctrl: WithdrawalController) => { 9 | router.post('/withdraw', async (req, res, next) => { 10 | const {amount} = req.body; 11 | // you would probably populate your request context with the user making 12 | // such an address. for convenience, we use a mock address as the 13 | // withdraw-to destination. 14 | const result = await ctrl.withdraw( 15 | toChecksumAddress(DEMO_WITHDRAWAL_ADDRESS), 16 | new BN(amount), 17 | ); 18 | 19 | console.log('Created withdrawal with transaction hash: ', result.TranID); 20 | res.status(200).json({ txHash: result.TranID }); 21 | }); 22 | }; 23 | -------------------------------------------------------------------------------- /examples/exchange/src/services/index.ts: -------------------------------------------------------------------------------- 1 | export { ZilliqaService } from './zilliqa'; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-website", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "docusaurus start", 7 | "build": "docusaurus build", 8 | "swizzle": "docusaurus swizzle", 9 | "deploy": "docusaurus deploy", 10 | "prettier": "prettier '**/*.{md,mdx}' --config .prettierrc", 11 | "format": "yarn prettier -- --write" 12 | }, 13 | "dependencies": { 14 | "@docusaurus/core": "^2.0.0", 15 | "@docusaurus/preset-classic": "^2.0.0", 16 | "clsx": "^1.1.1", 17 | "markdown-link-check": "^3.9.3", 18 | "react": "^17.0.1", 19 | "react-dom": "^17.0.1", 20 | "react-loadable" : "^5.5.0" 21 | }, 22 | "browserslist": { 23 | "production": [ 24 | ">0.2%", 25 | "not dead", 26 | "not op_mini all" 27 | ], 28 | "development": [ 29 | "last 1 chrome version", 30 | "last 1 firefox version", 31 | "last 1 safari version" 32 | ] 33 | }, 34 | "devDependencies": { 35 | "prettier": "^2.3.2" 36 | }, 37 | "resolutions": { 38 | "got": "^12.4.1", 39 | "trim": "^1.0.1" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /run_container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | docker run -d -p 8080:80 --name dev-portal dev-portal:1.0 5 | echo "container is viewable on localhost:8080" 6 | -------------------------------------------------------------------------------- /scripts/ci_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $(pwd) 4 | 5 | docker --version 6 | 7 | echo $TRAVIS_COMMIT 8 | application="dev-portal" 9 | 10 | docker build -t "$application:$TRAVIS_COMMIT" . 11 | -------------------------------------------------------------------------------- /src/pages/components/cards_img01.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const StarSvg = () => { 4 | return ( 5 | 6 | 7 | 8 | 9 | ); 10 | } 11 | 12 | export default StarSvg; -------------------------------------------------------------------------------- /src/pages/components/cards_img04.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ExchangeSvg = () => { 4 | return ( 5 | 6 | 7 | 8 | ); 9 | } 10 | 11 | export default ExchangeSvg; -------------------------------------------------------------------------------- /src/pages/styles.module.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | 3 | /** 4 | * CSS files with the .module.css suffix will be treated as CSS modules 5 | * and scoped locally. 6 | */ 7 | 8 | .heroBanner { 9 | padding: 4rem 0; 10 | text-align: center; 11 | position: relative; 12 | overflow: hidden; 13 | } 14 | 15 | @media screen and (max-width: 966px) { 16 | .heroBanner { 17 | padding: 2rem; 18 | } 19 | } 20 | 21 | .buttons { 22 | display: flex; 23 | align-items: center; 24 | justify-content: center; 25 | } 26 | 27 | .features { 28 | display: flex; 29 | align-items: center; 30 | padding: 2rem 0; 31 | width: 100%; 32 | } 33 | 34 | .featureImage { 35 | height: 200px; 36 | width: 200px; 37 | } 38 | -------------------------------------------------------------------------------- /static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/.nojekyll -------------------------------------------------------------------------------- /static/CNAME: -------------------------------------------------------------------------------- 1 | dev.zilliqa.com -------------------------------------------------------------------------------- /static/img/basics/networksharding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/basics/networksharding.png -------------------------------------------------------------------------------- /static/img/basics/technical-stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/basics/technical-stack.png -------------------------------------------------------------------------------- /static/img/basics/txnsharding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/basics/txnsharding.png -------------------------------------------------------------------------------- /static/img/chain_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/chain_bg.png -------------------------------------------------------------------------------- /static/img/contributors/core/account-management/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/account-management/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/account-management/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/account-management/image02.png -------------------------------------------------------------------------------- /static/img/contributors/core/account-management/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/account-management/image03.png -------------------------------------------------------------------------------- /static/img/contributors/core/account-management/image04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/account-management/image04.png -------------------------------------------------------------------------------- /static/img/contributors/core/account-management/image05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/account-management/image05.png -------------------------------------------------------------------------------- /static/img/contributors/core/consensus-protocol/image01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/consensus-protocol/image01.jpg -------------------------------------------------------------------------------- /static/img/contributors/core/difficulty-adjustment/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/difficulty-adjustment/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/difficulty-adjustment/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/difficulty-adjustment/image02.png -------------------------------------------------------------------------------- /static/img/contributors/core/guard-mode/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/guard-mode/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/multisignatures/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/multisignatures/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/multisignatures/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/multisignatures/image02.png -------------------------------------------------------------------------------- /static/img/contributors/core/nat-resolver/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/nat-resolver/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/nat-resolver/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/nat-resolver/image02.png -------------------------------------------------------------------------------- /static/img/contributors/core/nat-resolver/image03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/nat-resolver/image03.png -------------------------------------------------------------------------------- /static/img/contributors/core/network-layout/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/network-layout/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/rejoin-recovery/rejoin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/rejoin-recovery/rejoin.jpg -------------------------------------------------------------------------------- /static/img/contributors/core/scilla-operation/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/scilla-operation/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/scilla-operation/image02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/scilla-operation/image02.png -------------------------------------------------------------------------------- /static/img/contributors/core/transaction-lifecycle/image01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/transaction-lifecycle/image01.png -------------------------------------------------------------------------------- /static/img/contributors/core/tree-based-cluster-broadcasting/broadcast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/tree-based-cluster-broadcasting/broadcast.png -------------------------------------------------------------------------------- /static/img/contributors/core/tree-based-cluster-broadcasting/image01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/contributors/core/tree-based-cluster-broadcasting/image01.jpg -------------------------------------------------------------------------------- /static/img/dev/dapps-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/dapps-overview.png -------------------------------------------------------------------------------- /static/img/dev/getting-started/neo-savant-step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/getting-started/neo-savant-step1.png -------------------------------------------------------------------------------- /static/img/dev/getting-started/neo-savant-step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/getting-started/neo-savant-step2.png -------------------------------------------------------------------------------- /static/img/dev/getting-started/neo-savant-step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/getting-started/neo-savant-step3.png -------------------------------------------------------------------------------- /static/img/dev/getting-started/nucleus-faucet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/getting-started/nucleus-faucet.png -------------------------------------------------------------------------------- /static/img/dev/getting-started/zilpay-change-network-btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/getting-started/zilpay-change-network-btn.png -------------------------------------------------------------------------------- /static/img/dev/rentonzilliqa/account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/rentonzilliqa/account.png -------------------------------------------------------------------------------- /static/img/dev/rentonzilliqa/create-listing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/rentonzilliqa/create-listing.png -------------------------------------------------------------------------------- /static/img/dev/rentonzilliqa/listing-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/rentonzilliqa/listing-1.png -------------------------------------------------------------------------------- /static/img/dev/rentonzilliqa/listing-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/rentonzilliqa/listing-2.png -------------------------------------------------------------------------------- /static/img/dev/rentonzilliqa/listings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/rentonzilliqa/listings.png -------------------------------------------------------------------------------- /static/img/dev/rentonzilliqa/update-listing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/rentonzilliqa/update-listing.png -------------------------------------------------------------------------------- /static/img/dev/tools/ceres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/ceres.png -------------------------------------------------------------------------------- /static/img/dev/tools/customNetworkDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/customNetworkDetails.png -------------------------------------------------------------------------------- /static/img/dev/tools/deployContract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/deployContract.png -------------------------------------------------------------------------------- /static/img/dev/tools/deployDevex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/deployDevex.png -------------------------------------------------------------------------------- /static/img/dev/tools/deploySuccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/deploySuccess.png -------------------------------------------------------------------------------- /static/img/dev/tools/devex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/devex.png -------------------------------------------------------------------------------- /static/img/dev/tools/devexNetworkChange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/devexNetworkChange.png -------------------------------------------------------------------------------- /static/img/dev/tools/downloadLinux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/downloadLinux.png -------------------------------------------------------------------------------- /static/img/dev/tools/downloadMAC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/downloadMAC.png -------------------------------------------------------------------------------- /static/img/dev/tools/downloadWindows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/downloadWindows.png -------------------------------------------------------------------------------- /static/img/dev/tools/explorerStartService.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/explorerStartService.png -------------------------------------------------------------------------------- /static/img/dev/tools/faucetRequest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/faucetRequest.png -------------------------------------------------------------------------------- /static/img/dev/tools/isolatedStartService.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/isolatedStartService.png -------------------------------------------------------------------------------- /static/img/dev/tools/neosavant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/neosavant.png -------------------------------------------------------------------------------- /static/img/dev/tools/scillaStartService.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/scillaStartService.png -------------------------------------------------------------------------------- /static/img/dev/tools/viewblock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/tools/viewblock.png -------------------------------------------------------------------------------- /static/img/dev/wzil/burn_wzil_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/burn_wzil_1.png -------------------------------------------------------------------------------- /static/img/dev/wzil/burn_wzil_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/burn_wzil_2.png -------------------------------------------------------------------------------- /static/img/dev/wzil/import_contract_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/import_contract_1.png -------------------------------------------------------------------------------- /static/img/dev/wzil/mint_wzil_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/mint_wzil_1.png -------------------------------------------------------------------------------- /static/img/dev/wzil/mint_wzil_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/mint_wzil_2.png -------------------------------------------------------------------------------- /static/img/dev/wzil/pillar_wzil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/pillar_wzil.png -------------------------------------------------------------------------------- /static/img/dev/wzil/wZIL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/dev/wzil/wZIL.png -------------------------------------------------------------------------------- /static/img/exchanges/rosetta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/exchanges/rosetta.png -------------------------------------------------------------------------------- /static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/favicon.png -------------------------------------------------------------------------------- /static/img/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/hand.png -------------------------------------------------------------------------------- /static/img/hand_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/hand_light.png -------------------------------------------------------------------------------- /static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/logo.png -------------------------------------------------------------------------------- /static/img/miners/proxy-mining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zilliqa/dev-portal-old/253149c60c8d671b0b9d9cdf035609852dff3b5a/static/img/miners/proxy-mining.png -------------------------------------------------------------------------------- /stop_container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker stop dev-portal 4 | docker rm dev-portal 5 | --------------------------------------------------------------------------------