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

idl: Store deployment addresses for other clusters #2892

Merged

Conversation

acheroncrypto
Copy link
Collaborator

@acheroncrypto acheroncrypto commented Apr 6, 2024

Problem

It's currently not possible to store program address information for other clusters.

Solution

Initially, I thought of making the top-level address field an enum:

pub enum IdlAddress {
    Multiple {
        mainnet: Option<String>,
        testnet: Option<String>,
        devnet: Option<String>,
        localnet: Option<String>,
    },
    #[untagged]
    Single(String),
}

This way, we could support both string address as a default and an object type for more detailed (cluster based) information. However, the program's IDL may also exist in other clusters, which makes the current IDL (the one we got the other deployment addresses from) useless (because the IDL in the cluster should be fetched). For this reason, it made more sense to store this information in the metadata field compared to the top-level address field:

pub struct IdlDeployments {
    pub mainnet: Option<String>,
    pub testnet: Option<String>,
    pub devnet: Option<String>,
    pub localnet: Option<String>,
}

Summary of changes

Add metadata.deployments field that optionally stores deployment addresses in mainnet, testnet, devnet and localnet.

Copy link

vercel bot commented Apr 6, 2024

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added the idl related to the IDL, either program or client side label Apr 6, 2024
@acheroncrypto acheroncrypto merged commit da2d9a4 into coral-xyz:master Apr 6, 2024
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idl related to the IDL, either program or client side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant