Coder Social home page Coder Social logo

0g-storage-node's Introduction

0G Storage

Overview

0G Storage is the storage layer for the ZeroGravity data availability (DA) system. The 0G Storage layer holds three important features:

  • Buit-in - It is natively built into the ZeroGravity DA system for data storage and retrieval.
  • General purpose - It is designed to support atomic transactions, mutable kv stores as well as archive log systems to enable wide range of applications with various data types.
  • Incentive - Instead of being just a decentralized database, 0G Storage introduces PoRA mining algorithm to incentivize storage network participants.

To dive deep into the technical details, continue reading 0G Storage Spec.

Integration

We provide a SDK for users to easily integrate 0G Storage in their applications with the following features:

  • File Merkle Tree Class
  • Flow Contract Types
  • RPC methods support
  • File upload
  • Support browser environment
  • Tests for different environments (In Progress)
  • File download (In Progress)

Deployment

Please refer to Deployment page for detailed steps to compile and start a 0G Storage node.

Test

Prerequisites

  • Required python version: 3.8, 3.9, 3.10, higher version is not guaranteed (e.g. failed to install pysha3).
  • Install dependencies under root folder: pip3 install -r requirements.txt

Dependencies

Python test framework will launch blockchain fullnodes at local for storage node to interact with. There are 2 kinds of fullnodes supported:

  • Conflux eSpace node (by default).
  • BSC node (geth).

For Conflux eSpace node, the test framework will automatically compile the binary at runtime, and copy the binary to tests/tmp folder. For BSC node, the test framework will automatically download the latest version binary from github to tests/tmp folder.

Alternatively, you could also manually copy specific versoin binaries (conflux or geth) to the tests/tmp folder. Note, do NOT copy released conflux binary on github, since block height of some CIPs are hardcoded.

For testing, it's also dependent on the following repos:

  • 0G Storage Contract: It essentially provides two abi interfaces for 0G Storage Node to interact with the on-chain contracts.
    • ZgsFlow: It contains apis to submit chunk data.
    • PoraMine: It contains apis to submit PoRA answers.
  • 0G Storage Client: It is used to interact with certain 0G Storage Nodes to upload/download files.

Run Tests

Go to the tests folder and run following command to run all tests:

python test_all.py

or, run any single test, e.g.

python sync_test.py

Troubleshooting

  1. Test failed due to blockchain full node rpc inaccessible.
    • Traceback: node.wait_for_rpc_connection()
    • Solution: unset the http_proxy and https_proxy environment variables if configured.

Contributing

To make contributions to the project, please follow the guidelines here.

0g-storage-node's People

Contributors

peilun-conflux avatar boqiu avatar 0g-peterzhb avatar chenxingli avatar minifrenchbread avatar csdtowards avatar

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.