diff --git a/_src/_guides/_setup.md b/_src/_guides/_setup.md index 8e06c39..bdbb230 100644 --- a/_src/_guides/_setup.md +++ b/_src/_guides/_setup.md @@ -10,6 +10,7 @@ Then, include that as a module and connect to any BigchainDB node. You can creat ```js const BigchainDB = require('bigchaindb-driver') +const bip39 = require('bip39') const API_PATH = 'https://test.bigchaindb.com/api/v1/' const conn = new BigchainDB.Connection(API_PATH, { diff --git a/_src/_guides/tutorial-car-telemetry-app.md b/_src/_guides/tutorial-car-telemetry-app.md index 1060f2a..71106a1 100644 --- a/_src/_guides/tutorial-car-telemetry-app.md +++ b/_src/_guides/tutorial-car-telemetry-app.md @@ -44,6 +44,7 @@ So in our app, each object in the real world as the car, the telemetry box in th You will create a DID class that inherits from Orm BigchainDB driver, so DID objects will have all of the methods available in Orm. The `entity` represents the public key of the object itself. ```js +const Orm = require('bigchaindb-orm') class DID extends Orm { constructor(entity) { diff --git a/_src/_guides/tutorial-rbac.md b/_src/_guides/tutorial-rbac.md index 2636162..38d1058 100644 --- a/_src/_guides/tutorial-rbac.md +++ b/_src/_guides/tutorial-rbac.md @@ -29,7 +29,7 @@ Let's create the app. You will create an asset for Admin type which will act as const nameSpace = 'rbac-bdb-tutorial' async function createApp(){ // Generate keypair for admin instance - const admin1 = new driver.Ed25519Keypair() + const admin1 = new BigchainDB.Ed25519Keypair() // Create admin user type. This is the asset representing the group of // admins @@ -67,20 +67,20 @@ The `createNewAsset` function looks like this ```js async function createNewAsset(keypair, asset, metadata) { - let condition = driver.Transaction.makeEd25519Condition(keypair.publicKey, + let condition = BigchainDB.Transaction.makeEd25519Condition(keypair.publicKey, true) - let output = driver.Transaction.makeOutput(condition) + let output = BigchainDB.Transaction.makeOutput(condition) output.public_keys = [keypair.publicKey] - const transaction = driver.Transaction.makeCreateTransaction( + const transaction = BigchainDB.Transaction.makeCreateTransaction( asset, metadata, [output], keypair.publicKey ) - const txSigned = driver.Transaction.signTransaction(transaction, + const txSigned = BigchainDB.Transaction.signTransaction(transaction, keypair.privateKey) let tx await conn.postTransaction(txSigned) @@ -97,9 +97,9 @@ You have just generated the admin type and app asset, so now you are able to cre ```js function createUsers() { - const user1 = new driver.Ed25519Keypair() - const user2 = new driver.Ed25519Keypair() - const user3 = new driver.Ed25519Keypair() + const user1 = new BigchainDB.Ed25519Keypair() + const user2 = new BigchainDB.Ed25519Keypair() + const user3 = new BigchainDB.Ed25519Keypair() const adminuser1Metadata = { event: 'User Assigned',