2020-07-01 10:35:30 +00:00
|
|
|
-include .env
|
|
|
|
|
2020-06-23 15:33:44 +00:00
|
|
|
RELAYER_DOCKER_FILE="./_assets/Dockerfile.relayer"
|
|
|
|
RELAYER_DOCKER_IMAGE="redeem-relayer"
|
2020-06-29 15:41:28 +00:00
|
|
|
RELAYER_DOCKER_CONTAINER_NAME="redeem-relayer"
|
|
|
|
CONTAINER_KEYSTORES_PATH="/usr/keystores"
|
2020-06-23 15:33:44 +00:00
|
|
|
|
2020-09-23 09:22:04 +00:00
|
|
|
compile-contracts:
|
|
|
|
truffle compile
|
|
|
|
|
|
|
|
deploy-contracts: compile-contracts
|
|
|
|
truffle deploy
|
2020-06-29 15:41:28 +00:00
|
|
|
|
|
|
|
check-relayer-env-variables:
|
|
|
|
ifndef ENDPOINT
|
|
|
|
$(error ENDPOINT is undefined)
|
|
|
|
endif
|
|
|
|
ifndef KEYSTORES_PATH
|
|
|
|
$(error KEYSTORES_PATH is undefined)
|
|
|
|
endif
|
2020-07-01 10:35:30 +00:00
|
|
|
ifndef BUCKET
|
|
|
|
$(error BUCKET is undefined)
|
2020-06-29 15:41:28 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
run-relayer: check-relayer-env-variables
|
2020-07-01 16:18:03 +00:00
|
|
|
env PORT=$(PORT) node scripts/relay.js \
|
2020-07-01 10:35:30 +00:00
|
|
|
--endpoint=$(ENDPOINT) \
|
2020-06-29 15:41:28 +00:00
|
|
|
--account=$(KEYSTORES_PATH)/keystore.json \
|
|
|
|
--passfile=$(KEYSTORES_PATH)/keystore-passfile.txt \
|
2020-07-01 10:35:30 +00:00
|
|
|
--bucket=$(BUCKET)
|
2020-06-29 15:41:28 +00:00
|
|
|
|
|
|
|
build-relayer-docker-image:
|
|
|
|
docker build -t $(RELAYER_DOCKER_IMAGE) -f $(RELAYER_DOCKER_FILE) .
|
|
|
|
|
|
|
|
docker-run-relayer: check-relayer-env-variables
|
|
|
|
docker run \
|
2020-07-01 10:49:00 +00:00
|
|
|
-d \
|
2020-06-29 15:41:28 +00:00
|
|
|
-v $$(realpath $(KEYSTORES_PATH)):$(CONTAINER_KEYSTORES_PATH) \
|
|
|
|
-e KEYSTORES_PATH=$(CONTAINER_KEYSTORES_PATH) \
|
|
|
|
-e ENDPOINT=$(ENDPOINT) \
|
2020-07-01 10:35:30 +00:00
|
|
|
-e BUCKET=$(BUCKET) \
|
2020-06-29 15:41:28 +00:00
|
|
|
-e PORT=$(PORT) \
|
|
|
|
--name $(RELAYER_DOCKER_CONTAINER_NAME) \
|
|
|
|
--rm \
|
2020-07-01 10:35:30 +00:00
|
|
|
-p $(PORT):$(PORT) \
|
2020-06-29 15:41:28 +00:00
|
|
|
$(RELAYER_DOCKER_IMAGE) make run-relayer
|
|
|
|
|
|
|
|
docker-kill-relayer:
|
|
|
|
docker kill $(RELAYER_DOCKER_CONTAINER_NAME)
|
|
|
|
|
|
|
|
docker-stop-relayer:
|
|
|
|
docker stop $(RELAYER_DOCKER_CONTAINER_NAME)
|
|
|
|
|
|
|
|
deploy-erc20-factory:
|
|
|
|
node scripts/create-redeemable.js \
|
2020-07-01 10:35:30 +00:00
|
|
|
--endpoint=$(ENDPOINT) \
|
2020-06-29 15:41:28 +00:00
|
|
|
--account=$(ACCOUNT) \
|
|
|
|
--passfile=$(PASSFILE) \
|
|
|
|
--deploy-factory
|
|
|
|
|
|
|
|
deploy-erc20-bucket:
|
|
|
|
node scripts/create-redeemable.js \
|
2020-07-01 10:35:30 +00:00
|
|
|
--endpoint=$(ENDPOINT) \
|
2020-06-29 15:41:28 +00:00
|
|
|
--account=$(ACCOUNT) \
|
|
|
|
--passfile=$(PASSFILE) \
|
|
|
|
--deploy-bucket \
|
|
|
|
--factory=$(ERC20_FACTORY) \
|
|
|
|
--token=$(ERC20_TOKEN_ADDRESS) \
|
|
|
|
--validity-in-days=$(ERC20_BUCKET_VALIDITY) \
|
2020-07-01 10:35:30 +00:00
|
|
|
--relayer-uri="$(RELAYER_URI)"
|
2020-06-29 15:41:28 +00:00
|
|
|
|
2020-07-01 10:35:30 +00:00
|
|
|
create-erc20-redeemables:
|
|
|
|
node scripts/create-redeemable.js \
|
|
|
|
--endpoint=$(ENDPOINT) \
|
|
|
|
--account=$(ACCOUNT) \
|
|
|
|
--passfile=$(PASSFILE) \
|
|
|
|
--file=$(ERC20_BUCKET_FILE) \
|
|
|
|
--bucket=$(BUCKET)
|