Giter VIP home page Giter VIP logo

arbot's Introduction

Arbot

Arweave Data Feed Archiving Bot

This is a general purpose bot that archives any data streams.

Explanation

This bot takes json urls and registers them into arweave blockchain like this:

archive url

Anyone running this bot would be able to archive these data streams by fetching the endpoints permanently stored in arweave, querying them and storing their data into arweave further decentralizing the data points

archive data

API

/add

This registers a json endpoint to arweave blockchain.

curl -X POST \
    http://localhost:3001/add \
    -H 'Content-Type: application/json' \  
    -d '{
        "url": "https://jsonplaceholder.typicode.com/users"
    }'  
response
1Yux.....

/get_current_streams

This gets data streams that are registered on Arweave to be archived.

curl -X GET http://localhost:3001/get_current_streams

response
[
    {
        id: "1Yux..."
        url: "https://jsonplaceholder.typicode.com/users"
    }
]

Internal API

Sometimes you want to modify the data returned from endpoints before archiving it to arweave.

archiveApis function in ArweaveBot class accepts a second internals parameter which is an array of objects containing url(url) and a custom callback function(fn) which modifies the data returned from json endpoint before archiving it to arweave.

[{
    url: "https://jsonplaceholder.typicode.com/users",
    fn: function(data){
        //do something with data
        //return modified_data;
    }
}]

Setup

  • git clone https://github.com/imerkle/arbot.git
  • cd arbot
  • yarn install
  • yarn run build

Start Server

PORT=3001 JWK=~/path/to/arweavekeyfile.json yarn run start

You can create an also create an .env file in project root and specify all environment variables or use your cloud provider's environmental config panel.

Full list of default environmental configs

PORT=3001
JWK=secret.json

// When =true Arbot will not archive data endpoints registered on Arweave
// Useful when you dont want to waste your computing resources to archive other peoeple's data-stream
// Therefore only archiving your data-streams fed directly to bot via archiveApis function
NO_ARCHIVE=false

Hackathon

The bot is currently hosted @http://4db00386.ngrok.io with the wallet address xYI-CenXYvaDjgMXGR0Gcba_jXMwznuN2cNAGVmnjyE as part of hackathon.

Arbot UI

To easily intereact with the bot and see data feeds that are being archived by bot visit

https://github.com/imerkle/arbot-ui

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.