cannot create transaction block : cannot define a new channel in configtxgen

this question has been already asked&nbsp;<a href="https://stackoverflow.com/questions/48747186/creating-own-hyperledger-fabric-network-error-main-crit-003-cannot-define-new" target="_blank">source</a>&nbsp;as the question is 10 month old and as there are newer versions on fabric i'm reposting this question.

this question has been already asked source as the question is 10 month old and as there are newer versions on fabric i'm reposting this question.

for the following YAML FILE

Organizations:
  - &Smartforce
    Name: SmartforceMSP
    ID: SmartforceMSP
    MSPDir: /home/falcon/dev-iq-smartforce/crypto-config/ordererOrganizations/smartforce.com/msp
  • &BusinessPartner1
    Name: FalconMSP
    ID: FalconMSP
    MSPDir: /home/falcon/dev-iq-smartforce/crypto-config/peerOrganizations/falcon.com/msp

    AnchorPeers:

    • Host: localhost
      Port: 7051
  • &BusinessPartner2
    Name: FrostMSP
    ID: FrostMSP
    MSPDir: /home/falcon/dev-iq-smartforce/crypto-config/peerOrganizations/frost.com/msp
    AnchorPeers:

    • Host: localhost
      Port: 8051
Configuration for the Orderer

Orderer: &OrdererDefaults #SampleInsecureSolo

OrdererType: solo

Addresses:
- localhost:7050

Batch Timeout: The amount of time to wait before creating a batch

BatchTimeout: 2s

Batch Size: Controls the number of messages batched into a block

BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 98 MB
PreferredMaxBytes: 512 KB

Application: &ApplicationDefaults
Organizations:

Channel: &ChannelDefaults

Profiles:

TwoPartnerGenesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *Smartforce

  Application:
        &lt;&lt;: *ApplicationDefaults
        Organizations:
            - &lt;&lt;: *BusinessPartner1
            - &lt;&lt;: *BusinessPartner2  

  Consortiums:
      TwoPartnerConsortium:
          Organizations:
              - *BusinessPartner1
              - *BusinessPartner2

TwoOrgChannel:
Consortium: TwoPartnerConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- <<: *BusinessPartner1
- <<: *BusinessPartner2

the result for following file :

input :

configtxgen -outputCreateChannelTx ./TwoOrgChannel.tx -profile TwoPartnerGenesis -channelID channel01

output :

configtxgen -outputCreateChannelTx ./TwoOrgChannel.tx -profile TwoPartnerGenesis -channelID channel01
2018-12-20 12:30:29.818 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-12-20 12:30:29.824 IST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-12-20 12:30:29.824 IST [common/tools/configtxgen] main -> CRIT 003 Error on outputChannelCreateTx: config update generation failure: cannot define a new channel with no Consortium value

please anyone help me to identify the error. thanks in advance.

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