Getting error when import card to Hyperledger Composer - hyperledger-composer

I get the following error when I try to import a card using composer-rest-server multiple mode.
First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."
It was working fine before. I tried with both composer versions, 0.19.16 and hlfv11, and 0.20 hlfv12 but I get the error.
Also when I want to Authenticate to the REST server by navigating to the value of the authPath property through http://localhost:3000/auth/github I get the following error in my terminal but it successfully backs to composer rest server. When it was working fine I did not get such an error.
"Browse your REST API at http://localhost:3000/explorer
Potential security alert: hidden/protected properties ["password","verificationToken"] are used in query."

The problem you are seeing is due to a dependency in the dependency tree of the composer rest server being broken recently and so any npm installs of composer-rest-server will experience this problem as it will pull in this broken dependency.
Composer 0.19.17 has fixed this problem (and it will also be fixed in 0.20.3 when it is released). You can either move to these versions or you can use the docker image of composer rest server which has already downloaded the dependencies and doesn't include the broken dependency.

Related

Why can I submit a transactionID with a transaction in hyperledger composer REST?

Composer REST server allows me to submit a transactionID with my transaction input. The transaction is rejected if I supply a transactionID. Is there a way to remove the field from the input so that the server ignores client submitted transaction id?
I am assuming you are using the explorer interface. The Rest Server is a Loopback application and so we are not able to hide these fields in the example section (see https://github.com/hyperledger/composer/issues/663). An issue has been raised with Strongloop regarding this issue, see https://github.com/strongloop/loopback/issues/3510
I was facing a similar issue till I started installing my hyperledger composer and fabric from scratch. That's when I realised that I had used a deprecated link for installing npm. I had encountered a bunch of errors that I had ignored.
following the steps given here worked for me, for installing npm correctly.
https://www.sitepoint.com/beginners-guide-node-package-manager/
I also referred to https://hyperledger.github.io/composer/latest/installing/installing-prereqs.html in case any command did not work.
after correct installation, you will be able to remove transactionId and timestamp without encountering any error.

Unable to import / deploy business network to Composer Playground

Using the guide on https://hyperledger.github.io/composer/installing/using-playground-locally.html
The shell script has downloaded Hyperledger Composer 0.8.0 and Fabric V1 Beta docker images.
When using the Playground on my browser I am unable to deploy/import any sample business network (tried marbles network).
With the error:
t: line 33 column 1, to line 36 column 2. Class TradeMarble is not declared as abstract. It must define an identifying field.
Error on Composer Playground
I know there is a newer version of Composer (0.8.1; with 0.9.0 coming really soon) and Fabric V1 RC1. Do I need to update Composer and Fabric runtime/images?
We are in the process of updating the samples to support Composer v0.9. When v0.9 is released the online Composer Playground will be updated and you will be able to import samples again.
Sorry for the inconvenience!

I am unable to deploy phoenix app to heroku because of failed dependency (called coherence) compilation, how to make it work?

So to start I made an Elixir application using Phoenix framework.
This application uses coherence dependency for authentication to the website. This dependency was installed as it is advised on the git repo with -full argument to install all the options coherence has.
Then, I did just change a couple of lines in config.exs file of my project to use mailgun service for mailing and put credentials over there.
Next, I installed and configured my other deps (they have nothing to do with coherence).
Locally, my application could compile and run without problems.
Then, I wanted to deploy it to Heroku using Phoenix guidelines.
When I completed all the steps, I got an error when trying to push the application to Heroku.
I then tried to check the file lib/mix/tasks/coherence.clean.ex and the line 162 where I found a comment that said there is an error with updating a config file, but I couldn't figure out what that means and how to solve that.
I tried to make a fresh phoenix application, installing coherence with the same or different options and afterward deploying it following the Phoenix guidelines. Every time I was getting the same error.
I also want to note that I did try to create elixir_buildpack.config file and putting always_rebuild=true there and had no success. (it is a solution mentioned in troubleshooting section of deploying to Heroku guide)
So, my question is, what do I need to change in my config.exs file (or elsewhere) in order to make at least a fresh application with coherence installed to compile and work on Heroku?
useful links:
coherence dep github link
Thanks a ton guys.
The Heroku Buildpack for Elixir currently defaults to Elixir 1.2.6 while the code that throws that error uses the else syntax with with, a feature that was added in Elixir 1.3.0, so you need to set the Elixir version to use to 1.3.0 or later by adding the following to elixir_buildpack.config:
elixir_version=1.3.2

silex do i need composer to autoload?

I install my web site on ovh server but i think composer it not install on it.
So i have a fatal error
Class 'App\Models\Product\ProductModel' not found in /home/xxxxx/App/Controller/Home/HomeController.php on line 26
in my ftp i have
composer.json
App
bootstrap.php
Model
Product
ProductModel.php
Controller
indexController.php
Home
HomeController.php
www
index.php
I auto load App as App
Do you know if the problem is composer?
Do you know if i can use with out composer?
How?
thank you
Use Composer before you upload your code. Composer need not be executed on the server - in fact this is regarded more of a problem than a solution because it requires all package hosting servers to be up, and the command line tools for accessing version control systems be installed (at least as a fallback).
The recommended way to use Composer is to run it locally (or on a deployment machine that is local enough), let it fetch all files, create the autoloader, and then copy all the collected files to the target server.
This approach also resolves the problem with Composer requiring about 1GB of memory (or more, depending on how many packages have to be considered) when being run - if your web server has less memory installed, you won't be able to use Composer.

Why does bower not install socket.io.js file?

When I run bower install socket.io bower installs just fine but when looking at the installed file there is no socket.io.js file.. the issue with that is when trying to use the bower components as dependencies in my project I can't require('socket.io') (using debowerify) because its looking for bower_components/socket.io/socket.io.js
does anyone know why this is happening and what I need to do to fix this?
this is what bower install socket.io installs
the error message I get is
Error: module "./../../bower_components/socket.io/socket.io.js" not
found
From going through the getting started guide http://socket.io/docs/# there are two components to socket.io, one each for the server and client side code.
The client side code is separately installable from here https://www.npmjs.com/package/socket.io-client and it gives us a clue as to what is up ...
From the above we are told
A standalone build of socket.io-client is exposed automatically by the socket.io server as /socket.io/socket.io.js
So it's a little bit of magic that enables access to the client side code via the server side code which I think would explain the discrepancies with what we see in under the bower_components folder post install.
In the case of a node app using express you can reference socket.io.js on client side html simply by including it <script src="socket.io.js"></script> and then making reference a presumably global io object that is introduced by that.
Hope this helps

Resources