Hyperledger Fabric setup - hyperledger-fabric

I would like to setup Hyperledger Fabric on an Ubuntu machine with docker (docker-compose up). Is it possible to run the chaincode and nodejs code from another system (Mac system), as I already have Go and nodejs ready on the Mac.
Please help me with this query.

you can use same environment in different systems. This is the main reason to choose docker and docker-compose.
Just follow steps. Please confirm the version of tools.
To run on another system, you only have to simply build the image of your current hyperledger package on current system(Ubuntu). and use this image on another system(MAC).

Yes you can totally do that. Use this example: https://github.com/hyperledger/fabric-sdk-node/tree/master/examples/balance-transfer
Run docker-compose in your ubuntu machine. Update the app config.json and /app/network-config.json with ubuntu machine IP and make sure required ports are opened.
Run app on your mac.

Related

There has been a runner system failure, please try again

How to resolve this error specially on macbook. I have installed docker on my machine also but its not working.
You have to start docker deamon on your gitlab runner.
Below is link to docker desktop for mac.
If you start docker desktop gui, docker deamon will start.
https://docs.docker.com/desktop/mac/
This problem is not just for mac computers but also for windows. I experienced this problem and found out that the the PowerShell script part for Infra as Code that I was using was not installing docker.
I therefore made changes to the Infra as Code to ensure that Microsoft-Hyper-V is enabled and that docker is actually installed and docker service started, then the computer HAS to be restarted for the changes to pick up.
I do not know the exact order of when the restart should happen since I am still understanding the flow but I can update my answer when I have more info

How to distribute python3 code which contains external libraries

I wrote a small script in python3 that uses numpy, matplotlib, and other libraries used by pyCharm CE in my linux machine.
I used pyCharm to code and create the virtual env.
The script works only inside pyCharm because of the dependencies.
And a friend of mine wants to use my script in a windows machine. I'm not sure if even he has python installed.
How can I run my script outside pyCharm, or how can I activate the virtual env created by pyCharm to run the script?
And
How I can create a package or something to give the script to my friend or anyone else to freely use it?
Thanks
One way of going about to ask your friend to install python3.x and pip in his system. Meanwhile you create a requirements.txt which consists of the libraries that need to be installed and their versions in this format.
dj-database-url==0.5.0
Django==2.2.5
pytz==2019.2
sqlparse==0.3.0
psycopg2>=2.7,<3.0
Then ask your friend to run pip install -r <path to requirements.txt>. This will install all the required libraries and if there is no OS based dependencies then the project should run fine.
Another way of doing it in the case of bigger project where there are OS based dependencies is to use a containerization tool such as docker. Containerization lets you run projects, in other machines, which are dependent on various packages or environments which are available/installed in your machine.
For example: Imagine I created a python based application which is dependent on multiple packages in my Debian machine. I can build a docker image using python3.x as the base and install the required packages inside the image during the build time. It is fairly simple to do so. After doing so I can push the image to docker hub which is a registry to store docker images. Do mind that the images stored here are publicly available. If you are worried about that, you can use a private AWS ECR registry to store your images. Once I have pushed the image, anyone with access to the image can pull it and spin up a container. A container is an instance of an image which can run the applications/scripts/anything that the image is built to do. In order to be able to spin up containers they will need docker installed in their machine.
This way you can share your project and make it run in anyone's machine with as little hassle as possible. They will not need anything other than docker installed in their machine. Unlike Virtual Machine docker containers are not heavy on your machine.
In your case using docker you can build an image (much like an ISO image) with python3.x as base and install all the required packages such as numpy, matplotlib and other libraries, then copy the scripts required for the project to run into the image and push it to docker hub or a private registry of your choice. Then you can give your friend an access to the image. Your friend will need Docker for Windows installed in his machine in order to be able to spin up a container using the image you provided him with. This container will have your script running as it will have all the required dependencies installed in it by you while building the image itself.
For more info on Docker: https://www.docker.com/

error response from daemon container is not running

Im running ubuntu terminal 18.04 on window 10 Pro , Im getting error while running ./startFabric.sh
Error response from daemon: Container d827b753c3fda5ca92ada94c28e6362ebab32960f2af8805b4c9706e0056734d is not running
I have tried all the methods posted previously, can anyone please help me?
I tried removing all the container by using command docker ps -qa | xargs docker rm -f
https://i.imgur.com/NxxVyUn.png
Looks like you are trying to run the Hyperledger Composer simple fabric development server (which is basically a very simple hyperledger fabric environment to help you get started with composer using a hyperledger fabric network) inside a windows subsystem layer for linux environment. This isn't supported on Windows (either in git bash or in windows subsystem layer for linux).
If you are looking to use hyperledger composer then you should use a hypervisor to run a real linux VM such as virtualbox, vmware or hyperv (however it is highly recommended that you now invest time in the new programming models in hyperledger fabric rather than use hyperledger composer)
If you are looking to just using hyperledger fabric then you can start by looking at
https://hyperledger-fabric.readthedocs.io/en/release-1.4/install.html

shinyproxy basic basics (+ some general web knowledge)

The problem
While searching for ways to deploy shiny apps I stumbled across ShinyProxy. From what I understand it's an alternative for ShinyServer. However, I lack some (very basic) knowledge to follow the guide provided.
The questions
Can ShinyProxy be installed just on any bought/rented server? Do I need to preinstall some other software?
Where do I type in the commands provided in the ShinyProxy guide?
Does Docker need to be installed on the server or is it a tool to deploy to the server and is thus installed locally?
The ShinyProxy guide misses a point about installing ShinyProxy. Why? Is it not installed (or is installation so obvious)?
I couldn't actually find instructions on how to run a shiny app with ShinyProxy.
The authors of ShinyProxy can probably provide a much better answer, but here is my understanding:
Your server needs to support Java 8 and Docker (or you can install Java 8 and Docker on your server).
Assuming you logon to your server via SSH, the commands will be typed in the SSH terminal.
Yes Docker needs to be installed on the server
It appears that ShinyProxy does not need to be installed. You just need to download it (the shinyproxy-0.5.0.jar file) to a location on the server, and then run java -jar shinyproxy-0.5.0.jar (in your SSH terminal)
To run a Shiny app, you need to package it as an R package first, then build a Docker image for the R package. The app is then actually running inside a Docker container. You also need a configuration file to tell ShinyProxy where to look for your Docker image. Example is here https://github.com/openanalytics/shinyproxy-demo

docker-compose/boot2docker use in Ubuntu

I have a docker-compose.yml file in my project and I am trying to use it using docker on my linux machine (Ubuntu 14.04).
Can someone shed a light on this how I can use this in my project?
I have installed docker and docker-compose already. Also, I tried using boot2docker(however, it's only for Mac and Windows), it did not work.
Please help!
First thing is, you don't need to use boot2docker if you are already using the Linux machine. Now, if you have already installed docker and docker compose, just go through this documentation to get started.
In particular, try this example.

Resources