Livepeer Protocol – Livepeer协议区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Livepeer Protocol – Livepeer协议区块链毕设代写 是一篇很好的国外资料

Livepeer Protocol - Livepeer协议 Livepeer Protocol - Livepeer协议

Livepeer Protocol

Ethereum smart contracts used for the Livepeer protocol. These contracts govern the logic for:

  • Livepeer Token (LPT) ownership
  • Bonding and delegating LPT to elect active workers
  • Distributing inflationary rewards and fees to active participants
  • Time progression in the protocol
  • ETH escrow and ticket validation for a probabilistic micropayment protocol used to pay for transcoding work

Documentation

For a general overview of the protocol see:

  • The whitepaper for the original proposal
  • The Streamflow proposal paper for the Streamflow scalability upgrade proposal

The contracts are based off of the technical protocol specification.

Development

All contributions and bug fixes are welcome as pull requests back into the repo.

ERC20 Note

The Livepeer token is implemented as an ERC20 token in token/LivepeerToken.sol which inherits from the OpenZeppelin ERC20 token contract and all implemented ERC20 functions will revert if the operation is not successful. However, the ERC20 spec does not require functions to revert and instead requires functions to return true if the operation succeed and false if the operation fails. The contracts bonding/BondingManager.sol and token/Minter.sol do not check the return value of ERC20 functions and instead assume that they will revert if the operation fails. The Livepeer token contract is already deployed on mainnet and its implementation should not change so this is not a problem. However, if for some reason the implementation ever does change, developers should keep in mind that bonding/BondingManager.sol and token/Minter.sol do not check the return value of ERC20 functions.

ABIEncoderV2 Note

At the moment, the following contract files use the experimental ABIEncoderV2 Solidity compiler feature:

  • pm/TicketBroker.sol
  • pm/MReserve.sol
  • pm/MixinReserve.sol
  • pm/MixinTicketBrokerCore.sol
  • pm/MixinWrappers.sol

There have been bugs related to ABIEncoderV2 in the past and it is still experimental so developers should pay attention to the list of bugs associated with ABIEncoderV2 when making any contract code changes that involve ABIEncoderV2 and should make sure to use a compiler version with the necessary fixes. The primary motivation behind enabling ABIEncoderV2 in these contract files is to allow for Solidity structs to be passed as function arguments.

Install

Make sure Node.js v10.17.0 is installed.

git clone https://github.com/livepeer/protocol.git cd protocol npm install 

Build

Compile the contracts and build artifacts used for testing and deployment.

npm run compile 

Clean

Remove existing build artifacts.

npm run clean 

Lint

The project uses ESLint for Javascript linting and Solium for Solidity linting.

npm run lint 

Run Tests

All tests will be executed against an instance of ganache-cli.

To run all tests:

npm run test 

To run unit tests only:

npm run test:unit 

To run integration tests only:

npm run test:integration 

To run gas reporting tests (via eth-gas-reporter) only:

npm run test:gas 

To run tests with coverage (via solidity-coverage) reporting:

npm run test:coverage 

Deployment

Make sure that an ETH node is accessible and that the network being deployed to is supported by the truffle.js configuration.

npm run migrate 

Move CI from Circle to Github actions (


用于Livepeer协议的以太坊eth智能合约。这些合同控制以下逻辑:

Livepeer协议

有关协议的一般概述,请参阅:

  • 协议中的时间进度
  • 用于支付转码工作的概率小额支付协议的ETH托管和票据验证流量可扩展性升级建议
  • pm/TicketBroker.sol
  • pm/MReserve.sol
  • pm/MixinReserve.sol

文档

合同基于技术协议规范

  • pm/MixinTicketBrokerCore.sol
  • The Streamflow proposal paper for the Streamflow scalability upgrade proposal

欢迎所有贡献和错误修复,将请求拉回到回购协议中

开发

Livepeer令牌在token/LivepeerToken.sol中实现为ERC20令牌,该令牌继承自OpenZeppelin ERC20令牌契约,如果操作不成功,所有实现的ERC20函数将恢复。但是,ERC20规范不要求函数还原,而是要求函数在操作成功时返回true,在操作失败时返回false。契约bonding/BondingManager.sol和token/Minter.sol不检查ERC20函数的返回值,而是假设如果操作失败,它们将恢复。Livepeer令牌契约已部署在mainnet上,其实现不应更改,因此这不是问题。但是,如果由于某种原因实现发生了变化,开发人员应该记住bonding/BondingManager.sol和token/Minter.sol不会检查ERC20函数的返回值

ERC20注释

目前,以下合同文件使用了实验性的Abinecoderv2 Solidity编译器功能:

ABIEncoderV2 Note

过去有一些与Abinecoderv2相关的bug,它仍然是实验性的,因此开发人员在进行任何涉及Abinecoderv2的合同代码更改时,应该注意与Abinecoderv2相关的bug列表,并且应该确保使用带有必要修复的编译器版本。在这些契约文件中启用ABIEncoderV2的主要动机是允许Solidity结构作为函数参数传递

  • pm/TicketBroker.sol
  • pm/MReserve.sol
  • pm/MixinReserve.sol
  • pm/MixinTicketBrokerCore.sol
  • pm/MixinWrappers.sol

确保安装了Node.js v10.17.0

Install

编译契约并构建用于测试和部署的工件

git clone https://github.com/livepeer/protocol.git cd protocol npm install 

Build

删除现有的构建工件

npm run compile 

Clean

该项目使用ESLint进行Javascript脱毛,使用Solium进行坚固性脱毛

npm run clean 

Lint

所有测试都将针对ganache cli实例执行

npm run lint 

Run Tests

要运行所有测试:

要仅运行单元测试:

npm run test 

要仅运行集成测试:

npm run test:unit 

要仅运行气体报告测试(通过eth气体报告器):

npm run test:integration 

要运行覆盖测试(通过实体覆盖)报告:

npm run test:gas 

确保eth节点可访问,并且部署到的网络受truffle.js配置

npm run test:coverage 

Deployment

Make sure that an ETH node is accessible and that the network being deployed to is supported by the truffle.js configuration.

npm run migrate 

Move CI from Circle to Github actions (

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情