Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #12

Open
sm2x opened this issue Mar 23, 2019 · 6 comments
Open

Documentation #12

sm2x opened this issue Mar 23, 2019 · 6 comments

Comments

@sm2x
Copy link

sm2x commented Mar 23, 2019

do you have installation manual or documentation please

@Alex99y
Copy link
Contributor

Alex99y commented Mar 23, 2019

Hi sm2x, thanks for interesting in our project. Actually there isnt exist an official documentation to deploy or test Airmed Foundation because is still under development and will be strong changes for the version 1.0
This is a small tutorial for fast deploy in ubuntu 16.04.

First, the dependencies of Airmed Foundation:

  • Download and install IPFS:
wget https://dist.ipfs.io/go-ipfs/v0.4.19/go-ipfs_v0.4.19_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.4.19_linux-amd64.tar.gz
cd go-ipfs
sudo ./install.sh
ipfs init
nvm install 8.15
nvm use 8.15
  • Download Hyperledger Fabric (Dev mode, easy way)
git clone https://github.com/hyperledger/fabric-samples
cd fabric-samples
./scripts/bootstrap.sh 1.4.0 1.4.0
cd first-network
byfn.sh generate
byfn.sh up
  • Download Airmed Fundation
git clone https://github.com/the-chain/airmedfoundation-terminal
cd airmedfoundation-terminal
npm install 
  • Install chaincode to Hyperledger Fabric network
cd airmedfoundation-terminal
docker cp -a ./chaincode cli:/opt/gopath/src/github.com/hyperledger/fabric/peer
docker exec -it cli peer chaincode install -l "node" -n airmed -p /opt/gopath/src/github.com/hyperledger/fabric/peer/chaincode -v v1
docker exec -it cli peer chaincode instantiate -C mychannel -l "node" -n airmed -v v1 -c '{"Args":[]}' -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

Second, configure the server (Airmed Foundation):

cd airmedfoundation-terminal

  • Edit config/datastores.js
    Change the values to connect to postgreSQL. (if you dont have it installed, run this command: $ docker-compose up -d )

  • Edit config/policies.js
    Comment the line 20: (For testing purpose)
    //'*': 'isHTTPS',

  • Edit Hyperledger configuration file:
    fabric-api/config/configfile.yaml
    Replace the admin certs values for your new crypto-material values:
    Line 44 adminPrivateKey path (Org1)
    Line 56 adminPrivateKey path (Org2)

IMPORTANT:
fabric-sample and airmedfoundation-terminal should be in the same directory

Example:
/home/root/Desktop/fabric-sample
/home/root/Desktop/airmedfoundation-terminal

Third, run the application

  • Run ipfs
    ipfs daemon &
  • Run the sync process
    ./init.sh &
  • Run the server
    sails l & Maybe you need to run it with sudo

@sm2x
Copy link
Author

sm2x commented Mar 24, 2019

thank you for your time and help, I followed the instructions, but I'm getting some issues on the Third set of steps when I run "./init.sh" BEFORE "sails l" I am getting this error:

./init.sh

Start sync process
(node:11528) UnhandledPromiseRejectionWarning: RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/hyperledger/aft/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/usr/local/hyperledger/aft/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/usr/local/hyperledger/aft/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/usr/local/hyperledger/aft/node_modules/request/request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at Request.onRequestError (/usr/local/hyperledger/aft/node_modules/request/request.js:881:8)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at Socket.socketErrorListener (_http_client.js:401:9)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
(node:11528) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11528) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

BUT when I run "sails l" FIRST BEFORE "./init.sh", I get this error:

./init.sh

Start sync process
(node:11731) UnhandledPromiseRejectionWarning: RequestError: Error: Hostname/IP doesn't match certificate's altnames: "IP: 127.0.0.1 is not in the cert's list: "
at new RequestError (/usr/local/hyperledger/aft/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/usr/local/hyperledger/aft/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/usr/local/hyperledger/aft/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/usr/local/hyperledger/aft/node_modules/request/request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at Request.onRequestError (/usr/local/hyperledger/aft/node_modules/request/request.js:881:8)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:401:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
(node:11731) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11731) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

WHEN "sails l" runs, I checked the web client, everything seems working EXCEPT Explorer, no blocks or records show.

Again, thank you for your help.

@Alex99y
Copy link
Contributor

Alex99y commented Mar 24, 2019

This error appears because the sync process is checking the certificate of the site and the host domain, 127.0.0.1 does not match with airmedfoundation.thechain.tech
Are you sure you edited config/policies.js file?. Your server is redirecting all requests to the port 443 (SSL). In config/policies.js comment or delete the line 20
And yes, ./init.sh should be run after sails l

@sm2x
Copy link
Author

sm2x commented Mar 24, 2019

it is solved everything works, thank you

@kalyanipullela
Copy link

kalyanipullela commented Sep 26, 2019

Hello,
The sample usecase which you have built is really interesting to do but while trying with the repo I am facing some issues which are as follows:

  1. While I am going through the process, I am getting an error as follows while doing ./init.sh & :

UnhandledPromiseRejectionWarning: StatusCodeError: 404 - "\n\n<title>404 Not Found</title>\n\n
Not Found
The requested URL /gettotal was not found on this server.
\nApache/2.4.18 (Ubuntu) Server at 127.0.0.1 Port 80\n\n"

  1. I have also tried to run the project by doing npm start but that also gives an error

error: A hook (userconfig) failed to load!
error: Failed to lift app: { Error: Attempted to require('/home/miracle/Desktop/airmedfoundation-terminal/config/datastores.js'), but an error occurred:

Error: Cannot find module '../appconfig.json'

But the appconfig.json file is nowhere in the project

Could you please help me out to run this repo

Thanks In Advance

@Srinivasan1008
Copy link

Srinivasan1008 commented Mar 18, 2020

Can you give the details of the environment for this documentation. As far as i get os:ubuntu 16.04 LTS but what about other things like hyperledger fabric version,because there is no bootstrap.sh in fabric v2.0 and the airmed foundation terminal master branch has no chaincode folder,please can you say about the setup and steps in a detailed manner. I am a student,it will be a great help for me as my project is based on ipfs and hyperledger.

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants