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

added chainstack in README.md #609

Closed
wants to merge 1 commit into from

Conversation

syahrul12345
Copy link

I would like to include Chainstack into the README file as another option for Ethereum Node provider

@ricmoo
Copy link
Member

ricmoo commented Sep 23, 2019

Do you have more docs on chainstack? That list is more for built-in Providers, but I can easily add a ChainstackProvider.

@syahrul12345
Copy link
Author

Hi Richard,

Sure our documentation is here : https://docs.chainstack.com/

Chainstack is an Ethereum node provider, and we only support what's already specified here https:/ethereum/wiki/wiki/JSON-RPC

:)

@ricmoo
Copy link
Member

ricmoo commented Sep 24, 2019

Thanks!

What type of scale are you currently able to handle? I may consider adding you to the default provider, if you are interested and have the capacity.

When people use ethers.getDefaultProvider they get an instance of a FallbackProvider with several backends which are used for load balancing as well as verifying the results of a backend by comparing responses.

At this time, each backend receives around 60 million requests per day. I would also require an API Token (if you use them) with a larger capacity too.

Also, is there any intention of adding support for Rinkeby, Görli or Kovan? Just curious, as these can be configured per network.

Thanks! :)

@ricmoo ricmoo added enhancement New feature or improvement. next version on-deck This Enhancement or Bug is currently being worked on. labels Sep 28, 2019
@syahrul12345
Copy link
Author

syahrul12345 commented Oct 1, 2019

Hi @ricmoo. Hey, let's add in a Chainstack provider. They'll just need to specify their authentication details in this format https://username:password@rpc_end_point.com for a chainstack node. All of this can be obtained from our https://console.chainstack.com , when a user creates a new node

Do let me know how i can help!

@ricmoo
Copy link
Member

ricmoo commented Jan 8, 2020

It looks like you need to enter a credit card number, even for the purposes of the free developer tier.

Also, for the defaultProvider, it requires to be unauthenticated (or a general purpose account which I can hardcode into ethers and should be considered general public knowledge).

I generally avoid promoting products with pay-walls and systems that require sign-up cannot work with the default provider (the entire point of the default provider is absolutely-zero-touch; just works out of the box).

I think to integrate it at this point, the easiest thing to do is for you to provide an npm package which provides the Provider, which is likely just:

const { UrlJsonRpcProvider } = require("@ethersproject/providers"); 
const { inherits } = require("util");

export class ChainstackProvider extends UrlJsonRpcProvider {

    // You will likely use the apiKey parameter as the "username:password" string
    static getApiKey(apiKey: any): any {
        if (typeof(apiKey) !== "string" && apiKey.split(":").length !== 2) {
            logger.throwArgumentError("invalid username:password", "apiKey", apiKey);
        }
        return apiKey;
    }

    // Use this to compute the URL they should connect to
    static getUrl(network: Network, apiKey?: any): string {
        switch (network.name) {
            case "homestead":
                return "YOUR_URL_HERE";
                break;
            case "ropsten":
                return "YOUR_URL_HERE";
                break;
            case "rinkeby":
                return "YOUR_URL_HERE";
                break;
            case "goerli":
                return "YOUR_URL_HERE";
                break;
            case "kovan":
                return "YOUR_URL_HERE";
                break;
        }

        logger.throwArgumentError("unsupported network", "network", arguments[0]);
    }
}

@ricmoo
Copy link
Member

ricmoo commented Jan 8, 2020

Closing for now, but please feel free to re-open if something changes.

Thanks! :)

@ricmoo ricmoo closed this Jan 8, 2020
@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants