aws-samples / simple-nft-marketplace

This project provides sample codes to build a simple NFT marketplace with Amazon Managed Blockchain.
MIT No Attribution
95 stars 48 forks source link

feat(deploy): add automated script for deploy #7

Closed ryansonshine closed 2 years ago

ryansonshine commented 2 years ago

Issue #, if available: Closes #5

Description of changes: This change adds an automated script for deploying the infrastructure in this sample.

In the root directory of this project, run npm install then execute the deploy script by running ./deploy.js

Documentation has been added to the README.md in docs/en as well as docs/ja, however, the Japanese version will likely need edits from a native speaker.

A deploy-settings.json file gets created when a user runs the deploy script. This settings file is used to pass variables between stages and is also used to skip steps that have been completed previously in the event of needing to run the script more than once.

Docs Rendered - English Docs Rendered - Japanese

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

tbrand commented 2 years ago

It works very fine for me! Nice work @ryansonshine!!

Only one thing should be fixed I think. To change the deployment region, I needed to set AWS_DEFAULT_REGION=ap-northeast-1 to connect to AMB. Because AWSHttpProvider doesn't read profile and the default value is 'us-east-1'.

https://github.com/awslabs/aws-web3-http-provider/blob/main/index.js#L56

So you should mention about it in the docs or read the region from specified profile and set it to AWS_DEFAULT_REGION automatically.

ryansonshine commented 2 years ago

It works very fine for me! Nice work @ryansonshine!!

Only one thing should be fixed I think. To change the deployment region, I needed to set AWS_DEFAULT_REGION=ap-northeast-1 to connect to AMB. Because AWSHttpProvider doesn't read profile and the default value is 'us-east-1'.

https://github.com/awslabs/aws-web3-http-provider/blob/main/index.js#L56

So you should mention about it in the docs or read the region from specified profile and set it to AWS_DEFAULT_REGION automatically.

Great catch! I've updated the deploy script to pick up the region that the AMB node was deployed in.

tbrand commented 2 years ago

LGTM!