This repository contains the source code to build and operate a Hyperledger Fabric blockchain in Ubuntu 18 and up. The manager uses a REST service to generate, interact and manage Hyperledger Fabric blockchains and its deployed smart contracts. The presented tool has the capability to also operate under ARM processors by utilizing most of the fabric containers developed by chinyati.
- Download and install the programs below to run the fabric network.
- Git
- Docker & Docker Compose
- Go 1.15.x
- Python 3
- PyYAML
- Ruamel.yaml
- Docker
- NodeJS & NPM
- After download, the folder structure should look similar to the directory structure shown below.
Blockchain_Manager ├── blockchain_base │ ├── ... │ ├── chaincode │ │ ├── test_contract │ └── ... ├── express_app └── postman_collection_bcapi
- Load collection
postman_collection_bcapi
into Postman. - Navigate to
express_app
folder and install node dependencies.cd express_app npm install
- Navigate to
blockchain_base/bin
and check that binaries are executables.- Otherwise run
sudo chmod +x *
inside the desired architecture (i.e., arm or vanilla) to update permissions to desired binaries
- Otherwise run
- You are now ready to create your first blockchain.
# To run REST Service
npm run mongoUp # Generates MongoDB container to store blockchain structure information
npm start # Starts Blockchain service on Port 4000
# Run Test Chain
npm run chainUp # Generates a chain with 2 organizations, 1 peer per org, 1 orderer,
# 1 channel (TestChannel) with 1 consortium of org1&2, and block
# structure of 1s (timeout), 10 (max messages) and 2MB (max bytes).
npm run contractUp # Installs test_contract to TestChannel
npm run caliperUp # Generates a caliper instance
# Remove all containers
npm run clean
- Register a blockchain (
Register Blockchain
) - Build registered blockchain (
Build Blockchain
) - Insert new sample transaction to ledger (
Insert Transaction
) - Query submitted transaction from ledger (
Evaluate Transaction
)
This tool is not intented to be deployed for production environments, instead it is tailored for research purposes to facilitate rapid blockchain prototyping and smart contract testing.