Skip to content

Commit

Permalink
added documentation for client NFT setup
Browse files Browse the repository at this point in the history
  • Loading branch information
scottburch committed Aug 7, 2021
1 parent d42b3b7 commit cc94cf7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/nft/Bluzelle NFT Secure Storage API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Bluzelle NFT Secure Storage API

The bluzelle NFT API is a two step process.

* Upload the file (from the browser)
* Notify the network that the file has been uploaded (from your application server)

The second step is necessary so that your identity credentials can be kept secure while not requiring you to act as the middle man for the upload. The file upload happens directly between the users browser and the Bluzelle Net.

The process looks like this:

![](./short protocol.png)

### Step 1: Upload

We have provided a helper function in our Bluzelle JS client library to aid with the upload. You can use this code in your browser application.

````typescript
import {uploadNft} from 'bluzelle'
uploadNft("https:...", data as Uint8Array, "your_org_id"))
````



**The url and org_id will be provided to you by Bluzelle.**

### Step 2: Notify the network

In order for the network to start replicating the uploaded file, it must be notified that the file has been uploaded. We have created another helper function to aid you.

```typescript
bz.createNft(
id, // The id you want to assign to this file
hash, // The hash of the file
vendor, // Your organization id
userId, // Your id for the user that uploaded the file
mime, // The mime type for this file
'metadata', // Any arbritrary metadata you want to store for this file
gasParams) // The gas parameters for the transaction (these will be provided to you)
```

### Creating a bluzelle client instance

Instructions on how to install and use the bluzelle JS client is at https://github.com/bluzelle/blzjs

Binary file added docs/nft/short protocol.dia
Binary file not shown.
Binary file added docs/nft/short protocol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cc94cf7

Please sign in to comment.