perak / meteor-bigchain-collection

Extends Mongo.Collection, writes data to BigchainDB
4 stars 1 forks source link

publicKey and privateKey generation? #4

Open awatson1978 opened 6 years ago

awatson1978 commented 6 years ago

Hi there! Thank you so much for creating this package! Quick question... I understand how to get "app_id" and "app_key" through signing up with IPDB. But how do we generate the publicKey and privateKey? Can we just make random hashes for that? Do we register somewhere?
-a

perak commented 6 years ago

@awatson1978 typing from phone, but I will try to copy paste example...

perak commented 6 years ago
import BigchainDB from "bigchaindb-driver";
import bip39 from "bip39";

var keypair = new BigchainDB.Ed25519Keypair(bip39.mnemonicToSeed(“YOUR_PASSWORD”).slice(0, 32));
perak commented 6 years ago

In order bip39 package to work with newer versions if meteor, you will need to put this into client scope:

global.Buffer = global.Buffer || require("buffer").Buffer;

perak commented 6 years ago

By the way, this package is just experiment, and is not perfect way to work with bigchaindb.

If you need help how to use BDB in “real world” conditions, feel free to ask (I’m using bigchaindb in one project but without this package)

awatson1978 commented 6 years ago

Interesting. So that's just dropping down into the bigchaindb-driver. Gotchya. Do you recommend doing the entire implementation there?

I've got a project, usecase, and greenlight to do an IPFS/IPDB app, and am sketching out the implementation right now.

Thank you for the hints and recommendations!