Hyperledger peer for ClefOS on s390x
4.2K
The openblockchain project is IBM's proposed contribution to the Linux Foundation's Hyperledger project. We have made it available as open source to enable others to explore our architecture and design. IBM's intention is to engage rigorously in the Linux Foundation's Hyperledger project as the community establishes itself, and decides on a code base. Once established, we will transition our development focus to the Hyperledger effort, and this code will be maintained as needed for IBM's use.
While we invite contribution to the openblockchain project, we believe that the broader blockchain community's focus should be the Hyperledger project.
The steps for running a sample application using this container are described on this page. If you do not have access to a z Systems machine with Linux installed, you can obtain a 90 day LinuxOne cloud instance on the IBM LinuxONE Community Cloud in just minutes.

This project contains the core blockchain fabric. Further information:
Notes:
sysctl vm.overcommit_memory=1Assuming you have followed the development environment getting started instructions
This section describes the steps to exercise the container.
Hyperledger interacts with the daemon to create containers on the fly so it needs some specific options when invoked:
docker daemon -D -g /var/lib/docker -r=true --api-enable-cors=true -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock
Where -
| Option | Description |
|---|---|
-D | Enter debug mode (optional but you get lots of messages) |
-g /data/docker | Root of the Docker runtime |
-r=true | Restart container if daemon is restarted |
--api-enable-cores | Enable cross origin requests |
-H | Daemon socket(s) to connect to |
We give this peer the id of vp1. The OPENCHAIN_VM_ENDPOINT environment variable specifies the IP address (referred to later as ) found by issuing (assuming the docker daemon created the docker0 interface):
ifconfig docker0
docker0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::5484:7aff:fefe:9799/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:832417 errors:0 dropped:0 overruns:0 frame:0
TX packets:1088069 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:197601454 (188.4 MiB) TX bytes:2226944975 (2.0 GiB)
Use this address to start the first peer:
docker run --rm -it --name=vp1 -e OPENCHAIN_VM_ENDPOINT=http://<ipaddress>:4243 -e OPENCHAIN_PEER_ID=vp1 -e OPENCHAIN_PEER_ADDRESSAUTODETECT=true brunswickheads/openchain-peer obc-peer peer
Obtain this peer's IP address (referred to later as ) by using:
docker inspect --format '{{ .NetworkSettings.IPAddress }}' vp1
We can then start 1 or more peers with IDs of vp2, vp3, ... in other sessions. The IP address specified in OPENCHAIN_VM_ENDPOINT is that () and OPENCHAIN_PR_DISCOVERY_ROOTNODE is that of the first peer ().
docker run --rm -it -e OPENCHAIN_VM_ENDPOINT=http://<ipaddress>:4243 -e OPENCHAIN_PEER_ID=vp2 -e OPENCHAIN_PEER_ADDRESSAUTODETECT=true -e OPENCHAIN_PR_DISCOVERY_ROOTNODE=<vp1ip>:30303 brunswickheads/openchain-peer obc-peer peer
To deploy we can start another container and run obc-peer commands.
docker run --rm -it -e OPENCHAIN_PEER_ADDRESS=<vp1ip>:30303 brunswickheads/openchain-peer bash
At the prompt:
obc-peer chaincode deploy -p github.com/openblockchain/obc-peer/openchain/example/chaincode/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'
Then use the $NAME () it returns to begin querying and invoking chaincode:
bash> export NAME1=<name1>
bash> obc-peer chaincode query -l golang -n $NAME1 -c '{"Function": "query", "Args": ["b"]}'
bash> obc-peer chaincode invoke -n $NAME1 -c '{"Function": "invoke", "Args": ["a", "b", "3"]}'
Content type
Image
Digest
Size
564 MB
Last updated
over 10 years ago
docker pull brunswickheads/openchain-peer