Overview

The Harmony Testnet enables the developer and research community to interface with our blockchain. Building a highly scalable and decentralized protocol is a complex task and our team has been busy building and testing out various components of our blockchain. The Testnet will be continuously updated by the Harmony team with new features and components.

Our Testnet now has the complete features for scalability. In the last few weeks, our engineers as well as external contributors worked relentlessly to deliver:

  • Faster consensus using BLS multi-signatures & gossiping broadcast

  • Node staking on beacon chain using smart contracts

  • Secure resharding with Cuckoo Rule

  • Robust peer discovery via libp2p bootnodes & Kademlia routing

Join our development effort with Gitcoin bounties! We’re looking for contributions on improving our test pipeline and increasing test coverage. Our full team is also active on Discord and talk.harmony.one forum for your questions.

How can you interact with the Testnet

  • Wallet

  • Block Explorer

  • Block Benchmark (Networking Optimization)

Wallet

We have created a custom command line wallet for users of the Testnet. With the wallet, you can do the following:

  • Create/generate account id
  • Save your private key in local storage
  • Check account balance
  • Check transaction history (using the block explorer)
  • Send tokens to another account id

Installation

Download the wallet using the following script.

    curl -O https://raw.githubusercontent.com/harmony-one/harmony/master/scripts/wallet.sh
    chmod +x wallet.sh
    ./wallet.sh -d

Using the Wallet

Once you downloaded the wallet, you can review these detailed instructions for implementing the features:

  • Then you can execute it using the wallet.sh wrapper script.
./wallet.sh

Usage:
    wallet <action> <params>
Actions:
    1. new           - Generates a new account and store the private key locally
    2. list          - Lists all accounts in local keystore
    3. removeAll     - Removes all accounts in local keystore
    4. import        - Imports a new account by private key
        --privateKey     - the private key to import
    5. balances      - Shows the balances of all addresses or specific address
        --address        - The address to check balance for
    6. getFreeToken  - Gets free token on each shard
        --address        - The free token receiver account's address
    7. transfer
        --from           - The sender account's address or index in the local keystore
        --to             - The receiver account's address
        --amount         - The amount of token to transfer
        --shardID        - The shard Id for the transfer
  • The action New allows you to create a new wallet account with the private key stored locally. Let's call this account A.
harmony $./wallet.sh new
New account created with address:
    {0xb7098584e18fe78d2eDBD485DcBa7164Ac435764}
Please keep a copy of the private key:
    {48561e4682e3f6afc123933a9e331416b2696a7e7d88017d8cf1b521193b668a}
  • The action List lists all the locally stored accounts.
harmony $./wallet.sh list
Account 0:
  {0xb7098584e18fe78d2eDBD485DcBa7164Ac435764}
    PrivateKey: {48561e4682e3f6afc123933a9e331416b2696a7e7d88017d8cf1b521193b668a}
  • The action Balances shows the balances of all local accounts in each shard (Note a single account can have separate balances in each shard). You can check a specific address’s balance by specifying the “--address” parameter.
harmony $./wallet.sh balances
Account 0: 0xb7098584e18fe78d2eDBD485DcBa7164Ac435764:
    Balance in Shard 3:  0.000000
    Balance in Shard 2:  0.000000
    Balance in Shard 1:  0.000000
    Balance in Shard 0:  0.000000
  • The action getFreeToken will talk to the faucet smart contract and request 10 Harmony Testnet tokens in each shard for the specified address by “--address” parameter.
harmony $./wallet.sh getFreeToken --address=0xb7098584e18fe78d2eDBD485DcBa7164Ac435764
Transaction Id requesting free token in shard 0: 0x74efa50971ce65305ba8562729bf8f2183b7672c21ac36ee7275956c02745d52
Transaction Id requesting free token in shard 0: 0xc15aa42889affebc8acff7a8d0c01ba6092c67e7924acd588404542162b4e066
Transaction Id requesting free token in shard 0: 0x426bc9255b515d47eacedd02bfc0314ee6acb469c9cb7a3b3bc108beb435e561
Transaction Id requesting free token in shard 0: 0x1cbad58a165bdbc564325690429cb16bf512e79275a2ec77ce6f3dd7574ed6f8

NOTE: your account address is currently not searchable on explorer after getFreeToken call. It will be searchable after sending a transfer transaction. We are working on fixing it. Please see issue here.

  • After the above command, checking the balance will show the new balance in each shard.
harmony $./wallet.sh balances
Account 0: 0xb7098584e18fe78d2eDBD485DcBa7164Ac435764:
    Balance in Shard 0:  10.000000
    Balance in Shard 1:  10.000000
    Balance in Shard 2:  10.000000
    Balance in Shard 3:  10.000000
  • Now we create a new account, lets call it account B, to transfer some tokens from the previous wallet (account A).
harmony $./wallet.sh new
New account created with address:
    {0x2912Fd62468fB6F2610bC678424a3d066d2999DC}
Please keep a copy of the private key:
    {b3ec9eed86b198476ede79e456c0f34c5b830ab1107bf0776785eb02ba22b4d1}
  • We see the balance in the new account B that we created is 0 for all shards.
harmony $./wallet.sh balances
Account 0: 0xb7098584e18fe78d2eDBD485DcBa7164Ac435764:
    Balance in Shard 1:  10.000000
    Balance in Shard 0:  10.000000
    Balance in Shard 2:  10.000000
    Balance in Shard 3:  10.000000
Account 1: 0x2912Fd62468fB6F2610bC678424a3d066d2999DC:
    Balance in Shard 0:  0.000000
    Balance in Shard 1:  0.000000
    Balance in Shard 2:  0.000000
    Balance in Shard 3:  0.000000
  • We can transfer tokens from account A to account B by specifying the sender’s address, receiver’s address, the amount to transfer, and the shard ID.
harmony $./wallet.sh transfer --from=0xb7098584e18fe78d2eDBD485DcBa7164Ac435764 --to=0x2912Fd62468fB6F2610bC678424a3d066d2999DC --amount=8 --shardID=0
Transaction Id for shard 0: 0xBCE3163b8272f38E040611967E61533d189Dffa2
  • Now the 8 tokens are transferred from account A to account B in shard 0.
harmony $./wallet.sh balances
Account 0: 0xb7098584e18fe78d2eDBD485DcBa7164Ac435764:
    Balance in Shard 3:  10.000000
    Balance in Shard 2:  10.000000
    Balance in Shard 0:  2.000000
    Balance in Shard 1:  10.000000
Account 1: 0x2912Fd62468fB6F2610bC678424a3d066d2999DC:
    Balance in Shard 1:  0.000000
    Balance in Shard 0:  8.000000
    Balance in Shard 2:  0.000000
    Balance in Shard 3:  0.000000
  • Besides, you can remove all locally stored accounts.
harmony $./wallet.sh removeAll
All existing accounts deleted...
  • You can import a specific account by private key.
./wallet.sh import --privateKey=48561e4682e3f6afc123933a9e331416b2696a7e7d88017d8cf1b521193b668a
Private key imported...

Faucet

A faucet enables a user to request initial testing tokens for the Testnet. The faucet drips Ten Harmony Testnet tokens per request.

Disclaimer

The Testnet tokens are used for participation in the Testnet for simulation purpose only. They are unrelated to the official Harmony ONE tokens.

The smart contract for the faucet:

pragma solidity >=0.4.22 <0.6.0;

contract Faucet {
    mapping(address => bool) processed;
    uint quota = 10;
    address owner;

    constructor() public payable {
        owner = msg.sender;
    }

    // Transfers 10 token to the requestor address.
    function request(address payable requestor) public {
        require(msg.sender == owner);
        require(quota <= address(this).balance);
        require(!processed[requestor]);
        processed[requestor] = true;
        requestor.transfer(quota);
    }

    // Returns the balance of this faucet contract.
    function balance() public view returns(uint) {
        return address(this).balance;
    }
}

Block Explorer

The Harmony Block Explorer is an interactive tool for users to view the live Harmony blockchain. You can view the progress of blocks mined on the blockchain and search for a specific account, block or transaction.

Features

  • Search account using account id/address

  • Search block using block id

  • Search transaction using transaction id/hash

  • Display the latest block mined on the blockchain in order by time

  • Display the latest transaction processed in order by time

You can access the Harmony Block Explorer here

Block Benchmark

Our Adaptive IDA tackles a challenge central to any blockchain protocol - propagating blocks across a faulty, byzantine network - with stunning speed. Equally exciting is that we will open-source this component as part of our larger end-to-end, peer-to-peer networking library, libunison.

Background The standard approach to block propagation is called manycast. In manycast, the block proposer sends the 1MB block to each node in the network one by one. Since the proposer has to send all 500MB himself, if he has an average broadband internet speed of 64Mbps, this would take roughly 62.5 seconds. That’s faster than Bitcoin’s average 10 minute inter-block time, but it still isn’t nearly fast enough for a high-performance blockchain like Harmony.

Harmony's breakthrough block syncing

The benefits of the IDA implemented by Harmony are astonishing. By parallelizing the communication load, IDA completes in the amount of time it takes for one node to send an amount of data as large as the block plus some overhead. This further reduces the problem from logarithmic complexity to constant complexity or O(1).

Read all the details about our Block benchmark on our blog here