Coder Social home page Coder Social logo

ddnlink / ddn Goto Github PK

View Code? Open in Web Editor NEW
206.0 206.0 55.0 20.68 MB

DDN, Data Delivery Network, a next generation blockchain system

Home Page: https://ddn.net

License: Other

JavaScript 99.76% Shell 0.16% TypeScript 0.01% Dockerfile 0.08%
bitcoin blockchain ddn generation-blockchain network p2p wallet

ddn's Introduction

亿书币

【特别说明】本代码仅作为 《Nodejs开发加密货币》 的学习参考,请不要作为生产目的。亿书正在全新改版升级,敬请期待!

招聘信息

亿书,让有知识的人富起来。我们未来的产品,将全部基于P2P网络进行开发设计,面向未来进行技术研发。如果您对区块链感兴趣,欢迎加入我们:

  • 对编程十分热爱,积极主动,抗压能力强;
  • 有3-5年的开发经验,Node.js至少1年以上,熟悉ES6规范;
  • 有express、react、electron开发经验者优先;

联系方式,请将您的简历发送到: [email protected]

资源链接

安装使用

协议

The MIT License (MIT)

Copyright (c) 2016 Ebookcoin
Copyright (c) 2014-2015 Crypti

ddn's People

Contributors

cntailor avatar dependabot[bot] avatar haoei avatar imfly avatar limsbase avatar run-in-time avatar rustdreamer avatar skcher avatar softwaiter avatar wlydhub avatar wulianyougithub 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

ddn's Issues

Optimize the Buffer, check and modify the following codes

  • Buffer.from(transfer.amount, 'utf8') : if transfer.amount is not string, it will throw an error.
  • Buffer.from([asset.precision || 0]): Can it be optimized?
  • Buffer.from(asset.currency, 'utf8') : Encoding default is utf8, instead of Buffer.from(asset.currency, 'hex')?
    ...

全局参数常量需要进一步规范

目前常量配置文件有点分散,应该统一到一处,并将前端使用的常量尽量减少,比如:fee 能否作为系统常量,前端在没有旷工竞争的情况不需要用户去选择。

Using Chaos Mesh to enhance ddn

Hello, I am Chaos Mesh Maintainer. Chaos Mesh is an open-source and free Chaos Engineering platform, it can be directly used without modifying any code.

Blockchain is a very promising industry. Congratulations on doing such a promising project, Blockchain is a subdivision that is widely used in the distributed field. For distributed system, the stability and correctness of the cluster are very important. The nodes of the blockchain may be distributed in any corner of the world. Its terminal equipment are also different and the problems that appear will be strange, such as network partitions, high node pressure, and various other failures. Blockchain programs need to ensure reliability in such an unstable state, which is a very difficult task. We felt particularly deeply about this in the testing process.

You may also have heard that chaos engineering can guarantee the stability of the system to a certain extent, especially after the system is large enough, the simulation of real faults is particularly important. You can know what situation your program is in under what circumstances. In PingCAP (PingCAP is a world-renowned open source company, its products include TiDB/TiKV (TiDB has a 24.5k star on GitHub. TiKV has a 7.7k star)), we use chaos engineering to find the distributed database quite a lot of bugs, some of which are recorded in https://github.com/orgs/chaos-mesh/projects/1

On December 31, 2019, we open sourced our chaos engineering platform Chaos Mesh and entered the CNCF Sandbox on July 15 this year. It is currently the industry’s leading cloud-native chaos engineering platform. Now it has 2k stars on Github. In addition to general k8s operations, it also includes a simplified dashboard that can easily perform chaos operations on the front-end page. It also includes an observable data source that integrates chaos events and services. metric combination.

At present, in addition to our own use of Chaos Mesh to enhance the stability of our TiDB, some other companies such as Xiaopeng Motors, Meituan, Youzan, Dailymotion, NetEase Fuxi Lab, JuiceFS, Apache pulsar,Youzan etc. are using Chaos Mesh to enhance system stability. In addition, we can also see some open source projects integrating Chaos Mesh as part of the test system, such as datastax/fallout ethersphere/beekeeper cncf/cnf-conformance Experiment-catalog RCNIT Shortlink Fdb-k8s-chaos

As I said before, some users have integrated Chaos Mesh as part of their test system. In the blockchain field, you can see the Ethereum official storage project (ethersphere/beekeeper ) Use Chaos Mesh to ensure the stability of their system

In a few days ago, there is an attack in ETC(https://news.bitcoin.com/single-miner-reorgs-ethereum-classic-devs-report-a-chain-split/) it may be caused by a network partition. If it is, then this kind of scenario can be simulated by Chaos Mesh

In Chaos Mesh, we have many injection functions, such as pod/container kill, network partition, network interruption, CPU/memory usage, time rollback, disk failure, etc.

Welcome to use Chaos Mesh to enhance the stability of ddn. It is opensource and free. If you have any questions, or submit an issue at https://github.com/chaos-mesh/chaos-mesh, or send me an email [email protected]

Sorry for disturb

[Suggestion] Issue suggestion

For the convenience of issue classification and understanding, refer to other communities, please follow the following specifications.

DIP: For suggestions or proposals involving kernel improvement, such as performance optimization and algorithm improvement, please mark DIP in the header.The DDN improvement proposal .

DRC: For application suggestions, specifications, standards or features, please mark DRC: DDN request of comments.

For other contents, please mark keywords as appropriate, such as questions, features, functions, etc

Add all documents

Update all the documents:

  • @ddn/start, example project.
  • @ddn/ddn, command line tools.
  • @ddn/aob, asset on blockchain.
  • @ddn/crypto, decode and encode...
  • @ddn/peer, DDN peer, tiny blockchain.
  • @ddn/asset, DDN asset plugin.
  • @ddn/core, DDN extend system.
  • @ddn/node-sdk, DDN node sdk.
  • @ddn/doc, DDN doc website.

Please join us 😄

统一规范字段和方法名称,持续完善...

没有规矩,就是噩梦 😿

进一步规范如下:

原则:前后一致,逻辑一致,简单清晰
规范:名称一概使用完整英文驼峰模式,比如:blockId,而不是 block_id,更不是 b_id

影响到编码内容包括:

  1. 数据库字段名称(不是数据库名称)

  2. proto 对象字段

  3. (类)属性和(类)方法

数据库名称不改变,仍然使用26个字符、_、数字组合,具体名字使用 完整英文

Next plans

Over the next period, we will do the following things.

一、Development:

  1. Add visual deployment;
  2. Add customized packaging function;
  3. Add POW mechanism;
  4. Optimize wallet and blockchain browser;
  5. Deep docking with DATM;
  6. Revision of Node.js BlockChain Development 2;

二、Operation:

  1. Organizing self-governing organization community;
  2. Disseminating self-governing organization concept;
  3. Publishing DATM;
  4. Opening DDN technology training curriculum;
  5. Organize offline chain-builder conference.

More content will be updated continuously.

Welcome to join us.
You will get DDN through DATM or cash incentives from service providers.


接下来一段时间,我们将做下面一些事情。

开发方面:

  1. 新增可视化部署;
  2. 新增定制打包功能;
  3. 开启分支新增POW机制;
  4. 优化钱包和区块链浏览器;
  5. 与DATM深度对接;
  6. 修订《Node.js区块链开发2》;

运营方面:

  1. 组织自治组织社区;
  2. 传播自治组织理念;
  3. 发布DATM;
  4. 开启DDN技术培训课程;
  5. 组织线下造链开发者会议。

更多内容,会持续更新。

欢迎更多小伙伴加入,我们将通过DATM给予DDN奖励,并从服务的商家提成中给予现金奖励。

Error when run test.

Find an error when run yarn test, the message is the follow:

yarn run v1.16.0
$ ./node_modules/.bin/mocha -r intelli-espower-loader test/**/*.test.js

/Users/imfly/Documents/projects/LIMS/ddn/node_modules/espower-source/index.js:165
    var err = new SyntaxError(detail);
              ^
SyntaxError: 
    32:   var res = await node.submitTransactionAsync(node.ddn.aob.createFlags(currency, flagType, flag, account.password))
    33:   DEBUG('change flags response', res.body)
    34:   return res
    35: }
    36: 
    37: async function changeFlagsAsync(currency, flagType, flag, account) {

Add docker image

To facilitate users to quickly build deployment and development environment, add docker images of development and deployment。

系统配置分级管理,防止用户修改系统级别的配置

分级管理包括用户配置和系统管理,默认为用户级别,防止用户修改系统级别的配置。

用户级别的配置

config.local.js , .ddnrc.js , config.js等都应该是用户级别的配置,主要提供节点IP、PORT等信息;

系统级别的配置

constants.js 等提供产品系统级别的配置,主要为开发者提供,用于定制新的独立的链,这些定制一旦完成,基本上不应该再被修改。

【改进方案】升级交易类型处理方式

当前,交易类型的处理采取的阿拉伯数字形式,然后使用transaction_types对应来引用。主要问题是:

1. 容易冲突

这个问题很好解决,因为可以通过文档或代码约束,如果用户提供了与系统类型重复的交易类型,可以提醒错误,这需要在资产插件脚手架、插件扩展逻辑、以及文档等方面提供说明和编码。

2. 定义分散

需要在asset-*等资产插件中定义,另外,在node-sdk中重复定义,这不是很好的解决方法。当前版本,在@ddn/peer 的 transaction_types 里也有,需要做到一处定义,多出使用才对。

还有一种方案,可以考虑将 交易类型 插件化,专门用于交易类型的处理。

运行不起来

mac 11.5.2
npm 6.9.0
node 10.21.0

我下载的dev版本运行
npm install 然后又倒入了ddn下的peer,core包
npm start

localhost:ddn-dev jerome$ npm start

[email protected] start /Users/jerome/workpath/VScode/ddn-dev
NODE_ENV=development node ./scripts/startPeer.js

Start dev blockchain for /Users/jerome/workpath/VScode/ddn-dev/scripts/node
(node:86553) [SEQUELIZE0003] DeprecationWarning: String based operators are deprecated. Please use Symbol based operators for better security, read more at https://sequelize.org/master/manual/querying.html#operators
Executing (default): SELECT 1+1 AS result
info 08:16:53.51 loader.js:171 () @ddn/asset-evidence 资产包不包含自定义数据模型内容。
info 08:16:53.51 loader.js:171 () @ddn/asset-dapp 资产包不包含自定义数据模型内容。
Error: Sandbox is not ready
at oe (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:9463)
at b.value (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:109497)
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:109598)
at Generator.next ()
at x (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1128)
at s (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1331)
at /Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1390
at new Promise ()
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1271)
at b.L.value (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:109720)
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:106539)
at Generator.next ()
at x (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1128)
at s (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1331)
at /Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1390
at new Promise ()
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1271)
at b.L.value (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:106727)
at Program. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/peer/lib/kernal/program.js:221:43)
at Generator.next ()
at asyncGeneratorStep (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/peer/lib/kernal/program.js:144:103)
at _next (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/peer/lib/kernal/program.js:146:194)
Error: Sandbox is not ready
at oe (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:9463)
at b.value (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:109497)
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:109598)
at Generator.next ()
at x (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1128)
at s (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1331)
at /Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1390
at new Promise ()
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1271)
at b.L.value (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:109720)
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:106539)
at Generator.next ()
at x (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1128)
at s (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1331)
at /Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1390
at new Promise ()
at b. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:1271)
at b.L.value (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/contract/dist/index.js:1:106727)
at Program. (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/peer/lib/kernal/program.js:221:43)
at Generator.next ()
at asyncGeneratorStep (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/peer/lib/kernal/program.js:144:103)
at _next (/Users/jerome/workpath/VScode/ddn-dev/node_modules/@ddn/peer/lib/kernal/program.js:146:194)
info 08:16:53.98 program.js:366 (process.once) process exited

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.