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

mdg

v0.0.4

Published

General purpose Ethereum smart contract API server

Downloads

8

Readme

Madagascar (mdg)

npm version

General purpose Ethereum smart contract API server

The library is designed to make it easier to programmatically interact with smart contracts on Ethereum. It achieves that by creating a RESTful JSON api that mirrors all functions of a given contract. As a result, calls to contract functions can be made remotely via a traditional HTTP endpoint interface.

It also features a fully functional integration test suite that allows for automated testing of smart contract functions.

To see how this works please check the SimpleCoin API test

Installation

npm install mdg

Dependencies

io.js

The library is built with the latest features of ES6 supported by https://iojs.org/en/index.html

Ethereum

The library requires a running instance of an Ethereum client with JSON-RPC enabled. See:

If you are planning to use Geth (best choice as it stands), you will also need solc from cpp-ethereum if you want to be able to compile contracts from cli.

Make sure your primary account (or coinbase) has some funds, or otherwise you will not be able to send any transactions. Apart from this, your primary account needs to be explicitly "unlocked" to allow for transactions being sent via a programmatic interface (web3). For example, with Geth you need to start your client with --unlock primary. The full command would look like:

geth --unlock primary --rpc

Usage

var Mdg = require("mdg");

var mdg = (new Mdg(settings)).start();

Settings

A sample settings file can be found in test/

A note on running tests

If you configured your Ethereum client to work as described in the Dependencies section then testing should be pretty straight forward. A word of advice would be to set up your Ethereum client to run a private chain so you have plenty of ether to spend. I would also recommend reducing the amount of hardware resources allocated to mining so that your machine makes a bit less noise :) With Geth the full command would look like this (replace "12345" with any number):

geth --networkid 12345 --minerthreads 1  --rpc --unlock primary --mine