New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@requestnetwork/ethereum-storage

Package Overview
Dependencies
Maintainers
5
Versions
716
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@requestnetwork/ethereum-storage

Request Network storage layer based on ethereum.

  • 0.1.1-alpha.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

@requestnetwork/ethereum-storage

@requestnetwork/ethereum-storage is a package part of the Request Network protocol. It is an implementation of the Storage layer of Request Network protocol that uses IPFS to immutably store the data and uses the Ethereum network to persist the IPFS hash of the data and make them permanently available to everyone.

The package also stores the source and artifacts of the smart contract deployed on Ethereum.

Installation

npm install @requestnetwork/ethereum-storage

Usage

import EthereumStorage from '@requestnetwork/ethereum-storage';
import { Storage as StorageTypes } from '@requestnetwork/types';

const web3HttpProvider = require('web3-providers-http');

const provider = new web3HttpProvider('http://localhost:8545');
const web3Connection: StorageTypes.IWeb3Connection = {
  networkId: StorageTypes.EthereumNetwork.PRIVATE,
  timeout: 1000,
  web3Provider: provider,
};

const ipfsGatewayConnection: StorageTypes.IIpfsGatewayConnection = {
  host: 'localhost',
  port: 5001,
  protocol: StorageTypes.IpfsGatewayProtocol.HTTP,
  timeout: 1000,
};

const ethereumStorage = new EthereumStorage(ipfsGatewayConnection, web3Connection);

const data = 'Some data';

await ethereumStorage.append(data);

Smart Contract

ethereum-storage source can be downloaded in order to deploy the smart contract on a local environment:

git clone https://github.com/RequestNetwork/requestNetwork.git
cd requestNetwork/packages/ethereum-storage
yarn install
yarn run build
yarn run ganache

And in another terminal:

yarn run deploy

IPFS

In order to use the package in a test environment, IPFS can be installed locally and started with the following commands:

npm install ipfs --global
ipfs init
ipfs daemon

Local IPFS listening on port 5001 is used by default by the ethereum-storage package.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Read the contributing guide

License

MIT

Keywords

FAQs

Package last updated on 14 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc