Skip to content

Instantly share code, notes, and snippets.

@evias
Created March 30, 2021 23:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evias/a411c0b7077ca183a3c108ff01cc8e66 to your computer and use it in GitHub Desktop.
Save evias/a411c0b7077ca183a3c108ff01cc8e66 to your computer and use it in GitHub Desktop.

How to use DHealth accounts with symbol-cli

This document describes how to interact with the DHealth Public Network using symbol-cli.

Install symbol-cli

$ npm i -g symbol-cli

Import your account(s)

The DHealth network parameters are the following:

  • generation-hash: ED5761EA890A096C50D3F50B7C2F0CCB4B84AFC9EA870F381E84DDE36D04EF16
  • namespace-id: dhealth.dhp
  • divisibility: 6
  • epoch-adjustment: 1616978397
$ symbol-cli profile import \
    --profile [profile-name] \
    --url http://dual-02.dhealth.cloud:3000 \
    --network MAIN_NET \
    --generation-hash ED5761EA890A096C50D3F50B7C2F0CCB4B84AFC9EA870F381E84DDE36D04EF16 \
    --namespace-id "dhealth.dhp" \
    --divisibility 6 \
    --epoch-adjustment 1616978397

Request account information from the node

$ symbol-cli account info --profile [profile-name]

Monitor all account information (in realtime)

$ symbol-cli monitor all --profile [profile-name]

Create a transfer transaction

  • Bob Sending 0.000001 DHP to Alice (i.e. NDON5KFUJ6G7NB2PNMA4TFSLTP4RWE4CRIDOF2Q)
$ symbol-cli transaction transfer --profile [profile-name] \
    --mosaics @dhealth.dhp::1 \
    --recipient-address NDON5KFUJ6G7NB2PNMA4TFSLTP4RWE4CRIDOF2Q
    --message "Hello, Alice!"

⚠️ Note that the symbol-cli package requires the input of absolute amounts. In this case, we specify an amount of 1 as this equals to the smallest unit available with DHP, namely: 0.000001 dhealth.dhp (i.e. with 6 decimal places).

  • Bob Sending 1 DHP to Alice (i.e. NDON5KFUJ6G7NB2PNMA4TFSLTP4RWE4CRIDOF2Q)
$ symbol-cli transaction transfer --profile [profile-name] \
    --mosaics @dhealth.dhp::1000000 \
    --recipient-address NDON5KFUJ6G7NB2PNMA4TFSLTP4RWE4CRIDOF2Q
    --message "Hello, Alice!"

⚠️ Note that the symbol-cli package requires the input of absolute amounts. In this case, we specify an amount of 1000000 as this equals to 1 dhealth.dhp.

  • Bob Sending 50 DHP to Alice (i.e. NDON5KFUJ6G7NB2PNMA4TFSLTP4RWE4CRIDOF2Q)
$ symbol-cli transaction transfer --profile [profile-name] \
    --mosaics @dhealth.dhp::50000000 \
    --recipient-address NDON5KFUJ6G7NB2PNMA4TFSLTP4RWE4CRIDOF2Q
    --message "Hello, Alice!"

⚠️ Note that the symbol-cli package requires the input of absolute amounts. In this case, we specify an amount of 50000000 as this equals to 50 dhealth.dhp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment