Install, Configure, and Deploy the Solution
To implement this solution, there are three main areas to work on as described in the following section.
- Blockchain infrastructure preparation.
- Development and deployment of the smart contract.
- Creation of the application(s) which will make use of our smart contract.
oracle-blockchain-cms-plan-oracle.zip
Create a Hyperledger Fabric network, which initially will be composed of one single organization, but can be easily scaled to as many members as you need.
Then, we will proceed to create the smart contract to handle the logic needed to persist and manage into blockchain the entities required by our business use case.
Once the smart contract project gets created, we will install and deploy it into the blockchain network we created before, then we will configure the accounts, enrollments, and finally we will execute the initialization of the smartcontract and its NFTs.
At this point, the smart contract methods have already been published through the API Gateway of our Oracle Blockchain instance, also known as RESTPROXY, so they are ready to be used by the client applications, in our case the Web Application we have already created with VBCS, and we will provide in the last section.
Next to last step is the creation of the OCI Storage Bucket where the documents will be stored, and finally, last step is reconfiguration of the VBCS sample application to point to our newly created Blockchain Network and the new bucket configured in our tenancy. Once all the reconfiguration is done, application will be deployed into our tenancy.
Create an Oracle Blockchain Network
For the creation of a Hyperledger Fabric (HLF) network based in Oracle Blockchain, we are using the Oracle Blockchain Cloud Service.
We are going to create a single instance HLF network, as per the use case we can show the functionality within one single organization belonging to the network. New organizations can join the network by incorporating their own Blockchain instance, allowing new users from these organizations to own their folders, or review content from existing folders owned by other members.
Create the Founder Instance
Create a Channel
We need to join the organizations at the channel level to allow communication between the founder and the participant. This action will be executed using the Blockchain service console.
Create User Accounts
We will use Oracle Identity Cloud Service to create at least one user for each of the departments among the folders can be interchanged. To each of those users, an account will be created to hold in it the different folders they own.
Create Enrollments in the REST Proxy nodes
Oracle Blockchain Platform supports enrollments to the REST proxy. These enrollments are used in chaincodes where FT or NFT tokens exist, to map the identity of the caller to the role executing the transaction. To do this, you must create the relation of the user to the role defined in blockchain, and for simplicity you can name the role as the user.
Username | Enrollment | Instance |
---|---|---|
cmsrsk001 | cmsrsk001 | org1 |
cmsfin001 | cmsfin001 | org1 |
cmsleg001 | cmsleg001 | org1 |
- From the Blockchain service console of the founder instance (org1), navigate to the Nodes tab.
- Click on the hamburger menu besides restproxy and select View or manage enrollments.
- Select Create New Enrollment.
- Set Enrollment ID as cmsrsk001, User ID as cmsrsk001, and click Enroll.
Prepare the Oracle Blockchain App Builder development environment
The creation of a Hyperledger Fabric (HLF) smart contract requires knowledge of intrinsics about HLF, how to code in Java, Typescript, or GoLang, and how to deploy and manage the whole lifecycle of the smart contract project.
The Oracle Blockchain App Builder has been created in two flavors, you can use it as a command line tool aimed to automate build and deployment steps in CI/CD processes, or you can use it as a Microsoft Visual Code Plugin. Both of them will allow you to execute exactly the same functionality, just select the one you prefer depending on your preferences. Oracle Blockchain App Builder has the following features:
- Development: The Oracle Blockchain App Builder will create the whole chaincode project just creating what is known as a customized specification file. The project will include all the coded entities, all their accessors together with all the CRUD methods to manage those entities, and also the signature of any custom method required for any non-standard or complex business logic required by your application, which will become the only code needed to be manually implemented.
- Deployment: Once the chaincode project is ready to be tested, you can deploy it locally into the pre-configured Hyperledger Fabric Network, or remotely to any existing cloud or on-premises Oracle Blockchain Platform instance. Another option is to package the project to be deployed manually through the Oracle Blockchain console.
- Testing: Once the project has been deployed, you can test any of the auto-generated methods or the custom methods of the chaincode project.
- Debug: In case you are using the Visual Studio Code extension, you will also be able to perform line-by-line debugging of the chaincode.
You can install any of the following two available Oracle Blockchain App Builder versions:
- If you want to use Oracle Blockchain App Builder as a Microsoft Visual Studio plugin, follow the instructions from Install and Configure the Blockchain App Builder Extension for Visual Studio Code.
- If you prefer to use Oracle Blockchain App Builder as a command line tool, follow the instructions from Install and Configure Blockchain App Builder CLI.
If you are not comfortable installing this kind of development tools and all their dependencies, but you have access to Oracle Cloud, you can opt to create a dedicated development box with all these products already installed and prepared to be used in the cloud, and access it remotely. These machines are cost effective because of the compute shape required, and they are only billed while they are up and running.
Note:
In the Lab, to get a cloud machine ready with Visual Code Studio and the Oracle Blockchain App Builder low code plugin installed on it, you only need to execute the Prepare Setup and Environment Setup steps.Create and Configure the OCI Object Storage Bucket
We will configure the OCI Object Storage Bucket that will allow you to store and retrieve documents from the Oracle Visual Builder web application.
Note:
For more details about how to code a Oracle Visual Builder application to upload or download files from OCI Object Storage, see: Upload / Download files from OCI Storage in a Visual Builder app.To enable the usage of Buckets through the REST API offered by OCI Object Storage Buckets, we must create an OCI API Key related with user allowed to execute the REST API. Execute the following two configuration tasks to use the OCI Object Storage Buckets in our VBCS Web Application.
To enable the usage of OCI Object Storage Buckets from your Oracle Visual Builder App, you must create an OCI API Key to get access to the OCI Services via REST API.