Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted services folder (empty services folder) #303

Open
jmoreira-valory opened this issue Aug 29, 2024 · 1 comment
Open

Corrupted services folder (empty services folder) #303

jmoreira-valory opened this issue Aug 29, 2024 · 1 comment

Comments

@jmoreira-valory
Copy link
Collaborator

jmoreira-valory commented Aug 29, 2024

This problem can be caused due to 2 reasons:

  1. Executing rc113 after having executed rc112.
  2. Downgrading Pearl from version >=rc112 to version <rc112 will corrupt the services configuration and as a result it will be deleted.

This problem can also be caused due to a similar downgrade from other versions.

@jmoreira-valory
Copy link
Collaborator Author

jmoreira-valory commented Aug 29, 2024

Recovery instructions

These instructions will help you recover your Pearl configuration, in case the services folder has been corrupted.

  1. Stop any running agent and any instances of Pearl.

  2. Navigate to the Pearl config folder, and list the contents of the services folder:

    cd ~/.operate/services
    ls -la

⚠️ You should only continue with the remaining instructions if the /services folder exists and does not contain any folder starting by bafybei... (it may contain folders starting with other names, for example, invalid_bafybei).

⚠️ Please back up your ~/.operate/ folder on a safe place before proceeding.

  1. Ensure you have the latest version of Pearl installed. Do not run the application.

  2. Create the service folder and required files:

    mkdir ~/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u
    mkdir ~/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u/trader_pearl
    curl -o ~/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u/trader_pearl/README.md https://raw.githubusercontent.com/valory-xyz/trader/v0.18.4/packages/valory/services/trader_pearl/README.md
    curl -o ~/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u/trader_pearl/service.yaml https://raw.githubusercontent.com/valory-xyz/trader/v0.18.4/packages/valory/services/trader_pearl/service.yaml
    touch ~/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u/config.json
  3. Use your preferred text editor to edit the configuration file:

    open ~/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u/config.json

    You need to populate the file with the following contents. Placeholder values, denoted by < >, have to be provided manually. See how to find their values on the steps below.

    {
        "version": 3,
        "hash": "bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u",
        "keys": [
            {
            "ledger": 0,
            "address": "<AGENT_ADDRESS>",
            "private_key": "<AGENT_PRIVATE_KEY>"
            }
        ],
        "home_chain_id": "100",
        "chain_configs": {
            "100": {
                "ledger_config": {
                    "rpc": "https://rpc-gate.autonolas.tech/gnosis-rpc/",
                    "type": 0,
                    "chain": 2
                },
                "chain_data": {
                    "instances": ["<AGENT_ADDRESS>"],
                    "token": <SERVICE_ID>,
                    "multisig": "<SERVICE_MULTISIG>",
                    "staked": false,
                    "on_chain_state": 4,
                    "user_params": {
                        "staking_program_id": "<STAKING_PROGRAM_ID>",
                        "nft": "bafybeig64atqaladigoc3ds4arltdu63wkdrk3gesjfvnfdmz35amv7faq",
                        "threshold": 1,
                        "use_staking": true,
                        "use_mech_marketplace": false,
                        "cost_of_bond": 10000000000000000,
                        "fund_requirements": {
                            "agent": 100000000000000000,
                            "safe": 5000000000000000000
                        }
                    }
                }
            }
        },
        "service_path": "<YOUR_USER_HOME_FOLDER>/.operate/services/bafybeidicxsruh3r4a2xarawzan6ocwyvpn3ofv42po5kxf7x6ck7kn22u/trader_pearl",
        "name": "valory/trader_pearl"
    }
  4. Find your Master Safe address. It can be found as the safe parameter in the file ~/.operate/wallets/ethereum.json. You will need this value to identify your service ID on-chain (see next step).

    cat ~/.operate/wallets/ethereum.json | grep \"safe\"
  5. Fill the placeholder values and save the file. Please contact the team by providing your Master Safe address if you need assistance.

    • <SERVICE_ID>: This is your service ID. Do not surround this value with quotes " ". To retrieve this value, you need to examine the transactions of your Master Safe on Gnosis scan https://gnosisscan.io/address/<YOUR_MASTER_SAFE_ADDRESS>. You must examine a transaction with a CreateService event on the transaction logs (see an example here for serviceId 594). It will be typically one of the few first (2-4) transactions listed for your Master Safe.

    • Now, visit the page https://registry.olas.network/gnosis/services/<SERVICE_ID> (you need to substitute your service ID) to find these values:

      • <AGENT_ADDRESS>: Copy the address under "Agent Instances".
      • <SERVICE_MULTISIG>: Copy the address next to "Safe contract address:".
      • <STAKING_PROGRAM_ID>: Check the address under "Owner address". Next, identify the key corresponding to that address in the file profiles.py file. Replace <STAKING_PROGRAM_ID> by the corresponding key (for example, pearl_beta, pearl_beta_2, etc.).
    • <AGENT_PRIVATE_KEY>: You can find it by executing the command

      cat ~/.operate/keys/<AGENT_ADDRESS>
    • <YOUR_USER_HOME_FOLDER>: You can find it by executing the command

      echo $HOME
  6. Save the config.json file. If you have completed correctly the steps above, you should be able to run Pearl normally now.

@jmoreira-valory jmoreira-valory changed the title Corrupted services folder after downgrade Corrupted services folder (empty services folder) Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant