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

decyphertv

v0.1.19

Published

CLI for helper libraries to follow along with the decypher.tv ethereum screencast series

Downloads

8

Readme

DecypherTV

A simple library for interacting with the Ethereum blockchain without needing to run your own node. This library is intended to be used as a command-line interface to follow along with the Ethereum Ðapp Development series on http://decypher.tv/series/ethereum-development - but the library can also be used as a simple command line interface into Ethereum for your own purposes.

Installation

This library is going to be changing constantly, however there will be a snapshot of the current state of the library at the time each episode was recorded available.

To install the specific version used in an episode

$ npm install -g [email protected].{episodeNumber}

To simply install the latest version

$ npm install -g decyphertv

Usage

There are two modes. Local and Remote. Local assumes that you are running your own node locally (via testrpc, geth, or parity). Remote assumes that you are transacting to a remote node running on a different computer (via infura, blockcypher, or any custom endpoint)

Start Shell (Local)

To start a shell that is connected to a local node. Pass the flags -m local and -e endpoint where endpoint is the URL of the node
$ decypher -m local -e ${endpoint}
$ decypher -m local -e http://localhost:8545

Start Shell (Remote)

To start a shell that is connected to a remote node. Pass the flags -m remote and -e endpoint where endpoint is the URL of the node
$ decypher -m remote -e ${endpoint}
$ decypher -m remote -e https://mainnet.infura.io/123

Globals Loaded

NPM Package | Global Variable ------------- | ------------- solc | solc ethereumjs-tx | EthTx ethereumjs-util | EthUtil web3 (class) | Web3 web3 (instance) | web3

Helper Methods

The contract source can either be a string of the contract code, or a relative/absolute path to a .sol solidity file.

decypher.opcodes(source)
decypher.abi(source)
decypher.contract(source)
decypher.deployed(source, address)
decypher.etherBalance(contract|account)

Contract Calls (Remote)

All contract calls take an optional final parameter of an options hash that can override the defaults

// Function Signature
decypher.sendEther({to, value}, options={})

// Example Usage
decypher.sendEther({to: "0xC46CDe805aCC8e7507E53E36486C7D8600559d65", value: web3.toWei(1, 'ether')}, {gas: 21000})
// Function Signature
decypher.deployContract(source, params=[], options={})

// Example Usage
var source = `contract HelloWorld {
  string public message;

  function HelloWorld(string _message) {
    message = _message;
  }
}`

decypher.deployContract(source, ["Hello, World!"], {gas: 500000})
// Function Signature
decypher.callContract(deployed, methodName, params=[], options={})

// Example Usage
var source = `contract HelloWorld {
  string public message;

  function HelloWorld(string _message) {
    message = _message;
  }

  function updateMessage(string _message) {
  	message = _message;
  }

}`

var deployed = decypher.deployed(source, "0xC46CDe805aCC8e7507E53E36486C7D8600559d65")

decypher.callContract(deployed, "updateMessage", ["New Message!!"], {gas: 500000})

decypher.last

The CLI will do it's best to automatically store recently returned data in the decypher.last object. For example, whenever you deploy a contract the address it ultimately deploys to will be automatically stored for quick referene at decypher.last.contractAddress Return values the CLI will try to resolve are:

decypher.last.contractAddress
decypher.last.txHash
decypher.last.blockNumber

Tests

Tests will be added at a future time.

Contributing

Contribution guides will be added at a future time.