getting an error when I am trying to add an asset through transaction in hyperledger composer

getting an error when I am trying to add an asset through transaction in hyperledger composer

<strong>sample.cto file</strong>

sample.cto file

namespace org.example.basic
 asset Supplier identified by suppliername
    {
      o String suppliername
    }
    asset product identified by productname{
    o String productname
    -->Supplier supplier
    o Integer amount
    }
transaction SampleTransaction {
      -->product productasset
      o String productname
      o String supplier
      o Integer amount
    }

logic.js file

/* Sample transaction processor function. * @param {org.example.basic.SampleTransaction} tx The sample transaction instance. * @transaction */

async function createPost(tx) {


var factory = getFactory();
      return getAssetRegistry("org.example.basic.product")
      .then(function(postAssetRegistry) {
       var productname=tx.productname
       newPost = factory.newResource("org.example.basic", "product", productname);
       newPost.productname = tx.productname;
       newPost.supplier = tx.supplier;
       newPost.amount=tx.amount;

   return postAssetRegistry.add(newPost);

})

}

click here to view error image



blockchain hyperledger

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Top Hyperledger Blockchain Development Companies Reviews 2020 – TopDevelopers.co

An extensively researched list of top hyperledger developers with ratings & reviews to help find the best hyperledger Blockchain Development Companies around the world.

5 Blockchain Applications That Have Transformed the World of Technology

The blockchain is the decentralized database of the blocks of information, which gets recorded in the chain format and linked in a secured crypto graphical manner. This technology ensures proper safety of the data due to its secure nature, and it totally changes how people carry out transactions. It also brings about a faster and secure process of validating information needed to establish reliability.

What Is The Difference Between Blockchain And Bitcoin?

Our Blockchain Online Training will provide you to learn about Blockchain technology aspects with realty. Our Blockchain Course also includes live sessions, live Projects

What Makes a Blockchain Secure?

Our Blockchain Online Training will provide you to learn about Blockchain technology aspects with realty. Our Blockchain Course also includes live sessions, live Projects

Revolutionary Application of Blockchain Technology

Our Blockchain Online Training will provide you to learn about Blockchain technology aspects with realty. Our Blockchain Course also includes live sessions, live Projects