# Create the Hyperledger Channel

## Create your Hyperledger Channel

Before deploying your smart contract, you need to establish an environment for running the smart contract. You need to create a Fabric Channel and join all peers to your Fabric Channel.

In terminal 1, execute the following commands to create a Fabric Channel `${USER}-channel`&#x20;

```bash
#Configure a channel
configtxgen -profile AppChannel \
--configPath ${FABRIC_CFG_PATH} \
--channelID ${USER}-channel \
-outputCreateChannelTx ~/channel.tx

#Create a new channel (with a genesis block)
peer channel create -o node-1:7050 \
--channelID  ${USER}-channel \
-f ~/channel.tx \
--outputBlock ~/channel.block

#Let peer node-1 join the newly created channel
peer channel join -b ~/channel.block

#Verify if your Fabric Channel is on the list 
peer channel list
```

In terminal 2, join the newly created channel (via the \~/channel.block; shared in your home directory)

```bash
#Let peer node-2 join the newly created channel
peer channel join -b ~/channel.block

#Verify if your Fabric Channel is on the list 
peer channel list
```

Do the same in terminal 3

```bash
#Let peer node-3 join the newly created channel
peer channel join -b ~/channel.block

#Verify if your Fabric Channel is on the list 
peer channel list
```

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eric-lo.gitbook.io/hyperledger-fabric/create-the-hyperledger-channel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
