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

BlockFrostBackend does not work with prepod and preview testnets #108

Open
jb824 opened this issue Nov 24, 2024 · 0 comments
Open

BlockFrostBackend does not work with prepod and preview testnets #108

jb824 opened this issue Nov 24, 2024 · 0 comments

Comments

@jb824
Copy link

jb824 commented Nov 24, 2024

Unable to setup backend using BlockFrost with project id for testnet (prepod). Sample.env file should be updated with .env variable used in backend.init.py, line 94. Resolving .env variable name causes a 403 status error. Testnet networks, prepod and preview, need to be included in a match..case or if..else in blockfrost.init.py for setting the network type in the base url.

        self.chain_context = BlockFrostChainContext(
            project_id,
            base_url=ApiUrls.mainnet.value, # causes a 403 status code error with testnet project_id
        )
        self.api = self.chain_context.api
        self._block_cache: dict = {}

A match...case like below would help resolve this issue

        url = ""
        match project_id[:7]:
            case "prepod":
                url = ApiUrls.prepod.value
            case "preview":
                url = ApiUrls.preview.value
           ...     

I can submit a pull request tomorrow or next week unless this was left intentionally.

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