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

gardener-ethereum

v0.1.0

Published

Ethereum smart contracts for Gardener open source oracle project

Downloads

3

Readme

Oracle smart contracts

CircleCI Coverage Status

This repo is a part of open source oracle project. Initially developed by Espeo Software. Contains all smart contracts used in the project.

Table of contents:

Oracle theory

Oracle is a concept of getting informations from outside of the blockchain into smart contracts. Basically smart contracts cannot call anything which is outside the blockchain network. That's were oracle idea goes into. Smart contract emits event with needed informations and trusted offchain server, which is listening on that, parses it, gets data from offchain data source and passes it back using it's credentials.

Architecture

Oracle architecture sketch

Installation

Project uses Truffle Framework. If you're not familiar with it please look up their documentation.

Requirements:

  • Node.js >= 7.6 - async/await support

Dependencies are installed via npm install command.

Getting started

As a first step please clone .env.tpl file into .env and fill it with values:

  • PRIVATE_KEY - used for contracts deployment via single account private key. When you decide to use private key you don't need to pass a mnemonic value. Pass without 0x prefix.
  • ROPSTEN_PROVIDER_URL - provider url for connection with blockchain node. We recommend to use one from Infura
  • MNEMONIC - HDWallet seed used for contracts deployment instead of a single private key
  • ORACLE_SERVER_ADDRESS - Ethereum address (public key) of trusted server (required for running migrations even on local ganache network)

Contracts explanation:

  • Oracle - the most important contract, the heart of the project. It authorizes requests, stores them, emits events and proxies results.
  • UsingOracle - simple implementation of a smart contract, which is using an Oracle. It's optional but feel free to use it by extending one of your contracts from it. You can also implement your own version by adhering to the UsingOracleI interface.
  • Authorizable - part of Oracle contract responsible for user authorization. You can grant and revoke access to particular addresses here.
  • StringParser - library for string parsing and manipulation, useful after receiving result from Oracle.
  • OraclizeWrapper - proxy contract, which together with other smart contracts from contracts/oraclize directory makes it painless to migrate from a project using Oraclize solution to our open source oracle.

When you are ready, you can deploy the smart contracts using Truffle's migrations.

  • truffle migrate --network ganache to deploy to local Ganache test blockchain
  • truffle migrate --network ropsten to deploy to Ethereum testnet

Commands

You can use npx for running command line tools bundled with the project. If you are new to npx please read this post.

Some of available commands:

  • npx truffle - locally installed truffle framework
  • npx soldity-coverage - coverage for smart contracts
  • npx truffle-flattener contracts/... - contract flattening for etherscan verification

FAQ

What is Oraclize and why we decided to develop an open source solution?

Oraclize is currently the most popular oracle solution. They were first and their product offers a wide range of applications. The authors of this project found the Oraclize solution very useful and have used it multiple times. Unfortunately it's served as SaaS which means that every request costs an additional fee. Because of that, after spending much time working with oracles we decided to create our own implementation. We strongly believe in blockchain technology and open source. We think that this project can strengthen the Ethereum smart contracts ecosystem. Feel free to use, modify and contribute. Anytime, anywhere, always for free :)

How to migrate from Oraclize solution to this project?

There is a special wrapper called OraclizeWrapper which adheres to Oraclize interface and proxies the requests to our Oracle. To migrate your project you need to deploy this project and the OraclizeWrapper, authorized it in Oracle contract and then change the address in OraclizeAddressResolver to the deployed OraclizeWrapper. This way you don't need to change anything in the source code of your contract (which is crucial when it's already deployed).