Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Make new Connection("clusterName")work #2030

Closed
mikemaccana opened this issue Jan 11, 2024 · 2 comments
Closed

Make new Connection("clusterName")work #2030

mikemaccana opened this issue Jan 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mikemaccana
Copy link
Contributor

Motivation

Even Foundation and Labs people people call clusterApiURL() or have little helpers to match cluster names to connections. It would useful to allow Connection to just use a cluster name, if someone wants to connect to one of the official cluster URLs.

Example use case

Someone wants to connect to devnet.

They run:

const connection - new Connection("devnet");

And don't have to worry about matching the name to a network URL.

Details

Just check for a few magic values for the official clusters, anything outside those should be assumed to be a URL.

@mikemaccana mikemaccana added the enhancement New feature or request label Jan 11, 2024
@steveluscher
Copy link
Contributor

This runs up against the principle of greatest package efficiency. If you use the feature that exercises the clusterApiUrl logic, then you use some or all of that code. If you don't (ie. you supply your own RPC URL) then you use 0% of it, and waste those 628 gzipped bytes.

It's never a big deal in isolation, but if we allow this sort of pre-bundled-but-optional functionality everywhere (see #2115) then package efficiency goes way down.

Copy link
Contributor

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants