Boson Protocol Contracts – 玻色子协议区块链毕设代写
区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Boson Protocol Contracts – 玻色子协议区块链毕设代写 是一篇很好的国外资料
Boson Protocol Contracts
This is the place for smart contracts that are implementing Boson Protocol. You are invited to learn more about the project through its code and perhaps test locally how you might use it within your own project. When you are ready to integrate with Boson Protocol on a live network, you will soon be able to find the latest deployment details here, as well.
Note: the contracts are not yet deployed on Ethereum mainnet or other main networks.
For more details about how Boson Protocol works and how you might make use of it, please see the documentation site.
Table of Contents
- Local Development
- Testing
- Code Linting
- Documentation
- Contributing
- License
Local Development
Prerequisites
For local development of the contracts, your development machine will need a few tools installed.
At a minimum, you’ll need:
- Node (12.20)
- NPM (> 6)
- Ruby (2.7)
- Bundler (> 2)
- Git
- direnv
For instructions on how to get set up with these specific versions:
- See the OS X guide if you are on a Mac.
- See the Linux guide if you use a Linux distribution.
Running the build
We have a fully automated local build process to check that your changes are good to be merged. To run the build:
./go
By default, the build process fetches all dependencies, compiles, lints, formats and tests the codebase. There are also tasks for each step. This and subsequent sections provide more details of each of the tasks.
To fetch dependencies:
./go dependencies:install
To compile the contracts:
./go contracts:compile
Testing
Unit Tests
All contracts are thoroughly unit tested using Truffle’s JavaScript testing support.
To run the unit tests:
./go tests:unit
By default, the build system automates starting and stopping Ganache on a free port in the background ready for each test run.
If instead, you want to run the tests against an existing node, Ganache or otherwise, create a JSON file creating accounts in the same format as config/accounts.json
and execute:
./go "tests:unit[<port>,<path-to-accounts-json>]"
Coverage
We use solidity-coverage to provide test coverage reports.
To check the test coverage:
./go tests:coverage
solidity-coverage
runs its own instance of Ganache internally, as well as instrumenting contracts before running.
Interaction Tests
To run the interaction tests, follow the instructions in the interaction tests README.md.
Code Linting
Both the contracts themselves and the tests are linted and formatted as part of the build process.
For the contracts, we use:
- solhint for linting
- prettier-solidity for formatting
For the tests, we use:
- eslint for linting
- prettier for formatting
To lint the contracts:
./go contracts:lint
This will check if the linter is satisfied. If instead you want to attempt to automatically fix any linting issues:
./go contracts:lint_fix
To check the formatting of the contracts:
./go contracts:format
To automatically fix formatting issues:
./go contracts:format_fix
Similarly, for the tests, to perform the same tasks:
./go tests:lint ./go tests:lint_fix ./go tests:format ./go tests:format_fix
Documentation
For an overview of the contracts and their responsibilities, see Overview.
The whitepaper is available through the project’s website.
Contributing
We welcome contributions! Until now, Boson Protocol has been largely worked on by a small dedicated team. However, the ultimate goal is for all of the Boson Protocol repositories to be fully owned by the community and contributors. Issues, pull requests, suggestions, and any sort of involvement are more than welcome.
If you have noticed a bug, file an issue. If you have a large pull request, we recommend filing an issue first; small PRs are always welcome.
Questions are also welcome, as long as they are tech related. We can use them to improve our documentation.
All PRs must pass all tests before being merged.
By being in this community, you agree to the Code of Conduct. Take a look at it, if you haven’t already.
License
Licensed under LGPL v3.
玻色子协议契约
这是实现玻色子协议的智能合约的地方。我们邀请您通过它的代码了解更多关于这个项目的信息,也许您可以在本地测试如何在您自己的项目中使用它。当您准备好在一个实时网络上与Boson协议集成时,您很快就能在这里找到最新的部署细节。
注意:合同尚未部署在以太坊eth主网络或其他主网络上。
有关玻色子协议如何工作以及如何使用它的更多详细信息,请参阅文档网站。
目录
- 本地开发
- 测试
- 代码精简
- 文档
- 贡献
- 许可证
本地开发
先决条件
对于合同的本地开发,您的开发机器需要安装一些工具。
至少,您需要:
- 节点(12.20)
- NPM(>;6)
- Ruby(2.7)
- Bundler(>;2)
- direnv
- 如果您在Mac上,请参阅OS X指南。
有关如何设置这些特定版本的说明:
- 如果使用Linux发行版,请参阅《Linux指南》。
- 衣料的柔软度
运行构建
我们有一个完全自动化的本地生成过程来检查您的更改是否适合合并。要运行构建:
./go
默认情况下,构建过程获取所有依赖项、编译、lint、格式化和测试代码库。每个步骤都有任务。本节和后续部分提供了每个任务的更多详细信息。
获取依赖项:
./go dependencies:install
编译契约:
./go contracts:compile
测试
单元测试
覆盖
交互测试
代码筛选
文档
贡献
许可证
使用Truffle的JavaScript测试支持对所有契约进行彻底的单元测试。 要运行单元测试: 默认情况下,生成系统会在后台的空闲端口上自动启动和停止Ganache,以备每次测试运行。 如果您想对现有节点、Ganache或其他节点运行测试,请创建一个JSON文件,以与config相同的格式创建帐户/帐户.json并执行: 我们使用solidity coverage来提供测试覆盖率报告。 要检查测试覆盖率: solidity coverage在内部运行自己的Ganache实例,并在运行之前检测契约。 要运行交互测试,请按照交互测试中的说明进行操作自述文件.md. 作为构建过程的一部分,契约本身和测试都是lint和格式化的。 对于合同,我们使用: 对于测试,我们使用: 来整理合同: 这将检查整理是否满意。相反,如果您想尝试自动修复任何绒线问题: 要检查合同的格式: 要自动修复格式问题: 同样,对于测试,要执行相同的任务: 要查看合同及其责任的概述,参见概述。 欢迎投稿!到目前为止,玻色子协议主要是由一个小型的专门团队来完成的。然而,最终的目标是让所有的Boson协议存储库完全归社区和贡献者所有。问题、请求、建议和任何形式的参与都是非常受欢迎的。 如果您注意到一个bug,请提交一个问题。如果您有一个大的pull请求,我们建议您首先提交一个问题;小的pr总是受欢迎的。 只要与技术相关,也欢迎提问。我们可以用它们来改进我们的文档。 所有PRs必须通过所有测试才能合并。 加入这个社区,即表示您同意行为准则。看一看,如果你还没有。 根据LGPL v3许可。单元测试
./go tests:unit
./go "tests:unit[<port>,<path-to-accounts-json>]"
交互测试
./go tests:coverage
代码筛选
文档
./go contracts:lint
./go contracts:lint_fix
./go contracts:format
./go contracts:format_fix
./go tests:lint ./go tests:lint_fix ./go tests:format ./go tests:format_fix
贡献
白皮书可通过项目网站获取。许可证
License
部分转自网络,侵权联系删除区块链源码网
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Boson Protocol Contracts – 玻色子协议区块链毕设代写