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

truffle-conflux-sawtooth-seth-provider

v0.0.2-alpha.0

Published

A web3 provider which makes it possible to connect Truffle with Sawtooth Seth blockchains.

Downloads

6

Readme

ALPHA - UNPUBLISHED - EXPERIMENTAL USE ONLY

This module is an early work in progress. For the moment it is totally unsupported and should only be used in an experimental context.

truffle-conflux-sawtooth-seth-provider

A web3 provider which makes it possible to connect Truffle with Sawtooth Seth blockchains.

Supported operations

We intend to add support for all operations listed below, but items with a ❌ are yet to be completed.

  • truffle migrate ✔️
  • Use with truffle-conflux-contract in browser ✔️
  • truffle test ✔️ (if running against seth build which includes hyperledger/sawtooth-seth#77)
  • truffle debug

Important differences between Sawtooth Seth and Core Ethereum

It's important to know that Seth doesn't behave exactly like core Ethereum. An incomplete list of these differences is below.

  • No status flags on transaction receipt.
  • Transaction receipts contain the transaction's return data.
  • No support for the REVERT opcode.
  • Gas price is always 0.
  • Much larger block and transaction hashes.
  • Sawtooth's underlying data structure is a Radix Merkle Tree instead of a Merkle Patricia Tree.
  • Blocks aren't mined in Sawtooth, they're validated by a central validator network.
  • You must enable the BlockInfo Transaction Family if your contracts reqire the ability to read blockchain metadata (e.g. the previous block's hash).

For a more comprehensive understanding of Sawtooth's architecture, please see the Architecture Description section of Sawtooth's documentation site.

Library usage

Installation

npm install --save-dev truffle-conflux-sawtooth-seth-provider

Truffle configuration

Example truffle-conflux-config.js:

const SethProvider = require('truffle-conflux-sawtooth-seth-provider');

module.exports = {
  networks: {
    seth: {
      provider: new SethProvider('http://127.0.0.1:3030'),
      network_id: "*" // Match any network id
    }
  }
};

Usage in the browser with Webpack

Webpack is highly recommended for frontend usage. This README won't cover how to set up webpack for your project, as each project is different. However, when packing truffle-sawtoot-seth-provider you may see an error about an inability to resolve the fs module. The fs module isn't required for frontend use, so you can safely work around this error message by adding the following to your webpack configuration:

node: {
   fs: "empty"
}

Troubleshooting

Printing RPC requests and responses

This module makes use of the debug module to print RPC requests and responses. The debug module key for this module is SethProvider.

To enable RPC request/response output on the command line, ensure your DEBUG environment variable contains SethProvider:RPC.

To enable RPC request/response output in the browser, open your debugging console and run localStorage.debug = 'SethProvider:RPC' and refresh the page.

For more on how to use the debug module, see the Usage section in the debug module's README.