Vous êtes sur la page 1sur 7

5 minutes to Install Hyperledger

Fabric v1.4 on Ubuntu 18.04


DigitalOcean
Edward Tsang

(Updated for Fabric 1.4, still less than 3 mins to read, 5 mins to
install! But try not to use the $5 1GB RAM instance with 1.4, you
might run out of memory when starting the sample network, use
the $10 2GB RAM one.)

Yes, It can be done, in 5 mins or so. So I won’t waste too much


time to explain these to you. Just get a basic Ubuntu 18.04 Droplet
from DigitalOcean, or use my link (Discount code for newbies, I
get some free referral credits too) to sign up. Then run the
following steps.

Step 1 –

For new Droplets, always set the locale (choose en_US.UTF-8 if in


doubt) and do apt update/upgrade.

sudo dpkg-reconfigure locales


sudo apt-get update
sudo apt-get upgrade

Step 2 –

Install components needed for running Hyperledger.

sudo apt-get install curl git docker.io docker-compose golang


nodejs npm
Step 3.-

Setup docker this way.


sudo usermod -a -G docker $USER
sudo systemctl start docker
sudo systemctl enable docker

Step 4.-

This is the magic step to setup all the images needed for
Hyperledger Fabric v1.3.
curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.0

That’s it. You have done it. (If you needed previous version of
Fabric, just type 1.3.0 or other release number in the above
command.)

“Now what?” You might ask… You can try to build and run your
first Hyperledger Fabric network. Files are already there. Change
into the right directory and then run the generate and up
command.

cd fabric-samples/first-network
./byfn.sh generate
./byfn.sh up

You will see a big “Start” and “End” message when it is up and
running.

To check that everything is up and running, check with docker.


docker ps -a

To stop your network, run the following.


./byfn.sh down
That’s it. Will write more about Chaincode next time.

If you want to install Hyperledger Composer Playground on


Ubuntu 18.04, you can follow my other guide here.

5 minutes to Install Hyperledger


Composer Playground on Ubuntu
18.04 DigitalOcean
Yes, another 5 mins guide. This time to setup Hyperledger
Composer on Ubuntu 18.04. Official documentation supports
Ubuntu 16.04, but I have tested it on 18.04 and it is working fine.
Just follow the steps below and you will be up and running in a
few minutes. Should work on other VPS, but I am using
DigitalOcean. If you want to just run Fabric 1.4 without Composer,
you can follow my other guide here. Just get a basic Ubuntu 18.04
Droplet from DigitalOcean, or use my link (Discount code for
newbies, I get some free referral credits too) to sign up. Then run
the following steps.

Step 1 –

For new Droplets, always set the locale (choose en_US.UTF-8 if in


doubt) and do apt update/upgrade.
sudo dpkg-reconfigure locales
sudo apt-get update
sudo apt-get upgrade
Step 2 –

Add another user “playground”, using root will have all sorts of
problems during installation, please make sure you use user
“playground” to do it. Just follow the prompts to enter the info.
You will need to give it a password which you will need later on.
sudo adduser playground

Step 3 –

Set permissions for the new “playground” user account.


sudo usermod -aG sudo playground

Step 4 –

Log in as “playground”, we will use this account to do the


installation.
su - playground

Step 5 –

Install the prerequisites by getting and running the script from


github. It will ask for the password of “playground” account to
proceed.
curl -O https://hyperledger.github.io/composer/latest/prereqs-
ubuntu.sh
chmod u+x prereqs-ubuntu.sh
./prereqs-ubuntu.sh
Step 6 –

Log out of “playground” and log back in to proceed. Most of the


time, you will ignore these kind of steps on Linux, but this time,
please do it, it won’t work otherwise.
exit
su - playground

Step 7 –

Install components needed for running Hyperledger Composer.


npm install -g composer-cli composer-rest-server generator-
hyperledger-composer yo composer-playground

Step 8 –

Install components needed for running Hyperledger Fabric.


curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.0

Step 9 –

Start Composer, then you can access it via using your web-browser
to http://<Your IP Address>:8080.
composer-playground

That’s it. Will write more about Chaincode next time. Please let me
know if you have any questions. This is just a quick way to spin up
your own working copy of Composer to play around with. IBM
provides a free online one too.

Random Notes:
Why use Composer?
It’s a quick way to do a proof of concept (POC)project with
Hyperledger Fabric blockchain. When you have got your head
around it, you will likely to build the solution natively on Fabric.

Status of Composer.
IBM has scaled back the team responsible for Composer and will
be putting more effort on Fabric instead, read here for more info.
All it means for now is that the team won’t add new features to
Composer, but will keep it compatible with Fabric 1.x releases. It is
working with 1.4 now. As explained above, it is mostly a tool useful
for POC prototypes. It is still a great tool to use for now. There are
3rd party tools aiming to replace Composer, I might cover it in
future tutorials.

Composer TSC update


Simon Stone

Hi,

Back in September 2016, a small team (including myself and Dan) in IBM UK was formed with the mission to improv
At the time, the learning curve for blockchain developers was incredibly steep, and we felt that by improving the deve
growth of blockchain networks. Our initial prototype was codenamed "Concerto", and this code went on to be accept

Since then, Hyperledger Composer has assisted developers and business users in learning the key technical and in
industry specific use case through a business model definition, transaction processing functions, and external integr
Hyperledger Fabric. We've seen a huge uptake by you, our community, with Composer being used by many first tim
and also build a handful of live production blockchain solutions.

Speaking on behalf of my team in IBM, we're all incredibly proud of what we've contributed to Composer over the las
all your feedback and contributions.

However - we at IBM believe that there are some fundamental problems with the architecture and design of Compos
direction and plans.

Here are three of those problems:

- Composer has been designed from the start to support multiple blockchain platforms, not just Fabric - but this desig
are two completely different programming models - the Fabric programming model (chaincode) and the Composer p
significant confusion to users, with them needing to make a "choice" between the two programming models, with ver
choice has been a bad thing, with many users opting not to use the "optional" part past the initial exploration or POC

- This design has also made it a lot harder for us to adopt and expose the latest Fabric features. For example, one o
"when can I use the Fabric v1.2 private data feature with Composer?". Whilst we've taken some steps (getNativeAP
keep up with and aligned with the latest features in Fabric when we are trying to maintain a design that keeps us blo
have understandably stopped using Composer and instead have reverted to developing with Fabric.

- Finally, those of you that have used Composer will likely be fans of our simple, easy-to-use APIs (JavaScript and R
blockchain network. There is a lot of code behind the scenes to enable these APIs that doesn't really belong in Com
underlying, low-level Fabric APIs instead of pushing improvements directly into these Fabric APIs. Today it takes ~5
APIs, whilst in Composer it takes ~5 lines of code, and that's wrong - Composer's value should not come from just m

I think it's also worth pointing out at this time that we've had a lot less contributions from non-IBMers than we origina
our designs and plans being openly discussed in GitHub, Rocket.Chat, and the community calls - but for some reaso

As some of you in the community may have noticed, the IBM team contributing to Composer have gone a bit quiet re
Composer to support running against Fabric v1.2. Those of you with an even keener eye on work in Hyperledger in g
Fabric community, and starting to contribute to Fabric (FABN-692, FAB-11246).

At this time, IBM has decided to reduce the investment it makes towards developing Composer, in order to focus the
present, the team is working on two big features, due to be released as part of Fabric v1.3, that will improve the und
believe that these features will start to provide the underpinnings of an improved development experience for Fabric
improvements in Fabric v1.4 and onwards - for example, you may see modelling, REST APIs, code generators, IDE
Fabric over time.

The IBM team will continue to update Composer to maintain compatibility with the latest Fabric v1.x releases, and w
being, we will not be looking at delivering any major new features into Composer.

We would also like to make it clear that we are still more than happy to engage with potential new contributors, and h
and bug fixes that you deem important into Composer yourself. If you're interested, we'd also love to have you come
as always to enhance the experience for developers who are developing blockchain solutions , and as developers -
doing.

Finally, Dan (now at Clause.io) has also proposed an exciting plan regarding the future of the modelling language, w
consumed and used by a much wider range of blockchain projects. We'll be looking to publish a sample that shows t
smart contracts in Fabric v1.3, and hope to extend the code to support additional programming languages (Go, Java

Many thanks,
SimonUnless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Vous aimerez peut-être aussi