Open ppedziwiatr opened 2 years ago
Planned changes:
So in current env. there are in fact 3 possibilites:
gateway.lock
file is present)--replica
param)But yeah, in ECS env this must be handled by some kind of flag/env. variable.
If we remove the sequencer from the equation (i.e. from the gateway node) - https://github.com/warp-contracts/gateway/issues/89 - the above could be reduced to:
The sequencer-related endpoint is currently the only one, that cannot be scaled horizontally "easily".
Ok, so for compete this story, we need to complete #97 and #89 before.
Current configuration:
t3.medium
: https://eu-north-1.console.aws.amazon.com/ec2/home?region=eu-north-1#InstanceDetails:instanceId=i-0eda8ef302509bb14Runs in node cluster mode (https://nodejs.org/api/cluster.html#cluster), started via PM2 (https://pm2.keymetrics.io/docs/usage/cluster-mode/) with
-i max
. In case oft3.medium
this effectively means 2 nodes.Requires:
.secrets/warp-wallet-jwk.json
- an Arweave wallet that is used to connect with Bundlr (which is used for bundling contracts and contracts' interactions).secrets/vrf-priv-key.txt
-secp256k1
private key - required by the VRF featurevrf-pub-key.txt
-secp256k1
public key - required by the VRF featureAdditional notes: Only one worker in cluster runs the gateway tasks (e.g. transactions syncing, transactions verification) All workers in cluster run the http server and handle both the POST and GET requests. This is handled via
gateway.lock
file.replica instance: EC2 on
t3.micro
: https://eu-north-1.console.aws.amazon.com/ec2/home?region=eu-north-1#InstanceDetails:instanceId=i-0d80ce350fba0431c Also runs in node cluster mode, with the--replica
param. This effectively means, that node only serves data - i.e. serves only "GET" requests and does not run any tasks/jobs.ALB - https://eu-north-1.console.aws.amazon.com/ec2/home?region=eu-north-1#LoadBalancers:sort=loadBalancerName
sw-gw-alb
withsw-gw-target-group
https://eu-north-1.console.aws.amazon.com/ec2/home?region=eu-north-1#TargetGroup:targetGroupArn=arn:aws:elasticloadbalancing:eu-north-1:731675056359:targetgroup/sw-gw-target-group/d11c3b67c5addb3a This group has both the above EC2 instances connected.Cloudfront - https://us-east-1.console.aws.amazon.com/cloudfront/v3/home?region=eu-north-1#/distributions/E2UWDPG250O74Q - https://d1o5nlqr4okus2.cloudfront.net with the alb and main instance node origins connected. All the 'post' requests are sent to the main node. The rest is sent to the ALB. Some caching policies are enabled for certain endpoints - https://us-east-1.console.aws.amazon.com/cloudfront/v3/home?region=eu-north-1#/distributions/E2UWDPG250O74Q/behaviors This cloudfront distribution is connected to the gateway.redstone.finance domain.