FISCO BCOS Toolbox – FISCO BCOS工具箱区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,FISCO BCOS Toolbox – FISCO BCOS工具箱区块链毕设代写 是一篇很好的国外资料

FISCO BCOS Toolbox

FISCO BCOS Toolbox - FISCO BCOS工具箱

FISCO BCOS Toolbox created by SUIBE-Blockchain-Team.

由上海对外经贸大学区块链blockchain技术与应用研究中心研发的针对 FISCO BCOS 的工具箱。

DEMO: https://tools.doge.university/

FISCO BCOS Toolbox - FISCO BCOS工具箱 FISCO BCOS Toolbox - FISCO BCOS工具箱 FISCO BCOS Toolbox - FISCO BCOS工具箱 FISCO BCOS Toolbox - FISCO BCOS工具箱

内容包括:

  • FISCO BCOS 地址生成(已完成)
  • SDK Config 在线生成 (已完成)
  • 开发中的数据模拟(构建中)
  • 智能合约案例合集(构建中)
  • SDK 功能通过WEB页面调用(构建中) ……

环境变量文件见.envrc

FISCO BCOS Toolbox - FISCO BCOS工具箱

Contributors

FISCO BCOS Toolbox - FISCO BCOS工具箱
李大狗
💻
FISCO BCOS Toolbox - FISCO BCOS工具箱
HuiFeng Tang
💻
FISCO BCOS Toolbox - FISCO BCOS工具箱
Mu Li
💻

Docker Quickstart

This app can be run completely using Docker and docker-compose. Using Docker is recommended, as it guarantees the application is run using compatible versions of Python and Node.

There are three main services:

To run the development version of the app

docker-compose up flask-dev

To run the production version of the app

docker-compose up flask-prod

The list of environment: variables in the docker-compose.yml file takes precedence over any variables specified in .env.

To run any commands using the Flask CLI

docker-compose run --rm manage <<COMMAND>>

Therefore, to initialize a database you would run

docker-compose run --rm manage db init docker-compose run --rm manage db migrate docker-compose run --rm manage db upgrade

A docker volume node-modules is created to store NPM packages and is reused across the dev and prod versions of the application. For the purposes of DB testing with sqlite, the file dev.db is mounted to all containers. This volume mount should be removed from docker-compose.yml if a production DB server is used.

Running locally

Run the following commands to bootstrap your environment if you are unable to run the application using Docker

cd fisco_bcos_toolbox pip install -r requirements/dev.txt npm install npm start  # run the webpack dev server and flask server using concurrently

You will see a pretty welcome screen.

Database Initialization (locally)

Once you have installed your DBMS, run the following to create your app’s database tables and perform the initial migration

flask db init flask db migrate flask db upgrade

Deployment

When using Docker, reasonable production defaults are set in docker-compose.yml

FLASK_ENV=production FLASK_DEBUG=0 

Therefore, starting the app in “production” mode is as simple as

docker-compose up flask-prod

If running without Docker

export FLASK_ENV=production export FLASK_DEBUG=0 export DATABASE_URL="<YOUR DATABASE URL>" npm run build   # build assets with webpack flask run       # start the flask server

Shell

To open the interactive shell, run

docker-compose run --rm manage db shell flask shell # If running locally without Docker

By default, you will have access to the flask app.

Running Tests/Linter

To run all tests, run

docker-compose run --rm manage test flask test # If running locally without Docker

To run the linter, run

docker-compose run --rm manage lint flask lint # If running locally without Docker

The lint command will attempt to fix any linting/style errors in the code. If you only want to know if the code will pass CI and do not wish for the linter to make changes, add the --check argument.

Migrations

Whenever a database migration needs to be made. Run the following commands

docker-compose run --rm manage db migrate flask db migrate # If running locally without Docker

This will generate a new migration script. Then run

docker-compose run --rm manage db upgrade flask db upgrade # If running locally without Docker

To apply the migration.

For a full migration command reference, run docker-compose run --rm manage db --help.

If you will deploy your application remotely (e.g on Heroku) you should add the migrations folder to version control. You can do this after flask db migrate by running the following commands

git add migrations/* git commit -m "Add migrations"

Make sure folder migrations/versions is not empty.

Asset Management

Files placed inside the assets directory and its subdirectories (excluding js and css) will be copied by webpack’s file-loader into the static/build directory. In production, the plugin Flask-Static-Digest zips the webpack content and tags them with a MD5 hash. As a result, you must use the static_url_for function when including static content, as it resolves the correct file name, including the MD5 hash. For example

<link rel="shortcut icon" href="{{static_url_for('static', filename='build/img/favicon.ico') }}">

If all of your static files are managed this way, then their filenames will change whenever their contents do, and you can ask Flask to tell web browsers that they should cache all your assets forever by including the following line in .env:

SEND_FILE_MAX_AGE_DEFAULT=31556926  # one year 

FISCO BCOS Toolbox

FISCO BCOS Toolbox - FISCO BCOS工具箱

SUIBE区块链blockchain团队创建的FISCO BCOS工具箱。演示:https://tools.doge.university/

<FISCO BCOS Toolbox><FISCO BCOS Toolbox><FISCO BCOS Toolbox><FISCO BCOS Toolbox><FISCO BCOS Toolbox><FISCO BCOS Toolbox>

FISCO BCOS Toolbox - FISCO BCOS工具箱

使用Docker和Docker compose可以完全运行此应用程序。建议使用Docker,因为它可以保证应用程序使用Python和Node的兼容版本运行。

有三个主要服务:

运行应用程序的开发版本

运行应用程序的生产版本

环境列表:docker中的变量-合成.yml文件优先于.env中指定的任何变量。

要使用Flask CLI运行任何命令,因此,要初始化要运行的数据库,将创建docker卷节点模块来存储NPM包,并在应用程序的dev和prod版本中重用。为了使用sqlite进行数据库测试,文件开发数据库安装在所有容器上。应该从docker中删除此卷装入-合成.yml如果使用生产数据库服务器。

如果无法使用Docker运行应用程序,请运行以下命令来引导您的环境

您将看到一个非常欢迎的屏幕。

安装DBMS后,运行以下操作创建应用程序的数据库表并执行初始迁移

使用Docker时,Docker中会设置合理的生产默认值-合成.yml因此,在“生产”模式下启动应用程序很简单

如果不使用Docker运行

要打开交互式shell,请在默认情况下运行

即可访问flask应用程序。

要运行所有测试,请运行

要运行linter,请运行

lint命令将尝试修复代码中的任何linting/style错误。如果只想知道代码是否会传递CI,并且不希望linter进行更改,请添加–check参数。

每当需要进行数据库迁移时。运行以下命令

这将生成一个新的迁移脚本。然后运行

来应用迁移。

要获得完整的迁移命令参考,请运行docker compose run–rm manage db–help。

如果要远程部署应用程序(例如在Heroku上),则应将migrations文件夹添加到版本控制中。您可以在flask db migrate之后执行以下命令

确保folder migrations/versions不为空。

放置在assets目录及其子目录(不包括js和css)中的文件将被webpack的文件加载器复制到static/build目录中。在生产中,插件Flask Static Digest对webpack内容进行zip,并用MD5散列标记它们。因此,在包含静态内容时,必须使用static_url_for函数,因为它解析正确的文件名,包括MD5哈希。例如,

如果您的所有静态文件都是这样管理的,那么它们的文件名将随内容而改变,您可以要求Flask告诉web浏览器,他们应该永远缓存您的所有资产,方法是在.env中包含以下行:

FISCO BCOS Toolbox

贡献者

Docker Quickstart

在本地运行

数据库初始化(本地)

部署(英文)💻 FISCO BCOS Toolbox - FISCO BCOS工具箱
汤慧峰
💻 FISCO BCOS Toolbox - FISCO BCOS工具箱
muli
💻 在

FISCO BCOS Toolbox - FISCO BCOS工具箱

使用Docker和Docker compose可以完全运行此应用程序。建议使用Docker,因为它可以保证应用程序使用Python和Node的兼容版本运行。

有三个主要服务:

  • FISCO BCOS 地址生成(已完成)
  • SDK Config 在线生成 (已完成)
  • 开发中的数据模拟(构建中)
  • 智能合约案例合集(构建中)
  • SDK 功能通过WEB页面调用(构建中) ……

运行应用程序的开发版本

运行应用程序的生产版本

贡献者

FISCO BCOS Toolbox - FISCO BCOS工具箱
汤慧峰
💻
FISCO BCOS Toolbox - FISCO BCOS工具箱
muli
💻 在
FISCO BCOS Toolbox - FISCO BCOS工具箱
Mu Li
💻

Docker Quickstart

环境列表:docker中的变量-合成.yml文件优先于.env中指定的任何变量。

要使用Flask CLI运行任何命令,因此,要初始化要运行的数据库,将创建docker卷节点模块来存储NPM包,并在应用程序的dev和prod版本中重用。为了使用sqlite进行数据库测试,文件开发数据库安装在所有容器上。应该从docker中删除此卷装入-合成.yml如果使用生产数据库服务器。

如果无法使用Docker运行应用程序,请运行以下命令来引导您的环境

docker-compose up flask-dev

您将看到一个非常欢迎的屏幕。

docker-compose up flask-prod

安装DBMS后,运行以下操作创建应用程序的数据库表并执行初始迁移

使用Docker时,Docker中会设置合理的生产默认值-合成.yml因此,在“生产”模式下启动应用程序很简单

docker-compose run --rm manage <<COMMAND>>

如果不使用Docker运行

docker-compose run --rm manage db init docker-compose run --rm manage db migrate docker-compose run --rm manage db upgrade

要打开交互式shell,请在默认情况下运行

在本地运行

即可访问flask应用程序。

cd fisco_bcos_toolbox pip install -r requirements/dev.txt npm install npm start  # run the webpack dev server and flask server using concurrently

要运行所有测试,请运行

数据库初始化(本地)

要运行linter,请运行

flask db init flask db migrate flask db upgrade

部署(英文)💻 FISCO BCOS Toolbox - FISCO BCOS工具箱
汤慧峰
💻 FISCO BCOS Toolbox - FISCO BCOS工具箱
muli
💻 在

lint命令将尝试修复代码中的任何linting/style错误。如果只想知道代码是否会传递CI,并且不希望linter进行更改,请添加–check参数。

FLASK_ENV=production FLASK_DEBUG=0 

每当需要进行数据库迁移时。运行以下命令

docker-compose up flask-prod

这将生成一个新的迁移脚本。然后运行

export FLASK_ENV=production export FLASK_DEBUG=0 export DATABASE_URL="<YOUR DATABASE URL>" npm run build   # build assets with webpack flask run       # start the flask server

Shell

来应用迁移。

docker-compose run --rm manage db shell flask shell # If running locally without Docker

要获得完整的迁移命令参考,请运行docker compose run–rm manage db–help。

Running Tests/Linter

如果要远程部署应用程序(例如在Heroku上),则应将migrations文件夹添加到版本控制中。您可以在flask db migrate之后执行以下命令

docker-compose run --rm manage test flask test # If running locally without Docker

确保folder migrations/versions不为空。

docker-compose run --rm manage lint flask lint # If running locally without Docker

放置在assets目录及其子目录(不包括js和css)中的文件将被webpack的文件加载器复制到static/build目录中。在生产中,插件Flask Static Digest对webpack内容进行zip,并用MD5散列标记它们。因此,在包含静态内容时,必须使用static_url_for函数,因为它解析正确的文件名,包括MD5哈希。例如,

Migrations

如果您的所有静态文件都是这样管理的,那么它们的文件名将随内容而改变,您可以要求Flask告诉web浏览器,他们应该永远缓存您的所有资产,方法是在.env中包含以下行:

docker-compose run --rm manage db migrate flask db migrate # If running locally without Docker

This will generate a new migration script. Then run

docker-compose run --rm manage db upgrade flask db upgrade # If running locally without Docker

To apply the migration.

For a full migration command reference, run docker-compose run --rm manage db --help.

If you will deploy your application remotely (e.g on Heroku) you should add the migrations folder to version control. You can do this after flask db migrate by running the following commands

git add migrations/* git commit -m "Add migrations"

Make sure folder migrations/versions is not empty.

Asset Management

Files placed inside the assets directory and its subdirectories (excluding js and css) will be copied by webpack’s file-loader into the static/build directory. In production, the plugin Flask-Static-Digest zips the webpack content and tags them with a MD5 hash. As a result, you must use the static_url_for function when including static content, as it resolves the correct file name, including the MD5 hash. For example

<link rel="shortcut icon" href="{{static_url_for('static', filename='build/img/favicon.ico') }}">

If all of your static files are managed this way, then their filenames will change whenever their contents do, and you can ask Flask to tell web browsers that they should cache all your assets forever by including the following line in .env:

SEND_FILE_MAX_AGE_DEFAULT=31556926  # one year 

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » FISCO BCOS Toolbox – FISCO BCOS工具箱区块链毕设代写

提供最优质的资源集合

立即查看 了解详情