coincoin
coincoin copied to clipboard
Persistent wallet
Wallet (public and private keys) are in memory only. Even worst, they are generated on init
of the Token.MyWallet
gen_server
. This is really bad because if/when the gen_server crashes, new keys are generated and all coins are lost !
- [x] So we should first generate a wallet in the
application.ex
module and pass it to thegen_server
from here. This would prevent a crash to generate a new wallet - [ ] we want to persist public keys and private keys in a file
~/.coincoin_keys
. On startup if this file exist and keys can be read from it, we use these keys, otherwise we generate the keys and create this file. This must be implemented at theMyWallet
module level and not theWallet
module level. - [ ] document key persistence and how to make it work with docker