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.
-
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.
-
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.
-
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/
Branch:
get_account_infoModule
clientThe 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.
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.
The Aurum client will need to send an HTTP GET request to the
/accountinfoendpoint. For now we pass in a query parameter ofwrepresenting a wallet address. For example if the hostname of the Aurum producer isaurum.comand the wallet address is6490a4, then in order to get the account info, a GET request should be requested toaurum.com/accountinfo?w=6490a4'. Use the Java http client library to create such a request.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
Accountobject. 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/