Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@trusource/server

Package Overview
Dependencies
195
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @trusource/server

TruSource oracle local test server


Version published
Weekly downloads
1
decreased by-80%
Maintainers
2
Created
Weekly downloads
 

Readme

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

Last updated on 15 May 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc