aviondb

所属分类:IPFS
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2023-01-07 18:30:17
上 传 者sh-1993
说明:  具有类似MongoDB的开发人员界面的去中心化数据库(与OrbitDB完全兼容),
(A decentralised database with MongoDB-like developer interface (Fully Compatible with OrbitDB),)

文件列表:
.eslintrc.json (544, 2020-10-13)
.npmignore (552, 2020-10-13)
.prettierrc (40, 2020-10-13)
API.md (45183, 2020-10-13)
CHANGELOG.md (3072, 2020-10-13)
CODE_OF_CONDUCT.md (3323, 2020-10-13)
CONTRIBUTING.md (9516, 2020-10-13)
CONTRIBUTORS.md (925, 2020-10-13)
LICENSE (1064, 2020-10-13)
assets/ (0, 2020-10-13)
assets/Architecture.png (162317, 2020-10-13)
examples/ (0, 2020-10-13)
examples/index.html (2225, 2020-10-13)
package-lock.json (760201, 2020-10-13)
package.json (2069, 2020-10-13)
src/ (0, 2020-10-13)
src/@types/ (0, 2020-10-13)
src/@types/AccessControllerInterface.d.ts (1815, 2020-10-13)
src/@types/DBOptions.d.ts (2194, 2020-10-13)
src/@types/IReplicationStatus.d.ts (113, 2020-10-13)
src/@types/KeyStore.d.ts (848, 2020-10-13)
src/@types/KeyValueStore.d.ts (337, 2020-10-13)
src/@types/LogEntry.d.ts (537, 2020-10-13)
src/@types/OrbitDB.d.ts (3094, 2020-10-13)
src/@types/Store.d.ts (1635, 2020-10-13)
src/@types/cid.d.ts (2200, 2020-10-13)
src/@types/identity.d.ts (3276, 2020-10-13)
src/@types/ipfs.d.ts (11860, 2020-10-13)
src/@types/multihash.d.ts (630, 2020-10-13)
src/@types/orbit-db-cache.d.ts (488, 2020-10-13)
... ...

AvionDB JS Implementation

AvionDB: A Distributed, MongoDB-like Database

### Architecture ![AvionDB Architecture](https://github.com/dappkit/aviondb/blob/master/./assets/Architecture.png) AvionDB uses OrbitDB stores to model MongoDB-like Databases. It creates a notion of: - Each AvionDB instance can have several [Databases](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-specs#databases). - Each Database can have several [Collections](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-specs#collections). - Each Collection can have several [Documents](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-specs#documents). See more details in the [Specs](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-specs). ### Project status & support Status: **in active development** **_NOTE!_** _AvionDB is **alpha-stage** software. It means AvionDB hasn't been security audited and programming APIs and data formats can still change. We encourage you to [reach out to the maintainers](https://github.com/dappkit/aviondb/blob/master/https://discord.gg/88YpNuQ) if you plan to use AvionDB in mission critical systems._ This is the TypeScript implementation and it works with **Browsers**, **Node.js** & **TypeScript** with support for Linux, OS X, and Windows . The minimum required version of Node.js is now 8.6.0 due to the usage of `...` spread syntax. LTS versions (even numbered versions 8, 10, etc) are preferred. ## Table of Contents - [Table of Contents](https://github.com/dappkit/aviondb/blob/master/#table-of-contents) - [Install](https://github.com/dappkit/aviondb/blob/master/#install) - [Using NodeJS](https://github.com/dappkit/aviondb/blob/master/#using-nodejs) - [In a web browser](https://github.com/dappkit/aviondb/blob/master/#in-a-web-browser) - [through Browserify](https://github.com/dappkit/aviondb/blob/master/#through-browserify) - [through webpack](https://github.com/dappkit/aviondb/blob/master/#through-webpack) - [from CDN](https://github.com/dappkit/aviondb/blob/master/#from-cdn) - [Usage](https://github.com/dappkit/aviondb/blob/master/#usage) - [Example](https://github.com/dappkit/aviondb/blob/master/#example) - [API](https://github.com/dappkit/aviondb/blob/master/#api) - [Development](https://github.com/dappkit/aviondb/blob/master/#development) - [Run Tests](https://github.com/dappkit/aviondb/blob/master/#run-tests) - [Benchmarks](https://github.com/dappkit/aviondb/blob/master/#benchmarks) - [Specs](https://github.com/dappkit/aviondb/blob/master/#specs) - [Projects using AvionDB](https://github.com/dappkit/aviondb/blob/master/#projects-using-aviondb) - [Frequently Asked Questions](https://github.com/dappkit/aviondb/blob/master/#frequently-asked-questions) - [Are there implementations in other languages?](https://github.com/dappkit/aviondb/blob/master/#are-there-implementations-in-other-languages) - [Where can I see your Roadmap?](https://github.com/dappkit/aviondb/blob/master/#where-can-i-see-your-roadmap) - [What mongodb features does aviondb support?](https://github.com/dappkit/aviondb/blob/master/#what-mongodb-features-does-aviondb-support) - [How can I use AvionDB in my Application?](https://github.com/dappkit/aviondb/blob/master/#how-can-i-use-aviondb-in-my-application) - [Other Questions?](https://github.com/dappkit/aviondb/blob/master/#other-questions) - [Contributing](https://github.com/dappkit/aviondb/blob/master/#contributing) - [Sponsors](https://github.com/dappkit/aviondb/blob/master/#sponsors) - [License](https://github.com/dappkit/aviondb/blob/master/#license) ## Install This module uses node.js, and can be installed through npm: ### Using NodeJS ``` // Using npm npm install --save aviondb // Using Github npm install git+https://github.com/dappkit/aviondb.git ``` We support both the Current and Active LTS versions of Node.js. Please see [nodejs.org](https://github.com/dappkit/aviondb/blob/master/https://nodejs.org/) for what these currently are. The minimum required version of Node.js is now 8.6.0 due to the usage of `...` spread syntax. LTS versions (even numbered versions 8, 10, etc) are preferred. ### In a web browser #### **through Browserify** Same as in Node.js, you just have to [browserify](https://github.com/dappkit/aviondb/blob/master/http://browserify.org/) to bundle the code before serving it. > Note: The code uses `es6`, so you have to use [babel](https://github.com/dappkit/aviondb/blob/master/https://babeljs.io/) to convert the code into `es5` before using `browserify`. #### **through webpack** Same as in Node.js, you just have to [webpack](https://github.com/dappkit/aviondb/blob/master/https://webpack.js.org/) to bundle the the code before serving it. > Note: The code uses `es6`, so you have to use [babel](https://github.com/dappkit/aviondb/blob/master/https://babeljs.io/) to convert the code into `es5` before using `webpack`. #### **from CDN** Instead of a local installation (and browserification) you may request a remote copy of AvionDB from unpkg CDN. To always request the latest version, use the following: ```html ``` CDN-based AvionDB provides the `AvionDB` constructor as a method of the global `window` object. Example: ```javascript // create an AvionDB instance const aviondb = await AvionDB.init("DatabaseName", ipfs); ``` **See [examples/index.html](https://github.com/dappkit/aviondb/blob/master/./examples/index.html) to check out a fully functioning example for AvionDB with browser.** ## Usage **We are upgrading AvionDB to newer versions of `js-ipfs`. For now, please use js-ipfs@0.44.0** ### Example ```javascript // Import modules import AvionDB from "aviondb"; import IPFS from "ipfs"; const runExample = async () => { const ipfs = await IPFS.create(); // Creates a db named "DatabaseName" in the ".aviondb" directory in the project root. // If no path option is defined, $HOME/.aviondb is used for the database directory (e.g. "C:/Users/John/.aviondb" or "~/.aviondb"). const aviondb = await AvionDB.init("DatabaseName", ipfs, { path: "./.aviondb", }); // Returns the List of database names await AvionDB.listDatabases(); // prints ['DatabaseName'] // Creates a Collection named "employees" const collection = await aviondb.initCollection("employees"); // Returns the List of collection names await aviondb.listCollections(); // prints ['employees'] // Adding an employee document await collection.insertOne({ hourly_pay: "$15", name: "Elon", ssn: "562-48-5384", weekly_hours: 100, }); // We also support multi-insert using collection.insert() // See https://github.com/dappkit/aviondb/blob/master/API.md // Search by a single field Or many! var employee = await collection.findOne({ ssn: "562-48-5384", }); // We also support find(), findById() // See https://github.com/dappkit/aviondb/blob/master/API.md // Returns the matching document console.log(employee); // Prints the above added JSON document // Update a document var updatedEmployee = await collection.update( { ssn: "562-48-5384" }, { $set: { hourly_pay: "$100" } } ); // We also support updateMany(), findOneAndUpdate() // See https://github.com/dappkit/aviondb/blob/master/API.md // Returns the updated document console.log(updatedEmployee); // Prints the updated JSON document // await collection.close(); // Collection will be closed. // await aviondb.drop(); // Drops the database // await aviondb.close(); // Closes all collections and binding database. // await ipfs.stop(); }; runExample(); ``` See [FAQs](https://github.com/dappkit/aviondb/blob/master/#how-can-i-use-aviondb-in-my-application) Section for more examples on how to use AvionDB in your project. ## API See [API.md](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/blob/master/API.md) for the full documentation. ## Development ### Run Tests ``` npm test ``` ### Benchmarks Run Write Benchmark ``` npm run benchmarks:write ``` Run Query Benchmark ``` npm run benchmarks:query ``` Run Update Benchmark ``` npm run benchmarks:update ``` See [benchmarks/](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/tree/master/test/benchmarks) for more info on benchmarks. ## Specs We are working on the initial Specs. See [AvionDB Specs doc](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-specs/blob/master/README.md) ## Projects using AvionDB - [nOS Client](https://github.com/dappkit/aviondb/blob/master/https://github.com/nos/client): **nOS** is a blockchain powered virtual operating system that serves as the gateway to Decentralized Applications. The **nOS Client** (Developer MVP Release) allows for the development of Decentralized Applications that interact with Smart Contracts in the back-end. - [orbitdb-nos-identity-provider](https://github.com/dappkit/aviondb/blob/master/https://github.com/nos/orbitdb-nos-identity-provider/): OrbitDB and AvionDB Identity Provider for nOS Network and other ARK Core-based blockchains. - [bitsong-media-player](https://github.com/dappkit/aviondb/blob/master/https://github.com/bitsongofficial/bitsong-media-player): **[Private Repo]** BitSong Media Player for BitSong Blockchain, uses AvionDB to store, and share song tracks & metadata among the browser clients. - [js-pinza](https://github.com/dappkit/aviondb/blob/master/https://github.com/vaultec81/js-pinza): Pinza is a IPFS pinning system using [orbit-db](https://github.com/dappkit/aviondb/blob/master/https://github.com/orbitdb/orbit-db), and [aviondb](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb) as a distributed database. - [Movie-Reviews-CRUD-Application](https://github.com/dappkit/aviondb/blob/master/https://github.com/BCDevs/movies-avionDB): A Kickstarter Application to understand how AvionDB Works by Implementing one. ## Frequently Asked Questions ### Are there implementations in other languages? We are working to implement AvionDB for following languages: - NodeJS & Browser JS - Typescript - Golang - Rust The best place to find out what is out there and what is being actively worked on is likely by asking in the [Discord](https://github.com/dappkit/aviondb/blob/master/https://discord.gg/88YpNuQ). If you want or are planning to create an implementation in a language that is not listed here, then feel free to reach us out and discuss about it in the [Discord](https://github.com/dappkit/aviondb/blob/master/https://discord.gg/88YpNuQ). ### Where can I see your Roadmap? You can find our Roadmap [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues/10). The features in the Roadmap are taken from 2 separate issues([#7](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues/7), [#8](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues/8)) which individually maintain a list of feature proposals related to OrbitDB-specific improvements & AvionDB-specific improvements respectively. The Roadmap is an open discussion, feel free to add your suggestions, comments. ### What mongodb features does aviondb support? You can find all the supported MongoDB-like features in our [API docs](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/blob/master/API.md). ### How can I use AvionDB in my Application? You can see the following examples to get started with AvionDB: - [**aviondb-p2p-sync**](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-p2p-sync) A TodoList example using showing how you can sync/replicate AvionDB data across multiple devices. In this example, we synced a todolist from a desktop browser to a mobile browser using a QR Code. - Check out the app [here](https://github.com/dappkit/aviondb/blob/master/https://bit.ly/aviondb-p2p-sync) - Check out the code [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-p2p-sync) - [**aviondb-firebase**](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-firebase) An example using Firebase for AvionDB Access Control. In this example, we used Firebase email/password authentication as an Access Control for AvionDB (a distributed, MongoDB-like database). So, if you would try to write to AvionDB without logging in, the database will not allow you to do so internally. - Check out the app [here](https://github.com/dappkit/aviondb/blob/master/https://bit.ly/aviondb-firebase) - Check out the code [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-firebase) - [**aviondb-onboard**](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-onboard) An example using Blocknaive's OnBoard.js Auth based Access Controller for AvionDB & OrbitDB. This allows you to integrate [AvionDB](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb) with [@metamask_io](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/metamask_io), [@TorusLabs](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/TorusLabs), [@authereum](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/authereum), [@dapper_labs](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/dapper_labs), [@coinbase](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/coinbase), [@TrustWalletApp](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/TrustWalletApp), [@Trezor](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/Trezor), [@Ledger](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/Ledger), [@fortmatic](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/fortmatic), [@portis_io](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/portis_io), [@Squarelink_Inc](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/Squarelink_Inc), [@WalletConnect](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/WalletConnect), [@opera](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/opera), [@ethstatus](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/ethstatus), [@unilogin](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/unilogin), [@imTokenOfficial](https://github.com/dappkit/aviondb/blob/master/https://twitter.com/imTokenOfficial). - Check out the app [here](https://github.com/dappkit/aviondb/blob/master/https://bit.ly/aviondb-blocknative) - Check out the code [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-onboard) - [**aviondb-ceramic-3id**](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-ceramic-3id) An example using DID-agnostic [Ceramic 3IDs](https://github.com/dappkit/aviondb/blob/master/https://jwt.io/) based Access Controller for AvionDB & OrbitDB. You can join the discussion [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues/41). **Coming Soon** - [**aviondb-jwt**](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-jwt) An example using [JWT](https://github.com/dappkit/aviondb/blob/master/https://jwt.io/) based Access Controller for AvionDB & OrbitDB. You can join the discussion [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues/16). **Coming Soon** - [**aviondb-webauthn**](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb-webauthn) An example using [WebAuthn](https://github.com/dappkit/aviondb/blob/master/https://webauthn.io/) based Access Controller for AvionDB & OrbitDB. You can join the discussion [here](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues/18) **Coming Soon** ### Other Questions? If you didn't find the answer to your question(s), feel free to reach us out on [Discord](https://github.com/dappkit/aviondb/blob/master/https://discord.gg/88YpNuQ). ## Contributing **Take a look at our organization-wide [Contributing Guide](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/blob/master/CONTRIBUTING.md).** As far as code goes, we would be happy to accept PRs! If you want to work on something, it'd be good to talk beforehand to make sure nobody else is working on it. You can reach us [on Discord](https://github.com/dappkit/aviondb/blob/master/https://discord.gg/88YpNuQ), or in the [issues section](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues). If you want to code but don't know where to start, check out the issues labelled ["help wanted"](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+sort%3Areactions-%2B1-desc), ["discussion"](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/issues?q=is%3Aopen+is%3Aissue+label%3A%22discussion%22+sort%3Areactions-%2B1-desc). Please note that we have a [Code of Conduct](https://github.com/dappkit/aviondb/blob/master/CODE_OF_CONDUCT.md), and that all activity in the [@dappkit](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit) organization falls under it. Read it when you get the chance, as being part of this community means that you agree to abide by it. Thanks. ## Sponsors The development of AvionDB has been sponsored by: - [Dappkit](https://github.com/dappkit/aviondb/blob/master/https://dappkit.io) If you want to sponsor developers to work on AvionDB, please consider sponsoring using the "Sponsor" button on the top of the [AvionDB Github Page](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb). ## License [MIT](https://github.com/dappkit/aviondb/blob/master/https://github.com/dappkit/aviondb/blob/master/LICENSE)

近期下载者

相关文件


收藏者