Skip to content

picolonet/storage

 
 

Repository files navigation

What is Picolo?

Picolo is a database network built for web 3.0. It gives developers a new way of storing data on a decentralized network of nodes close to their users.

Status

Picolo is in prototype stage. See our Roadmap for a list of features planned or in development.

Quickstart

  • Install dependencies
npm install pg request async
  • Create an app
const pg = require('pg')
const request = require('request')

request.post('https://us-central1-flares-d1c56.cloudfunctions.net/createApp', { json: { name: 'testApp' } },
    (err, res, body) => {
        console.log(err, body)
    }
)
  • Connect to an app
const pg = require('pg')
const request = require('request')

let pool = new pg.Pool()
request.get('https://us-central1-flares-d1c56.cloudfunctions.net/getApp/testApp',
    (err, res, body) => {
        console.log(err, body)
        if (!err && res.statusCode == 200) {
            pool = new pg.Pool({connectionString: body,})
        }
    }
)
  • Run queries
const pg = require('pg')
const request = require('request')

// Create a table
pool.query('CREATE TABLE IF NOT EXISTS t3 (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), name STRING)', (err, res) => {
    console.log(err, res)
})

// Insert some data
pool.query("INSERT INTO t3 (name) VALUES ('picolo')", (err, res) => {
    console.log(err, res)
})

// Query it
pool.query('SELECT name FROM t3', (err, res) => {
    console.log(err, res)
    res.rows.forEach(function(row) {
        console.log(row)
    })
})

pool.end()

Full example is here

Run a node

Picolo is a decentralized network with an open participation model. Anyone can run a node and contribute to the capacity of the network.

On linux

curl -L https://github.com/picolonet/storage/releases/download/1.0.0/picolo-linux-amd64.tar.gz | tar xvz
sudo cp -i picolo /usr/local/bin
picolo

On mac

curl -L https://github.com/picolonet/storage/releases/download/1.0.0/picolo-darwin-amd64.tar.gz | tar xvz
sudo cp -i picolo /usr/local/bin
picolo

On windows

  • Download archive
  • Navigate to the directory and extract the archive
  • In command shell, run .\picolo.exe --nofork

Need Help?

  • Join us on Gitter - This is the most immediate way to connect with Picolo engineers.

Roadmap

  • Replace RAFT consensus with a version that is tolerant to Byzantine faults
  • Replace network layer with an optimized DHT based layer
  • Replace discovery service with the network layer

Packages

No packages published

Languages

  • Go 90.7%
  • TypeScript 4.4%
  • C++ 1.7%
  • Yacc 1.1%
  • Shell 0.4%
  • Tcl 0.3%
  • Other 1.4%