Helium Network Rosetta Gateway Implementation

Today I’m happy to present to you the initial Rosetta implementation of the Helium blockchain.

Quick start

git clone https://github.com/syuan100/rosetta-helium
cd rosetta-helium

docker build . -t rosetta-helium:latest
docker run -d --rm --init -v "$(pwd)/helium-data:/data" -p 8080:8080 -p 44158:44158 rosetta-helium:latest

If you wish to expose logs, you can use this command:

docker run -d --rm --init -v "$(pwd)/helium-data:/data" -v "$(pwd)/helium-logs:/var/data/log"  -p 8080:8080 -p 44158:44158 rosetta-helium:latest

Logs will be stored in /helium-logs in the current directory. You can tail -f console.log in that foleder to view the output for the embedded Helium node.

It’s HIGHLY recommended that you set the internal/external NAT settings through environment variables for better performance:

NAT_INTERNAL_IP172.17.0.X (Docker IP)
NAT_INTERNAL_PORT44158 (Default port for peering)
NAT_EXTERNAL_IP → Your publicly accessible IP address
NAT_EXTERNAL_PORT44158 (Whatever port you exposed)

Full command w/ logs:

docker run -d --rm --init -v "$(pwd)/helium-data:/data" -v "$(pwd)/helium-logs:/var/data/log" -p 8080:8080 -p 44158:44158 -e NAT_INTERNAL_IP={{docker_ip}} -e NAT_INTERNAL_PORT={{docker_port}} -e NAT_EXTERNAL_IP={{public_ip}} -e NAT_EXTERNAL_PORT={{public_port}} rosetta-helium:latest

Note: This is not a FULL implementation

  • All network related transactions that don’t have balance changing effects are represented by “pass through” operations will all metadata retained.
  • HTLC Transactions have not been implemented
  • Only payment_v2 transactions are available for construction (assertion, staking, and other user actions will be implemented at a later date)
  • No syncing from genesis (will pull from the latest agreed upon snapshot)
  • Because of the above, historical balances and account reconciliation are not supported

The reason we’re releasing this first version of the Rosetta implementation is because the transactions currently implemented should be minimally viable to allow exchanges to operate.

We will create the OPTION to sync from genesis in the future, however at this point in time it is prohibitively expensive.


After starting the node, please wait a few minutes for peers to populate and for the snapshot to be fully digested. Prior to fully digesting the snapshot, you may receive a “transaction not found” error when you query /network/status.

Once the node is up and running, running /network/status should give you output like below:

{
    "current_block_identifier": {
        "index": 941790,
        "hash": "l_eYadmResKrjmc1qr8P5v2pX6SGeiC063UpzAbp4OA"
    },
    "current_block_timestamp": 1627478690000,
    "genesis_block_identifier": {
        "index": 933121,
        "hash": "T5mOqiro2AXxbkNDynT81tCKc6-IQdBHwAknZ77t2gk"
    },
    "oldest_block_identifier": {
        "index": 933121,
        "hash": "T5mOqiro2AXxbkNDynT81tCKc6-IQdBHwAknZ77t2gk"
    },
    "sync_status": {
        "current_index": 941790,
        "target_index": 942000,
        "synced": false
    },
    "peers": [
        {
            "peer_id": "/p2p/1123sJmjziJhevRLtDd2dJoVWJrrv4jkbWXaxFuZezAkqZwEsMUX"
        },
        {
            "peer_id": "/p2p/112UL8CZURGEpdTp9sooeFGQ3TRxhdLDg6nurVaEjd27RzqGQrGe"
        },
        {
            "peer_id": "/p2p/112Y1gfgPHXHKb8YNNDuEhs8Pmdb1aL8ie1XrLcUDUtWhVDjeanY"
        },
        {
            "peer_id": "/p2p/112a5Mzuhw4h9Er29yGhsYLi9FePQmzmgyKXZW53to8uXHzZYSS3"
        },
        {
            "peer_id": "/p2p/112q3oqKDuf5DGL8BxqwuQDpHtDS3F5f45HF76r5wHDiBouJZoeS"
        },
        {
            "peer_id": "/p2p/116pTusoaKqjwjMFfCnwUgoRssZXcn31qoRkt6hwzgrZUrLdkto"
        },
        {
            "peer_id": "/p2p/11KfPmQwWwGgUagyP5UvJkgZCc2EKHWyfiAKTEXcUzqwFCAzyWK"
        },
        {
            "peer_id": "/p2p/11YhEnAXphJfUpgtaLCss5prqdgQqhcvZ51wyRFDxYt5FTemP6T"
        }
    ]
}

At this point you’re up and running! Check out the wiki for more information about the implementation and how to construct a transaction, or run rosetta-cli checks.

Please let me know if you have any questions or suggestions. We will be updating this repository occasionally for new functionality.

7 Likes

Hello, if you’ve been experiencing issues there have recently been a few updates to commands and also to underlying dependencies. Please try again with the latest changes.

2 Likes

Thank you @syuan100 . Appreciate posting your implementation here.

4 Likes

Update notice [v1.1] - We have updated the helium-rosetta repo. Please pull the latest repo and rebuild for the latest bug fixes and features.

Features:

  • Include testnet configuration (build containers with Dockerfile_testnet )

Bug fixes:

  • Fix network type indicator for deriving addresses
  • Added missing txns gen_validator_v1 , gen_price_oracle_v1 , update_gatway_oui_v1 , token_burn_exchange_rate_v1
  • Fix Pending status error for unstake transactions
6 Likes

A bug was discovered in the last release. We have released a hotfix and bumped the version number to v1.1.1, as well as repaired the link in the post above: Release v1.1.1 · syuan100/rosetta-helium · GitHub

4 Likes

Awesome seeing this getting completed. Thanks Steven!

1 Like

Enjoyed your demo at the last Helium community call. I have a test node up and running nicely :+1:

@syuan100 feel free to put your implementation in here - https://github.com/coinbase/rosetta-ecosystem/blob/master/implementations.md - we want to make sure we have centralized repo of all the implementations. So feel free to raise a PR.

1 Like

@shrimalmadhur, added PR here!

1 Like