Hyperledger Sawtooth Marketplace Rest API 404 error

I am trying to build & test the following program on a clean install of Ubuntu v18:

I am trying to build & test the following program on a clean install of Ubuntu v18:

https://github.com/hyperledger/sawtooth-marketplace

After installing, I get a 404 "resource not found" error when I try to navigate to the "Marketplace-Rest-API" (localhost:8040) and the "Sawtooth-Blockchain-Rest-API" (localhost:8043)

I am not sure why these don't work. The interfaces at localhost:8041 and localhost:8042 work perfectly well. It seems the rest APIs are navigated to in a similar way to these two so I'm not sure why they would work and the others wouldn't.

Edit: It seems I can reach the ports because there is a response in terminal:

 `[2018-11-20 15:16:14 +0000] [10] [INFO] Goin' Fast @ http://market-rest-api:8000
--- Logging error ---
`Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 982, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 59-63: ordinal not in range(128)
Call stack:
  File "/project/sawtooth-marketplace/bin/marketplace-rest-api", line 30, in <module>
    main()
  File "/project/sawtooth-marketplace/rest_api/api/main.py", line 189, in main
    loop.run_forever()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 345, in run_forever
    self._run_once()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1312, in _run_once
    handle._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 775, in create_server
    backlog=backlog, run_async=True)
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 891, in _helper
    logger.debug(self.config.LOGO)
Message: '\n                 \u2584\u2584\u2584\u2584\u2584\n        \u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584       _______________\n      \u2584\u2584\u2584\u2584\u2584  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584  /                 \\\n     \u2580\u2580\u2580\u2580\u2588\u2588\u2588\u2588\u2588\u258c \u2580\u2590\u2584 \u2580\u2590\u2588 |   Gotta go fast!  |\n   \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2588\u2588 | _________________/\n   \u2580\u2584\u2584\u2584\u2584\u2584  \u2580\u2580\u2588\u2584\u2580\u2588\u2550\u2550\u2550\u2550\u2588\u2580 |/\n        \u2580\u2580\u2580\u2584  \u2580\u2580\u2588\u2588\u2588 \u2580       \u2584\u2584\n     \u2584\u2588\u2588\u2588\u2580\u2580\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584 \u2584\u2580\u2580\u2580\u2580\u2580\u2580\u2588\u258c\n   \u2588\u2588\u2580\u2584\u2584\u2584\u2588\u2588\u2580\u2584\u2588\u2588\u2588\u2580 \u2580\u2580\u2588\u2588\u2588\u2588      \u2584\u2588\u2588\n\u2584\u2580\u2580\u2580\u2584\u2588\u2588\u2584\u2580\u2580\u258c\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2592\u2588\u2588\u2588     \u258c\u2584\u2584\u2580\n\u258c    \u2590\u2580\u2588\u2588\u2588\u2588\u2590\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2592\u2590\u2588\u2588\u258c\n\u2580\u2584\u2584\u2584\u2584\u2580   \u2580\u2580\u2588\u2588\u2588\u2588\u2592\u2592\u2592\u2592\u2584\u2588\u2588\u2580\n          \u2580\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n        \u2584\u2584\u2588\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\n      \u2584\u2588\u2588\u2580     \u2580\u2580\u2580  \u2588\n     \u2584\u2588             \u2590\u258c\n \u2584\u2584\u2584\u2584\u2588\u258c              \u2580\u2588\u2584\u2584\u2584\u2584\u2580\u2580\u2584\n\u258c     \u2590                \u2580\u2580\u2584\u2584\u2584\u2580\n \u2580\u2580\u2584\u2584\u2580\n'
 `

Any help would be much appreciated!


how tampering of data (already added block's data) in blockchain or worldstate is detected in blockchain and hyperledger fabric?

I have a couple of question regarding the tamper proof mechanism of the blockchain.

I have a couple of question regarding the tamper proof mechanism of the blockchain.

1) My understanding: I understood that hash of [ hash the previous block + content of current block ] will go as a hash to the next block. if we tamper content of a block the hash will change and the link to the next block will be broken.

My Question: If a suspect changed the content of a block long after the block got added, will the calculation of hash and placing the hash in the next block happens automatically ?. Suppose if some one has already illegally changed the content and the link is broken, is there an automatic mechanism to trigger the event that the link has been broken ?. At what time the tampered copy of blockchain will be identified and invalidated ?

2) My understanding: In Hyperledger fabric I uderstood that ledger = blockchain + worldstate. The world state is calculated based on the blockchain. The application will depend on worldstate values, the applications will not traverse through blockchain to find a value.

My questions are: i) how frequetly the worldstate is recalculated ?

ii) will a broken chain(in case of a tamper) is detected while re-calculating the worldstate

iii) what if a suspect tampers the worldstate on a peer. how this situation is set right ? will the tampering be detected during the consensus or any other acticity ?

I read and understood that the blockchain is tamper proof, but really want to understand which processes safe guard the BC ?

Blockchain (Hyperledger sawtooth) data management

When you think about designing a blockchain network using Hyperledger sawtooth, It’s important to consider how your data will grow and amplify as your business. Being familiar with on-chain and off-chain data there are certain questions that popped up in terms of data management.

When you think about designing a blockchain network using Hyperledger sawtooth, It’s important to consider how your data will grow and amplify as your business. Being familiar with on-chain and off-chain data there are certain questions that popped up in terms of data management.

  1. What if the validators run out of storage?
  2. What are the ways for scaling the validator who has to have a copy of all the transactions?
  3. How much data one transaction generates?
  4. What will be the suitable design If there is a possibility of getting a billion transactions over a period of time?
  5. If that generates considerable amount of data then what are the ways for cutting down the data which is not in use anymore?
  6. Can I perform CRUD operation in TSDB which sawtooth uses by default?
  7. If using an IOT devices with the project then it generates a huge amount of data. How to manage this data in a decentralised and distributed way?
  8. If using third party for data management then what are the efficient and cost effective methods with features like sharding, archiving, data consistency, etc..
  • Please clear my doubts and also correct me wherever I’m wrong with the above. Thank you.

Deploy and expose chaincode as REST api on amazon managed blockchain hyperledger fabric 1.2

I have configured amazon managed blockchain setup with Hyperledger 1.2. The network is prepared with a single member and a single peer node. Hyperledger Fabric Client setup is with Golang 1.10.3. I have installed, Instantiated, Queried and Invoked mycc chaincode example given in AWS tutorial

Which works perfectly. Complete exercise was done following this link.

I want to deploy and expose the chaincode as REST api. There is a sample project Amazon Managed Blockchain Workshop. They have used RESTful API, running as a Node.js Express application, using the Hyperledger Fabric Client SDK to query and invoke chaincode. I want to run non-profit chaincode example on Hyperledger Fabric Client prepared for AWS managed Blockchain Hyper Ledger 1.2

I have performed below steps:

Here are the steps how am I am running and testing the REST API.

cd ~/non-profit-blockchain/ngo-rest-api
nvm use lts/carbon
node app.js &

If I execute Register/enroll a user request

curl -s -X POST http://localhost:3000/users -H "content-type: application/x-www-form-urlencoded" -d 'username=john&orgName=Org1'

Instead of showing: response:

{"success":true,"secret":"","message":"michael enrolled Successfully"}

It shows below error message.

{"success":false,"message":"failed Error: Missing mspid parameter"}

I have also tried by adding mspid in the request but the error message is still same. What am I missing?

Here are contents of ngo-connection-profile.yaml

channels:
  mychannel:
    orderers:
      - orderer.com
    peers:
      peer1:
        endorsingPeer: true
        chaincodeQuery: true
        ledgerQuery: true
        eventSource: true
<pre><code>
organizations:
  Org1:
    mspid:
    peers:
      - peer1
    certificateAuthorities:
      - ca-org1
orderers:
  orderer.com:
    url: grpcs://orderer.n-XDXDXDXDXDSXDSXDXSDXSDXDSXDSXDS.managedblockchain.us-east-1.amazonaws.com:30001
    grpcOptions:
      ssl-target-name-override: orderer.n-XDXDXDXDXDSXDSXDXSDXSDXDSXDSXDS.managedblockchain.us-east-1.amazonaws.com
    tlsCACerts:
      path: /opt/home/managedblockchain-tls-chain.pem
</pre></code>
peers:
  peer1:
    url: grpcs://nd-NDNDNDNDNDNDNDNDNDNDND.m-AAAAAAAAAAAAAAAAAAAAAAAAA.n-XDXDXDXDXDSXDSXDXSDXSDXDSXDSXDS....
    eventUrl: grpcs://nd-NDNDNDNDNDNDNDNDNDNDND.m-AAAAAAAAAAAAAAAAAAAAAAAAA.n-XDXDXDXDXDSXDSXDXSDXSDXDSXDSXDS.....
    grpcOptions:
      ssl-target-name-override: nd-NDNDNDNDNDNDNDNDNDNDND.m-AAAAAAAAAAAAAAAAAAAAAAAAA.n-XDXDXDXDXDSXDSXDXSDXSDXDSXDSXDS.xxx
    tlsCACerts:
      path: /opt/home/managedblockchain-tls-chain.pem

certificateAuthorities:
ca-org1:
url: https://ca.m-AAAAAAAAAAAAAAAAAAAAAAAAA.n-XDXDXDXDXDSXDSXDXSDXSDXDSXDSXDS....
httpOptions:
verify: false
tlsCACerts:
path: /opt/home/managedblockchain-tls-chain.pem
registrar:
- enrollId: aaaaaaaa
enrollSecret: XXXXXXXXXXX
caName: m-AAAAAAAAAAAAAAAAAAAAAAAAA