Simple Benchmarking Contract – 简单基准合同区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Simple Benchmarking Contract – 简单基准合同区块链毕设代写 是一篇很好的国外资料

Simple Benchmarking Contract

Illustrates a pretty basic benchmarking contract.

The contract uses an upper and lower bound to validate the entry. Additionally the deploying party may choose an unit (i.e. Mio. €). The benchmarkees are deduplicated (one entry per benchmarkee). The benchmarkees are only pseudonymized by their address. Their entry is clearly visible via any Blockchain explorer. The sum is queriable after the 3rd entry at the moment.

Math is done via fixed point math with 19 – precision

The Typescript “Client” is intended for Node.JS usage and proofs at the moment, that connectivity is possible and that the average with multiple account via smart contract matches the locally calculated average.

Math with Ethereum

Suppose we have two numbers, 3.141592653589793238462643383279502884197169399375105820974944 and 1.123456789012345678901234567890. As Ethereum’s floating point math support is not quite usable yet, I diverted to using fixed point math by using https://github.com/hifi-finance/prb-math’s excellent library. The library “reserves” 19 digits of an integer to save the “after-comma part” (see the table below)

“pre-comma” part “after-comma” part (19 digits, everything gets truncated to 19)
3 1415926535897932384
1 1234567890123456789

Pi for example would be transmitted as 31415926535897932384, the number 2 as 20000000000000000000. This is expected and required to perform mathematical operations.

Using/Hosting the app (developer mode)

Dependencies:

Blockchain/Ethereum:

  • Ganache (Emulates an Ethereum Blockchain and provides 10 Accounts for usage) https://www.trufflesuite.com/ganache
  • Metamask Browser extension (provides underlying primitives for connecting to Ethereum/Ganache either via Infura or locally) https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=de

Webclient:

  • either Chrome or any Chromium related browser (i.e. Chromium Edge) [it might work on Firefox as well, although not tested]
  • Node.js > v12

Procedures:

Compiling the contract (in case something has changed)

Run npm install and then npx truffle compile in the contract directory. In case you are running windows copy the contracts like this: cp -r build/contracts ../client/src For running on bash compatible OS’es (i.E. Mac or Linux-derivatives) use the ./compile-contracts.sh script in the contracts folder

Start Ganache

Simple Benchmarking Contract - 简单基准合同 Use the Quickstart Ethereum option (this should suffice for development purposes)

Setup Metamask

Simple Benchmarking Contract - 简单基准合同

Attribut Wert
Network Name Ganache
New RPC URL http://127.0.0.1:7545
Chain ID 1337

Simple Benchmarking Contract - 简单基准合同

Key import from Ganache

Simple Benchmarking Contract - 简单基准合同

Simple Benchmarking Contract - 简单基准合同

Simple Benchmarking Contract - 简单基准合同

Simple Benchmarking Contract - 简单基准合同

Simple Benchmarking Contract - 简单基准合同

Start Web Frontend

Run npm run start

UML

Simple Benchmarking Contract - 简单基准合同

Licenses (generated by https://github.com/franciscop/legally)

Contract

Licenses (903)

License Number %
MIT 718 79
ISC 74 8
LGPL 3.0 21 2
BSD 2 Clause 19 2
Apache 2.0 16 1
BSD 3 Clause 16 1
CC0 12 1
W3C 5 0
JSON 4 0
MPL 2.0 3 0
0BSD 2 0
BSD 2 0
Unlicense 2 0
WTFPL 2 0
AFL 2.1 1 0
CC BY 3.0 1 0
GPL 2.0 1 0
MPL 1 0
Ruby 1 0
Zlib 1 0
later 1 0

Reports

1% of the dependencies are unlicensed (10/875)

Client

Licenses (1738)

License Number %
MIT 1394 80
ISC 103 5
BSD 2 Clause 46 2
BSD 3 Clause 41 2
CC0 41 2
Apache 2.0 35 2
W3C 22 1
LGPL 3.0 21 1
bzip2 5 0
BSD 4 0
JSON 4 0
WTFPL 4 0
GPL 2.0 3 0
MPL 2.0 3 0
0BSD 1 0
AFL 2.1 1 0
CC BY 3.0 1 0
CC BY 4.0 1 0
CC-BY 1 0
MPL 1 0
MPL 1.1 1 0
Public Domain 1 0
Ruby 1 0
Unlicense 1 0
Zlib 1 0
later 1 0

Reports

4% of the dependencies are unlicensed (79/1734)


使用/托管应用程序(开发人员模式)

依赖项:

过程:

编译契约(以防发生更改)

启动Ganache

设置元掩码

从Ganache导入密钥启动Web前端https://github.com/franciscop/legally)

合同

许可证(903)

报告

客户端

许可证(1738)

报告

  • Ganache(模拟以太坊eth区块链blockchain并提供10使用帐户)https://www.trufflesuite.com/ganache
  • 元掩码浏览器扩展(提供底层原语,用于通过Infura或本地连接到以太坊eth/Ganache)https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=de
  • Chrome或任何与Chrome相关的浏览器(即。Chromium Edge)[虽然未经测试,但也可以在Firefox上使用]
  • Node.js>v12
  • 3 1415926535897932384 1

    <1234567890123456789 网络名称http://127.0.0.1:7545 链ID 21 2 BSD 2条款 19 2

    <16 1

    3 0 MPL 1 0 1

    1 0 以后 <1

    <0

    <1394

    <80

    103 <5

    <46 CC-BY 1 0 MPL 1 0 MPL 1.1 1 0 公共域 1

    <0

    <1 <0 未授权 1 0

    说明了一个非常基本的基准合同

    合同使用上限和下限来验证条目。此外,部署方可以选择一个单位(即Mio)。€). 基准测试是重复数据消除的(每个基准测试一个条目)。标杆只是通过地址来化名。通过任何区块链blockchain浏览器都可以清楚地看到它们的条目。在第三个条目之后,可以查询该总和

    数学是通过19-精度的定点数学来完成的

    Typescript“Client”是为Node.JS使用而设计的,它证明了连接是可能的,并且通过智能合约多个帐户的平均值与本地计算的平均值相匹配

    依赖项:

    假设我们有两个数字,3.141592653589793238462643383279502884197169399375105820974944和1.12345678901234567890。由于以太坊eth的浮点数学支持还不太实用,我转而使用https://github.com/hifi-finance/prb-math这是一个极好的图书馆。库“保留”19位整数以保存“逗号后部分”(见下表)

    “pre-comma” part “after-comma” part (19 digits, everything gets truncated to 19)
    3 1415926535897932384
    1 网络名称http://127.0.0.1:7545 链ID

    例如Pi将被传输为31415926535897932384,数字2为2000000000000000。这是执行数学运算所需要的

    过程:

    编译契约(以防发生更改)

    区块链blockchain/以太坊eth

    • Ganache(模拟以太坊eth区块链blockchain并提供10使用帐户)https://www.trufflesuite.com/ganache
    • 元掩码浏览器扩展(提供底层原语,用于通过Infura或本地连接到以太坊eth/Ganache)https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=de

    网络客户端:

    • Chrome或任何与Chrome相关的浏览器(即。Chromium Edge)[虽然未经测试,但也可以在Firefox上使用]
    • Node.js&gt;v12

    启动Ganache

    设置元掩码

    运行npm install,然后在contract目录中编译npx truffle。如果您运行的是windows,请复制如下契约:cp-r build/contracts../client/src用于在bash兼容的操作系统(即Mac或Linux衍生产品)上运行,请使用contracts文件夹中的./compile-contracts.sh脚本

    从Ganache导入密钥启动Web前端https://github.com/franciscop/legally)

    合同

    许可证(903)

    报告

    客户端

    许可证(1738)

    报告

  • Ganache(模拟以太坊eth区块链blockchain并提供10使用帐户)https://www.trufflesuite.com/ganache
  • 元掩码浏览器扩展(提供底层原语,用于通过Infura或本地连接到以太坊eth/Ganache)https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=de
  • Chrome或任何与Chrome相关的浏览器(即。Chromium Edge)[虽然未经测试,但也可以在Firefox上使用]
  • Node.js&gt;v12
  • 3 1415926535897932384 1

    <1234567890123456789 网络名称http://127.0.0.1:7545 链ID 21 2 BSD 2条款 19 2

    <16 1

    3 0 MPL 1 0 1

    1 0 以后 <1

    <0

    <1394

    <80

    103 <5

    <46 CC-BY 1 0 MPL 1 0 MPL 1.1 1 0 公共域 1

    <0

    <1 <0 未授权 1 0

    Simple Benchmarking Contract - 简单基准合同使用快速启动以太坊eth选项(这应该足以满足开发目的)

    合同

    Simple Benchmarking Contract - 简单基准合同><<

    <<<<<Simple Benchmarking Contract<<<<<<<<<<<<<标签<<<<<<<<Simple Benchmarking Contract<<<<<<<<<<<<<<<<<<<<<

    4%其中的依赖项是未授权的(79/1734)

    Attribut Wert
    21 2
    BSD 2条款 19
    2 1

    Simple Benchmarking Contract - 简单基准合同

    许可证(903)

    Simple Benchmarking Contract - 简单基准合同

    Simple Benchmarking Contract - 简单基准合同

    Simple Benchmarking Contract - 简单基准合同

    Simple Benchmarking Contract - 简单基准合同

    Simple Benchmarking Contract - 简单基准合同

    报告

    Run npm run start

    客户端

    Simple Benchmarking Contract - 简单基准合同

    许可证(1738)

    报告

    Licenses (903)

    License Number %
    0 MPL 1
    0 1
    1 0 以后
    <1 103 <5
    CC-BY 1
    0 MPL 1
    0 MPL 1.1 1
    0 公共域 1
    <1 <0 未授权
    1 0 0
    0BSD 2 0
    BSD 2 0
    Unlicense 2 0
    WTFPL 2 0
    AFL 2.1 1 0
    CC BY 3.0 1 0
    GPL 2.0 1 0
    MPL 1 0
    Ruby 1 0
    Zlib 1 0
    later 1 0

    Reports

    1% of the dependencies are unlicensed (10/875)

    Client

    Licenses (1738)

    License Number %
    MIT 1394 80
    ISC 103 5
    BSD 2 Clause 46 2
    BSD 3 Clause 41 2
    CC0 41 2
    Apache 2.0 35 2
    W3C 22 1
    LGPL 3.0 21 1
    bzip2 5 0
    BSD 4 0
    JSON 4 0
    WTFPL 4 0
    GPL 2.0 3 0
    MPL 2.0 3 0
    0BSD 1 0
    AFL 2.1 1 0
    CC BY 3.0 1 0
    CC BY 4.0 1 0
    CC-BY 1 0
    MPL 1 0
    MPL 1.1 1 0
    Public Domain 1 0
    Ruby 1 0
    Unlicense 1 0
    Zlib 1 0
    later 1 0

    Reports

    4% of the dependencies are unlicensed (79/1734)

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

    www.interchains.cc

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

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

    提供最优质的资源集合

    立即查看 了解详情