Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle Blockchain Quick Start Guide

You're reading from   Oracle Blockchain Quick Start Guide A practical approach to implementing blockchain in your enterprise

Arrow left icon
Product type Paperback
Published in Sep 2019
Publisher Packt
ISBN-13 9781789804164
Length 350 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Vivek Acharya Vivek Acharya
Author Profile Icon Vivek Acharya
Vivek Acharya
Nimesh Prakash Nimesh Prakash
Author Profile Icon Nimesh Prakash
Nimesh Prakash
Anand Eswararao Yerrapati Anand Eswararao Yerrapati
Author Profile Icon Anand Eswararao Yerrapati
Anand Eswararao Yerrapati
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. Exploring Blockchain and BaaS 2. Construing Distributed Ledger Tech and Blockchain FREE CHAPTER 3. Delving into Hyperledger Fabric 4. Engage in Business Case on Blockchain Platform 5. Managing Solutions on Oracle Blockchain Platform 6. Developing Solutions on Oracle Blockchain Platform 7. Other Books You May Enjoy

Testing chaincode

A chaincode can be tested locally, without installing it on OBP. There are two ways to test chaincode: using mock shim and using REST endpoints.

Testing chaincode using the shim

Let's see how to test the earlier chaincode developed locally in the Go language. Before that, here are some key points to note:

  • Install the Go language locally on your machine.
  • This test filename should take this form: <Go file name>_test.go.

For example: if the chaincode name is education.go, then this test filename should be education_test.go.

  • Keep both files in the same folder.
  • Set GOPATH to the folder.
  • Install the dependent packages used in the chaincode if they can't be found.

For example: go get github...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime