Add all chainIds to "scanConfig" (this will allow us to "decode" the filepaths like etherscan/* to have the chainId instead
Traverse the filesystem to generate this array.
2.1 Use globby to get all account filepaths: https://github.com/sindresorhus/globby
2.2 Use fs.readFileSync to load all of those files into memory & generate that AccountDBRow type
We want a function which is callable synchronously (no
await
needed). that loads up ALL accounts fromdata/*/*/accounts.json
.The data type we are trying to load up can be called
Array<AccountDBRow>
.An
AccountDBRow
is like the typeAccountRow
which is already in the db, but with a few extra keys. You can define the the like this:Steps
scanConfig
" (this will allow us to "decode" the filepaths likeetherscan/*
to have the chainId insteadfs.readFileSync
to load all of those files into memory & generate thatAccountDBRow
typeExpected outcome