ProvenDB Hyperledger service is a client wallet for a Hyperledger network, which is consumed by ProvenDB Anchor service. At the moment, you can use this repo to run a POC Hyperledger testnetwork and a ProvenDB Hyperledger wallet service on the same host.
Most of the scripts used to create and destroy a test network are from the official fabric sample. You can also refer to this official Fabric test network docs for a depth understanding of the following procedure
-
go: 1.14+
-
docker-compose: 1.26.2+
-
clone this repo
-
download necessary deps in this repo:
./bootstrap.sh
-
add the following mapping to
/etc/hosts
:127.0.0.1 orderer.example.com 127.0.0.1 peer0.org1.example.com 127.0.0.1 peer0.org2.example.com 127.0.0.1 ca.example.com
-
create a Hyperledger test network:
./create_network.sh
(re-run this to recreate the network) -
compile and deploy chaincode:
./deploy_chaincode.sh
(re-run to update the chaincode, but beware to increment the version inCC_VERSION
) -
build and run the Hyperledger wallet service:
make ./hyperledger
./delete_network.sh
- remove the mapping from
/etc/hosts
set in the step 3 of the network setup
http://localhost:8080
.
├── bin # deps created by ./bootstrap.sh
├── chaincode # the smart contract that is deployed to the Hyperledger testnet and embeds data in transactions
├── cmd
│ ├── hyperledger # the ProvenDB Hyperledger service binary, which is running along side the Hyperledger testnet in an Azure VM
│ └── playground # playground binary
├── config # created by ./create_network.sh
├── data # some internal wallet data generated by the ProvenDB Hyperledger service
├── keystore # created by ./create_network.sh
├── pkg
│ └── hyperledger # core logic of the ProvenDB Hyperledger service, which uses the Hyperledger Fabric Go SDK: https://github.com/hyperledger/fabric-sdk-go
└── test-network # Hyperledger testnet installation that contains scripts and states of the testnet. The scripts are copied from https://github.com/hyperledger/fabric-samples
There is a deployed Hyperledger testnet on an Azure VM, where a ProvenDB Hyperledger service is also running aside. The ProvenDB Hyperledger service is currently consumed by all anchors in dev
, stg
and prd
to support HYPERLEDGER
anchor type
Use the following command to gain SSH access to it:
./ssh-to-vm.sh
.
├── go # golang installation
└── provendb-hyperledger # ProvenDB Hyperledger service installation. Please refer to `Project Structure` section
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
act='ttyout="*"'
tar -xf go1.14.4.linux-amd64.tar.gz --checkpoint --checkpoint-action=$act -C /usr/local
rm go1.14.4.linux-amd64.tar.gz
if [ -z $GOROOT ]
then
echo "export GOROOT=/usr/local/go" >> ~/.profile
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
GOPATH=$PWD/../../gocc
to-absolute-path $GOPATH
GOPATH=$ABS_PATH
echo "export GOPATH=$GOPATH" >> ~/.profile
echo "======== Updated .profile with GOROOT/GOPATH/PATH===="
echo "export GOROOT=/usr/local/go" >> ~/.bashrc
echo "export GOPATH=$GOPATH" >> ~/.bashrc
echo "======== Updated .profile with GOROOT/GOPATH/PATH===="
# UPDATED Dec 15, 2019
echo "export GOCACHE=~/.go-cache" >> ~/.bashrc
mkdir -p $GOCACHE
chown -R $USER $GOCACHE
else
echo "======== No Change made to .profile ====="
fi
https://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session https://tmuxcheatsheet.com/