This module utilizes curl and the [Coinmarketcap API](https://coinmarketcap.com/api/) to allow the query of the latest Ether (ETH) price relative to some 120 currencies. The service requires a valid Coinmarketcap API key, which is freely available with [registration](https://pro.coinmarketcap.com/signup/). The query function wraps this API call: https://coinmarketcap.com/api/documentation/v1/#operation/getV2CryptocurrencyQuotesLatest:
The service is discoverable at [Fluence](https://dash.fluence.dev/), e.g., https://dash.fluence.dev/blueprint/a7959f53-a70b-4183-83e0-649f4f91160c, and ready for use.
## How to Build The Service
machine setup instructions
In the `eth-price-getter` dir,
```bash
# if needed
chmod +x .build.sh
./build.sh
```
That compiles both the curl and the price getter code and places the resulting wasm code into the `artifacts` dir. For local testing run `fce-repl Config.toml` to initiate the repl:
```bash
fce-repl Config.toml
Welcome to the FCE REPL (version 0.1.33)
app service was created with service id = b0cc4d0d-fb3e-49e1-8532-54d77e03cdaa
Calling `interface` lists both the curl_adapter and ether_price_getter interfaces. Calling the `ether_price_getter` service function with the API key and conversion currency symbol, `"35fd4b0e-56cf-4182-8f22-d4095cf0a738", "EUR"`, yields the raw json string result expected.
which yields a fresh keypair and derived seed and allows us to create a new service. The `fldist new_service` is a convenience method that takes care the module uploads to the node, the creation of the blueprint, and finally, the instantiation of the services.
specifies that we are creating a new service comprised of two modules, the curl_adapter module and the ether_price_getter module, and generates the confirmation with service id:
We can now discover the service on the [Fluence dashboard](https://dash.fluence.dev/blueprint/a7959f53-a70b-4183-83e0-649f4f91160c) and put it to use. Whether we want to write a frontend application or use the `fldist` tool to execute the remote service, we need an AIR script. Using the prepared [AIR script](../air-scripts/get_eth_price.js) for which you need to supply your own API key: