https://github.com/grmvoid/chainvault
https://github.com/grmvoid/chainvault
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/grmvoid/chainvault
- Owner: grmvoid
- License: mit
- Created: 2020-11-10T16:34:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-05T06:51:43.000Z (3 months ago)
- Last Synced: 2025-03-05T07:31:07.928Z (3 months ago)
- Language: TypeScript
- Size: 990 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChainVault
ChainVault is a database that saves data in files and memory. It is based on blockchain technology, so the data is immutable and any change in the data causes chain disturbances and data corruption. ChainVault provides only the SDK that we can implement in our project.
## Setup
Clone this repo to your desktop and run npm install to install all the dependencies.
## Example
```
import ChainVault from 'chainvault'const db = new ChainVault('db', 4)
db.initialize()const blocks = db.find();
console.log(blocks);
```## ToDo
- [] Setup ESLint / Prettier
- [] Prepare CI for Yarn Workspaces (Monorepo)
- [] Make better docs / JSDocs
- [] P2P Network
- [] Implement Consensus algorithm
- [] Make Unit Tests for all packages## API Reference
ChainVault(dbName: string, difficult: number): ChainVault
Constructor for ChainVault class.
initialize(): void
Initializes connection to database.
find(): Array
Returns all blocks from chain
findOne(index: number): Block
Return one block by specified index from chain
insert(data: object): Block
Saves the new block and returns it.
validate(): boolean
Check validates of chain.
## License
ChainVault is licensed under the MIT - see the [LICENSE](LICENSE) file for details.