-SafeRouterMoon – -安全路线月区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,-SafeRouterMoon – -安全路线月区块链毕设代写 是一篇很好的国外资料

-SafeRouterMoon

Easily seed initial data to smart contracts using this npm package

Installation

via npm

npm i --save @libertypie/truffle-seeder

via yarn

yarn add  @libertypie/truffle-seeder

Usage

Create new seed file

yarn seeder-init --contract HelloContract --method SetHelloMethod

the –contract is the contract you are targeting (eg. HelloContract)
and –method is the method or function in the targeted contract

after the seed files has been created, check the seeds folder in your project root and edit the file in the files sub folder

below is a sample of how a seed file looks like

module.exports = {     contract: 'HelloContract',     method:   'SetHelloMethod',     data: [         /*           * to seed args multiple times, add extra arrays          ['arg1','arg2',...'argn'],          ['arg1', 'arg2'...'argn']         */     ] }

You add the args using an array inside the data array as shown

Seed File Options

contract:

The name of the contract you are targeting, it should exist in truffle build folder

method:

The method or function in the targetted contract where the data will be fed to

processor:

The processor is the function responsible for processing the data and calling the method/function from the contract The default processor is located at src/processors/StandardSeedProcessor.js

below is a seed file with a custom processor

module.exports = {     contract: 'HelloContract',     method:   'SetHelloMethod',     processor: customDataProcessor,     data: [         /*           * to seed args multiple times, add extra arrays          ['arg1','arg2',...'argn'],          ['arg1', 'arg2'...'argn']         */     ] }  // customDataProcessor customDataProcessor = async ({     contractName,     contractInstance,      contractMethod,      argsArray,     networkId,     web3,     web3Account }) => {   //process and insert data here  }

Seeding the data

To seed the data to the contract’s method, you will run the command below

 yarn seeder-run 

About

The npm package is developed maintained by the team at LibertyPie Project

Contribution

To contribute, kindly fork the project, at project root create a dev.env file, insert APP_ROOT_DIR pointint to your truffle project where testing will be done, example:

 APP_ROOT_DIR=/path/to/truffle/solidity/project 

-SafeRouterMoon

使用此npm包可以轻松地将初始数据播种到智能合约中–contract是您要针对的合约(例如HelloContract)
并且–method是创建种子文件后目标合约中的方法或函数,检查项目根目录中的seeds文件夹并编辑files子文件夹中的文件

安装

通过npm

npm i --save @libertypie/truffle-seeder

通过yarn

yarn add  @libertypie/truffle-seeder

使用

创建新的种子文件

yarn seeder-init --contract HelloContract --method SetHelloMethod

下面是seed文件的外观示例

您使用数据数组中的数组添加参数,如图所示

目标合约的名称,它应该存在于truffle build文件夹中

module.exports = {     contract: 'HelloContract',     method:   'SetHelloMethod',     data: [         /*           * to seed args multiple times, add extra arrays          ['arg1','arg2',...'argn'],          ['arg1', 'arg2'...'argn']         */     ] }

目标合约中的方法或函数,其中数据将被馈送到

种子文件选项

合同:

处理器是负责处理数据并从合约中调用方法/函数的函数默认处理器位于下面的src/processors/StandardSeedProcessor.js

方法:

是一个带有自定义处理器的种子文件

处理器:

要将数据种子化到合同的方法中,您将运行下面的命令

npm包是由LibertyPie项目的团队开发和维护的,将APPu ROOTu DIR pointint插入将要进行测试的块菌项目,示例:

module.exports = {     contract: 'HelloContract',     method:   'SetHelloMethod',     processor: customDataProcessor,     data: [         /*           * to seed args multiple times, add extra arrays          ['arg1','arg2',...'argn'],          ['arg1', 'arg2'...'argn']         */     ] }  // customDataProcessor customDataProcessor = async ({     contractName,     contractInstance,      contractMethod,      argsArray,     networkId,     web3,     web3Account }) => {   //process and insert data here  }

种子数据

To seed the data to the contract’s method, you will run the command below

 yarn seeder-run 

关于

The npm package is developed maintained by the team at LibertyPie Project

贡献

To contribute, kindly fork the project, at project root create a dev.env file, insert APP_ROOT_DIR pointint to your truffle project where testing will be done, example:

 APP_ROOT_DIR=/path/to/truffle/solidity/project 

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情