diff --git a/chaincode-docker-devmode/.gitignore b/chaincode-docker-devmode/.gitignore deleted file mode 100644 index 3bb4c8e8..00000000 --- a/chaincode-docker-devmode/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/myc.block -/chaincode/sacc/go/sacc -/chaincode/abstore/go/abstore diff --git a/chaincode-docker-devmode/README.rst b/chaincode-docker-devmode/README.rst deleted file mode 100644 index 315056f2..00000000 --- a/chaincode-docker-devmode/README.rst +++ /dev/null @@ -1,142 +0,0 @@ -Using dev mode -============== - -Normally chaincodes are started and maintained by peer. However in “dev -mode", chaincode is built and started by the user. This mode is useful -during chaincode development phase for rapid code/build/run/debug cycle -turnaround. - -We start "dev mode" by leveraging pre-generated orderer and channel artifacts for -a sample dev network. As such, the user can immediately jump into the process -of compiling chaincode and driving calls. - -Install Fabric Samples ----------------------- - -If you haven't already done so, please `install samples `_. - -Navigate to the ``chaincode-docker-devmode`` directory of the ``fabric-samples`` -clone: - -.. code:: bash - - cd chaincode-docker-devmode - -Download docker images -^^^^^^^^^^^^^^^^^^^^^^ - -We need four docker images in order for "dev mode" to run against the supplied -docker compose script. If you installed the ``fabric-samples`` repo clone and -followed the instructions to `install samples, binaries and docker images `_, then -you should have the necessary Docker images installed locally. - -.. note:: If you choose to manually pull the images then you must retag them as - ``latest``. - -Issue a ``docker images`` command to reveal your local Docker Registry. You -should see something similar to following: - -.. code:: bash - - docker images - REPOSITORY TAG IMAGE ID CREATED SIZE - hyperledger/fabric-tools latest c584c20ac82b 9 days ago 1.42 GB - hyperledger/fabric-tools x86_64-1.1.0-preview c584c20ac82b 9 days ago 1.42 GB - hyperledger/fabric-orderer latest 2fccc91736df 9 days ago 159 MB - hyperledger/fabric-orderer x86_64-1.1.0-preview 2fccc91736df 9 dyas ago 159 MB - hyperledger/fabric-peer latest 337f3d90b452 9 days ago 165 MB - hyperledger/fabric-peer x86_64-1.1.0-preview 337f3d90b452 9 days ago 165 MB - hyperledger/fabric-ccenv latest 82489d1c11e8 9 days ago 1.35 GB - hyperledger/fabric-ccenv x86_64-1.1.0-preview 82489d1c11e8 9 days ago 1.35 GB - -.. note:: If you retrieved the images through the `install samples, binaries and docker images `_, - then you will see additional images listed. However, we are only concerned with - these four. - -Now open three terminals and navigate to your ``chaincode-docker-devmode`` -directory in each. - -Terminal 1 - Start the network ------------------------------- - -.. code:: bash - - docker-compose -f docker-compose-simple.yaml up - -The above starts the network with the ``SingleSampleMSPSolo`` orderer profile and -launches the peer in "dev mode". It also launches two additional containers - -one for the chaincode environment and a CLI to interact with the chaincode. The -commands for create and join channel are embedded in the CLI container, so we -can jump immediately to the chaincode calls. - -.. note:: TLS is not enabled as it is not supported when running chaincode in dev mode. - -Terminal 2 - Build & start the chaincode ----------------------------------------- - -.. code:: bash - - docker exec -it chaincode sh - -You should see the following: - -.. code:: sh - - /opt/gopath/src/chaincode $ - -Now, compile your chaincode: - -.. code:: sh - - cd abstore/go - go build -o abstore - -Now run the chaincode: - -.. code:: sh - - CORE_CHAINCODE_ID_NAME=mycc:0 CORE_PEER_TLS_ENABLED=false ./abstore -peer.address peer:7052 - -The chaincode is started with peer and chaincode logs indicating successful registration with the peer. -Note that at this stage the chaincode is not associated with any channel. This is done in subsequent steps -using the ``instantiate`` command. - -Terminal 3 - Use the chaincode ------------------------------- - -Even though you are in ``--peer-chaincodedev`` mode, you still have to install the -chaincode so the life-cycle system chaincode can go through its checks normally. -This requirement may be removed in future when in ``--peer-chaincodedev`` mode. - -We'll leverage the CLI container to drive these calls. - -.. code:: bash - - docker exec -it cli bash - -.. code:: bash - - peer chaincode install -p chaincodedev/chaincode/abstore/go -n mycc -v 0 - peer chaincode instantiate -n mycc -v 0 -c '{"Args":["init","a","100","b","200"]}' -C myc - -Now issue an invoke to move ``10`` from ``a`` to ``b``. - -.. code:: bash - - peer chaincode invoke -n mycc -c '{"Args":["invoke","a","b","10"]}' -C myc - -Finally, query ``a``. We should see a value of ``90``. - -.. code:: bash - - peer chaincode query -n mycc -c '{"Args":["query","a"]}' -C myc - -Testing new chaincode ---------------------- - -By default, we mount only ``abstore``. However, you can easily test different -chaincodes by adding them to the ``chaincode`` subdirectory and relaunching -your network. At this point they will be accessible in your ``chaincode`` container. - -.. Licensed under Creative Commons Attribution 4.0 International License - https://creativecommons.org/licenses/by/4.0/ diff --git a/chaincode-docker-devmode/docker-compose-simple.yaml b/chaincode-docker-devmode/docker-compose-simple.yaml deleted file mode 100644 index 076b6051..00000000 --- a/chaincode-docker-devmode/docker-compose-simple.yaml +++ /dev/null @@ -1,87 +0,0 @@ -version: '2' - -services: - orderer: - container_name: orderer - image: hyperledger/fabric-orderer - environment: - - FABRIC_LOGGING_SPEC=debug - - ORDERER_GENERAL_LISTENADDRESS=orderer - - ORDERER_GENERAL_BOOTSTRAPMETHOD=file - - ORDERER_GENERAL_BOOTSTRAPFILE=orderer.block - - ORDERER_GENERAL_LOCALMSPID=DEFAULT - - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp - - GRPC_TRACE=all=true, - - GRPC_VERBOSITY=debug - working_dir: /opt/gopath/src/github.com/hyperledger/fabric - command: orderer - volumes: - - ./msp:/etc/hyperledger/msp - - ./orderer.block:/etc/hyperledger/fabric/orderer.block - ports: - - 7050:7050 - peer: - container_name: peer - image: hyperledger/fabric-peer - environment: - - CORE_PEER_ID=peer - - CORE_PEER_ADDRESS=peer:7051 - - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer:7051 - - CORE_PEER_LOCALMSPID=DEFAULT - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - FABRIC_LOGGING_SPEC=DEBUG - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp - volumes: - - /var/run/:/host/var/run/ - - ./msp:/etc/hyperledger/msp - working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: peer node start --peer-chaincodedev=true - ports: - - 7051:7051 - - 7053:7053 - depends_on: - - orderer - - cli: - container_name: cli - image: hyperledger/fabric-tools - tty: true - environment: - - GOPATH=/opt/gopath - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - FABRIC_LOGGING_SPEC=DEBUG - - CORE_PEER_ID=cli - - CORE_PEER_ADDRESS=peer:7051 - - CORE_PEER_LOCALMSPID=DEFAULT - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp - working_dir: /opt/gopath/src/chaincodedev - command: /bin/bash -c './script.sh' - volumes: - - /var/run/:/host/var/run/ - - ./msp:/etc/hyperledger/msp - - ./../chaincode:/opt/gopath/src/chaincodedev/chaincode - - ./:/opt/gopath/src/chaincodedev/ - depends_on: - - orderer - - peer - - chaincode: - container_name: chaincode - image: hyperledger/fabric-ccenv - tty: true - environment: - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - FABRIC_LOGGING_SPEC=DEBUG - - CORE_PEER_ID=abstore - - CORE_PEER_ADDRESS=peer:7051 - - CORE_PEER_LOCALMSPID=DEFAULT - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp - working_dir: /opt/gopath/src/chaincode - command: /bin/sh -c 'sleep 6000000' - volumes: - - /var/run/:/host/var/run/ - - ./msp:/etc/hyperledger/msp - - ./../chaincode:/opt/gopath/src/chaincode - depends_on: - - orderer - - peer diff --git a/chaincode-docker-devmode/msp/admincerts/admincert.pem b/chaincode-docker-devmode/msp/admincerts/admincert.pem deleted file mode 100644 index 415d5617..00000000 --- a/chaincode-docker-devmode/msp/admincerts/admincert.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICNjCCAd2gAwIBAgIRAMnf9/dmV9RvCCVw9pZQUfUwCgYIKoZIzj0EAwIwgYEx -CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4g -RnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMQwwCgYDVQQLEwND -T1AxHDAaBgNVBAMTE2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcxMTEyMTM0MTEx -WhcNMjcxMTEwMTM0MTExWjBpMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv -cm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEMMAoGA1UECxMDQ09QMR8wHQYD -VQQDExZwZWVyMC5vcmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0D -AQcDQgAEZ8S4V71OBJpyMIVZdwYdFXAckItrpvSrCf0HQg40WW9XSoOOO76I+Umf -EkmTlIJXP7/AyRRSRU38oI8Ivtu4M6NNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1Ud -EwEB/wQCMAAwKwYDVR0jBCQwIoAginORIhnPEFZUhXm6eWBkm7K7Zc8R4/z7LW4H -ossDlCswCgYIKoZIzj0EAwIDRwAwRAIgVikIUZzgfuFsGLQHWJUVJCU7pDaETkaz -PzFgsCiLxUACICgzJYlW7nvZxP7b6tbeu3t8mrhMXQs956mD4+BoKuNI ------END CERTIFICATE----- diff --git a/chaincode-docker-devmode/msp/cacerts/cacert.pem b/chaincode-docker-devmode/msp/cacerts/cacert.pem deleted file mode 100644 index 22dfce98..00000000 --- a/chaincode-docker-devmode/msp/cacerts/cacert.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICYjCCAgigAwIBAgIRAL1fEAnz5zp4moJ8MdSb/lYwCgYIKoZIzj0EAwIwgYEx -CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4g -RnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMQwwCgYDVQQLEwND -T1AxHDAaBgNVBAMTE2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcxMTEyMTM0MTEx -WhcNMjcxMTEwMTM0MTExWjCBgTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlm -b3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhh -bXBsZS5jb20xDDAKBgNVBAsTA0NPUDEcMBoGA1UEAxMTY2Eub3JnMS5leGFtcGxl -LmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGrsQ6oJpk6hDWf63HU3OSNd -bou9KNw/VIee1IngPDI4YJU7O+Xa/XLJuwnFv7BpR8Ytl3f+njC8i/RZP2/svO+j -XzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQF -MAMBAf8wKQYDVR0OBCIEIIpzkSIZzxBWVIV5unlgZJuyu2XPEeP8+y1uB6LLA5Qr -MAoGCCqGSM49BAMCA0gAMEUCIQDUh/+CC2dAICnYtACXspwUaaEbiyZxYIx+XDvW -o8VVcgIgGz5S4iC5+xkxgeaISPfxKTTVy6yzTdYGzCw1vPppjzo= ------END CERTIFICATE----- diff --git a/chaincode-docker-devmode/msp/keystore/key.pem b/chaincode-docker-devmode/msp/keystore/key.pem deleted file mode 100755 index 797d567a..00000000 --- a/chaincode-docker-devmode/msp/keystore/key.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgXa3mln4anewXtqrM -hMw6mfZhslkRa/j9P790ToKjlsihRANCAARnxLhXvU4EmnIwhVl3Bh0VcByQi2um -9KsJ/QdCDjRZb1dKg447voj5SZ8SSZOUglc/v8DJFFJFTfygjwi+27gz ------END PRIVATE KEY----- diff --git a/chaincode-docker-devmode/msp/signcerts/peer.pem b/chaincode-docker-devmode/msp/signcerts/peer.pem deleted file mode 100644 index 415d5617..00000000 --- a/chaincode-docker-devmode/msp/signcerts/peer.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICNjCCAd2gAwIBAgIRAMnf9/dmV9RvCCVw9pZQUfUwCgYIKoZIzj0EAwIwgYEx -CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4g -RnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMQwwCgYDVQQLEwND -T1AxHDAaBgNVBAMTE2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTcxMTEyMTM0MTEx -WhcNMjcxMTEwMTM0MTExWjBpMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv -cm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEMMAoGA1UECxMDQ09QMR8wHQYD -VQQDExZwZWVyMC5vcmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0D -AQcDQgAEZ8S4V71OBJpyMIVZdwYdFXAckItrpvSrCf0HQg40WW9XSoOOO76I+Umf -EkmTlIJXP7/AyRRSRU38oI8Ivtu4M6NNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1Ud -EwEB/wQCMAAwKwYDVR0jBCQwIoAginORIhnPEFZUhXm6eWBkm7K7Zc8R4/z7LW4H -ossDlCswCgYIKoZIzj0EAwIDRwAwRAIgVikIUZzgfuFsGLQHWJUVJCU7pDaETkaz -PzFgsCiLxUACICgzJYlW7nvZxP7b6tbeu3t8mrhMXQs956mD4+BoKuNI ------END CERTIFICATE----- diff --git a/chaincode-docker-devmode/msp/tlscacerts/tlsroot.pem b/chaincode-docker-devmode/msp/tlscacerts/tlsroot.pem deleted file mode 100644 index 10625226..00000000 --- a/chaincode-docker-devmode/msp/tlscacerts/tlsroot.pem +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB8jCCAZigAwIBAgIRANxd4D3sY0656NqOh8Rha0AwCgYIKoZIzj0EAwIwWDEL -MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG -cmFuY2lzY28xDTALBgNVBAoTBE9yZzIxDTALBgNVBAMTBE9yZzIwHhcNMTcwNTA4 -MDkzMDM0WhcNMjcwNTA2MDkzMDM0WjBYMQswCQYDVQQGEwJVUzETMBEGA1UECBMK -Q2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzENMAsGA1UEChMET3Jn -MjENMAsGA1UEAxMET3JnMjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDYy+qzS -J/8CMfhpBFhUhhz+7up4+lwjBWDSS01koszNh8camHTA8vS4ZsN+DZ2DRsSmRZgs -tG2oogLLIdh6Z1CjQzBBMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUA -MA8GA1UdEwEB/wQFMAMBAf8wDQYDVR0OBAYEBAECAwQwCgYIKoZIzj0EAwIDSAAw -RQIgWnMmH0yxAjub3qfzxQioHKQ8+WvUjAXm0ejId9Q+rDICIQDr30UCPj+SXzOb -Cu4psMMBfLujKoiBNdLE1KEpt8lN1g== ------END CERTIFICATE----- diff --git a/chaincode-docker-devmode/msp/tlsintermediatecerts/tlsintermediate.pem b/chaincode-docker-devmode/msp/tlsintermediatecerts/tlsintermediate.pem deleted file mode 100644 index 0feba1a6..00000000 --- a/chaincode-docker-devmode/msp/tlsintermediatecerts/tlsintermediate.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICETCCAbagAwIBAgIQNpgoASE9fi0ooZVKcnwnZzAKBggqhkjOPQQDAjBYMQsw -CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy -YW5jaXNjbzENMAsGA1UEChMET3JnMjENMAsGA1UEAxMET3JnMjAeFw0xNzA1MDgw -OTMwMzRaFw0yNzA1MDYwOTMwMzRaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpD -YWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRQwEgYDVQQKEwtPcmcy -LWNoaWxkMTEUMBIGA1UEAxMLT3JnMi1jaGlsZDEwWTATBgcqhkjOPQIBBggqhkjO -PQMBBwNCAARTBJ8/o1tpHPwuixYDgRwcrzAru0cWJJhE6KWHAa0vBCG4nl0zjjRS -og+iAuUcY4Z/gJoHol6dKSHk9h5jrqtEo1QwUjAOBgNVHQ8BAf8EBAMCAaYwDwYD -VR0lBAgwBgYEVR0lADAPBgNVHRMBAf8EBTADAQH/MA0GA1UdDgQGBAQBAgMEMA8G -A1UdIwQIMAaABAECAwQwCgYIKoZIzj0EAwIDSQAwRgIhAIkPzk7ORV/WhfG7QY/6 -/OJg4++ftz2SZc44NIuogMArAiEAqbnpnmmHnzo2Qc6gnliCegpGnJ18RUT/jZlj -1qXHcvg= ------END CERTIFICATE----- diff --git a/chaincode-docker-devmode/myc.tx b/chaincode-docker-devmode/myc.tx deleted file mode 100644 index a9fb16c9..00000000 Binary files a/chaincode-docker-devmode/myc.tx and /dev/null differ diff --git a/chaincode-docker-devmode/orderer.block b/chaincode-docker-devmode/orderer.block deleted file mode 100644 index f69234ca..00000000 Binary files a/chaincode-docker-devmode/orderer.block and /dev/null differ diff --git a/chaincode-docker-devmode/script.sh b/chaincode-docker-devmode/script.sh deleted file mode 100755 index e910c423..00000000 --- a/chaincode-docker-devmode/script.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright London Stock Exchange Group All Rights Reserved. -# -# SPDX-License-Identifier: Apache-2.0 -set -e -# This script expedites the chaincode development process by automating the -# requisite channel create/join commands - -# We use a pre-generated orderer.block and channel transaction artifact (myc.tx), -# both of which are created using the configtxgen tool - -# first we create the channel against the specified configuration in myc.tx -# this call returns a channel configuration block - myc.block - to the CLI container -peer channel create -c myc -f myc.tx -o orderer:7050 - -# now we will join the channel and start the chain with myc.block serving as the -# channel's first block (i.e. the genesis block) -peer channel join -b myc.block - -# Now the user can proceed to build and start chaincode in one terminal -# And leverage the CLI container to issue install instantiate invoke query commands in another - -#we should have bailed if above commands failed. -#we are here, so they worked -sleep 600000 -exit 0