Search code examples
hyperledger-fabricchannelpeer

Channel for one organization


Is it possible to have a single organization on a channel? The reason I want to do this is due to the fact that the data that this single organization is registring is meant to be private. So I would like this organization to save this data in a private ledger and on another channel, with other organizations as well, this data would be persisted by its hash and validated by the other organizations. I know this is unusual and I know the existence of private data on Hyperledger Fabric but I would like this to happen so the organization wouldn't need to have a side database for the actual data which could have its registries altered or even deleted by a admin for example.

This channel could have more than one peer but they would all be owned by that organization so there wouldn't be a single point of failure. In addition to that they would all validate the transactions as if they were from different organizations.

What do you guys think about it? Is it too crazy? Is there an alternative way to achieve this goal?


Solution

  • Yes, it is possible and channel creation has nothing to with how many organizations will be part of it.

    I am taking the Build your first network as the reference for the following steps.

    You have to create a profile with 1 org in the configtx.yaml. link

    OneOrgChannel:
            Consortium: SampleConsortium
            <<: *ChannelDefaults
            Application:
                <<: *ApplicationDefaults
                Organizations:
                    - *Org1
                Capabilities:
                    <<: *ApplicationCapabilities
    

    Create the channel transaction using the OneOrgChannel profile.

    export CHANNEL_NAME=channel1  && ../bin/configtxgen -profile OneOrgChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $CHANNEL_NAME
    

    Now, you can create a single org channel using this channel transaction file.

    peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --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