makerdao / mcd-cli

MCD Command-line interface
GNU Affero General Public License v3.0
18 stars 8 forks source link

Use ilk-registry, add name, upd to 1.0.9 #24

Closed brianmcmichael closed 4 years ago

brianmcmichael commented 4 years ago

The ilk registry feature now acquires ilk information off the blockchain. This takes a little more time (a few seconds) than before so the new component writes out the info to a file. When re-checking ilks, which mcd-cli does on basically every call, it updates the file modification time. This gets checked on every call. If the user hasn't performed a command in the past 10 minutes it will then invalidate the file and re-acquire, otherwise it will read out the existing file. An active user would keep updating the file and not experience the timeout. 10 minutes is arbitrary, an attempt to compromise between not aggressively re-checking but also making it so that if a new collateral type is entered the user can walk away for a bit and re-set the ilk list. Open to suggestions on this mechanic.

Here's the new output on mainnet:

bmcmichael@bmcx1c:~/makerdao/mcd-cli$ ./bin/mcd ilks
ILK          GEM   DEC   DESC

ETH-A       WETH    18   Wrapped Ether
BAT-A        BAT    18   Basic Attention Token
USDC-A      USDC     6   USD//C
USDC-B      USDC     6   USD//C
WBTC-A      WBTC     8   Wrapped BTC
TUSD-A      TUSD    18   TrueUSD
ZRX-A        ZRX    18   0x Protocol Token
KNC-A        KNC    18   Kyber Network Crystal
gbalabasquer commented 4 years ago

This looks good but I'm wondering if we should also take the ilk contract addresses from the ilk-registry instead of the config file.

brianmcmichael commented 4 years ago

@gbalabasquer I'm happy to make that update. Would probably want to do it in a different PR.