Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@trusource/server

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trusource/server

TruSource oracle local test server

  • 0.1.4
  • npm
  • Socket score

Version published
Weekly downloads
87
increased by1640%
Maintainers
2
Weekly downloads
 
Created
Source

@trusource/server

Locally test smart contract calls to a TruSource provided oracle.

Getting started

$ npm install @trusource/server

Quick Start

After running a local ganache instance and migrating your contracts

const { server } = require('@trusource/server');

const model = require('./model.json');
const oracleArtifact = require('../build/contracts/Oracle.json');

server(oracleArtifact, model);

trusource.server

trusource.server(oracleArtifact, model);

Calling the server function initiates a process that listens for events emitted by a local ganache instance, fetches the requested data and makes contract calls, passing the response in the payload.

oracleArtifact

A build artifact generated for the oracle.sol smart contract after migration to a local ganache instance. From the root of truffle project, it is found at ./build/contracts/Oracle.json.

model.json

A model representing an api from a data source, can be found here.

Command Line Interface

Installing the package creates trusource-server command line utility, which can be used as follows.

$ trusource-server <path-to-Oracle.json> <path-to-model.json>

Keywords

FAQs

Package last updated on 10 May 2020

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