You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Management of data in store is currently very cumbersome and error-prone. It is currently managed through the methods try_read_storage and create_storage, which need to be called/managed in a tighly-coupled and convoluted way.
Instead, a more manageable and mantainable method is propoded here using a single method called at the begining of the script (we consider variables not required in individual files are stored in .env file, similar to #106 ):
read_storage() {
if $store folder don't exist -> create folder
if $store/README.txt don't exist -> create $store/README.txt; fill README.txt
if $store/.env don't exist -> create $store/.env
unset RPC
unset USE_STAKING
unset AGENT_ID
source $store/.env
if variable RPC don't defined -> ask_user_rpc; store RPC on $store/.env
if variable USE_STAKING don't defined -> ask_user_use_staking; store USE_STAKING on $store/.env
if variable AGENT_ID not defined -> populate AGENT_ID accordingly
# From this point on, we also need the autonomy commands.
if /trader folder don't exist -> clone trader repository, initialize poetry, etc.
if $store/keys.json don't exist -> autonomy create keys.json
if $store/agent_address.txt don't exist -> create agent_address.txt from keys.json (we have a method to do it. do we need this file?)
if $store/agent_pkey.txt don't exist -> create agent_pkey.txt from keys.json (we have a method)
if $store/operator_keys.json don't exist -> autonomy create operator_keys.json
if $store/operator_address.txt don't exist -> create operator_address.txt from operator_keys.json (do we need this file?)
if $store/operator_pkey.txt don't exist -> create operator_pkey.txt from keys.json (we have a method)
# Files available_tools_store.json, policy_store.json, possibly not need to initialize here?
# Files service.id.txt and service_safe_address.txt, possibly not need to initialize here? Store in the .env file instead.
}
The text was updated successfully, but these errors were encountered:
Management of data in store is currently very cumbersome and error-prone. It is currently managed through the methods
try_read_storage
andcreate_storage
, which need to be called/managed in a tighly-coupled and convoluted way.Instead, a more manageable and mantainable method is propoded here using a single method called at the begining of the script (we consider variables not required in individual files are stored in .env file, similar to #106 ):
The text was updated successfully, but these errors were encountered: