harmony-one / bounties

Bounty program is to help the community take part in the development of the Harmony blockchain. It covers from core feature to validator tooling, from dApp development to DeFi integration.
MIT License
59 stars 23 forks source link

Harmony CLI using Rosetta SDK #1

Closed LeoHChen closed 3 years ago

LeoHChen commented 3 years ago

Description

A Command Line Tool to query Harmony blockchain using Rosetta SDK.

Context

Harmony supports the Rosetta API (https://www.rosetta-api.org/). A tool to query harmony blockchain data using Rosetta SDK would be an easy to use tool for scripting and query. The Rosetta end point provided by Harmony is https://rosetta.s0.t.hmny.io.

The Harmony submission of Rosetta support is here. (https://community.rosetta-api.org/t/harmonys-rosetta-data-construction-api/293)

Acceptance Criteria

Reward

USD 2,000 equivalent amount of Harmony ONE token.

radykov commented 3 years ago

What about wrapping around a current Rosetta CLI implementation ? There is a Coinbase supplied CLI which could be wrapped around for a quick win https://github.com/coinbase/rosetta-cli

Would an implementation that wraps around that and provides sufficient testing be suitable ?

LeoHChen commented 3 years ago

@radykov , thanks for your interest. Harmony uses rosetta api's network feature to support multiple shards. I don't know if coinbase's cli support cross-shard transfer feature that Harmony supported.

Have you tried it on harmony's implementation? If that works, it will be a much simpler job then.

radykov commented 3 years ago

Tested it on some commands on the Harmony endpoint and it allows you to specify shards.

But upon further inspection, coinbase's CLI only allows to look up block contents and account balances (apart from functionality to test the implementation)

Since it looks like all the Data, Construction, and Index API's are needed, a simple wrapping of the rosetta cli might not work

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 10065.8979 ONE (1988.14 USD @ $0.2/ONE) attached to it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 weeks, 1 day from now. Please review their action plans below:

1) lyledavids has started work.

rosetta cli 2) ntsanov has started work.

Golang implementation for harmony rosetta api using battle tested cli library - spf13/cobra 3) xhanka00 has started work.

Harmony CLI using Rosetta SDK 4) kevdez has started work.

A Harmony CLI that uses the Rosetta API, written in Node.js 5) brianspha has started work.

See bounty description

Learn more on the Gitcoin Issue Details page.

ntsanov commented 3 years ago

I've been doing work on the task for the last few days but seems that https://rosetta.s0.t.hmny.io/ is down since yesterday. I got to construction part but seems that the faucet only works for shard 0 and can't really test much at this point. Any Idea when it will be up again ?

LeoHChen commented 3 years ago

@ntsanov is it still an issue? what's the error did you see?

ntsanov commented 3 years ago

@ntsanov is it still an issue? what's the error did you see?

It's working now. I'm not sure when it went up, cause I was testing on shard 1 last few days but it was down for at least 2 days. It seemed like the service was down but the proxy was working - it was returning 502 Bad Gateway

kevdez commented 3 years ago

Just for clarification, this issue is for implementing the Data API portion of Rosetta into a cli, correct?

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 10065.8979 ONE (1272.32 USD @ $0.11/ONE) has been submitted by:


ntsanov commented 3 years ago

I've submited my work. Will welcome some feedback :)

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 10065.8979 ONE (1135.52 USD @ $0.12/ONE) has been submitted by:

  1. @ntsanov

@papiofficial please take a look at the submitted work:


LeoHChen commented 3 years ago

@ntsanov , I've reviewed your PR. It's pretty close to what I am looking for. Can you add a travis ci build/test support into your repo so that I can see the build status of the repo? The test would ideally cover all the API endpoints of rosetta.

ntsanov commented 3 years ago

@ntsanov , I've reviewed your PR. It's pretty close to what I am looking for. Can you add a travis ci build/test support into your repo so that I can see the build status of the repo? The test would ideally cover all the API endpoints of rosetta.

Sure I will do that today or tomorrow evening

ntsanov commented 3 years ago

I've added the travis build/config and tests for data endpoints as well In order to be run on a fork, following ENV must be set in travis settings panel: PRIVATE_KEY - whenever this env is preset, no keystore is used but this private key is used for signing instead FROM_ADDRESS - address of the private key provided Some amount of ONE would need to be transferred to this test wallet in order for the transfer to be successful

LeoHChen commented 3 years ago

Thanks @ntsanov . This is good. I think we can get it closed.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 10065.8979 ONE (908.79 USD @ $0.1/ONE) attached to this issue has been approved & issued to @brianspha.

nelsonmfinda commented 3 years ago

Hi @LeoHChen, why you closed this issue? I can see here https://gitcoin.co/issue/harmony-one/bounties/1/100025310 this bounty is open.