Basic repo that allows you to run your own crossbar instance very simply. The main motivations:
- The
crossbarapplication is very performant and scaling based on resources is not the bottleneck. - Surge connects to many exchanges. If a single outgoing IP address is making too many requests, the exchanges will rate limit the IP address. This repo is built with that in mind.
- The closer you are to Tokyo the lower the latency.
Note: All endpoints use preemptible nodes for cost optimization. Minor downtime (seconds) may occur during node preemption, but this saves 60-90% on infrastructure costs.
- Primary: Use
asia-northeast3for best performance - Load Balancing: Rotate between endpoints to avoid rate limits
- Testing: Use the stage environment for development
Want to sponsor additional endpoints? Deploy using this repo and submit a PR with your company logo and endpoint details!
Join our Telegram channel for endpoint updates, maintenance notifications, and community discussions: @switchboard_endpoints
- Each region gets its own isolated network, cluster, node pool, and most importantly a regional static IP address.
- If you want two nodes, you simply define two regions. This means two separate outgoing IP addresses. This means you can make twice as many requests without being rate limited.
- Use preemptible nodes to save money. This means you might have some minor downtime (seconds) if a node is preempted. But it can save you 60-90% on node costs.
- This uses
stabletag. It's best to hardcode a version.
- Global Load Balancer: This might be nice instead of having clients rotate the URL's they use for thier requests.
- API Key: If users want to secure their instance they can use an API key. Although for early implementation its not necessary.
- Multi-Cloud: Add integrations for AWS, Azure, and any other cloud provider.
- Install pulumi and setup all your credentials.. Start from
cd pulumi. cp env.example stage.envandcp env.example prod.env- Init your stack:
pulumi stack init {{org}}/stageandpulumi stack init {{org}}/prodrespectively. - Select your stack:
pulumi stack select {{org}}/stageorpulumi stack select {{org}}/prod. It's recommended to have two environemnts. This way you can test new crossbar tags without affecting the production environment. - Run
pulumi upto deploy the infrastructure. - If you run into issues, you can run
pulumi upagain in most cases. Other times, you might need topulumi destroyand thenpulumi upagain. - Once the infrastructure is deployed, you can see all your new IPs. They look something like this:
https://xx.xxx.xx.xx.sslip.io
- SSL certs can take some time to get ready. Use this to test:
curl -k "https://{{your_ip}}.sslip.io/simulate/solana/mainnet/EAsoLo2uSvBDx3a5grqzfqBMg5RqpJVHRtXmjsFEc4LL?includeReceipts=true" - If you want to destroy. First you need to set the
deletionProtectiontofalsein the Pulumi.dev.yaml file.- Then you do a
pulumi upto update the state. - Then you can do a
pulumi destroyto destroy the infrastructure.
- Then you do a
- If your certs don't work, delete them:
kubectl delete certificate crossbar-us-{region}-tls-secret --context=gke_{project_name}_{region}_crossbar-{region}-cluster
Contributions are welcome. Simply create an issue first, we can discuss the changes you want to make. If you want to make a change, you can fork the repo and create a pull request.
