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

tamperproof

v1.0.17

Published

MongoDB link to EOS blockchain.

Downloads

23

Readme

TamperProof Logo

A utility that conveniently links MongoDB to EOS blockchains.

Motive

Blockchains provide security and transparency. Unfortunately it's very difficult for existing applications to take advantage of the benefits they offer. We're migrating towards a world where the public will not trust unverifiable data sources. With TamperProof, anyone can prove the state of their MongoDB database by fingerprinting it on a EOS powered blockchain.

TamperProof Process

Installation

npm i -g tamperproof

Usage

Hash a 'single' document.

tamperproof \
-d database_name \
-c collection_name \
-x mongodb+srv://mongodb_connection_string \
-i 5cbba8a857a66431e9bb2164 \
-a accountuser1 \
-k 5J7J5tD9WrKWAkAVyXLNonh2WcVqWBXxajmMthDPTuJbBksDhyz

Hash a 'whole' collection.

tamperproof \
-d database_name \
-c collection_name \
-x mongodb+srv://mongodb_connection_string \
-a accountuser1 \
-k 5J7J5tD9WrKWAkAVyXLNonh2WcVqWBXxajmMthDPTuJbBksDhyz

Sample Result

Identifier: ["my_mongo_db","predictions"]
=> 0adb7441e30f6970596a759a80114f748ea53da2ac5dcb5f99925762243dd890 (identifier)
-------------------------------------
Talking to MongoDB...
Number of documents in Hash: 2
[{"_id":"5cc5e16c57a66431e9bb217c","home_team":"Eagles","away_team":"Bobcats","prediction":"10-0","winning_team":"Eagles","gametime":"10-03-2020 @ 10:00PM"},{"_id":"5cc5e2104cb78c31e97ebee2","home_team":"Tigers","away_team":"Bears","prediction":"20-15","winning_team":"Tigers","gametime":"10-05-2020 @ 10:00PM"}]
=> 66407328a8492ad22f3a526476059810512e9f65ab012bf7410a31579ec12e7e (data)
-------------------------------------
Writing to Blockchain...
Successfully wrote to chain with TX id.
=> 70c99fc7aa16f33f1f49a6f68bded1ec08a4ccc5f5b4c1dabc27bd3021276f46
https://bloks.io/transaction/70c99fc7aa16f33f1f49a6f68bded1ec08a4ccc5f5b4c1dabc27bd3021276f46

Interpreting Results

Both the "identifier" and the "data" properties are hashed with SHA256.

  • The identifier is a hash of an array converted to a string. The array is one of the following formats: ["database","collection"] or ["database","collection","_id"]
  • The data is a hash of a string of the Result returned from the database. This string is created by passing the DB result to JSON.stringify().

Parameters

| Parameter | Example | Purpose | Required | |-----------|--------------------------------------------------------|----------------------------------------|----------| | -x | mongodb+srv://:@cluster0-bwwwb.mongodb.net | MongoDB connection string. | YES | | -d | my_database_name | MongoDB database name. | No | | -c | my_collection_name | MongoDB collection name. | No | | -i | 5cbba8a857a66431e9bb2164 | _id for document lookup. | No | | -k | 5J7J5tD9WrKWAkAVyXLNonh2WcVqWBXxajmMthDPTuJbBksDhyz | EOSIO private key (active permission). | YES | | -a | useraccount1 | EOSIO account name. | YES | | -e | https://publicapi-mainnet.eosauthority.com | EOSIO http endpoint. | No |

  • Note: Sensitive parameters should be stored as session data and not passed via command line.

Use Programatically

let tamperproof = require("tamperproof")

;(async () => {
  let result = await tamperproof({
    d: "my_database_name",
    c: "my_collection_name",
    i: "5cbba8a857a66431e9bb2164",
    x: "mongodb+srv://<user>:<pass>@cluster0-bwwwb.mongodb.net",
    a: "useraccount1",
    k: "5J7J5tD9WrKWAkAVyXLNonh2WcVqWBXxajmMthDPTuJbBksDhyz",
    e: "https://publicapi-mainnet.eosauthority.com" // endpoint required.
  })
})()

Acquire Blockchain Account

Accounts are free on private EOS blockchains. If you wish to use the public EOS blockchain (default setting) there is a small one-time fee (typically ~$1). This will provide you with both a private key and account name of your choice (-k and -a params).

https://www.eosnameservice.io