npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iexec-poco

v5.0.0

Published

[![Build Status](https://drone.iex.ec/api/badges/iExecBlockchainComputing/PoCo-dev/status.svg)](https://drone.iex.ec/iExecBlockchainComputing/PoCo-dev)

Downloads

48

Readme

Build Status

Introduction

This repository contains the smart contract implementation of iExec's PoCo protocole.

Related articles on medium

PoCo UML

Documentation

How to?

Configure a deployment

Starting from version 5, the PoCo uses a modular design based on ERC1538. The migration scripts and tests will use different modules and deployment process depending on the required configuration. In particular, the configuration can use a create2 factory for the deployment, and enable native token or ERC20 token based escrow depending on the targeted blockchain. This means that the codebase is the same on public blockchains (ERC20 based RLC) and dedicated sidechains (Native token based RLC).

The configuration file is located in ./config/config.json.

It contains:

  • A list of categories created during the deployment process. Additional categories can be created by the contract administrator using the createCategory function.
  • For each chainid, a quick configuration:
    • "asset": can be "Token" or "Native", select which escrow to use.
    • "token": the address of the token to use. If asset is set to token, and no token address is provided, a mock will be deployed on the fly.
    • "v3": a list of ressources from a previous (v3) deployment. This allows previous ressources to be automatically available. It also enables score transfer from v3 to v5. [optional]
    • "v5": deployment parameters for the new version. If usefactory is set to true, and no salt is provided, a random salt will be used.

If you want to deploy the iExec PoCo V5 smart contracts on a new blockchain, the recommanded process is to:

  1. Edit the ./config/config.json file as follows:
  2. Create a new entry under "chains" with your chainid;
  3. Set the asset type depending on your blockchain;
  4. If you are using "asset": "Token", provide the address of the token you want to use;
  5. Unless you know what you are doing, leave all "v3" ressources to Null;
  6. Use the factory with the same salt as the other blockchains, and use the same wallet as previous deployments to have the same deployment address on this new blockchain.

Build

The PoCo smart contracts are in the ./contracts folder. Json artefacts, containing the contracts bytecode and ABI can be found in the ./build folder. In case you need to regenerate them, you can use the following command:

npm install
npm run build

Test

Automatic testing

The PoCo smart contracts come with a test suite in the ./test folder. You can startup a sandbox blockchain and run the tests using the following command:

npm install
npm run autotest fast

Additionnaly, you can produce a coverage report using the following command:

npm run coverage

The automatic testing command uses a ganache-cli blockchain instance to run the tests. You can also use your own blockchain endpoint to run these tests.

Testing on a custom blockchain

  1. Start your blockchain. You can either use ganache with the following command:
ganache-cli <any additional arguments>

or run any other blockchain client. 2. [Optional] If your blockchain listen to a port that is not 8545, or if the blockchain is on a different node, update the ./truffle.js configuration accordingly (see the documentation here). 3. Run the tests using:

npm run test

or

truffle test

Deploy

You can deploy the smart contracts according to the 3_deploy_contracts.js content. This will automatically save the addresses of the deployed artefacts to the ./build folder.

To do so:

  1. Make sure you followed the "Configure a deployment" section;
  2. Enter your targeted blockchain parameters in truffle.js configuration file;
  3. Run the deployment using:
npm run migrate -- --network <your network name>