mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 01:36:55 +01:00
Updates in the text
This commit is contained in:
parent
7ae5073b35
commit
47f0079cd8
@ -1,17 +1,25 @@
|
||||
---
|
||||
layout: guide
|
||||
|
||||
title: "Tutorial: Token distribution launch"
|
||||
tagline: Build a token launch with BigchainDB
|
||||
title: "Tutorial: How to launch your own token on BigchainDB"
|
||||
tagline: Learn how to use divisible assets in BigchainDB for token distribution events
|
||||
header: header-token.jpg
|
||||
|
||||
learn: >
|
||||
- How BigchainDB can be used to record the transactions made by a token distribution launch
|
||||
|
||||
- How to use divisible assets on BigchainDB
|
||||
|
||||
- How assets in BigchainDB can represent tokens
|
||||
|
||||
- How tokens can be distributed to participants using TRANSFER transactions
|
||||
|
||||
---
|
||||
|
||||
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).
|
||||
Hi there! Welcome to our second tutorial about divisible assets. For this tutorial, we assume that you are familiar with the BigchainDB primitives (assets, inputs, outputs, transactions etc.). If you are not, familiarize yourself with [Key concepts of BigchainDB](../key-concepts-of-bigchaindb/).
|
||||
|
||||
# About token distribution events
|
||||
|
||||
In the last 12 months we have witnessed exponential growth in token distribution events. Most of them have been launched on Ethereum. Since we are experiencing rising interest in potential token launches on BigchainDB, this tutorial aims at showing a very simple approach on how to launch your own token on BigchainDB. Note however, that we do not support ERC20 and no one has launched tokens on BigchainDB yet. This tutorial just aims at showing one possible approach.
|
||||
|
||||
# Setup
|
||||
|
||||
@ -21,21 +29,21 @@ Start by installing the official [BigchainDB JavaScript driver](https://github.c
|
||||
npm i bigchaindb-driver
|
||||
```
|
||||
|
||||
Then, include that as a module and connect to IPDB or any BigchainDB node. Use the credentials below or create your own `app_id` and `app_key` on [IPDB](https://ipdb.io/#getstarted).
|
||||
Then, include that as a module and connect to IPDB or any BigchainDB node. In the case of IPDB, create your own `app_id` and `app_key` on [IPDB](https://ipdb.io/#getstarted).
|
||||
|
||||
```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'
|
||||
app_id: 'Get one from developers.ipdb.io',
|
||||
app_key: 'Same as app_id'
|
||||
})
|
||||
```
|
||||
|
||||
# Create divisible asset
|
||||
# Usage of divisible assets to create tokens
|
||||
|
||||
When creating a divisible asset in BigchainDB, the number of the sub-assets that you want to create should be specified.
|
||||
BigchainDB supports divisible assets. A divisible asset is an asset that has a fixed number of sub-assets linked to it. These fixed sub-assets that are linked to it, represent your tokens. When creating a divisible asset in BigchainDB, the number of the sub-assets (tokens) that you want to create needs to be specified. That represents your fixed total supply of tokens. The code below illustrates how to create a divisible asset with 10000 tokens associated to it.
|
||||
|
||||
```js
|
||||
const nTokens = 10000
|
||||
@ -65,7 +73,7 @@ function tokenLaunch() {
|
||||
}
|
||||
```
|
||||
|
||||
We have decided to create 10000 tokens. For that there is an extra parameter to the `makeOutput()` function. Pay attention to give the function a string instead of a plain number. With the `tokenCreator` keypair we indicate who the owner of the tokens will be. Once the transaction is accepted by BigchainDB we update the value of the tokens left in the possesion of the creator.
|
||||
Now, we have minted 10000 tokens. For that there is an extra parameter to the `makeOutput()` function. Pay attention to give the function a string instead of a plain number. With the `tokenCreator` keypair we indicate who the owner of the tokens will be. Once the transaction is accepted by BigchainDB we update the value of the tokens left in the possesion of the creator.
|
||||
|
||||
Once the tokens are created we can start to spread it over our users.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user