Skip to content

Commit

Permalink
Separate prod and dev env for batch submitter (#122)
Browse files Browse the repository at this point in the history
* kms in bs

* KMS only

* cleanup 1

* rm prvt keys checks

* correct address to proposer

* cleanup + add req env vars

* fix flags tests

* start KMS soon

* rm dead code, pull KMS before the stack starts up

* start KMS and wait for it

* bump urface/cli

* logs kms, clear cache

* restart batch submitter on error

* env var credentials

* fix tests for pending tx

* comments in dc

* log

* Separate prod and dev env

* Fix lint

* Remove KMS waiting script

* Use default session settings

* Add KMS region

Co-authored-by: Ino Murko <ino@enya.ai>
Co-authored-by: CAPtheorem <79423264+CAPtheorem@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 25, 2022
1 parent 6dbc72a commit 56fd18c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 6 additions & 0 deletions go/batch-submitter/batch_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ func Main(gitVersion string) func(ctx *cli.Context) error {
Region: aws.String(cfg.KmsRegion),
Endpoint: aws.String(cfg.KmsEndpoint)},
)
// AWS uses IAM role for task
if cfg.BuildEnv == "production" {
sess, _ = session.NewSession(&aws.Config{
Region: aws.String(cfg.KmsRegion)},
)
}
svc := kms.New(sess)
var services []*bsscore.Service
if cfg.RunTxBatchSubmitter {
Expand Down
14 changes: 0 additions & 14 deletions ops/scripts/batch-submitter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,5 @@ curl --fail \
--output /dev/null \
$L2_ETH_RPC

echo "waits for kms to be up"
curl \
-X POST \
--silent \
--fail \
--show-error \
-H "Content-Type: application/json" \
-H "X-Amz-Target:TrentService.ListKeys" \
--retry-connrefused \
--retry $RETRIES \
--retry-delay 3 \
--output /dev/null \
$BATCH_SUBMITTER_KMS_ENDPOINT

# go
exec batch-submitter "$@"

0 comments on commit 56fd18c

Please sign in to comment.