To expose price update actions to an end user, we'll need to build a CLI that binds commands to initialize, update, and read oracle data on-chain.
Acceptance Criteria
Price Updater
As an admin, I would like to run the Price Updater where the following is true:
I can run price-updater --help to get adequate documentation on how to use the executable.
I can run the Price Updater with either a key wallet stored in a JSON file or a YubiHSM wallet.
Specifying the price-updater --keyWallet=<file path to keywallet> flag will load an skey JSON file by it's path.
If keyWallet is not specified, the YubiHSM will be used.
I can run the command price-updater --network=<name of network associated with admin keys> ... resulting in the following
Oracle Initialization is run.
A configuration file is generated and placed at ./ containing the following structure:
{ "nftAssetClass": "<asset class of price oracle NFT>"
, "network": "<network that the oracle has been deployed to>"
, "adminWallet": "<optional keywallet value provided>"
}
I can run the command price-updater --config=<path to generated config file> ... where the config file is valid, which should result in the Oracle Update function being called and passing it's outputs communicating failure, success, or no price update needed yet to the terminal.
I can run the command price-updater read --config="<path to config file>" which returns the datum of the current Price Oracle.
Implementation
The Price Updater is a command-line application that when run will ensure price data is posted on-chain. The code is written in purescript and will depend on the dusd-api and ctl for interacting with the chain. dusd-api should expose functions for initializing, updating, and reading the price datum. Not that this can developed with dummy initialize, update, and read Oracle functions if they have not been implemented yet.
To expose price update actions to an end user, we'll need to build a CLI that binds commands to initialize, update, and read oracle data on-chain.
Acceptance Criteria
Price Updater
As an admin, I would like to run the Price Updater where the following is true:
price-updater --help
to get adequate documentation on how to use the executable.price-updater --keyWallet=<file path to keywallet>
flag will load an skey JSON file by it's path.keyWallet
is not specified, the YubiHSM will be used.price-updater --network=<name of network associated with admin keys> ...
resulting in the following./
containing the following structure:price-updater --config=<path to generated config file> ...
where the config file is valid, which should result in the Oracle Update function being called and passing it's outputs communicating failure, success, or no price update needed yet to the terminal.price-updater read --config="<path to config file>"
which returns the datum of the current Price Oracle.Implementation
The Price Updater is a command-line application that when run will ensure price data is posted on-chain. The code is written in purescript and will depend on the
dusd-api
andctl
for interacting with the chain.dusd-api
should expose functions for initializing, updating, and reading the price datum. Not that this can developed with dummy initialize, update, and read Oracle functions if they have not been implemented yet.Also note that real price data will be wire up after this effort so dummy data will be used.
When the
price-updater
is ran, it performs the following operations--config
flag is setdusd-api
with a dummy price.dusd-api
with a dummy price.When the
price-updater read --config="<path to config file>"
is ran, call the on-chain Oracle datum getter defined indusd-api
.Tests
There should be test cases to address the following aspects of the CLI