Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryandsilva/easy-bigchain
:star: Helper library for BigChainDB (Blockchain Database) tasks :star:
https://github.com/ryandsilva/easy-bigchain
bigchaindb bip39 blockchain helper-functions javascript
Last synced: 25 days ago
JSON representation
:star: Helper library for BigChainDB (Blockchain Database) tasks :star:
- Host: GitHub
- URL: https://github.com/ryandsilva/easy-bigchain
- Owner: RyanDsilva
- License: mit
- Created: 2019-01-07T18:01:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T20:49:58.000Z (almost 6 years ago)
- Last Synced: 2024-10-27T23:26:35.182Z (2 months ago)
- Topics: bigchaindb, bip39, blockchain, helper-functions, javascript
- Language: JavaScript
- Homepage:
- Size: 271 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⭐️ Easy Bigchain ⭐️
![Stars](https://img.shields.io/github/stars/knapsackt/easy-bigchain.svg?style=for-the-badge)
![Issues](https://img.shields.io/github/issues/knapsackt/easy-bigchain.svg?style=for-the-badge)
![MIT](https://img.shields.io/github/license/knapsackt/easy-bigchain.svg?style=for-the-badge)> Helper library for BigChainDB tasks. Blockchain Database now with a high level abstracted API. Blockchain, accessible to all!
[![HitCount](http://hits.dwyl.io/knapsackt/easy-bigchain.svg)](http://hits.dwyl.io/knapsackt/easy-bigchain)
---
## Installation 💻
```bash
$ npm install easy-bigchain --save
```## Usage 👨💻
```js
import bigchain from 'easy-bigchain'
```### 1. Connect to BigChainDB
```js
const connection = bigchain.connect(CONNECTION_STRING)
// Default == https://test.bigchaindb.com/api/v1/
```### 2. Generate KeyPairs for Users
```js
const user = bigchain.generateKeypair()
```> OR
```js
const user = bigchain.generateKeypair(SEED_PHRASE)
```### 3. Create Asset
```js
bigchain.createAsset(CONNECTION_OBJECT, ASSET, METADATA, USER, function(
transaction
) {
// execute code
})
```- **CONNECTION OBJECT** : Object returned from the _connect()_ function call
- **ASSET** : The main data object (immutable)
- **METADATA** : Additonal Information to be stored
- **USER** : Object returned from the _generateKeypair()_ function call### 4. Transfer Asset
```js
bigchain.transferAsset(
CONNECTION_OBJECT
TRANSACTION,
METADATA,
CURRENT_OWNER,
NEW_OWNER,
function(transaction) {
// execute code
}
)
```- **CONNECTION OBJECT** : Object returned from the _connect()_ function call
- **TRANSACTION** : The original Transaction from where the asset is to be transferred
- **METADATA**: Additonal Information to be stored
- **CURRENT OWNER and NEW OWNER** are objects returned from the _generateKeypair()_ function call#### Due to some unexpected behaviour of the _getTransaction()_ function, I have made use of the entire transaction itself. Not efficient but works till that issue is fixed.
---
## Contributing ✨
Please send a Pull Request with appropriate documentation and I would be more than happy to merge it! 😄