GithubHelp home page GithubHelp logo

chainsql / chainsqld Goto Github PK

View Code? Open in Web Editor NEW
214.0 24.0 75.0 124.68 MB

ChainSQL: the collaboration of blockchain and database

Home Page: http://www.chainsql.net

License: Other

CMake 2.25% Python 0.15% C 28.47% Shell 0.32% C++ 68.05% Makefile 0.08% Assembly 0.15% M4 0.13% PHP 0.02% Java 0.16% Dockerfile 0.01% Sage 0.15% JavaScript 0.03% Swift 0.02% Lua 0.01% WebAssembly 0.01%

chainsqld's Introduction

English / 中文

Chainsql

Overview

ChainSQL is a blockchain supporting database operations. The DB operating log will be stored in the chainsql chain, then you can acquire the visual data in traditional DB.

Details of ChainSQL

Detailed online-document can be found here.

By setting the sync_tables, sync_db and auto_sync, you can restore the real DB tables you wanted from block chain. You can set the DB type arbitrarily, includeing mysql, sqlite, oracle and so on.

We defined three new transaction types for the DB operation, named sqlStatement, tableListSet and sqlTransaction. sqlStatement is used to insert, update or delete records, tableListSet is used to create a table and other operations to the table-self, sqlTransaction is used to operator a set of DB sql clause in one blockchain's transaction.

You can operate the DB or send DB operations to the block chain by the following four ways.

  1. RPC API , supplied by the RPC modules.
  2. Web sockets API, developed using javascript and java. Refer to API in javascript and API in java .
  3. Commandline, access to the node directly.
  4. By kingshrad, using db's primitive sql clause. Refer toAccess by sql.

The table module send data request to other nodes and sort the tx datas from other nodes, then give the right transaction data to the sql module. This module also seeks every ledger in local block chain to get the compatible table data to send back to the required nodes.

The sql module analysis transaction data to get the real sql, then operate the DB ussing these real sql sentences.

Further more, storage modules make you check the DB before sending tx data to the block chain, this makes it possible that we can operate DB timely.

If you want to get more infomation about this production ,please access the site www.chainsql.net.

Version

On updating our version or releasing new functions, the RELEASENOTES will be updated for the detail description.

Setup

Refer to the Setup for details.

Compile

Refer to the Builds directory for details, we introduce the detail compiling steps in several OS systems.

License

ChainSQL is under the GNU General Public License v3.0. See the LICENSE directory for details.

Contact Us

Email: [email protected]

Wechat: scan the QR below to follow PeerSafe, and then send chainsql, you will receive the QR image for ChainSQL community.

PeerSafe Wechat QR code:

PeerSafe

chainsqld's People

Contributors

ahbritto avatar alexdupre avatar bachase avatar cruanezhou avatar halberdholder avatar howardhinnant avatar jedmccaleb avatar joelkatz avatar joeloser avatar justmoon avatar luleigreat avatar luleihello avatar manojsdoshi avatar mellery451 avatar miguelportilla avatar mojicode avatar mtrippled avatar nbougalis avatar rec avatar scottschurr avatar seelabs avatar shaxunyeman avatar ssmjfish avatar sublimator avatar vinniefalco avatar wilsonianb avatar wufeipeng avatar wufeipeng007 avatar ximinez avatar xiuxiufxx 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  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  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  avatar  avatar  avatar  avatar

chainsqld's Issues

新节点怎么加入区块链网络?

新节点加入区块链网络时,是不是需要修改所有区块链网络内节点的配置文件?修改配置文件后的节点都需要重新运行么?

Not able to create table and identify source address

Chainsql c= Chainsql .c;
c. connect ( "ws://127.0.0.1:6006" );
System.out.println("successfully connected to chainsql");

c.as("n94ngNasveyfF2KttLuNni6nHPcUtw1Se3969nUginy8cf2Kzb4Z", "xnoPBzXtMeMyMHUVTgbuqAfg1SUTb");

c. createTable ( "dc_universe" , c. array (
"{'field':'id','type':'int','length':11,'PK':1,'NN':1 , 'UQ':1}" ,
"{'field':'name','type':'varchar','length':50,'default':null}" ,
"{'field':'age' , 'type': 'int'}" ),
FALSE)
. submit (SyncCond.db_success);

Ouput:
Nov 05, 2018 1:23:48 PM com.peersafe.base.client.Client log
INFO: Connecting to ws://127.0.0.1:6006
connect success
successfully connected to chainsql
Account is missing,please checkout!
Exception: Owner or User parse failed

I don't understand where to find the address and how to create a table with owner account.
Any guidance on this will be really helpful.

Thanks,
Ananth

grant didn't work

使用Java SDK,根用户创建了表,然后执行:
JSONObject obj = c.grant("users", addressA, "{insert:true, select:true, delete:true, update:true}") .submit(Submit.SyncCond.validate_success);
来授权,然后use(addressA), as(addressA, secretA), 执行get查询,总是返回:
{"error_message":"can't get TableName in DB ,please check field tablename!","status":"error"}

db_noDbConfig

系统是ubuntu16.04,mysql是5.7.31,数据库在本地和远程都能正常连接使用。
sync_db的配置信息如下
[sync_db] type=mysql host=127.0.0.1 port=3306 user=root pass=root db=chainsql first_storage=0 charset=utf8
socket连接显示成功,但是使用createTable创建数据表一直报错“db_noDbConfig”,这个要怎么解决呢?

节点之间不连接

已经在配置文件里设置了
ips, validators, validation_seed, validation_public_key
节点都能正常启动,但是节点之间就是不连接。
节点间用telnet检测peer端口可以连通

是因为什么配置错了吗

Redhat/Centos下[sync_db]配置localhost连接mysql失败的问题

问题:
在Redhat7.2/Centos7.5下,安装mysql,在[sync_db]中配置 host=localhost不好用,而host=127.0.0.1可以。

这是一个已知问题,soci连接库使用socket方式去连接localhost的数据库,但是找到的socket路径是'/var/run/mysqld/mysqld.sock' ,这个路径在ubuntu下是对的,但是在redhat/centos下路径不对,导致连接失败

解决方法:大家可以先用127.0.0.1去连接,我们后面会解决这个问题

balance decrease unexpectedly

I created an account and pay it 1000. Then I used that account to insert a new record into a table, but I found the balance of that account decrease to 999 unexpectedly.

updated on Feb.12
I think it's because a transaction cost some fee, right? Is there any way to control the amount of fee?

chainsql account problem

按照文档搭建了chainsql网络,在account上遇到了问题。我用Java API的generateAddress生成地址,然后再使用该地址查询,总会有Account not found的错误。换成在chainsqld.cfg中配置的seed,也是一样的结果。这里的account应该怎样生成?我要创建表的话要用什么account?

发布区块的条件

我有个疑问,chainsql打包区块的条件是什么?是交易达到一定数量就打包区块嘛,如果是这样,如果有很长时间段只有几笔交易,达不到打包区块的条件,那么这段时间就一直不打包区块了吗

link error when compile: ERR_remove_thread_state

Ubuntu默认是自动升级的,16.04版本自 2018年7月份自动升级后,chainsql在ubuntu下无法链接通过,错误提示:

/usr/local/openssl-1.0.2/lib/libcrypto.a(err.o): In function `ERR_remove_thread_state':
err.c:(.text+0x1ac0): multiple definition of `ERR_remove_thread_state'
/usr/lib/x86_64-linux-gnu/libmysqlclient.a(ssl.cpp.o):(.text+0x1df0): first defined here

目前暂时无好的解决方案,只有替换回旧的.a文件,可成功编译的libmysqlclient.a文件已放至 Builds/Ubuntu目录下,替换可编译通过

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.