Giter VIP home page Giter VIP logo

cxo's Introduction

cxo logo

中文文档 | по русски

CX Object System

Build Status GoReportCard Telegram group Google Groups

The CXO is objects system, goal of which is sharing any objects. The CXO is low level and designed to build application on top of it

Get Started and API Documentation

See CXO wiki to get this information

API Documentation

See CXO wiki to get this information

Installation and Version

Use dep to use particular version of the CXO. The master branch of the repository points to latest stable release. Actually, it points to alpha-release for now.

To get the release use

go get -u -t github.com/skycoin/cxo/...

Test all packages

go test -cover -race github.com/skycoin/cxo/...

Docker

docker run -ti --rm -p 8870:8870 -p 8871:8871 skycoin/cxo

Development

Modules

  • cmd - apps
    • cxocli - CLI is admin RPC based tool to control any CXO-node (wiki/CLI).
    • cxod - an averga CXO daemon that accepts all subscriptions
  • cxoutils - basic utilities
  • data - database interfaces, objects and errors
    • data/cxds - CX data store is implementation of key-value store
    • data/idxdb - implementation of index DB
    • data/tests - tests for the data interfaces
  • node - TCP transport for CXO
    • node/log - logger
    • node/msg - protocol messages
  • skyobject - CXO core: encode/decode, etc
    • registry - schemas, types, etc,

And

Formatting and Coding Style

See CONTRIBUTING.md for details.

Versioning

The CXO uses MAJOR.MINOR versions. Where MAJOR is

  • API changes
  • protocol changes
  • data representation changes

and MINOR is

  • small API changes
  • fixes
  • improvements

Thus, DB files are not compatible between different major versions. Nodes with different major versions can't communicate. Saved data may have another representation.

Versions
1.0

not defined

2.1
  • git tag: v2.1
  • commit: d4e4ab573c438a965588a651ee1b76b8acbb3724

Gopkg.toml

[[constraint]]
name = "github.com/skycoin/cxo"
revision = "d4e4ab573c438a965588a651ee1b76b8acbb3724"

or

[[constraint]]
name = "github.com/skycoin/cxo"
version = "v2.1"
3.0
  • git tag: v3.0
  • commit: 8bc2f995634cd46d1266e2120795b04b025e0d62

Gopkg.toml

[[constraint]]
name = "github.com/skycoin/cxo"
revision = "8bc2f995634cd46d1266e2120795b04b025e0d62"

or

[[constraint]]
name = "github.com/skycoin/cxo"
version = "v3.0"

Dependencies

Dependencies are managed with dep. The dep place all dependencies in vendor/ subfolder. Install the dep using link above and call

dep ensure

if you have problems with building the CXO.


cxo's People

Contributors

gz-c avatar ljesparis avatar logrusorgru avatar nicolas-lsy avatar tectiv3 avatar vyloy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cxo's Issues

TLS for RPC of node

RPC of the Node has no protection. And anyone can "administrate" the Node.

issue of addresses comparison

Package node/gnet has internal mapping stringifyed_address -> connection_instance. But a network address can be represented many ways. For example, "[::]:9090" and "[::1]:9090" are equal. Thus, methods like gnet.Pool.Connection(address string) *gnet.Conn and similar methods of node package can cause unexpected results.

goalng-nuts question

Is there a planned payment mechanism for storing cxo?

I could see such a mechanism powering basically a global network file store. I.e. something really really useful. It could come with replication controls so that the owner can choose the desired replication (paying whatever the rate is for the amount of data that results). Pay more to have more guarantee that the data won't be lost, etc. In this manner skycoin could not only be asset-backed by bandwidth capacity but also asset-backed by storage capacity.

Feed preview

We need a way to get preview of a feed. E.g. a Root object of a feed, we are not subscribed, filled partially (some branches by choose).

Missing Gopkg files

Gopkg.lock and Gopkg.toml are in the .gitignore, was there a specific reason for that?

Refactor RPC implementation

  1. UDP transport will be removed.
  2. TCP transport will be merged into Node.

Hence, RPC implementation has to be refactored. It must contain only two public objects:

  1. RPC - rpc server, based on net/rpc.
  2. RPCClient - rpc client, based on net/rpc.

There is no need to split methods of RPCClient into 3 separate groups, like RootRPC, NodeRPC
and TransportRPC.

Note, that net/rpc is frozen.

Detailed statistic

Detailed statistic required:

  • create time of Root objects
  • access time of Root object
  • total amount and size of related objects
    • exclusive
    • shared
  • same for a feed
  • total objects
  • total size

This statistic will be used for cleaning (#97)

intro/discovery/discovery rid out of Xorm

The xorm drops (*xorm.Rows).Next() error and (*xorm.Rows).Err() can only returns sql.ErrNoRows. Since, CXO have a little SLQ work, then I think CXO should rid out of the xorm to

  • avoid unnecessary dependency
  • handle possible error

The work is faster then time of waiting reply from xorm developers.


Work: 50% (in progress, next after #147)
Test: 0%

Manage node's networking resources

Node's networking resources must be managed properly:

  • Number of outgoing connections must be limited.
  • Number of pending connections must be limited.
  • Overall number of connections must be limited.

skyobject/ user provided schema name

There is a bug that not allows to use user provided names for schemas. Everything is ok, until you are using structures in structures. For example

type User struct {}

type TwoUsers struct {
    User
    AnotherUser User
}

and if

reg := skyobejct.NewRegistry()
reg.Register("User", User{})
reg.Register("TwoUsers", TwoUsers{})

then everything is ok, but if

reg := skyobejct.NewRegistry()
reg.Register("bbs.User", User{})
reg.Register("bbs.TwoUsers", TwoUsers{})

then it fails.

Fix node filling

A node can have stale Root objects and potential memory leaks. Thus we have to track connections from which a Root object we send to subscribers received until the Root is filled up.

DB cache.

Add in memory cache for the CXDS database to speed up the CXO.

Improve GC

Improve GC.

By default a node calls GC every 5 seconds and removes all root objects of every feed before
last full root object.Thus, if root objects appears often than replicates, then them never be replicated.

Proposals how the GC should work to handle all needs are welcome.

Temporary workaround is: disable GC and call it manually.

Split database to index and key-value store

The data package represents database and keeps all inside.
We need to split it for two separate packages:

  1. key-value store with API
  • get []byte by hash
  • set hash-[]byte pair
  • increment refs count of an object by hash
  • decrement the refs count

While the refs count is zero, object should be deleted. This part will be moved to server later

  1. machine local index DB that keeps meta information for every object
  • the size of value

  • when key was created
  • the number of accesses
  • last access time
  • ref count

Little-endian seq encoding

Index DB uses little-endian encoding of seq numbers. This way Root objects grater then 256 can't be used.

Move to new gotree API

Move to new gotree API to avoid dep ensure for end users (to make CXO go gettable, without additional movements).

Work: 100%
Tests: 10% (work in progress).

Exchange, hold and drop Root obejcts properly

Required:

  • node must keep published Root until it replicated by remote peer
  • node must keep "unpacked" Root objects until pack.Close called if the pack contains saved Root object or object it contains refers to saved Root
  • node must send 'drop' and 'approve' messages to peers from which a Root object comes from
  • node must decrement refs. count of all saved (only saved not all related!) dropping Root

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.