Skip to content

Commit

Permalink
Update channel_update_tutorial.rst with joinbysnapshot
Browse files Browse the repository at this point in the history
Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
  • Loading branch information
wenjianqiao authored and denyeart committed Nov 10, 2020
1 parent 421dddf commit 45afdbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 13 additions & 1 deletion docs/source/channel_update_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ as the Org3 Admin:
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
export CORE_PEER_ADDRESS=peer0.org3.example.com:11051
Now let's send a call to the ordering service asking for the genesis block of
Org3 peers can join ``mychannel`` by either the genesis block or a snapshot that is created
after Org3 has joined the channel.

To join by the genesis block, send a call to the ordering service asking for the genesis block of
``mychannel``. As a result of the successful channel update, the ordering service
will verify that Org3 can pull the genesis block and join the channel. If Org3 had not
been successfully appended to the channel config, the ordering service would
Expand Down Expand Up @@ -489,6 +492,15 @@ peer to the channel:
peer channel join -b mychannel.block
To join by a snapshot, follow the instruction in `Taking a snapshot <peer_ledger_snapshot.html#taking-a-snapshot>`__
to take a snapshot on an existing peer. The snapshot should be taken after Org3 has been added to ``mychannel``
to ensure that the snapshot contains the updated channel configuration including Org3.
Locate the snapshot directory, copy it to the filesystem of the new Org3 peer, and issue the
``peer channel joinbysnapshot`` command using the path to the snapshot on your file system.

.. code:: bash
peer channel joinbysnapshot --snapshotpath <path to snapshot>
Configuring Leader Election
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 3 additions & 3 deletions docs/source/peer_ledger_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Note that the file types explained here is a superset of all of the files that m
When joining a channel using the genesis block, a command similar to `peer channel join --blockpath mychannel.block` is issued. When joining the peer to the channel using a snapshot, issue a command similar to:

```
peer channel joinbysnapshot --snapshotPath <path to snapshot>
peer channel joinbysnapshot --snapshotpath <path to snapshot>
```

To verify that the peer has joined the channel successfully, issue a command similar to:
Expand All @@ -153,9 +153,9 @@ Additionally, if the peer has not already installed a chaincode being used on th

If you want to try out the ledger snapshotting process, you'll first need a network with a running channel. If you don't have a network, deploy the [test network](./test_network.html). This will create a network with two orgs, which both have a single peer, and an application channel.

Next, follow the [Adding an Org to a Channel](./channel_update_tutorial.html) to add a new org to your network and application channel. When you reach the section where you are asked to [Join Org3 to the Channel](./channel_update_tutorial.html#join-org3-to-the-channel), select the peer you want to use to take the snapshot and follow the instructions above to take the snapshot. Then locate the snapshot on the your peer and copy it somewhere else on your filesystem. Taking the snapshot at this step ensures that the new peer joins the channel using a snapshot taken after a point when its organization has already been joined to the channel.
Next, follow the [Adding an Org to a Channel](./channel_update_tutorial.html) to add a new org to your network and application channel. When you reach the section where you are asked to [Join Org3 to the Channel](./channel_update_tutorial.html#join-org3-to-the-channel), select the peer you want to use to take the snapshot and follow the instructions above to take the snapshot. Then locate the snapshot on the peer and copy it somewhere else on your filesystem. Taking the snapshot at this step ensures that the new peer joins the channel using a snapshot taken after a point when its organization has already been joined to the channel.

After you have taken the snapshot and copied it, instead of issuing the `peer channel join -b mychannel.block` command, substitute `peer channel joinbysnapshot --snapshotPath <path to snapshot>` using the path to the snapshot on your filesystem.
After you have taken the snapshot and copied it, instead of issuing the `peer channel join -b mychannel.block` command, substitute `peer channel joinbysnapshot --snapshotpath <path to snapshot>` using the path to the snapshot on your filesystem.

## Troubleshooting

Expand Down

0 comments on commit 45afdbd

Please sign in to comment.