Skip to content

Commit

Permalink
Merge pull request #26 from Crossbell-Box/feature/prod-configs
Browse files Browse the repository at this point in the history
Add production configs
  • Loading branch information
sljeff authored Mar 9, 2023
2 parents 0b08c6c + 9dff160 commit 2f5993f
Show file tree
Hide file tree
Showing 6 changed files with 519 additions and 0 deletions.
58 changes: 58 additions & 0 deletions deploy/prod/deploy-validator-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: bridge-validator-01
namespace: crossbell
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 5
selector:
matchLabels:
app: bridge
tier: validator
template:
metadata:
labels:
app: bridge
tier: validator
annotations:
vault.hashicorp.com/agent-inject: 'true'
vault.hashicorp.com/agent-inject-secret-keystore: kv/bridge
vault.hashicorp.com/role: 'read-bridge'
spec:
serviceAccountName: read-bridge
containers:
- image: $IMAGE_TAG_RELEASE
imagePullPolicy: Always
name: bridge-validator-01
env:
- name: CONFIG_PATH
value: /opt/bridge/config/config.validator01.json
- name: VERBOSITY
value: "100"
ports:
- containerPort: 3000
protocol: TCP
resources:
requests:
memory: "500Mi"
cpu: "50m"
limits:
memory: "1000Mi"
cpu: "200m"
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: "/opt/bridge/config/"
name: bridge-validator
readOnly: true
volumes:
- name: bridge-validator
secret:
secretName: bridge-validator
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
58 changes: 58 additions & 0 deletions deploy/prod/deploy-validator-02.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: bridge-validator-02
namespace: crossbell
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 5
selector:
matchLabels:
app: bridge
tier: validator
template:
metadata:
labels:
app: bridge
tier: validator
annotations:
vault.hashicorp.com/agent-inject: 'true'
vault.hashicorp.com/agent-inject-secret-keystore: kv/bridge
vault.hashicorp.com/role: 'read-bridge'
spec:
serviceAccountName: read-bridge
containers:
- image: $IMAGE_TAG_RELEASE
imagePullPolicy: Always
name: bridge-validator-02
env:
- name: CONFIG_PATH
value: /opt/bridge/config/config.validator02.json
- name: VERBOSITY
value: "100"
ports:
- containerPort: 3000
protocol: TCP
resources:
requests:
memory: "500Mi"
cpu: "50m"
limits:
memory: "1000Mi"
cpu: "200m"
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: "/opt/bridge/config/"
name: bridge-validator
readOnly: true
volumes:
- name: bridge-validator
secret:
secretName: bridge-validator
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
59 changes: 59 additions & 0 deletions deploy/prod/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: bridge-indexer
namespace: crossbell
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 5
selector:
matchLabels:
app: bridge
tier: indexer
template:
metadata:
labels:
app: bridge
tier: indexer
spec:
containers:
- image: $IMAGE_TAG_RELEASE
imagePullPolicy: Always
name: bridge-indexer
env:
- name: CONFIG_PATH
value: /opt/bridge/config/config.indexer.json
- name: VERBOSITY
value: "100"
command:
- bridge
- --config
- /opt/bridge/config/config.indexer.json
- --verbosity
- "100"
ports:
- containerPort: 3000
protocol: TCP
resources:
requests:
memory: "100Mi"
cpu: "50m"
limits:
memory: "500Mi"
cpu: "200m"
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: "/opt/bridge/config/"
name: bridge-indexer
readOnly: true
volumes:
- name: bridge-indexer
secret:
secretName: bridge-indexer
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
5 changes: 5 additions & 0 deletions deploy/prod/sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: read-bridge
namespace: crossbell
166 changes: 166 additions & 0 deletions deploy/prod/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
apiVersion: v1
stringData:
config.indexer.json: |
{
"listeners": {
"Crossbell": {
"chainId": "0xE99",
"rpcUrl": "$RPC_CSB",
"slackUrl": "$CSB_SLACK_URL",
"domainSeparators": {
"3737": "",
"137": ""
},
"decimals": {
"3737": 18,
"137": 18
},
"blockTime": 1,
"safeBlockRange": 30,
"preventOmissionRange": 0,
"maxTasksQuery": 1000,
"minTasksQuery": 50,
"taskInterval": 15,
"transactionCheckPeriod": 15,
"secret": {
"validator": {
"plainPrivateKey": ""
}
},
"fromHeight": 25469431,
"contracts": {
"CrossbellGateway": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA"
},
"subscriptions": {
"WithdrawalRequestedSubscription": {
"to": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA",
"type": 1,
"handler": {
"contract": "CrossbellGateway",
"name": "RequestWithdrawal"
}
},
"StoreRequestWithdrawalSubscription": {
"to": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA",
"type": 1,
"handler": {
"contract": "CrossbellGateway",
"name": "RequestWithdrawal"
},
"callbacks": {
"Crossbell": "StoreRequestWithdrawal"
}
},
"DepositedSubscription": {
"to": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA",
"type": 1,
"handler": {
"contract": "CrossbellGateway",
"name": "Deposited"
},
"callbacks": {
"Crossbell": "StoreCrossbellDepositedCallback"
}
},
"DepositedDoneSubscription": {
"to": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA",
"type": 1,
"handler": {
"contract": "CrossbellGateway",
"name": "Deposited"
},
"callbacks": {
"Crossbell": "RequestDepositedDoneCallback"
}
},
"SubmitSignaturesSubscription": {
"to": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA",
"type": 1,
"handler": {
"contract": "CrossbellGateway",
"name": "SubmitWithdrawalSignatures"
},
"callbacks": {
"Crossbell": "StoreBatchSubmitWithdrawalSignatures"
}
},
"AckDepositSubscription": {
"to": "0x37b0CD884785320d8d2354c7Ae424b32391D50aA",
"type": 1,
"handler": {
"contract": "CrossbellGateway",
"name": "AckDeposit"
},
"callbacks": {
"Crossbell": "StoreDepositAck"
}
}
}
},
"Polygon": {
"disabled": false,
"chainId": "0x89",
"rpcUrl": "$RPC_POLYGON",
"slackUrl": "$CSB_SLACK_URL",
"blockTime": 2,
"safeBlockRange": 300,
"preventOmissionRange": 0,
"transactionCheckPeriod": 15,
"secret": {
"validator": {
"plainPrivateKey": ""
}
},
"fromHeight": 40027744,
"contracts": {
"MainchainGateway": "0x901F109c602D2D1f4c1B4a7236113CE090A4292a"
},
"subscriptions": {
"DepositRequestedSubscription": {
"to": "0x901F109c602D2D1f4c1B4a7236113CE090A4292a",
"type": 1,
"handler": {
"contract": "MainchainGateway",
"name": "RequestDeposit"
}
},
"StoreDepositRequestedSubscription": {
"to": "0x901F109c602D2D1f4c1B4a7236113CE090A4292a",
"type": 1,
"handler": {
"contract": "MainchainGateway",
"name": "RequestDeposit"
},
"callbacks": {
"Crossbell": "StoreRequestDeposit"
}
},
"RequestWithdrewDoneSubscription": {
"to": "0x901F109c602D2D1f4c1B4a7236113CE090A4292a",
"type": 1,
"handler": {
"contract": "MainchainGateway",
"name": "Withdrew"
},
"callbacks": {
"Crossbell": "RequestWithdrewDoneCallback",
"Polygon": "WithdrewDone2SlackCallback"
}
}
}
}
},
"database": {
"host": "$DB_HOST",
"user": "$DB_USER",
"password": "$DB_PASS",
"dbName": "relayer",
"port": 5432,
"maxOpenConns": 50
}
}
kind: Secret
metadata:
name: bridge-indexer
namespace: crossbell
type: Opaque
Loading

0 comments on commit 2f5993f

Please sign in to comment.