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

htmlcoin-ipfs

v1.0.0

Published

Share files using Htmlcoin and IPFS

Downloads

2

Readme

htmlcoin-ipfs

A demo for sharing files via Htmlcoin and IPFS.

How it works

image

Quick Start

Prerequirements

  1. Get the source code and install dependencies.
$ git clone https://github.com/denuoweb/htmlcoin-ipfs.git
$ cd htmlcoin-ipfs
$ npm install
  1. Install the Solidity compiler. You'd better install it from a binary package or the source code.

  2. Install Solar. Solar is a smart contract deployment tool of Htmlcoin.

  3. Start a local IPFS node or use a public one.

// configuration in file src/App.js for a public node of Infura
ipfsApi = ipfsAPI('ipfs.infura.io', '5001', {protocol: 'https'})

// command to start a local IPFS node and set up CORS
$ ipfs daemon
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"*\"]"
$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "[\"true\"]"
// configuration in file src/App.js for a local node
ipfsApi = ipfsAPI('localhost', '5001', {protocol: 'http'})
  1. Start a Htmlcoin node and a CORS proxy.
// start a Htmlcoin QT node on Mac with RPC parameters specified
$ /Applications/Htmlcoin-Qt.app/Contents/MacOS/Htmlcoin-Qt -server -rpcuser=atx -rpcpassword=atx -rpcport=4889

// start a CORS proxy
$ npm install -g local-cors-proxy
$ lcp --proxyUrl http://localhost:13889  --proxyPartial "" --port 8010

// configuration in file src/App.js
contract = (new Htmlcoin('http://atx:[email protected]:8010', repo)).contract('IpfsRecord.sol')

Deployment

  1. Deploy the smart contract. Make sure there are some coins left in the sender address after deployment for futurn usage.
// command for deploying the smart contract, generating a file named solar.development.json
$ cd src
$ solar deploy IpfsRecord.sol --htmlcoin_rpc="http://USER:[email protected]:4889/"

// configuration in file src/App.js
import repo from './solar.development.json'

// in file solar.development.json
{
  "contracts": {
    "IpfsRecord.sol": {
      "source": "IpfsRecord.sol:IpfsRecord",
      "abi": ...,
      "bin": ...,
      "binhash": "3192a61fb90d58e13313cbcad551892014f423c637b9633ef42c9d3c56610e54",
      "name": "IpfsRecord",
      "deployName": "IpfsRecord.sol",
      "address": "a5cbd6eaa89b349d13ce24331406a89d04e9d90a",
      "txid": "b97a8a562b3fb6aeab9d4b023025182141092bb41dcb3955aecf27ffc82eb30d",
      "createdAt": "2018-11-15T10:31:23.43932943+08:00",
      "confirmed": true,
      "sender": "HWE1ZZEs7yxoEGzdLVZnNqsmuLPSThi4d6",
      "senderHex": "8aefb4b0ff32c65e9dc4d8036cd6cec0b4c7fe9f"
    }
  },
  "libraries": {},
  "related": {}
}
  1. Start the system.
$ cd ..
$ npm start
  1. Open URL http://localhost:3000/ in your browser, and you will see a page with an UPLOAD button on it. Now you can upload any files and share it with others through this platform. After several files uploaded, the page will be like follows.

image