1

When fetching the program account using getAccountInfo rpc, it will return the following response:

{
    "jsonrpc": "2.0",
    "result": {
        "context": {
            "apiVersion": "1.17.6",
            "slot": 261230517
        },
        "value": {
            "data": {
                "parsed": {
                    "info": {
                        "programData": "CeWxs7Ytt4YAzKW7jtZtqdUJaAriwX5x3Gkt7cKqSFAF"
                    },
                    "type": "program"
                },
                "program": "bpf-upgradeable-loader",
                "space": 36
            },
            "executable": true,
            "lamports": 1141440,
            "owner": "BPFLoaderUpgradeab1e11111111111111111111111",
            "rentEpoch": 18446744073709551615,
            "space": 36
        }
    },
    "id": 1
}

I know the actual program code is deployed at CeWxs7Ytt4YAzKW7jtZtqdUJaAriwX5x3Gkt7cKqSFAF.

However, is it possible to change the value of programData and make it switch to another data account with different program code?

Thanks

1 Answer 1

3

While your question is not that clear, it is not possible to transfer the data stored in one program ID to another. You can very well create another program ID with exactly the same program code as the first one but you cannot get the data from the first program ID to the second one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.