hyperledger-labs / fablo

Fablo is a simple tool to generate the Hyperledger Fabric blockchain network and run it on Docker. It supports RAFT and solo consensus protocols, multiple organizations and channels, chaincode installation and upgrade.
Apache License 2.0
191 stars 72 forks source link

Problem with chaincode setup on new, default networks #317

Closed sapient closed 2 years ago

sapient commented 2 years ago

Hi,

It seems that the chaincode install fails either at the end of building, or immediately after it has been built, however I am unable to determine which.

After running

ubuntu@fabu:~/fablo$ fablo init node rest
ubuntu@fabu:~/fablo$ fablo up

The process goes through all the normal steps, I will summarise here

=========================================================== v: 1.0.2
Validation errors count: 0
Validation warnings count: 0
===========================================================
...
============ 🤓 Generating basic configs 🤓 ==============
==== 🔒 Generating crypto material for Orderer 🔒 ====
==== 🔒 Generating crypto material for Org1 🔒 ====
==== 🏠 Generating genesis block for group group1 🏠 ====
============ 🚀 Starting network 🚀 ==============
============ 🤓 Generating config for 'my-channel1' 🤓 ==============
============ 😻 Creating 'my-channel1' on Org1/peer0 😻 ==============
==== 😸 Joining 'my-channel1' on  Org1/peer1 😸 ====

All of the steps above have more output and the results are all successful.

Finally, we get to the chaincode part

============ 😎 Packaging chaincode 'chaincode1' 😎 ==============
Buiding chaincode 'chaincode1'...
   CHAINCODE_NAME: chaincode1
   CHAINCODE_LANG: node
   CHAINCODE_DIR_PATH: /home/ubuntu/fablo/./chaincodes/chaincode-kv-node
   NODE_VERSION: v12.22.12 (recommended: 12)

ubuntu@fabu:~/fablo$ docker ps
...

Before fablo exits, I do see the normal node build thing happen, bunch of libs downloaded etc, but then it just quits, while I THINK I should see more details about the actual installation of the contract. When I log into the cli, the chaincode1 directory contains a full node_modules, however the chaincode_packages directory is completely empty, and when I query the channel, only the lifecycle chaincode is installed.

Obviously something is crashing, but I would like some help in figuring out what. ie, are there any log files? Any extra flags I can pass for more info? etc

Thanks

sapient commented 2 years ago

So I have spun up a complete fresh VM on AWS, installed docker and docker compose, nvm and node v12. I ran the following commands

    1  sudo apt-get update
    2  sudo apt-get upgrade
    3  sudo apt install apt-transport-https ca-certificates curl software-properties-common
    4  sudo apt install docker.io
    5  sudo apt install docker-compose
    6  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    7  nvm install 12
    8  nvm use 12
    9  sudo curl -Lf https://github.com/hyperledger-labs/fablo/releases/download/1.0.2/fablo.sh -o /usr/local/bin/fablo && sudo chmod +x /usr/local/bin/fablo
   10  mkdir fab
   11  cd fab/
   12  fablo init rest node
   13  fablo up

Again crashed after building the contract, while it works 100% fine locally, I have to assume I am missing some installed requirement. Is there a list anywhere of what pre-requisite software needs to be installed to get this working?

sapient commented 2 years ago

I turned off the --silent flag on the npm build command and discovered the missing requirement was make. I installed build-essential, and while I got a ton of warning, but it built and installed.