Skip to content

Aurum client getting account #30

@Vineet77

Description

@Vineet77

Branch: get_account_info
Module client

The goal of this issue to get the Aurum client to be able to connect to a specified auurm producer, and get account information specific for the wallet address specified. There are 3 steps in this issue.

  1. The `AurumClient has a constructor that takes in a string hostname. Create an instance variable to store that. Also we will need an http client variable.

  2. The Aurum client will need to send an HTTP GET request to the /accountinfo endpoint. For now we pass in a query parameter of w representing a wallet address. For example if the hostname of the Aurum producer is aurum.com and the wallet address is 6490a4, then in order to get the account info, a GET request should be requested to aurum.com/accountinfo?w=6490a4'. Use the Java http client library to create such a request.

  3. The response should be a json. Here is an example response:
    {"WalletAddress":"21d42fb85cc6ec9b90d6af25a265a13263c80bbbfdb080876bb550766f727ff8", "Balance":500000000000000, "StateNonce":0}

The next step is to parse the JSON response and create an Account object. Use Google's gson, a json parsing library.

All tests must pass. (Run ./gradlew test).

Helpful links:
https://openjdk.java.net/groups/net/httpclient/intro.html
https://github.com/google/gson/blob/master/UserGuide.md
https://stackoverflow.com/questions/16595493/gson-parsing-without-a-lot-of-classes
https://mkyong.com/java/java-11-httpclient-examples/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions