Exemplo n.º 1
0
                           channel_name='businesschannel',
                           requestor=org1_admin,
                           config_yaml=CONFIG_YAML_PATH,
                           channel_profile='TwoOrgsChannel'))
    if response:
        print("Create channel successful")
    else:
        print("Create channel failed")
        print(response)
        exit(-1)

    # Join Peers into Channel, the response should be true if succeed
    response = loop.run_until_complete(
        cli.channel_join(
            requestor=org1_admin,
            channel_name='businesschannel',
            peers=['peer0.org1.example.com', 'peer1.org1.example.com'],
            orderer='orderer.example.com'))
    if response:
        print("Join channel successful")
    else:
        print("Join channel failed")
        exit(-1)

    # Join Peers from a different MSP into Channel
    org2_admin = cli.get_user(org_name='org2.example.com', name='Admin')

    # org2_admin is required to operate peers of org2.example.com
    response = loop.run_until_complete(
        cli.channel_join(
            requestor=org2_admin,
Exemplo n.º 2
0
        orderer='orderer.org1.dz',
        channel_name='firstchannel',
        requestor=org1_admin,
        config_yaml=
        '/home/Adel/Desktop/PFE/Two_Chain_Network_Template/pfe-project',
        channel_profile='firstchannel'))

print(response == True)

# Join Peers into Channel, the response should be true if succeed

responses = loop.run_until_complete(
    cli.channel_join(requestor=org1_admin,
                     channel_name='firstchannel',
                     peers=[
                         'peer0.org1.dz', 'peer1.org1.dz', 'peer2.org1.dz',
                         'peer3.org1.dz'
                     ],
                     orderer='orderer.org1.dz'))

print(len(responses) == 4)

# Create a Second Channel, the response should be true if succeed
response = loop.run_until_complete(
    cli.channel_create(
        orderer='orderer.org1.dz',
        channel_name='secondchannel',
        requestor=org1_admin,
        config_yaml=
        '/home/Adel/Desktop/PFE/Two_Chain_Network_Template/pfe-project',
        channel_profile='secondchannel'))
Exemplo n.º 3
0
        channel_name='businesschannel',
        requestor=org1_admin,
        config_yaml=CONFIG_YAML_PATH,
        channel_profile='TwoOrgsChannel'
    ))
    if response:
        print("Create channel successful")
    else:
        print("Create channel failed")
        print(response)
        exit(-1)

    # Join Peers into Channel, the response should be true if succeed
    response = loop.run_until_complete(cli.channel_join(
        requestor=org1_admin,
        channel_name='businesschannel',
        peers=['peer0.org1.example.com', 'peer1.org1.example.com'],
        orderer='orderer.example.com'))
    if response:
        print("Join channel successful")
    else:
        print("Join channel failed")
        exit(-1)

    # Join Peers from a different MSP into Channel
    org2_admin = cli.get_user(org_name='org2.example.com', name='Admin')

    # org2_admin is required to operate peers of org2.example.com
    response = loop.run_until_complete(cli.channel_join(
        requestor=org2_admin,
        channel_name='businesschannel',
Exemplo n.º 4
0
response = loop.run_until_complete(
    cli.channel_create(
        orderer="orderer1.org1.dz",
        channel_name="secondchannel",
        requestor=org1_admin,
        config_yaml="/*****************YOUR_PATH*****************/",
        channel_profile="secondchannel",
    ))

# Join Peers into Channel, the response should be true if succeed

responses = loop.run_until_complete(
    cli.channel_join(
        requestor=org1_admin,
        channel_name="firstchannel",
        peers=["peer0.org1.dz", "peer1.org1.dz", "peer2.org1.dz"],
        orderer="orderer1.org1.dz",
    ))

responses = loop.run_until_complete(
    cli.channel_join(
        requestor=org1_admin,
        channel_name="secondchannel",
        peers=["peer0.org1.dz", "peer1.org1.dz", "peer2.org1.dz"],
        orderer="orderer1.org1.dz",
    ))

# The response should be true if succeed
responses = loop.run_until_complete(
    cli.chaincode_install(
        requestor=org1_admin,