基于区块链的毕业设计NFT-Minter – NFT薄荷糖

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计NFT-Minter – NFT薄荷糖 是一篇很好的国外资料

NFT-Minter

WIP - Unfinished as of this commit!

Serverless Framework Python Flask API on AWS

This template demonstrates how to develop and deploy a simple Python Flask API service running on AWS Lambda using the traditional Serverless Framework.

Anatomy of the template

This template configures a single function, api, which is responsible for handling all incoming requests thanks to configured http events. To learn more about http event configuration options, please refer to http event docs. As the events are configured in a way to accept all incoming requests, Flask framework is responsible for routing and handling requests internally. The implementation takes advantage of serverless-wsgi, which allows you to wrap WSGI applications such as Flask apps. To learn more about serverless-wsgi, please refer to corresponding GitHub repository. Additionally, the template relies on serverless-python-requirements plugin for packaging dependencies from requirements.txt file. For more details about serverless-python-requirements configuration, please refer to corresponding GitHub repository.

Usage

Prerequisites

In order to package your dependencies locally with serverless-python-requirements, you need to have Python3.8 installed locally. You can create and activate a dedicated virtual environment with the following command:

python3.8 -m venv ./venv source ./venv/bin/activate

Alternatively, you can also use dockerizePip configuration from serverless-python-requirements. For details on that, please refer to corresponding GitHub repository.

Deployment

This example is made to work with the Serverless Framework dashboard, which includes advanced features such as CI/CD, monitoring, metrics, etc.

In order to deploy with dashboard, you need to first login with:

serverless login 

install dependencies with:

npm install 

and

pip install -r requirements.txt 

and then perform deployment with:

serverless deploy 

After running deploy, you should see output similar to:

erverless: Using Python specified in "runtime": python3.8 Serverless: Packaging Python WSGI handler... Serverless: Generated requirements from /home/xxx/xxx/xxx/examples/aws-python-flask-api/requirements.txt in /home/xxx/xxx/xxx/examples/aws-python-flask-api/.serverless/requirements.txt... Serverless: Using static cache of requirements found at /home/xxx/.cache/serverless-python-requirements/62f10436f9a1bb8040df30ef2db5736c8015b18256bf0b6f1b0cbb2640030244_slspyc ... Serverless: Packaging service... Serverless: Excluding development dependencies... Serverless: Injecting required Python packages to package... Serverless: Creating Stack... Serverless: Checking Stack create progress... ........ Serverless: Stack create finished... Serverless: Uploading CloudFormation file to S3... Serverless: Uploading artifacts... Serverless: Uploading service aws-python-flask-api.zip file to S3 (1.3 MB)... Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... ................................. Serverless: Stack update finished... Service Information service: aws-python-flask-api stage: dev region: us-east-1 stack: aws-python-flask-api-dev resources: 12 api keys:   None endpoints:   ANY - https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/   ANY - https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/{proxy+} functions:   api: aws-python-flask-api-dev-api layers:   None

Note: In current form, after deployment, your API is public and can be invoked by anyone. For production deployments, you might want to configure an authorizer. For details on how to do that, refer to http event docs.

Invocation

After successful deployment, you can call the created application via HTTP:

curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/

Which should result in the following response:

{"message":"Hello from root!"} 

Calling the /hello path with:

curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/hello

Should result in the following response:

{"message":"Hello from path!"}

If you try to invoke a path or method that does not have a configured handler, e.g. with:

curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/nonexistent

You should receive the following response:

{"error":"Not Found!"}

Local development

Thanks to capabilities of serverless-wsgi, it is also possible to run your application locally, however, in order to do that, you will need to first install werkzeug dependency, as well as all other dependencies listed in requirements.txt. It is recommended to use a dedicated virtual environment for that purpose. You can install all needed dependencies with the following commands:

pip install werkzeug pip install -r requirements.txt

At this point, you can run your application locally with the following command:

serverless wsgi serve

For additional local development capabilities of serverless-wsgi plugin, please refer to corresponding GitHub repository.


NFT Minter

WIP-自提交之日起未完成

AWS上的无服务器框架Python Flask API

此模板演示如何使用传统的无服务器框架开发和部署在AWS Lambda上运行的简单Python Flask API服务

模板的剖析

此模板配置单个函数api,该函数负责处理所有传入的请求,这要归功于已配置的http事件。要了解有关http事件配置选项的更多信息,请参阅http事件文档。由于事件是以接受所有传入请求的方式配置的,Flask framework负责在内部路由和处理请求。该实现利用了无服务器wsgi,它允许您包装wsgi应用程序,如Flask应用程序。要了解有关无服务器wsgi的更多信息,请参考相应的GitHub存储库。此外,该模板依赖于无服务器python需求插件来打包requirements.txt文件中的依赖项。有关无服务器python需求配置的更多详细信息,请参阅相应的GitHub存储库

使用

先决条件

为了在本地用无服务器python需求打包依赖项,您需要在本地安装Python3.8。您可以使用以下命令创建和激活专用虚拟环境:

python3.8 -m venv ./venv source ./venv/bin/activate

或者,您也可以根据无服务器python要求使用dockerizePip配置。有关详细信息,请参阅相应的GitHub存储库

本地开发

此示例用于无服务器框架仪表板,其中包括高级功能,如CI/CD、监视、度量等。

为了与仪表板一起部署,您需要首先使用登录:

serverless login 

安装依赖项:

npm install 

pip install -r requirements.txt 

,然后使用执行部署:

serverless deploy 

运行部署后,您应该会看到类似的输出:

erverless: Using Python specified in "runtime": python3.8 Serverless: Packaging Python WSGI handler... Serverless: Generated requirements from /home/xxx/xxx/xxx/examples/aws-python-flask-api/requirements.txt in /home/xxx/xxx/xxx/examples/aws-python-flask-api/.serverless/requirements.txt... Serverless: Using static cache of requirements found at /home/xxx/.cache/serverless-python-requirements/62f10436f9a1bb8040df30ef2db5736c8015b18256bf0b6f1b0cbb2640030244_slspyc ... Serverless: Packaging service... Serverless: Excluding development dependencies... Serverless: Injecting required Python packages to package... Serverless: Creating Stack... Serverless: Checking Stack create progress... ........ Serverless: Stack create finished... Serverless: Uploading CloudFormation file to S3... Serverless: Uploading artifacts... Serverless: Uploading service aws-python-flask-api.zip file to S3 (1.3 MB)... Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... ................................. Serverless: Stack update finished... Service Information service: aws-python-flask-api stage: dev region: us-east-1 stack: aws-python-flask-api-dev resources: 12 api keys:   None endpoints:   ANY - https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/   ANY - https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/{proxy+} functions:   api: aws-python-flask-api-dev-api layers:   None

注意:在当前表单中,部署后,您的API是公共的,任何人都可以调用。对于生产部署,您可能需要配置授权者。有关如何执行此操作的详细信息,请参阅http事件文档

Invocation

成功部署后,您可以通过HTTP:

curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/

调用已创建的应用程序,这将导致以下响应:

{"message":"Hello from root!"} 

使用调用/hello路径:

curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/hello

将导致以下响应:

{"message":"Hello from path!"}

如果您尝试调用没有配置处理程序的路径或方法,例如,使用:

curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/nonexistent

您应该会收到以下响应:

{"error":"Not Found!"}

Local development

由于无服务器wsgi的功能,您也可以在本地运行应用程序,但是,为了做到这一点,您需要首先安装werkzeug依赖项以及requirements.txt中列出的所有其他依赖项。建议为此使用专用虚拟环境。您可以使用以下命令安装所有需要的依赖项:

pip install werkzeug pip install -r requirements.txt

此时,您可以使用以下命令在本地运行应用程序:

serverless wsgi serve

有关无服务器wsgi插件的其他本地开发功能,请参阅相应的GitHub存储库

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/24884.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计NFT-Minter – NFT薄荷糖

提供最优质的资源集合

立即查看 了解详情