mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 09:46:57 +01:00
add setup block
This commit is contained in:
parent
c22ec13358
commit
4ff6adddcc
@ -12,9 +12,19 @@ learn: >
|
||||
- How asset metadata is updated. In BigchainDB it is possible to use `TRANSFER` transactions to change the state of an asset, in this case the mileage of a car.
|
||||
---
|
||||
|
||||
# Connect to IPDB
|
||||
# Setup
|
||||
|
||||
Start by installing the official [BigchainDB JavaScript driver](https://github.com/bigchaindb/js-bigchaindb-driver):
|
||||
|
||||
```bash
|
||||
npm i bigchaindb-driver
|
||||
```
|
||||
|
||||
Then include as a module and connect to IPDB or any BigchainDB node:
|
||||
|
||||
```js
|
||||
const BigchainDB = require('bigchaindb-driver')
|
||||
|
||||
const API_PATH = 'https://test.ipdb.io/api/v1/'
|
||||
const conn = new BigchainDB.Connection(API_PATH, {
|
||||
app_id: '2db4355b',
|
||||
|
@ -13,10 +13,30 @@ learn: >
|
||||
|
||||
We show how divisible assets work in BigchainDB by showing how you could create your own token launch on BigchainDB. The token distribution is represented by divisible assets (tokens) linked to one specific application (company/network).
|
||||
|
||||
When creating a divisible asset in BigchainDB, the number of the sub-assets that you want to create should be specified.
|
||||
# Setup
|
||||
|
||||
Start by installing the official [BigchainDB JavaScript driver](https://github.com/bigchaindb/js-bigchaindb-driver):
|
||||
|
||||
```bash
|
||||
npm i bigchaindb-driver
|
||||
```
|
||||
|
||||
Then include as a module and connect to IPDB or any BigchainDB node:
|
||||
|
||||
```js
|
||||
const BigchainDB = require('bigchaindb-driver')
|
||||
|
||||
const API_PATH = 'https://test.ipdb.io/api/v1/'
|
||||
const conn = new BigchainDB.Connection(API_PATH, {
|
||||
app_id: '2db4355b',
|
||||
app_key: 'b106b7e24cc2306a00906da90de4a960'
|
||||
})
|
||||
```
|
||||
|
||||
# Create divisible asset
|
||||
|
||||
When creating a divisible asset in BigchainDB, the number of the sub-assets that you want to create should be specified.
|
||||
|
||||
```js
|
||||
const nTokens = 10000
|
||||
let tokensLeft
|
||||
|
Loading…
Reference in New Issue
Block a user