Giter VIP home page Giter VIP logo

building-a-celo-oracle-for-off-chain-data-a-step-by-step-guide's Introduction

Building-a-Celo-Oracle-for-Off-Chain-Data-A-Step-by-Step-Guide

This repository contains the source code for a tutorial on building an oracle using the Celo blockchain. The project demonstrates how to create a smart contract, an off-chain server to fetch data from a RESTful API, and a client-side application to display the data submitted to the Celo blockchain. By following the tutorial and exploring this repository, you can create your own oracle to securely provide off-chain data to your smart contracts.

Table of Contents

Getting Started

Clone this repository to your local machine:

git clone https://github.com/your_username/celo-oracle.git

Prerequisites

Before you begin, ensure you have the following software installed:

Additionally, sign up for a free API key from OpenWeather API.

Installation

Navigate to the project directory and install the required packages:

cd celo-oracle
npm install

Usage

  1. Update the privateKey and accountAddress variables in the server/index.js file with your own private key and MetaMask account address, respectively.
  2. Update the OPEN_WEATHER_API_KEY variable in the server/index.js file with your OpenWeather API key.
  3. Run the off-chain server:
cd server
npm start

Deployment

Deploy the smart contract to the Celo Alfajores test network by running the following command in the project directory:

truffle migrate --network alfajores

Built With

Contributing

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.