Best of Crypto

Best of Crypto

1655921880

Go-SDK & CLI tool To interact with The Harmony Blockchain

Harmony's go-sdk

This is a go layer on top of the Harmony RPC, included is a CLI tool that you can build with a simple invocation of make

See https://docs.harmony.one/home/network/wallets/harmony-cli/download-setup for detailed documentation on how to use the hmy CLI tools

Build

Working directly on this repo can be challenging because of the upstream dependencies. Follow the README in the main repo for an already ready development environment: https://github.com/harmony-one/harmony/blob/master/README.md.

...for the impatient:

$ docker run -it  harmonyone/main:stable /bin/bash
$ cd ../go-sdk
$ git pull -r origin master
$ make

Usage & Examples

hmy implements a fluent API, that is, there is a hierarchy of commands.

bash completions

once built, add hmy to your path and add to your .bashrc

. <(hmy completion)

invoke the following command to see the most command usages of hmy

$ hmy cookbook

Cookbook of Usage

Note:

1) Every subcommand recognizes a '--help' flag
2) If a passphrase is used by a subcommand, one can enter their own passphrase interactively
   with the --passphrase option. Alternatively, one can pass their own passphrase via a file
   using the --passphrase-file option. If no passphrase option is selected, the default
   passphrase of '' is used.
3) These examples use Shard 0 of Mainnet as argument for --node

Examples:

1.  Check account balance on given chain
./hmy --node=https://api.s0.t.hmny.io balances <SOME_ONE_ADDRESS>

2.  Check sent transaction
./hmy --node=https://api.s0.t.hmny.io blockchain transaction-by-hash <SOME_TX_HASH>

3.  List local account keys
./hmy keys list

4.  Sending a transaction (waits 40 seconds for transaction confirmation)
./hmy --node=https://api.s0.t.hmny.io transfer \
    --from <SOME_ONE_ADDRESS> --to <SOME_ONE_ADDRESS> \
    --from-shard 0 --to-shard 1 --amount 200 --passphrase

5.  Sending a batch of transactions as dictated from a file (the `--dry-run` options still apply)
./hmy --node=https://api.s0.t.hmny.io transfer --file <PATH_TO_JSON_FILE>
Check README for details on json file format.

6.  Check a completed transaction receipt
./hmy --node=https://api.s0.t.hmny.io blockchain transaction-receipt <SOME_TX_HASH>

7.  Import an account using the mnemonic. Prompts the user to give the mnemonic.
./hmy keys recover-from-mnemonic <ACCOUNT_NAME>

8.  Import an existing keystore file
./hmy keys import-ks <PATH_TO_KEYSTORE_JSON>

9.  Import a keystore file using a secp256k1 private key
./hmy keys import-private-key <secp256k1_PRIVATE_KEY>

10. Export a keystore file's secp256k1 private key
./hmy keys export-private-key <ACCOUNT_ADDRESS> --passphrase

11. Generate a BLS key then encrypt and save the private key to the specified location.
./hmy keys generate-bls-key --bls-file-path <PATH_FOR_BLS_KEY_FILE>

12. Create a new validator with a list of BLS keys
./hmy --node=https://api.s0.t.hmny.io staking create-validator --amount 10 --validator-addr <SOME_ONE_ADDRESS> \
    --bls-pubkeys <BLS_KEY_1>,<BLS_KEY_2>,<BLS_KEY_3> \
    --identity foo --details bar --name baz --max-change-rate 0.1 --max-rate 0.1 --max-total-delegation 10 \
    --min-self-delegation 10 --rate 0.1 --security-contact Leo  --website harmony.one --passphrase

13. Edit an existing validator
./hmy --node=https://api.s0.t.hmny.io staking edit-validator \
    --validator-addr <SOME_ONE_ADDRESS> --identity foo --details bar \
    --name baz --security-contact EK --website harmony.one \
    --min-self-delegation 0 --max-total-delegation 10 --rate 0.1\
    --add-bls-key <SOME_BLS_KEY> --remove-bls-key <OTHER_BLS_KEY> --passphrase

14. Delegate an amount to a validator
./hmy --node=https://api.s0.t.hmny.io staking delegate \
    --delegator-addr <SOME_ONE_ADDRESS> --validator-addr <VALIDATOR_ONE_ADDRESS> \
    --amount 10 --passphrase

15. Undelegate to a validator
./hmy --node=https://api.s0.t.hmny.io staking undelegate \
    --delegator-addr <SOME_ONE_ADDRESS> --validator-addr <VALIDATOR_ONE_ADDRESS> \
    --amount 10 --passphrase

16. Collect block rewards as a delegator
./hmy --node=https://api.s0.t.hmny.io staking collect-rewards \
    --delegator-addr <SOME_ONE_ADDRESS> --passphrase

17. Check elected validators
./hmy --node=https://api.s0.t.hmny.io blockchain validator elected

18. Get current staking utility metrics
./hmy --node=https://api.s0.t.hmny.io blockchain utility-metrics

19. Check in-memory record of failed staking transactions
./hmy --node=https://api.s0.t.hmny.io failures staking

20. Check which shard your BLS public key would be assigned to as a validator
./hmy --node=https://api.s0.t.hmny.io utility shard-for-bls <BLS_PUBLIC_KEY>

21. List Space In Governance
./hmy governance list-space

22. List Proposal In Space Of Governance
./hmy governance list-proposal --space=[space key, example: staking-testnet]

23. View Proposal In Governance
./hmy governance view-proposal --proposal=[proposal hash]

24. New Proposal In Space Of Governance
./hmy governance new-proposal --proposal-yaml=[file path] --key=[key name]
PS: key must first use (hmy keys import-private-key) to import
Yaml example(time is in UTC timezone):
space: staking-testnet
start: 2020-04-16 21:45:12
end: 2020-04-21 21:45:12
choices:
  - yes
  - no
title: this is title
body: |
  this is body,
  you can write mutli line

25. Vote Proposal In Space Of Governance
./hmy governance vote-proposal --proposal=[proposal hash] --choice=[your choice text, eg: yes] --key=[key name]
PS: key must first use (hmy keys import-private-key) to import

26. Enter Console
./hmy command --net=testnet --shard=0

Sending batched transactions

One may find it useful to send a batch of transaction with 1 instance of the binary. To do this, one can specify a JSON file with the transaction subcommand to dictate a batch of transaction to send off in sequential order.

Example:

hmy --node="https://api.s1.t.hmny.io/" transfer --file ./batchTransactions.json

Note that the --wait-for-confirm and --dry-run options still apply when sending batched transactions

Transfer JSON file format

The JSON file will be a JSON array where each element has the following attributes:

KeyValue-typeValue-description
fromstring[Required] Sender's one address, must have key in keystore.
tostring[Required] The receivers one address.
amountstring[Required] The amount to send in $ONE.
from-shardstring[Required] The source shard.
to-shardstring[Required] The destination shard.
passphrase-filestring[Optional] The file path to file containing the passphrase in plain text. If none is provided, check for passphrase string.
passphrase-stringstring[Optional] The passphrase as a string in plain text. If none is provided, passphrase is ''.
noncestring[Optional] The nonce of a specific transaction, default uses nonce from blockchain.
gas-pricestring[Optional] The gas price to pay in NANO (1e-9 of $ONE), default is 1.
gas-limitstring[Optional] The gas limit, default is 21000.
stop-on-errorboolean[Optional] If true, stop sending transactions if an error occurred, default is false.
true-nonceboolean[Optional] If true, send transaction using true on-chain nonce. Cannot be used with nonce. If none is provided, use tx pool nonce.

Example of JSON file:

[
  {
    "from": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
    "to": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
    "from-shard" : "0",
    "to-shard": "0",
    "amount": "1",
    "passphrase-string": "",
    "nonce": "35",
    "stop-on-error": true
  },
  {
    "from": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
    "to": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
    "from-shard" : "0",
    "to-shard": "0",
    "amount": "1",
    "passphrase-file": "./pw.txt",
    "gas-price": "1",
    "gas-limit": "21000",
    "true-nonce": true
  }
]

Batched transaction response format

The return will be a JSON array where each element is a transaction log. The transaction log has the following attributes:

KeyValue-typeValue-description
transaction-receiptstringThe transaction hash/receipt if the CLI signed and sent a transaction, otherwise this key will not exist
transactionJSON ObjectThe transaction parameters if --dry-run is toggled, otherwise this key will not exist.
blockchain-receiptJSON ObjectThe transaction receipt from the blockchain if wait-for-confirm is > 0, otherwise this key will not exist.
raw-transactionstringThe raw bytes in hex of a sighed transaction if --dry-run is toggled, otherwise this key will not exist
errorsJSON ArrayA JSON array of strings describing any error that occurred during the execution of a transaction. If no errors, this key will not exist.
time-signed-utcstringThe time in UTC as a string of roughly when the transaction was signed. If no signed transaction, this key will not exist.

Example of returned JSON Array:

[
  {
    "errors": [
      "[2020-01-22 22:01:10.819406] strconv.ParseUint: parsing \"-1\": invalid syntax"
    ]
  },
  {
    "transaction-receipt": "0xf1706080ea9ac210ee2c12c69fb310be5a5da99582b7c783e2f741a3536abbfd",
    "blockchain-receipt": {
      "blockHash": "0xe6de09f4e0ca351257d301a50b4e2ca82646473dc1c4302b570bfab17d421850",
      "blockNumber": "0xb71",
      "contractAddress": null,
      "cumulativeGasUsed": "0x5208",
      "from": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
      "gasUsed": "0x5208",
      "logs": [],
      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "shardID": 0,
      "status": "0x1",
      "to": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
      "transactionHash": "0xf1706080ea9ac210ee2c12c69fb310be5a5da99582b7c783e2f741a3536abbfd",
      "transactionIndex": "0x0"
    },
    "time-signed-utc": "2020-01-22 22:01:11.468407"
  }
]

Offline sign transfer

  1. Get Nonce From a Account. (Need to be online, but no passphrase required)
./hmy get-nonce --node=https://api.s0.t.hmny.io --from=[ONE address]

2.   Sign transfer and write to file. (Passphrase required, But no need to be online)

./hmy transfer --offline-sign --nonce=[nonce value from previous] --from=[ONE address] --to=[ONE address] --amount=1000 --from-shard=0 --to-shard=0 > signed.json

3.   send signed.json to Harmony blockchain! (Need to be online, but no passphrase required)

./hmy offline-sign-transfer --node=https://api.s0.b.hmny.io --file ./signed.json

Debugging

The go-sdk code respects HMY_RPC_DEBUG HMY_TX_DEBUG as debugging based environment variables.

HMY_RPC_DEBUG=true HMY_TX_DEBUG=true ./hmy blockchain protocol-version

Contract Deploy

You can deploy the contract use the command;

./hmy command --node="https://api.s0.b.hmny.io" --net=testnet

Then you can test this code to deploy a smart contract

var abi = [{"constant":false,"inputs":[],"name":"changeIt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"number","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
var code = '0x60806040526212345660005534801561001757600080fd5b5060c8806100266000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806327b5c17514604e5780638381f58a146062575b600080fd5b348015605957600080fd5b506060608a565b005b348015606d57600080fd5b5060746096565b6040518082815260200191505060405180910390f35b62654321600081905550565b600054815600a165627a7a72305820294db9eed647c48762212fd43bf9ed7733c9d9f43b1ce5583bb4c2bae97fae770029'
var account = 'one1xjanr7lgulc0fqyc8dmfp6jfwuje2d94xfnzyd' // change this to your account address, support eth or one address
var myContract=eth.contract(abi)
contract = myContract.new({from:account,data:code})

Wait for a few seconds and it's ready to use

Download Details:
Author: harmony-one
Source Code: https://github.com/harmony-one/go-sdk
License:

#harmony #blockchain #smartcontract #go #javascript

What is GEEK

Buddha Community

Go-SDK & CLI tool To interact with The Harmony Blockchain

Download Android SDK Manager and SDK Tools

In this tutorial, we’ll read about the Android SDK Manager. We will see what is SDK manager in Android and why and how it is important for Android. So, SDK stands for Software Development Kit, which is a collection of software tools required. SDK basically helps Android to download tools and recent versions of Android. Every time a new Android version is released, along with it is released an SDK corresponding to it. This SDK must be installed by the developers for the devices.
What is SDK Manager?
A Software development kit is a set of tools required for the development of applications for Android. It also ensures that the progress of App development goes as flat as pancakes. We need SDK irrespective of the language we are using. Android SDK comes wrapped up with the Android Studio these days. An Android SDK separates the tools, platforms and other components into packages. These can be downloaded from the SDK Manager.

#android tutorials #android sdk manager #android sdk manager download #android sdk tools #android studio sdk manager #sdk download #sdk manager #sdk tools

Best of Crypto

Best of Crypto

1655921880

Go-SDK & CLI tool To interact with The Harmony Blockchain

Harmony's go-sdk

This is a go layer on top of the Harmony RPC, included is a CLI tool that you can build with a simple invocation of make

See https://docs.harmony.one/home/network/wallets/harmony-cli/download-setup for detailed documentation on how to use the hmy CLI tools

Build

Working directly on this repo can be challenging because of the upstream dependencies. Follow the README in the main repo for an already ready development environment: https://github.com/harmony-one/harmony/blob/master/README.md.

...for the impatient:

$ docker run -it  harmonyone/main:stable /bin/bash
$ cd ../go-sdk
$ git pull -r origin master
$ make

Usage & Examples

hmy implements a fluent API, that is, there is a hierarchy of commands.

bash completions

once built, add hmy to your path and add to your .bashrc

. <(hmy completion)

invoke the following command to see the most command usages of hmy

$ hmy cookbook

Cookbook of Usage

Note:

1) Every subcommand recognizes a '--help' flag
2) If a passphrase is used by a subcommand, one can enter their own passphrase interactively
   with the --passphrase option. Alternatively, one can pass their own passphrase via a file
   using the --passphrase-file option. If no passphrase option is selected, the default
   passphrase of '' is used.
3) These examples use Shard 0 of Mainnet as argument for --node

Examples:

1.  Check account balance on given chain
./hmy --node=https://api.s0.t.hmny.io balances <SOME_ONE_ADDRESS>

2.  Check sent transaction
./hmy --node=https://api.s0.t.hmny.io blockchain transaction-by-hash <SOME_TX_HASH>

3.  List local account keys
./hmy keys list

4.  Sending a transaction (waits 40 seconds for transaction confirmation)
./hmy --node=https://api.s0.t.hmny.io transfer \
    --from <SOME_ONE_ADDRESS> --to <SOME_ONE_ADDRESS> \
    --from-shard 0 --to-shard 1 --amount 200 --passphrase

5.  Sending a batch of transactions as dictated from a file (the `--dry-run` options still apply)
./hmy --node=https://api.s0.t.hmny.io transfer --file <PATH_TO_JSON_FILE>
Check README for details on json file format.

6.  Check a completed transaction receipt
./hmy --node=https://api.s0.t.hmny.io blockchain transaction-receipt <SOME_TX_HASH>

7.  Import an account using the mnemonic. Prompts the user to give the mnemonic.
./hmy keys recover-from-mnemonic <ACCOUNT_NAME>

8.  Import an existing keystore file
./hmy keys import-ks <PATH_TO_KEYSTORE_JSON>

9.  Import a keystore file using a secp256k1 private key
./hmy keys import-private-key <secp256k1_PRIVATE_KEY>

10. Export a keystore file's secp256k1 private key
./hmy keys export-private-key <ACCOUNT_ADDRESS> --passphrase

11. Generate a BLS key then encrypt and save the private key to the specified location.
./hmy keys generate-bls-key --bls-file-path <PATH_FOR_BLS_KEY_FILE>

12. Create a new validator with a list of BLS keys
./hmy --node=https://api.s0.t.hmny.io staking create-validator --amount 10 --validator-addr <SOME_ONE_ADDRESS> \
    --bls-pubkeys <BLS_KEY_1>,<BLS_KEY_2>,<BLS_KEY_3> \
    --identity foo --details bar --name baz --max-change-rate 0.1 --max-rate 0.1 --max-total-delegation 10 \
    --min-self-delegation 10 --rate 0.1 --security-contact Leo  --website harmony.one --passphrase

13. Edit an existing validator
./hmy --node=https://api.s0.t.hmny.io staking edit-validator \
    --validator-addr <SOME_ONE_ADDRESS> --identity foo --details bar \
    --name baz --security-contact EK --website harmony.one \
    --min-self-delegation 0 --max-total-delegation 10 --rate 0.1\
    --add-bls-key <SOME_BLS_KEY> --remove-bls-key <OTHER_BLS_KEY> --passphrase

14. Delegate an amount to a validator
./hmy --node=https://api.s0.t.hmny.io staking delegate \
    --delegator-addr <SOME_ONE_ADDRESS> --validator-addr <VALIDATOR_ONE_ADDRESS> \
    --amount 10 --passphrase

15. Undelegate to a validator
./hmy --node=https://api.s0.t.hmny.io staking undelegate \
    --delegator-addr <SOME_ONE_ADDRESS> --validator-addr <VALIDATOR_ONE_ADDRESS> \
    --amount 10 --passphrase

16. Collect block rewards as a delegator
./hmy --node=https://api.s0.t.hmny.io staking collect-rewards \
    --delegator-addr <SOME_ONE_ADDRESS> --passphrase

17. Check elected validators
./hmy --node=https://api.s0.t.hmny.io blockchain validator elected

18. Get current staking utility metrics
./hmy --node=https://api.s0.t.hmny.io blockchain utility-metrics

19. Check in-memory record of failed staking transactions
./hmy --node=https://api.s0.t.hmny.io failures staking

20. Check which shard your BLS public key would be assigned to as a validator
./hmy --node=https://api.s0.t.hmny.io utility shard-for-bls <BLS_PUBLIC_KEY>

21. List Space In Governance
./hmy governance list-space

22. List Proposal In Space Of Governance
./hmy governance list-proposal --space=[space key, example: staking-testnet]

23. View Proposal In Governance
./hmy governance view-proposal --proposal=[proposal hash]

24. New Proposal In Space Of Governance
./hmy governance new-proposal --proposal-yaml=[file path] --key=[key name]
PS: key must first use (hmy keys import-private-key) to import
Yaml example(time is in UTC timezone):
space: staking-testnet
start: 2020-04-16 21:45:12
end: 2020-04-21 21:45:12
choices:
  - yes
  - no
title: this is title
body: |
  this is body,
  you can write mutli line

25. Vote Proposal In Space Of Governance
./hmy governance vote-proposal --proposal=[proposal hash] --choice=[your choice text, eg: yes] --key=[key name]
PS: key must first use (hmy keys import-private-key) to import

26. Enter Console
./hmy command --net=testnet --shard=0

Sending batched transactions

One may find it useful to send a batch of transaction with 1 instance of the binary. To do this, one can specify a JSON file with the transaction subcommand to dictate a batch of transaction to send off in sequential order.

Example:

hmy --node="https://api.s1.t.hmny.io/" transfer --file ./batchTransactions.json

Note that the --wait-for-confirm and --dry-run options still apply when sending batched transactions

Transfer JSON file format

The JSON file will be a JSON array where each element has the following attributes:

KeyValue-typeValue-description
fromstring[Required] Sender's one address, must have key in keystore.
tostring[Required] The receivers one address.
amountstring[Required] The amount to send in $ONE.
from-shardstring[Required] The source shard.
to-shardstring[Required] The destination shard.
passphrase-filestring[Optional] The file path to file containing the passphrase in plain text. If none is provided, check for passphrase string.
passphrase-stringstring[Optional] The passphrase as a string in plain text. If none is provided, passphrase is ''.
noncestring[Optional] The nonce of a specific transaction, default uses nonce from blockchain.
gas-pricestring[Optional] The gas price to pay in NANO (1e-9 of $ONE), default is 1.
gas-limitstring[Optional] The gas limit, default is 21000.
stop-on-errorboolean[Optional] If true, stop sending transactions if an error occurred, default is false.
true-nonceboolean[Optional] If true, send transaction using true on-chain nonce. Cannot be used with nonce. If none is provided, use tx pool nonce.

Example of JSON file:

[
  {
    "from": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
    "to": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
    "from-shard" : "0",
    "to-shard": "0",
    "amount": "1",
    "passphrase-string": "",
    "nonce": "35",
    "stop-on-error": true
  },
  {
    "from": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
    "to": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
    "from-shard" : "0",
    "to-shard": "0",
    "amount": "1",
    "passphrase-file": "./pw.txt",
    "gas-price": "1",
    "gas-limit": "21000",
    "true-nonce": true
  }
]

Batched transaction response format

The return will be a JSON array where each element is a transaction log. The transaction log has the following attributes:

KeyValue-typeValue-description
transaction-receiptstringThe transaction hash/receipt if the CLI signed and sent a transaction, otherwise this key will not exist
transactionJSON ObjectThe transaction parameters if --dry-run is toggled, otherwise this key will not exist.
blockchain-receiptJSON ObjectThe transaction receipt from the blockchain if wait-for-confirm is > 0, otherwise this key will not exist.
raw-transactionstringThe raw bytes in hex of a sighed transaction if --dry-run is toggled, otherwise this key will not exist
errorsJSON ArrayA JSON array of strings describing any error that occurred during the execution of a transaction. If no errors, this key will not exist.
time-signed-utcstringThe time in UTC as a string of roughly when the transaction was signed. If no signed transaction, this key will not exist.

Example of returned JSON Array:

[
  {
    "errors": [
      "[2020-01-22 22:01:10.819406] strconv.ParseUint: parsing \"-1\": invalid syntax"
    ]
  },
  {
    "transaction-receipt": "0xf1706080ea9ac210ee2c12c69fb310be5a5da99582b7c783e2f741a3536abbfd",
    "blockchain-receipt": {
      "blockHash": "0xe6de09f4e0ca351257d301a50b4e2ca82646473dc1c4302b570bfab17d421850",
      "blockNumber": "0xb71",
      "contractAddress": null,
      "cumulativeGasUsed": "0x5208",
      "from": "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7",
      "gasUsed": "0x5208",
      "logs": [],
      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "shardID": 0,
      "status": "0x1",
      "to": "one1zksj3evekayy90xt4psrz8h6j2v3hla4qwz4ur",
      "transactionHash": "0xf1706080ea9ac210ee2c12c69fb310be5a5da99582b7c783e2f741a3536abbfd",
      "transactionIndex": "0x0"
    },
    "time-signed-utc": "2020-01-22 22:01:11.468407"
  }
]

Offline sign transfer

  1. Get Nonce From a Account. (Need to be online, but no passphrase required)
./hmy get-nonce --node=https://api.s0.t.hmny.io --from=[ONE address]

2.   Sign transfer and write to file. (Passphrase required, But no need to be online)

./hmy transfer --offline-sign --nonce=[nonce value from previous] --from=[ONE address] --to=[ONE address] --amount=1000 --from-shard=0 --to-shard=0 > signed.json

3.   send signed.json to Harmony blockchain! (Need to be online, but no passphrase required)

./hmy offline-sign-transfer --node=https://api.s0.b.hmny.io --file ./signed.json

Debugging

The go-sdk code respects HMY_RPC_DEBUG HMY_TX_DEBUG as debugging based environment variables.

HMY_RPC_DEBUG=true HMY_TX_DEBUG=true ./hmy blockchain protocol-version

Contract Deploy

You can deploy the contract use the command;

./hmy command --node="https://api.s0.b.hmny.io" --net=testnet

Then you can test this code to deploy a smart contract

var abi = [{"constant":false,"inputs":[],"name":"changeIt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"number","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
var code = '0x60806040526212345660005534801561001757600080fd5b5060c8806100266000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806327b5c17514604e5780638381f58a146062575b600080fd5b348015605957600080fd5b506060608a565b005b348015606d57600080fd5b5060746096565b6040518082815260200191505060405180910390f35b62654321600081905550565b600054815600a165627a7a72305820294db9eed647c48762212fd43bf9ed7733c9d9f43b1ce5583bb4c2bae97fae770029'
var account = 'one1xjanr7lgulc0fqyc8dmfp6jfwuje2d94xfnzyd' // change this to your account address, support eth or one address
var myContract=eth.contract(abi)
contract = myContract.new({from:account,data:code})

Wait for a few seconds and it's ready to use

Download Details:
Author: harmony-one
Source Code: https://github.com/harmony-one/go-sdk
License:

#harmony #blockchain #smartcontract #go #javascript

Devin Pinto

1606217442

Blockchain Certification | Blockchain Training Course | Blockchain Council

In all the market sectors, Blockchain technology has contributed to the redesign. The improvements that were once impossible have been pushed forward. Blockchain is one of the leading innovations with the ability to influence the various sectors of the industry. It also has the ability to be one of the career-influencing innovations at the same time. We have seen an increasing inclination towards the certification of the Blockchain in recent years, and there are obvious reasons behind it. Blockchain has everything to offer, from good packages to its universal application and futuristic development. Let’s address the reasons why one should go for Blockchain certification.

5 advantages of certification by Blockchain:

1. Lucrative packages- Everyone who completes their education or upskills themselves wants to end up with a good bundle, not only is one assured of a good learning experience with Blockchain, but the packages are drool-worthy at the same time. A Blockchain developer’s average salary varies between $150,000 and $175,000 per annum. Comparatively, a software developer gets a $137,000 per year salary. For a Blockchain developer, the San Francisco Bay area provides the highest bundle, amounting to $162,288 per annum. There’s no point arguing that learning about Blockchain is a smart decision with such lucrative packages.

2. Growing industry- When you select any qualification course, it becomes important that you choose a growing segment or industry that promises potential in the future. You should anticipate all of these with Blockchain. The size of the blockchain market is expected to rise from USD 3.0 billion in 2020 to USD 39.7 billion by 2025. This will see an incredible 67.3 percent CAGR between 2020-2025. To help business processes, several businesses are outsourcing Blockchain technologies. This clearly demonstrates that there will be higher demand in the future for Blockchain developers and certified Blockchain professionals.

3. Universal application- One of the major reasons for the success of Blockchain is that it has a global application. It is not sector-specific. Blockchain usage cases are discovered by almost all market segments. In addition, other innovations such as AI, big data, data science and much more are also supported by Blockchain. It becomes easier to get into a suitable industry once you know about Blockchain.

**4. Work protection-**Surely you would like to invest in an ability that ensures job security. You had the same chance for Blockchain. Since this is the technology of the future, understanding that Blockchain can keep up with futuristic developments will help in a successful and safe job.

**5.**After a certain point of your professional life, you are expected to learn about new abilities that can help enhance your skills. Upskilling is paramount. Upskilling oneself has become the need for the hour, and choosing a path that holds a lot of potential for the future is the best way to do this. For all computer geeks and others who want to gain awareness of emerging technology, Blockchain is a good option.

Concluding thoughts- opting for Blockchain certification is a successful career move with all these advantages. You will be able to find yourself in a safe and secured work profile once you have all the knowledge and information. Link for Blockchain certification programme with the Blockchain Council.

#blockchain certificate #blockchain training #blockchain certification #blockchain developers #blockchain #blockchain council

5 Blockchain Applications That Have Transformed the World of Technology

The blockchain is the decentralized database of the blocks of information, which gets recorded in the chain format and linked in a secured crypto graphical manner. This technology ensures proper safety of the data due to its secure nature, and it totally changes how people carry out transactions. It also brings about a faster and secure process of validating information needed to establish reliability.

Though blockchain technology came into the market to carry out only digital transactions, it is now used in various industries like supply chain, finance, health care, and many more.

The blockchain technology has made its position in mobile app development as well. Blockchain applications are transparent and accountable. From getting easy access to medical records and buying insurance, you can see blockchain applications everywhere.

Here are some of the areas where you can see the use of blockchain applications and how they have changed various industries.

1. Ripple

Ripple is useful for increasing banking transactions. The implementation of blockchain technology in the financial sector is much more profound than any other sector. Ripple proves this. It is one of the greatest tools to record and complete financial transactions.

It develops a large network despite strict physical boundaries. As there is no such third-party involvement present, the cost of these transactions is lower than usual. At the same time, the network also remains transparent and quite secured.

It is normally seen that financial transactions that happen globally are

error-prone and take a lot of time. In addition to this, when the transaction

fees and exchange rates get added up, the total cost usually gets high.

However, Ripple offers real-time international transactions without spending too much money. It has the network of about 200+ institutions making the process affordable, secure, and fast for all sorts of international transactions.

2. Etherisc

This blockchain application helps in automating flight insurance. Insurance is another area where blockchain is gaining popularity. Through this application, insurers can make smart contracts rather than getting involved in the traditional contracts that are usually complex. Etherisc is the blockchain application that helps customers buy flight insurance. If the flight gets canceled or delayed, they do not have to wait for months to get the payment back. This application ensures an on-time payout.

#blockchain #blockchain-technology #blockchain-development #blockchain-use-cases #blockchain-a #blockchain-technologies #technology #decentralization

Fannie  Zemlak

Fannie Zemlak

1599854400

What's new in the go 1.15

Go announced Go 1.15 version on 11 Aug 2020. Highlighted updates and features include Substantial improvements to the Go linker, Improved allocation for small objects at high core counts, X.509 CommonName deprecation, GOPROXY supports skipping proxies that return errors, New embedded tzdata package, Several Core Library improvements and more.

As Go promise for maintaining backward compatibility. After upgrading to the latest Go 1.15 version, almost all existing Golang applications or programs continue to compile and run as older Golang version.

#go #golang #go 1.15 #go features #go improvement #go package #go new features