Git Product home page Git Product logo

Comments (6)

Alex99y avatar Alex99y commented on May 30, 2024 5

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

from airmedfoundation-terminal.

sm2x avatar sm2x commented on May 30, 2024

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.

from airmedfoundation-terminal.

Alex99y avatar Alex99y commented on May 30, 2024

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

from airmedfoundation-terminal.

sm2x avatar sm2x commented on May 30, 2024

it is solved everything works, thank you

from airmedfoundation-terminal.

kalyanipullela avatar kalyanipullela commented on May 30, 2024

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

from airmedfoundation-terminal.

Srinivasan1008 avatar Srinivasan1008 commented on May 30, 2024

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

from airmedfoundation-terminal.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.