├── .gitattributes ├── 9781484248461.jpg ├── Ch10 ├── ethapp-step1 │ ├── .DS_Store │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── components │ │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ │ ├── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ │ ├── start │ │ │ │ ├── start.component.css │ │ │ │ ├── start.component.html │ │ │ │ ├── start.component.spec.ts │ │ │ │ └── start.component.ts │ │ │ │ └── transfer │ │ │ │ ├── transfer.component.css │ │ │ │ ├── transfer.component.html │ │ │ │ ├── transfer.component.spec.ts │ │ │ │ └── transfer.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── truffle │ │ ├── build │ │ │ └── contracts │ │ │ │ ├── Migrations.json │ │ │ │ └── Transfer.json │ │ ├── contracts │ │ │ ├── Migrations.sol │ │ │ └── Transfer.sol │ │ ├── migrations │ │ │ ├── 1_initial_migration.js │ │ │ └── 2_deploy_contracts.js │ │ ├── npm │ │ └── truffle-config.js │ ├── tsconfig.json │ └── tslint.json └── ethapp-step2 │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── ng │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── components │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ ├── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ ├── start │ │ │ │ ├── start.component.css │ │ │ │ ├── start.component.html │ │ │ │ ├── start.component.spec.ts │ │ │ │ └── start.component.ts │ │ │ └── transfer │ │ │ │ ├── transfer.component.css │ │ │ │ ├── transfer.component.html │ │ │ │ ├── transfer.component.spec.ts │ │ │ │ └── transfer.component.ts │ │ └── services │ │ │ ├── transfer.service.spec.ts │ │ │ └── transfer.service.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── truffle │ ├── build │ │ └── contracts │ │ │ ├── Migrations.json │ │ │ └── Transfer.json │ ├── contracts │ │ ├── Migrations.sol │ │ └── Transfer.sol │ ├── migrations │ │ ├── 1_initial_migration.js │ │ └── 2_deploy_contracts.js │ └── truffle-config.js │ ├── tsconfig.json │ └── tslint.json ├── Ch2 ├── .DS_Store ├── EOS-node.md ├── bitcoin-node.md └── neo-cli.md ├── Ch3 ├── step1 │ ├── .DS_Store │ ├── p2p.js │ └── package.json ├── step2 │ ├── .DS_Store │ ├── block.js │ ├── chain.js │ ├── p2p.js │ ├── package-lock.json │ └── package.json ├── step3 │ ├── .DS_Store │ ├── block.js │ ├── chain.js │ ├── p2p.js │ ├── package-lock.json │ └── package.json ├── step4 │ ├── .DS_Store │ ├── block.js │ ├── chain.js │ ├── db │ │ └── .DS_Store │ ├── p2p.js │ ├── package-lock.json │ └── package.json ├── step5 │ ├── .DS_Store │ ├── block.js │ ├── chain.js │ ├── p2p.js │ ├── package-lock.json │ ├── package.json │ └── wallet.js ├── step6 │ ├── .DS_Store │ ├── block.js │ ├── chain.js │ ├── db │ │ └── .DS_Store │ ├── p2p.js │ ├── package-lock.json │ ├── package.json │ └── wallet.js └── step7 │ ├── .DS_Store │ ├── bin │ └── cli.js │ ├── block.js │ ├── chain.js │ ├── cli_lib │ ├── base.js │ ├── cmd.js │ ├── cmds │ │ ├── block.js │ │ ├── help.js │ │ ├── version.js │ │ └── wallet.js │ └── logger.js │ ├── db │ └── .DS_Store │ ├── p2p.js │ ├── package-lock.json │ ├── package.json │ └── wallet.js ├── Ch5 ├── step1 │ ├── .DS_Store │ └── MySmartContract │ │ ├── .idea │ │ ├── MySmartContract.iml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── workspace.xml │ │ ├── build │ │ └── contracts │ │ │ ├── HelloWorldContract.json │ │ │ ├── MD5SmartContract.json │ │ │ └── Migrations.json │ │ ├── contracts │ │ ├── HelloWorldContract.sol │ │ ├── MD5SmartContract.sol │ │ └── Migrations.sol │ │ ├── migrations │ │ ├── 1_initial_migration.js │ │ ├── 2_deploy_contracts.js │ │ └── 3_deploy_contracts.js │ │ ├── readme.txt │ │ └── truffle-config.js └── step2 │ ├── .DS_Store │ └── MySmartContract │ ├── .idea │ ├── MySmartContract.iml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml │ ├── build │ └── contracts │ │ ├── HelloWorldContract.json │ │ ├── MD5SmartContract.json │ │ └── Migrations.json │ ├── contracts │ ├── HelloWorldContract.sol │ ├── MD5SmartContract.sol │ └── Migrations.sol │ ├── genesis_block.json │ ├── geth.log │ ├── migrations │ ├── 1_initial_migration.js │ ├── 2_deploy_contracts.js │ └── 3_deploy_contracts.js │ ├── readme.txt │ ├── remix │ └── HelloWorldContract.js │ ├── testnet-blockchain │ ├── geth │ │ ├── LOCK │ │ ├── chaindata │ │ │ ├── 000002.ldb │ │ │ ├── 000005.ldb │ │ │ ├── 000008.ldb │ │ │ ├── 000009.log │ │ │ ├── CURRENT │ │ │ ├── CURRENT.bak │ │ │ ├── LOCK │ │ │ ├── LOG │ │ │ └── MANIFEST-000010 │ │ ├── lightchaindata │ │ │ ├── 000001.log │ │ │ ├── CURRENT │ │ │ ├── LOCK │ │ │ ├── LOG │ │ │ └── MANIFEST-000000 │ │ ├── nodekey │ │ ├── nodes │ │ │ ├── 000002.ldb │ │ │ ├── 000005.ldb │ │ │ ├── 000006.log │ │ │ ├── CURRENT │ │ │ ├── CURRENT.bak │ │ │ ├── LOCK │ │ │ ├── LOG │ │ │ └── MANIFEST-000007 │ │ └── transactions.rlp │ ├── history │ └── keystore │ │ └── UTC--2019-04-28T13-18-44.349178000Z--a8eceb3e2dd7af9c6fdb12edd8a7e84290932c2d │ └── truffle-config.js ├── Ch6 ├── eosio.token │ ├── eosio.token.abi │ ├── eosio.token.cpp │ ├── eosio.token.hpp │ ├── eosio.token.wasm │ └── tokens.txt └── helloworld │ ├── .DS_Store │ ├── commands.txt │ ├── helloworld-hello-rc.md │ ├── helloworld-rc.md │ ├── helloworld.abi │ ├── helloworld.cpp │ ├── helloworld.wasm │ └── rc │ ├── abi_to_rc.py │ ├── rc-action-template.md │ └── rc-overview-template.md ├── Ch7 └── SmartContracts │ ├── .DS_Store │ ├── helloWorld.avm │ ├── helloWorld.debug.json │ └── helloWorld.py ├── Ch8 ├── fabric-dev-servers │ ├── .composer │ │ ├── cards │ │ │ ├── PeerAdmin@hlfv1 │ │ │ │ ├── connection.json │ │ │ │ ├── credentials │ │ │ │ │ ├── certificate │ │ │ │ │ └── privateKey │ │ │ │ └── metadata.json │ │ │ └── admin@hello-network │ │ │ │ ├── connection.json │ │ │ │ └── metadata.json │ │ ├── client-data │ │ │ ├── PeerAdmin@hlfv1 │ │ │ │ ├── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-priv │ │ │ │ ├── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-pub │ │ │ │ └── PeerAdmin │ │ │ └── admin@hello-network │ │ │ │ ├── 0857549051e3d21486bd9f0d001748b26714bd1ad91c8ff967bcdce7b2c6a560-priv │ │ │ │ ├── 0857549051e3d21486bd9f0d001748b26714bd1ad91c8ff967bcdce7b2c6a560-pub │ │ │ │ └── admin │ │ └── logs │ │ │ └── trace_20190208.log │ ├── Dockerfile │ ├── _loader.sh │ ├── createComposerProfile.sh │ ├── createPeerAdminCard.sh │ ├── custom-jwt.js │ ├── downloadFabric.sh │ ├── envvars.txt │ ├── fabric-dev-servers.tar.gz │ ├── fabric-scripts │ │ ├── hlfv1 │ │ │ ├── composer │ │ │ │ ├── composer-channel.tx │ │ │ │ ├── composer-genesis.block │ │ │ │ ├── configtx.yaml │ │ │ │ ├── creds │ │ │ │ │ ├── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-priv │ │ │ │ │ ├── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-pub │ │ │ │ │ ├── PeerAdmin │ │ │ │ │ └── PeerAdmin.cert │ │ │ │ ├── crypto-config.yaml │ │ │ │ ├── crypto-config │ │ │ │ │ ├── ordererOrganizations │ │ │ │ │ │ └── example.com │ │ │ │ │ │ │ ├── ca │ │ │ │ │ │ │ ├── 5a6c4ce688103f8220147c6f8257eefbb5a1a8a80220c720d8152a2158021893_sk │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ ├── orderers │ │ │ │ │ │ │ └── orderer.example.com │ │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ │ └── 4947ca37ff6aca98aed30b2f50b64b152f22089e51cf0a70ff5ceb76e9872d66_sk │ │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ │ └── orderer.example.com-cert.pem │ │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ │ └── server.key │ │ │ │ │ │ │ ├── tlsca │ │ │ │ │ │ │ ├── 7b50b613ab7f8142a9f3c1a7b546c9f042026ffc7439fa37b6c5c0eb91ae0c1d_sk │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ └── users │ │ │ │ │ │ │ └── Admin@example.com │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ └── c6211e0b87d5ac94276dbf92e4cfadf385ee78e1c46cffb9a2e454e090736065_sk │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ └── server.key │ │ │ │ │ └── peerOrganizations │ │ │ │ │ │ └── org1.example.com │ │ │ │ │ │ ├── ca │ │ │ │ │ │ ├── 19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ ├── peers │ │ │ │ │ │ └── peer0.org1.example.com │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ └── dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ └── peer0.org1.example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ └── server.key │ │ │ │ │ │ ├── tlsca │ │ │ │ │ │ ├── ed9a007fe080f78d1af5410dbf35cedac9781ce6808f3c3573b748eb0de142ac_sk │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ └── users │ │ │ │ │ │ └── Admin@org1.example.com │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ └── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ └── tls │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ └── server.key │ │ │ │ ├── docker-compose.yml │ │ │ │ └── howtobuild.txt │ │ │ ├── createComposerProfile.sh │ │ │ ├── createPeerAdminCard.sh │ │ │ ├── downloadFabric.sh │ │ │ ├── startFabric.sh │ │ │ ├── stopFabric.sh │ │ │ └── teardownFabric.sh │ │ ├── hlfv11 │ │ │ ├── composer │ │ │ │ ├── composer-channel.tx │ │ │ │ ├── composer-genesis.block │ │ │ │ ├── configtx.yaml │ │ │ │ ├── crypto-config.yaml │ │ │ │ ├── crypto-config │ │ │ │ │ ├── ordererOrganizations │ │ │ │ │ │ └── example.com │ │ │ │ │ │ │ ├── ca │ │ │ │ │ │ │ ├── 5a6c4ce688103f8220147c6f8257eefbb5a1a8a80220c720d8152a2158021893_sk │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ ├── orderers │ │ │ │ │ │ │ └── orderer.example.com │ │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ │ └── 4947ca37ff6aca98aed30b2f50b64b152f22089e51cf0a70ff5ceb76e9872d66_sk │ │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ │ └── orderer.example.com-cert.pem │ │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ │ └── server.key │ │ │ │ │ │ │ ├── tlsca │ │ │ │ │ │ │ ├── 7b50b613ab7f8142a9f3c1a7b546c9f042026ffc7439fa37b6c5c0eb91ae0c1d_sk │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ └── users │ │ │ │ │ │ │ └── Admin@example.com │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ └── c6211e0b87d5ac94276dbf92e4cfadf385ee78e1c46cffb9a2e454e090736065_sk │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ └── server.key │ │ │ │ │ └── peerOrganizations │ │ │ │ │ │ └── org1.example.com │ │ │ │ │ │ ├── ca │ │ │ │ │ │ ├── 19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ ├── peers │ │ │ │ │ │ └── peer0.org1.example.com │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ └── dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ └── peer0.org1.example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ └── server.key │ │ │ │ │ │ ├── tlsca │ │ │ │ │ │ ├── ed9a007fe080f78d1af5410dbf35cedac9781ce6808f3c3573b748eb0de142ac_sk │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ └── users │ │ │ │ │ │ └── Admin@org1.example.com │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ └── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ └── tls │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ └── server.key │ │ │ │ ├── docker-compose-dev.yml │ │ │ │ ├── docker-compose.yml │ │ │ │ └── howtobuild.txt │ │ │ ├── createComposerProfile.sh │ │ │ ├── createPeerAdminCard.sh │ │ │ ├── downloadFabric.sh │ │ │ ├── startFabric.sh │ │ │ ├── stopFabric.sh │ │ │ └── teardownFabric.sh │ │ └── hlfv12 │ │ │ ├── composer │ │ │ ├── composer-channel.tx │ │ │ ├── composer-genesis.block │ │ │ ├── configtx.yaml │ │ │ ├── crypto-config.yaml │ │ │ ├── crypto-config │ │ │ │ ├── ordererOrganizations │ │ │ │ │ └── example.com │ │ │ │ │ │ ├── ca │ │ │ │ │ │ ├── 5a6c4ce688103f8220147c6f8257eefbb5a1a8a80220c720d8152a2158021893_sk │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ ├── orderers │ │ │ │ │ │ └── orderer.example.com │ │ │ │ │ │ │ ├── msp │ │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ │ └── 4947ca37ff6aca98aed30b2f50b64b152f22089e51cf0a70ff5ceb76e9872d66_sk │ │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ │ └── orderer.example.com-cert.pem │ │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ │ └── tls │ │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ │ └── server.key │ │ │ │ │ │ ├── tlsca │ │ │ │ │ │ ├── 7b50b613ab7f8142a9f3c1a7b546c9f042026ffc7439fa37b6c5c0eb91ae0c1d_sk │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ └── users │ │ │ │ │ │ └── Admin@example.com │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.example.com-cert.pem │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ └── c6211e0b87d5ac94276dbf92e4cfadf385ee78e1c46cffb9a2e454e090736065_sk │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ └── Admin@example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.example.com-cert.pem │ │ │ │ │ │ └── tls │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ └── server.key │ │ │ │ └── peerOrganizations │ │ │ │ │ └── org1.example.com │ │ │ │ │ ├── ca │ │ │ │ │ ├── 19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ ├── msp │ │ │ │ │ ├── admincerts │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ ├── cacerts │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ ├── peers │ │ │ │ │ └── peer0.org1.example.com │ │ │ │ │ │ ├── msp │ │ │ │ │ │ ├── admincerts │ │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ │ ├── cacerts │ │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ │ ├── keystore │ │ │ │ │ │ │ └── dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk │ │ │ │ │ │ ├── signcerts │ │ │ │ │ │ │ └── peer0.org1.example.com-cert.pem │ │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ │ └── tls │ │ │ │ │ │ ├── ca.crt │ │ │ │ │ │ ├── server.crt │ │ │ │ │ │ └── server.key │ │ │ │ │ ├── tlsca │ │ │ │ │ ├── ed9a007fe080f78d1af5410dbf35cedac9781ce6808f3c3573b748eb0de142ac_sk │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ └── users │ │ │ │ │ └── Admin@org1.example.com │ │ │ │ │ ├── msp │ │ │ │ │ ├── admincerts │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ ├── cacerts │ │ │ │ │ │ └── ca.org1.example.com-cert.pem │ │ │ │ │ ├── keystore │ │ │ │ │ │ └── 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk │ │ │ │ │ ├── signcerts │ │ │ │ │ │ └── Admin@org1.example.com-cert.pem │ │ │ │ │ └── tlscacerts │ │ │ │ │ │ └── tlsca.org1.example.com-cert.pem │ │ │ │ │ └── tls │ │ │ │ │ ├── ca.crt │ │ │ │ │ ├── server.crt │ │ │ │ │ └── server.key │ │ │ ├── docker-compose-dev.yml │ │ │ ├── docker-compose.yml │ │ │ └── howtobuild.txt │ │ │ ├── createComposerProfile.sh │ │ │ ├── createPeerAdminCard.sh │ │ │ ├── downloadFabric.sh │ │ │ ├── startFabric.sh │ │ │ ├── stopFabric.sh │ │ │ └── teardownFabric.sh │ ├── networkadmin.card │ ├── package.json │ ├── startFabric.sh │ ├── stopFabric.sh │ ├── teardownAllDocker.sh │ └── teardownFabric.sh └── hello-network │ ├── .DS_Store │ ├── hello-network.bna │ └── hello-network │ ├── .eslintrc.yml │ ├── README.md │ ├── features │ ├── sample.feature │ └── support │ │ └── index.js │ ├── hello-network@0.0.1.bna │ ├── lib │ └── logic.js │ ├── models │ └── org.skynet.cto │ ├── package.json │ ├── permissions.acl │ └── test │ └── logic.js ├── Ch9 ├── ethdapp-step2 │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── components │ │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ │ ├── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ │ ├── start │ │ │ │ ├── start.component.css │ │ │ │ ├── start.component.html │ │ │ │ ├── start.component.spec.ts │ │ │ │ └── start.component.ts │ │ │ │ └── transfer │ │ │ │ ├── transfer.component.css │ │ │ │ ├── transfer.component.html │ │ │ │ ├── transfer.component.spec.ts │ │ │ │ └── transfer.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── ethdapp-step3 │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── components │ │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ │ ├── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ │ ├── start │ │ │ │ ├── start.component.css │ │ │ │ ├── start.component.html │ │ │ │ ├── start.component.spec.ts │ │ │ │ └── start.component.ts │ │ │ │ └── transfer │ │ │ │ ├── transfer.component.css │ │ │ │ ├── transfer.component.html │ │ │ │ ├── transfer.component.spec.ts │ │ │ │ └── transfer.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── ethdapp-step4 │ ├── .DS_Store │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ └── components │ │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ │ ├── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ │ ├── start │ │ │ │ ├── start.component.css │ │ │ │ ├── start.component.html │ │ │ │ ├── start.component.spec.ts │ │ │ │ └── start.component.ts │ │ │ │ └── transfer │ │ │ │ ├── transfer.component.css │ │ │ │ ├── transfer.component.html │ │ │ │ ├── transfer.component.spec.ts │ │ │ │ └── transfer.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json └── ethdapp-step5 │ ├── .DS_Store │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── components │ │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ ├── footer.component.spec.ts │ │ │ └── footer.component.ts │ │ │ ├── header │ │ │ ├── header.component.css │ │ │ ├── header.component.html │ │ │ ├── header.component.spec.ts │ │ │ └── header.component.ts │ │ │ ├── start │ │ │ ├── start.component.css │ │ │ ├── start.component.html │ │ │ ├── start.component.spec.ts │ │ │ └── start.component.ts │ │ │ └── transfer │ │ │ ├── transfer.component.css │ │ │ ├── transfer.component.html │ │ │ ├── transfer.component.spec.ts │ │ │ └── transfer.component.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json ├── Contributing.md ├── LICENSE.txt ├── README.md └── errata.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /9781484248461.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/9781484248461.jpg -------------------------------------------------------------------------------- /Ch10/ethapp-step1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step1/.DS_Store -------------------------------------------------------------------------------- /Ch10/ethapp-step1/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /Ch10/ethapp-step1/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to ethdapp!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { StartComponent } from './components/start/start.component'; 5 | import { TransferComponent } from './components/transfer/transfer.component'; 6 | const routes: Routes = [ 7 | { path: '', redirectTo: '/start', pathMatch: 'full' }, 8 | { path: 'start', component: StartComponent }, 9 | { path: 'transfer', component: TransferComponent } 10 | ]; 11 | @NgModule({ 12 | declarations: [], 13 | imports: [ RouterModule.forRoot(routes), CommonModule ], 14 | exports: [ RouterModule ] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step1/src/app/app.component.css -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ethdapp'; 10 | } 11 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | p { 2 | padding-left: 0; 3 | font-size: 11px; 4 | } 5 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Copyright (c) 2019 Company Name. All Rights Reserved.

4 |
5 |
6 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | .nav { 2 | margin-bottom: 0; 3 | padding-left: 0; 4 | list-style: none; 5 | } 6 | li { 7 | display: block; 8 | float: left; 9 | width: 100px; 10 | height: 25px; 11 | padding: 5px; 12 | } 13 | .nav>li>a { 14 | margin-bottom: 0; 15 | padding-left: 0; 16 | font-weight: 500; 17 | font-size: 12px; 18 | text-transform: uppercase; 19 | position: relative; 20 | } 21 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/start/start.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step1/src/app/components/start/start.component.css -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/start/start.component.html: -------------------------------------------------------------------------------- 1 |

2 | start works! 3 |

4 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-start', 5 | templateUrl: './start.component.html', 6 | styleUrls: ['./start.component.css'] 7 | }) 8 | export class StartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/transfer/transfer.component.css: -------------------------------------------------------------------------------- 1 | .transfer-container { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | .transfer-container > * { 6 | width: 100%; 7 | } 8 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/app/components/transfer/transfer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferComponent } from './transfer.component'; 4 | 5 | describe('TransferComponent', () => { 6 | let component: TransferComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TransferComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TransferComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step1/src/assets/.gitkeep -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step1/src/favicon.ico -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ethdapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'hammerjs'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | import { environment } from './environments/environment'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/truffle/contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.4.21 <0.6.0; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | constructor() public { 8 | owner = msg.sender; 9 | } 10 | 11 | modifier restricted() { 12 | if (msg.sender == owner) _; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/truffle/contracts/Transfer.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | contract Transfer { 4 | address payable from; 5 | address payable to; 6 | 7 | constructor() public { 8 | from = msg.sender; 9 | } 10 | 11 | event Pay(address _to, address _from, uint amt); 12 | 13 | function pay( address payable _to ) public payable returns (bool) { 14 | to = _to; 15 | to.transfer(msg.value); 16 | emit Pay(to, from, msg.value); 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/truffle/migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/truffle/migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | var Transfer = artifacts.require("./Transfer.sol"); 2 | module.exports = function(deployer) { 3 | deployer.deploy(Transfer); 4 | }; 5 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/truffle/npm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step1/truffle/npm -------------------------------------------------------------------------------- /Ch10/ethapp-step1/truffle/truffle-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | networks: { 3 | development: { 4 | host: "127.0.0.1", 5 | port: 8545, 6 | network_id: "*", 7 | gas: 5000000, 8 | gasPrice: 100000000000 9 | } 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Ch10/ethapp-step1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /Ch10/ethapp-step2/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ethdapp!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Ch10/ethapp-step2/ng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step2/ng -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | // components 5 | import { StartComponent } from './components/start/start.component'; 6 | import { TransferComponent } from './components/transfer/transfer.component'; 7 | 8 | const routes: Routes = [ 9 | { path: '', redirectTo: '/start', pathMatch: 'full' }, 10 | { path: 'start', component: StartComponent }, 11 | { path: 'transfer', component: TransferComponent } 12 | ]; 13 | 14 | @NgModule({ 15 | declarations: [], 16 | imports: [ RouterModule.forRoot(routes), CommonModule ], 17 | exports: [ RouterModule ] 18 | }) 19 | export class AppRoutingModule { } 20 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step2/src/app/app.component.css -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ethdapp'; 10 | } 11 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | p { 2 | padding-left: 0; 3 | font-size: 11px; 4 | } 5 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Copyright (c) 2019 Company Name. All Rights Reserved.

4 |
5 |
6 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | .nav { 2 | margin-bottom: 0; 3 | padding-left: 0; 4 | list-style: none; 5 | } 6 | li { 7 | display: block; 8 | float: left; 9 | width: 100px; 10 | height: 25px; 11 | padding: 5px; 12 | } 13 | .nav>li>a { 14 | margin-bottom: 0; 15 | padding-left: 0; 16 | font-weight: 500; 17 | font-size: 12px; 18 | text-transform: uppercase; 19 | position: relative; 20 | } 21 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/start/start.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step2/src/app/components/start/start.component.css -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/start/start.component.html: -------------------------------------------------------------------------------- 1 |

2 | start works! 3 |

4 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-start', 5 | templateUrl: './start.component.html', 6 | styleUrls: ['./start.component.css'] 7 | }) 8 | export class StartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/transfer/transfer.component.css: -------------------------------------------------------------------------------- 1 | .transfer-container { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | 6 | .transfer-container > * { 7 | width: 100%; 8 | } 9 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/components/transfer/transfer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferComponent } from './transfer.component'; 4 | 5 | describe('TransferComponent', () => { 6 | let component: TransferComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TransferComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TransferComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/app/services/transfer.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferService } from './transfer.service'; 4 | 5 | describe('TransferService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: TransferService = TestBed.get(TransferService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step2/src/assets/.gitkeep -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch10/ethapp-step2/src/favicon.ico -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Ethdapp 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | 14 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/truffle/contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.4.21 <0.6.0; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | constructor() public { 8 | owner = msg.sender; 9 | } 10 | 11 | modifier restricted() { 12 | if (msg.sender == owner) _; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/truffle/contracts/Transfer.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | contract Transfer { 4 | address payable from; 5 | address payable to; 6 | 7 | constructor() public { 8 | from = msg.sender; 9 | } 10 | 11 | event Pay(address _to, address _from, uint amt); 12 | 13 | function pay( address payable _to ) public payable returns (bool) { 14 | to = _to; 15 | to.transfer(msg.value); 16 | emit Pay(to, from, msg.value); 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/truffle/migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/truffle/migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | var Transfer = artifacts.require("./Transfer.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Transfer); 5 | }; 6 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/truffle/truffle-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | networks: { 3 | development: { 4 | host: "127.0.0.1", 5 | port: 8545, 6 | network_id: "*", 7 | gas: 5000000, 8 | gasPrice: 100000000000 9 | } 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Ch10/ethapp-step2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2017", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Ch2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch2/.DS_Store -------------------------------------------------------------------------------- /Ch2/EOS-node.md: -------------------------------------------------------------------------------- 1 | # Installing EOS full node 2 | 3 | Requirements are listed here: https://developers.eos.io/eosio-nodeos/docs/install-nodeos 4 | 5 | ``` 6 | > git clone https://github.com/EOSIO/eos --recursive 7 | > cd eos 8 | > ./eosio_build.sh #takes about 30 mins to an hour. 9 | ``` 10 | 11 | Check that the demon is working correctly; 12 | 13 | ``` 14 | > cd build/programs/nodeos 15 | > ./nodeos -h #list of commands 16 | ``` 17 | 18 | Run the EOS node daemon; 19 | 20 | ``` 21 | > ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin 22 | ``` 23 | -------------------------------------------------------------------------------- /Ch3/step1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step1/.DS_Store -------------------------------------------------------------------------------- /Ch3/step2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step2/.DS_Store -------------------------------------------------------------------------------- /Ch3/step3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step3/.DS_Store -------------------------------------------------------------------------------- /Ch3/step4/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step4/.DS_Store -------------------------------------------------------------------------------- /Ch3/step4/db/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step4/db/.DS_Store -------------------------------------------------------------------------------- /Ch3/step5/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step5/.DS_Store -------------------------------------------------------------------------------- /Ch3/step6/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step6/.DS_Store -------------------------------------------------------------------------------- /Ch3/step6/db/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step6/db/.DS_Store -------------------------------------------------------------------------------- /Ch3/step6/wallet.js: -------------------------------------------------------------------------------- 1 | let EC = require('elliptic').ec, 2 | fs = require('fs'); 3 | 4 | const ec = new EC('secp256k1'), 5 | privateKeyLocation = __dirname + '/wallet/private_key'; 6 | 7 | exports.initWallet = () => { 8 | let privateKey; 9 | if (fs.existsSync(privateKeyLocation)) { 10 | const buffer = fs.readFileSync(privateKeyLocation, 'utf8'); 11 | privateKey = buffer.toString(); 12 | } else { 13 | privateKey = generatePrivateKey(); 14 | fs.writeFileSync(privateKeyLocation, privateKey); 15 | } 16 | 17 | const key = ec.keyFromPrivate(privateKey, 'hex'); 18 | const publicKey = key.getPublic().encode('hex'); 19 | return({'privateKeyLocation': privateKeyLocation, 'publicKey': publicKey}); 20 | }; 21 | 22 | const generatePrivateKey = () => { 23 | const keyPair = ec.genKeyPair(); 24 | const privateKey = keyPair.getPrivate(); 25 | return privateKey.toString(16); 26 | }; -------------------------------------------------------------------------------- /Ch3/step7/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step7/.DS_Store -------------------------------------------------------------------------------- /Ch3/step7/bin/cli.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Elad Elrom, All Rights Reserved. 3 | * Code licensed under the BSD License: 4 | * @author Elad Elrom 5 | */ 6 | 'use strict'; 7 | 8 | var verbose = process.argv.indexOf('--verbose') !== -1; 9 | var insane = process.argv.indexOf('--insane') !== -1; 10 | 11 | if (verbose || insane) 12 | process.env.GH_VERBOSE = true; 13 | 14 | if (insane) 15 | process.env.GH_VERBOSE_INSANE = true; 16 | 17 | require('../cli_lib/cmd.js').run(); 18 | -------------------------------------------------------------------------------- /Ch3/step7/cli_lib/cmds/version.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Elad Elrom, All Rights Reserved. 3 | * Code licensed under the BSD License: 4 | * @author Elad Elrom 5 | */ 6 | 'use strict'; 7 | 8 | let base = require('../base'), 9 | logger = require('../logger'); 10 | 11 | function Version() {} 12 | 13 | Version.DETAILS = { 14 | alias: 'v', 15 | description: 'Version.', 16 | }; 17 | 18 | Version.prototype.run = function() { 19 | base.asyncReadPackages(this.printVersion) 20 | }; 21 | 22 | Version.prototype.printVersion = function(pkg) { 23 | logger.log(pkg.name + ' ' + pkg.version) 24 | }; 25 | 26 | exports.Impl = Version; 27 | -------------------------------------------------------------------------------- /Ch3/step7/db/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch3/step7/db/.DS_Store -------------------------------------------------------------------------------- /Ch3/step7/wallet.js: -------------------------------------------------------------------------------- 1 | let EC = require('elliptic').ec, 2 | fs = require('fs'); 3 | 4 | const ec = new EC('secp256k1'), 5 | privateKeyLocation = __dirname + '/wallet/private_key'; 6 | 7 | exports.initWallet = () => { 8 | let privateKey; 9 | if (fs.existsSync(privateKeyLocation)) { 10 | const buffer = fs.readFileSync(privateKeyLocation, 'utf8'); 11 | privateKey = buffer.toString(); 12 | } else { 13 | privateKey = generatePrivateKey(); 14 | fs.writeFileSync(privateKeyLocation, privateKey); 15 | } 16 | 17 | const key = ec.keyFromPrivate(privateKey, 'hex'); 18 | const publicKey = key.getPublic().encode('hex'); 19 | return({'privateKeyLocation': privateKeyLocation, 'publicKey': publicKey}); 20 | }; 21 | 22 | const generatePrivateKey = () => { 23 | const keyPair = ec.genKeyPair(); 24 | const privateKey = keyPair.getPrivate(); 25 | return privateKey.toString(16); 26 | }; -------------------------------------------------------------------------------- /Ch5/step1/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step1/.DS_Store -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/.idea/MySmartContract.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/contracts/HelloWorldContract.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | contract HelloWorldContract { 3 | string greeting; 4 | constructor() public { 5 | greeting = 'Hello World'; 6 | } 7 | function greet() public view returns (string memory) { 8 | return greeting; 9 | } 10 | } -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/contracts/MD5SmartContract.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | contract MD5SmartContract { 3 | bytes32 public signature; 4 | event signEvent(bytes32 signature); 5 | constructor() public { 6 | } 7 | function sign(string memory document) public { 8 | signature = sha256(bytes(document)); 9 | emit signEvent(signature); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.4.21 <0.6.0; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | constructor() public { 8 | owner = msg.sender; 9 | } 10 | 11 | modifier restricted() { 12 | if (msg.sender == owner) _; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | const HelloWorldContract = artifacts.require("HelloWorldContract.sol"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(HelloWorldContract); 5 | }; -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/migrations/3_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | const MD5SmartContract = artifacts.require("MD5SmartContract.sol"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(MD5SmartContract); 5 | }; -------------------------------------------------------------------------------- /Ch5/step1/MySmartContract/readme.txt: -------------------------------------------------------------------------------- 1 | To compile and interact with these Contracts. Ensure "ganache" and "truffle" are installed globally on your machine. 2 | Then, open four terminals and run these commands; 3 | 1) > ganache-cli -p 8584 4 | 2) > truffle compile 5 | 3) > truffle migrate --reset 6 | 4) > truffle console --network development 7 | truffle(development)> HelloWorldContract.deployed().then(_app => { hello = _app }) 8 | undefined 9 | truffle(development)> hello.greet() 10 | 'Hello World' 11 | truffle(development)> MD5SmartContract.deployed().then(_app => { doc = _app }) 12 | undefined 13 | truffle(development)> doc.sign('634ef85e038cea45bd20900fc97e09dc') 14 | truffle(development)> doc.signature() 15 | 0x7869cd540ff8c3b2635ec87251f361e21ad3c72fbc2f79897b9816bec54b0a48 -------------------------------------------------------------------------------- /Ch5/step2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/.DS_Store -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/.idea/MySmartContract.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/contracts/HelloWorldContract.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | contract HelloWorldContract { 3 | string greeting; 4 | constructor() public { 5 | greeting = 'Hello World'; 6 | } 7 | function greet() public view returns (string memory) { 8 | return greeting; 9 | } 10 | } -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/contracts/MD5SmartContract.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | contract MD5SmartContract { 3 | bytes32 public signature; 4 | event signEvent(bytes32 signature); 5 | constructor() public { 6 | } 7 | function sign(string memory document) public { 8 | signature = sha256(bytes(document)); 9 | emit signEvent(signature); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.4.21 <0.6.0; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | constructor() public { 8 | owner = msg.sender; 9 | } 10 | 11 | modifier restricted() { 12 | if (msg.sender == owner) _; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/genesis_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "chainId": 1, 4 | "homesteadBlock": 0, 5 | "eip155Block": 0, 6 | "eip158Block": 0 7 | }, 8 | "difficulty": "0x800", 9 | "gasLimit": "0x1000000", 10 | "alloc": { 11 | "0x44dc998cbc1c7504bec0a96af4a9aef6606a768a": 12 | { "balance": "0x1337000000000000000000" } 13 | } 14 | } -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | const HelloWorldContract = artifacts.require("HelloWorldContract.sol"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(HelloWorldContract); 5 | }; -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/migrations/3_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | const MD5SmartContract = artifacts.require("MD5SmartContract.sol"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(MD5SmartContract); 5 | }; -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/readme.txt: -------------------------------------------------------------------------------- 1 | To compile and interact with these Contracts. Ensure "ganache" and "truffle" are installed globally on your machine. 2 | Then, open four terminals and run these commands; 3 | 1) > ganache-cli -p 8584 4 | 2) > truffle compile 5 | 3) > truffle migrate --reset 6 | 4) > truffle console --network development 7 | truffle(development)> HelloWorldContract.deployed().then(_app => { hello = _app }) 8 | undefined 9 | truffle(development)> hello.greet() 10 | 'Hello World' 11 | truffle(development)> MD5SmartContract.deployed().then(_app => { doc = _app }) 12 | undefined 13 | truffle(development)> doc.sign('634ef85e038cea45bd20900fc97e09dc') 14 | truffle(development)> doc.signature() 15 | 0x7869cd540ff8c3b2635ec87251f361e21ad3c72fbc2f79897b9816bec54b0a48 -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/LOCK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/LOCK -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000002.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000002.ldb -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000005.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000005.ldb -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000008.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000008.ldb -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000009.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/000009.log -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000010 2 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/CURRENT.bak: -------------------------------------------------------------------------------- 1 | MANIFEST-000007 2 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/LOCK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/LOCK -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/MANIFEST-000010: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/chaindata/MANIFEST-000010 -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/000001.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/000001.log -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000000 2 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/LOCK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/LOCK -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/LOG: -------------------------------------------------------------------------------- 1 | =============== Apr 28, 2019 (+03) =============== 2 | 16:18:04.933181 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 3 | 16:18:04.945935 db@open opening 4 | 16:18:04.948404 version@stat F·[] S·0B[] Sc·[] 5 | 16:18:04.953238 db@janitor F·2 G·0 6 | 16:18:04.963732 db@open done T·17.715315ms 7 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/MANIFEST-000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/lightchaindata/MANIFEST-000000 -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodekey: -------------------------------------------------------------------------------- 1 | 95259729bd995748c3eb80e18fca9c85c7d9397998c265dd83cc2d38162d63e7 -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/000002.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/000002.ldb -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/000005.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/000005.ldb -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/000006.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/000006.log -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000007 2 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/CURRENT.bak: -------------------------------------------------------------------------------- 1 | MANIFEST-000004 2 | -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/LOCK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/LOCK -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/MANIFEST-000007: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/nodes/MANIFEST-000007 -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/geth/transactions.rlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch5/step2/MySmartContract/testnet-blockchain/geth/transactions.rlp -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/history: -------------------------------------------------------------------------------- 1 | eth.syncing 2 | eth.blockNumber 3 | eth.getBalance(eth.accounts[0]) 4 | b3 5 | eth.accounts 6 | miner.start() 7 | eth.blockNumber 8 | eth.getBalance(eth.accounts[0]) 9 | miner.stop() 10 | loadScript("remix/HelloWorldContract.js") 11 | miner.start() 12 | geth –help 13 | geth --help 14 | geth -help 15 | geth help 16 | help 17 | eth.pendingTransactions 18 | geth removedb -------------------------------------------------------------------------------- /Ch5/step2/MySmartContract/testnet-blockchain/keystore/UTC--2019-04-28T13-18-44.349178000Z--a8eceb3e2dd7af9c6fdb12edd8a7e84290932c2d: -------------------------------------------------------------------------------- 1 | {"address":"a8eceb3e2dd7af9c6fdb12edd8a7e84290932c2d","crypto":{"cipher":"aes-128-ctr","ciphertext":"d232ba981ffb7289d8f0e7019884cfb5d7a6a50c4c5f203c1a78627b59818b9c","cipherparams":{"iv":"2ef1d7419d12d27983993b0152f8568c"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"f0c2b814655eaac2a6428960acf3c8744d45282c6d51fd1fb5d0091972313542"},"mac":"98bd0fa4bb8a034253bce834de7e97e114f3cda5211dda5fdefcc2d5546d409d"},"id":"2555094a-ae9c-43a4-be70-1ea7fd638578","version":3} -------------------------------------------------------------------------------- /Ch6/eosio.token/eosio.token.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch6/eosio.token/eosio.token.wasm -------------------------------------------------------------------------------- /Ch6/eosio.token/tokens.txt: -------------------------------------------------------------------------------- 1 | # create accounts: 2 | > cleos create account eosio eosio.token [public key] 3 | > cleos create account eosio jane [public key] 4 | 5 | # Generate tokens and transfer 6 | > cleos wallet unlock --password [DEFAULT_MASTER_KEY] 7 | > cleos push action eosio.token create '[ "eosio", "20000000.0000 TOKEN"]' -p eosio.token@active 8 | > cleos get currency stats eosio.token TOKEN 9 | > cleos push action eosio.token issue '[ "jane", "500.0000 TOKEN", "move tokens to Jane" ]' -p eosio@active 10 | > cleos get currency balance eosio.token jane TOKEN 11 | > cleos push action eosio.token transfer '[ "jane", "john", "100.0000 TOKEN", "transfer tokens" ]' -p jane@active 12 | > cleos get currency balance eosio.token jane TOKEN 13 | > cleos get currency balance eosio.token john TOKEN -------------------------------------------------------------------------------- /Ch6/helloworld/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch6/helloworld/.DS_Store -------------------------------------------------------------------------------- /Ch6/helloworld/helloworld-hello-rc.md: -------------------------------------------------------------------------------- 1 | # Action - `{{ hello }}` 2 | 3 | ### Description 4 | 5 | The `{{ hello }}` action... 6 | 7 | ### Input and Input Type 8 | 9 | The `{{ hello }}` action requires the following `input` and `input type`: 10 | 11 | | Action | Input | Input Type | 12 | |:--|:--|:--| 13 | | `{{ hello }}` | `{{ userVar }}` | `{{ name }}` | 14 | -------------------------------------------------------------------------------- /Ch6/helloworld/helloworld-rc.md: -------------------------------------------------------------------------------- 1 | # Smart Contract - `{{ helloworld }}` 2 | 3 | This is an overview of the actions for the `{{ helloworld }}` smart contract. 4 | 5 | ### Description 6 | 7 | The `{{ helloworld }}` contract... 8 | 9 | ### Action, Input and Input Type 10 | 11 | The table below contains the `action`, `input` and `input type` for the `{{ helloworld }}` contract. 12 | 13 | | Action | Input | Input Type | 14 | |:--|:--|:--| 15 | | `{{ hello }}` | `{{ user }}` | `{{ name }}` | -------------------------------------------------------------------------------- /Ch6/helloworld/helloworld.abi: -------------------------------------------------------------------------------- 1 | { 2 | "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Tue Dec 25 09:49:21 2018", 3 | "version": "eosio::abi/1.1", 4 | "structs": [ 5 | { 6 | "name": "hello", 7 | "base": "", 8 | "fields": [ 9 | { 10 | "name": "user", 11 | "type": "name" 12 | } 13 | ] 14 | } 15 | ], 16 | "types": [], 17 | "actions": [ 18 | { 19 | "name": "hello", 20 | "type": "hello", 21 | "ricardian_contract": "" 22 | } 23 | ], 24 | "tables": [], 25 | "ricardian_clauses": [], 26 | "variants": [], 27 | "abi_extensions": [] 28 | } -------------------------------------------------------------------------------- /Ch6/helloworld/helloworld.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace eosio; 3 | 4 | class helloworld : public contract { 5 | public: 6 | using contract::contract; 7 | [[eosio::action]] 8 | void hello( name user ) { 9 | print( "World: User: ", user); 10 | } 11 | }; 12 | 13 | EOSIO_DISPATCH( helloworld, (hello)) 14 | -------------------------------------------------------------------------------- /Ch6/helloworld/helloworld.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch6/helloworld/helloworld.wasm -------------------------------------------------------------------------------- /Ch6/helloworld/rc/rc-action-template.md: -------------------------------------------------------------------------------- 1 | # Action - `$action` 2 | 3 | ### Description 4 | 5 | The `$action` action... 6 | 7 | ### $input_header and Input $type_header 8 | 9 | The `$action` action requires the following `$input` and `input $type`: 10 | 11 | | Action | Input | Input Type | 12 | |:--|:--|:--| 13 | -------------------------------------------------------------------------------- /Ch6/helloworld/rc/rc-overview-template.md: -------------------------------------------------------------------------------- 1 | # Smart Contract - `$contract` 2 | 3 | This is an overview of the actions for the `$contract` smart contract. 4 | 5 | ### Description 6 | 7 | The `$contract` contract... 8 | 9 | ### $action_header, $input_header and Input $type_header 10 | 11 | The table below contains the `$action`, `$input` and `input $type` for the `$contract` contract. 12 | 13 | | Action | Input | Input Type | 14 | |:--|:--|:--| 15 | -------------------------------------------------------------------------------- /Ch7/SmartContracts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch7/SmartContracts/.DS_Store -------------------------------------------------------------------------------- /Ch7/SmartContracts/helloWorld.avm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch7/SmartContracts/helloWorld.avm -------------------------------------------------------------------------------- /Ch7/SmartContracts/helloWorld.debug.json: -------------------------------------------------------------------------------- 1 | { 2 | "avm": { 3 | "name": "helloWorld", 4 | "hash": "bc1119bd9344c486cd961cbdbc97be9d" 5 | }, 6 | "compiler": { 7 | "name": "neo-boa", 8 | "version": "0.5.6" 9 | }, 10 | "files": [ 11 | { 12 | "id": 1, 13 | "url": "/Users/Eli/Desktop/neo-python/neo/bin/smartContracts/helloWorld.py" 14 | } 15 | ], 16 | "map": [ 17 | { 18 | "start": 3, 19 | "end": 31, 20 | "file": 1, 21 | "method": "Main", 22 | "line": 3, 23 | "file_line_no": 3 24 | }, 25 | { 26 | "start": 32, 27 | "end": 35, 28 | "file": 1, 29 | "line": 5 30 | } 31 | ], 32 | "breakpoints": [] 33 | } -------------------------------------------------------------------------------- /Ch7/SmartContracts/helloWorld.py: -------------------------------------------------------------------------------- 1 | def Main(): 2 | 3 | print("hello world"); 4 | 5 | return True 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/cards/PeerAdmin@hlfv1/connection.json: -------------------------------------------------------------------------------- 1 | {"name":"hlfv1","x-type":"hlfv1","x-commitTimeout":300,"version":"1.0.0","client":{"organization":"Org1","connection":{"timeout":{"peer":{"endorser":"300","eventHub":"300","eventReg":"300"},"orderer":"300"}}},"channels":{"composerchannel":{"orderers":["orderer.example.com"],"peers":{"peer0.org1.example.com":{}}}},"organizations":{"Org1":{"mspid":"Org1MSP","peers":["peer0.org1.example.com"],"certificateAuthorities":["ca.org1.example.com"]}},"orderers":{"orderer.example.com":{"url":"grpc://localhost:7050"}},"peers":{"peer0.org1.example.com":{"url":"grpc://localhost:7051"}},"certificateAuthorities":{"ca.org1.example.com":{"url":"http://localhost:7054","caName":"ca.org1.example.com"}}} -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/cards/PeerAdmin@hlfv1/credentials/certificate: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh 5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2 6 | WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN 7 | U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ 8 | MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh 9 | WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G 10 | A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9 11 | rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6 12 | CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS 13 | XVMHPa0iyC497vdNURA= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/cards/PeerAdmin@hlfv1/credentials/privateKey: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg00IwLLBKoi/9ikb6 3 | ZOAV0S1XeNGWllvlFDeczRKQn2uhRANCAARrvCsQUNRpMUkzFaC7+zV4mClo+beg 4 | 4VkUyQR5y5Fle5UVH2GigChWnUoouTO2e2acA/DUuyLDHT0emeBMhoMC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/cards/PeerAdmin@hlfv1/metadata.json: -------------------------------------------------------------------------------- 1 | {"version":1,"userName":"PeerAdmin","roles":["PeerAdmin","ChannelAdmin"]} -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/cards/admin@hello-network/connection.json: -------------------------------------------------------------------------------- 1 | {"name":"hlfv1","x-type":"hlfv1","x-commitTimeout":300,"version":"1.0.0","client":{"organization":"Org1","connection":{"timeout":{"peer":{"endorser":"300","eventHub":"300","eventReg":"300"},"orderer":"300"}}},"channels":{"composerchannel":{"orderers":["orderer.example.com"],"peers":{"peer0.org1.example.com":{}}}},"organizations":{"Org1":{"mspid":"Org1MSP","peers":["peer0.org1.example.com"],"certificateAuthorities":["ca.org1.example.com"]}},"orderers":{"orderer.example.com":{"url":"grpc://localhost:7050"}},"peers":{"peer0.org1.example.com":{"url":"grpc://localhost:7051"}},"certificateAuthorities":{"ca.org1.example.com":{"url":"http://localhost:7054","caName":"ca.org1.example.com"}}} -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/cards/admin@hello-network/metadata.json: -------------------------------------------------------------------------------- 1 | {"version":1,"userName":"admin","businessNetwork":"hello-network","enrollmentSecret":"adminpw"} -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/client-data/PeerAdmin@hlfv1/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-priv: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg00IwLLBKoi/9ikb6 3 | ZOAV0S1XeNGWllvlFDeczRKQn2uhRANCAARrvCsQUNRpMUkzFaC7+zV4mClo+beg 4 | 4VkUyQR5y5Fle5UVH2GigChWnUoouTO2e2acA/DUuyLDHT0emeBMhoMC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/client-data/PeerAdmin@hlfv1/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEa7wrEFDUaTFJMxWgu/s1eJgpaPm3 3 | oOFZFMkEecuRZXuVFR9hooAoVp1KKLkztntmnAPw1Lsiwx09HpngTIaDAg== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/client-data/admin@hello-network/0857549051e3d21486bd9f0d001748b26714bd1ad91c8ff967bcdce7b2c6a560-priv: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgMPNiyUXSphwNZSf7 3 | jGkoaG9lXoRqXKgrCrt0zqjjuSChRANCAARnujcrtvCL55uME/kfL0LY9V9kut5o 4 | ruBPZLLCbhanbh6I7pL2UXG65XrqY6lbMCgxttONNSFxevncytocdTfd 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/.composer/client-data/admin@hello-network/0857549051e3d21486bd9f0d001748b26714bd1ad91c8ff967bcdce7b2c6a560-pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZ7o3K7bwi+ebjBP5Hy9C2PVfZLre 3 | aK7gT2Sywm4Wp24eiO6S9lFxuuV66mOpWzAoMbbTjTUhcXr53MraHHU33Q== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM hyperledger/composer-rest-server:0.17.2 2 | 3 | RUN npm install --production loopback-connector-mongodb passport-jwt && \ 4 | npm cache clean --force && \ 5 | ln -s node_modules .node_modules 6 | 7 | COPY custom-jwt.js node_modules/custom-jwt.js 8 | 9 | COPY .composer /home/composer/.composer 10 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/createComposerProfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/_loader.sh 15 | echo 16 | echo NOTE: createComposerProfile is deprecated from v0.15.0 Please use createPeerAdminCard.sh 17 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/createPeerAdminCard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/_loader.sh 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/custom-jwt.js: -------------------------------------------------------------------------------- 1 | // based on: 2 | // https://github.com/hyperledger/composer/issues/2038 3 | 4 | const passportJwt = require('passport-jwt'); 5 | const util = require('util'); 6 | 7 | function CustomJwtStrategy(options, verify) { 8 | options.jwtFromRequest = passportJwt.ExtractJwt.fromAuthHeaderAsBearerToken(); 9 | passportJwt.Strategy.call(this, options, verify); 10 | } 11 | 12 | util.inherits(CustomJwtStrategy, passportJwt.Strategy); 13 | 14 | module.exports = { 15 | Strategy: CustomJwtStrategy 16 | }; 17 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/downloadFabric.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/_loader.sh 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/envvars.txt: -------------------------------------------------------------------------------- 1 | COMPOSER_CARD=admin@hello-network 2 | COMPOSER_NAMESPACES=never 3 | COMPOSER_AUTHENTICATION=true 4 | COMPOSER_MULTIUSER=true 5 | COMPOSER_PROVIDERS='{ 6 | "jwt": { 7 | "provider": "jwt", 8 | "module": "/home/composer/node_modules/custom-jwt.js", 9 | "secretOrKey": "gSi4WmttWuvy2ewoTGooigPwSDoxwZOy", 10 | "authScheme": "saml", 11 | "successRedirect": "/", 12 | "failureRedirect":"/" 13 | } 14 | }' 15 | COMPOSER_DATASOURCES='{ 16 | "db": { 17 | "name": "db", 18 | "connector": "mongodb", 19 | "host": "mongo" 20 | } 21 | }' 22 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-dev-servers.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-dev-servers.tar.gz -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/composer-channel.tx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/composer-channel.tx -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/composer-genesis.block: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/composer-genesis.block -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/creds/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-priv: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg00IwLLBKoi/9ikb6 3 | ZOAV0S1XeNGWllvlFDeczRKQn2uhRANCAARrvCsQUNRpMUkzFaC7+zV4mClo+beg 4 | 4VkUyQR5y5Fle5UVH2GigChWnUoouTO2e2acA/DUuyLDHT0emeBMhoMC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/creds/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEa7wrEFDUaTFJMxWgu/s1eJgpaPm3 3 | oOFZFMkEecuRZXuVFR9hooAoVp1KKLkztntmnAPw1Lsiwx09HpngTIaDAg== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/creds/PeerAdmin.cert: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh 5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2 6 | WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN 7 | U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ 8 | MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh 9 | WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G 10 | A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9 11 | rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6 12 | CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS 13 | XVMHPa0iyC497vdNURA= 14 | -----END CERTIFICATE----- 15 | 16 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/ca/5a6c4ce688103f8220147c6f8257eefbb5a1a8a80220c720d8152a2158021893_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgFH6mpG1eMF5aHxPT 3 | x9EYelK+x4Rsr0DwOcEAQx6CcHihRANCAAQ3itSHQBz1FH7u6C6J+DpPeFjQ96P4 4 | WvKd9m1NOm0IbYH+im0PZiKhc6ACmbecspGwtxZ4As8fWzXmFJgiIpJV 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/ca/ca.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICLzCCAdagAwIBAgIRAIt8vOTsiBPBWyNE7RX6dfcwCgYIKoZIzj0EAwIwaTEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt 5 | cGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMGkxCzAJBgNV 6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp 7 | c2NvMRQwEgYDVQQKEwtleGFtcGxlLmNvbTEXMBUGA1UEAxMOY2EuZXhhbXBsZS5j 8 | b20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ3itSHQBz1FH7u6C6J+DpPeFjQ 9 | 96P4WvKd9m1NOm0IbYH+im0PZiKhc6ACmbecspGwtxZ4As8fWzXmFJgiIpJVo18w 10 | XTAOBgNVHQ8BAf8EBAMCAaYwDwYDVR0lBAgwBgYEVR0lADAPBgNVHRMBAf8EBTAD 11 | AQH/MCkGA1UdDgQiBCBabEzmiBA/giAUfG+CV+77taGoqAIgxyDYFSohWAIYkzAK 12 | BggqhkjOPQQDAgNHADBEAiAiXeykPXGb1ThUmmV10TeX74kXOCCqg05b/QsmkUwc 13 | KAIgMbOlp0sQDf1/hBneh4le+ZvnLWIjJ4/cIMlS/ryI7hk= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/keystore/4947ca37ff6aca98aed30b2f50b64b152f22089e51cf0a70ff5ceb76e9872d66_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgT7Z7Si4n8bLYZp7z 3 | VG0zT1Na1jVRSsXZROJfkFeYt9+hRANCAATy+yoX2/Kvg+cpraErwgNpz/rugkll 4 | Gk5Iwhpg3aaNvvdJ6z8i2+jzUPJtixGEzdWH/ZwXEffrA6oJJyP0jQtX 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICDDCCAbOgAwIBAgIRAJqWoKHhtATinG8VJNgTMXUwCgYIKoZIzj0EAwIwaTEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt 5 | cGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMFgxCzAJBgNV 6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp 7 | c2NvMRwwGgYDVQQDExNvcmRlcmVyLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYI 8 | KoZIzj0DAQcDQgAE8vsqF9vyr4PnKa2hK8IDac/67oJJZRpOSMIaYN2mjb73Ses/ 9 | Itvo81DybYsRhM3Vh/2cFxH36wOqCScj9I0LV6NNMEswDgYDVR0PAQH/BAQDAgeA 10 | MAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgC 11 | IMcg2BUqIVgCGJMwCgYIKoZIzj0EAwIDRwAwRAIgWKl+h9EpAQ1IAvDtjdheG6nJ 12 | dq7Vs2+hFs9vnNv09bQCIB5s9mNGSUJHte1i5AvaIPjc/hws2eb66+bfX1QNwbhn 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgpWulWhjFbPGJB/d0 3 | D/k4aWjBNnSNLtFN2QY/pBwitQqhRANCAAT6SCy5qUTq2pppD4KLun4l/Cw1LKW5 4 | ptySEV5X03V7bH2T/dyNnzu3LrpJetOGbc4n71R/PlospymwlsfXxn42 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/tlsca/7b50b613ab7f8142a9f3c1a7b546c9f042026ffc7439fa37b6c5c0eb91ae0c1d_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgD6gfAHZtuIPiblb0 3 | EZdrYVbPqajueJxb6P5Ifd2hZBehRANCAASJn3QUVcKCp+s6lSPEP5KlWmE9rEG0 4 | kpECsAfW28vZQSIg2Ez+Tp1alA9SYN/5BtL1N6lUUoVhG3lz8uvi8zhr 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore/c6211e0b87d5ac94276dbf92e4cfadf385ee78e1c46cffb9a2e454e090736065_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg66zme6zQ30DbyTCY 3 | rFN6a5OpK279aD2iBKpVgtv0OMChRANCAATMnfON22yJYU+2+BqU8s/ZgaxO41Vk 4 | NCedJ40v/6RaJBSl5bMWQPgFEt61nBGZn3XnpqpAg8CfyIKOT9k0DpJi 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/signcerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICLTCCAdOgAwIBAgIRAONgtrFpsgoaRf+ViGEBS7gwCgYIKoZIzj0EAwIwbDEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5l 5 | eGFtcGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMFYxCzAJ 6 | BgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJh 7 | bmNpc2NvMRowGAYDVQQDDBFBZG1pbkBleGFtcGxlLmNvbTBZMBMGByqGSM49AgEG 8 | CCqGSM49AwEHA0IABMoRWQ5005OSZtyuhHSoWabVdObnX+78B2xW+XfwW+q7s0fd 9 | z+op9R0loEXmPK0aR2qMladp3aQauD8sKxrP5EKjbDBqMA4GA1UdDwEB/wQEAwIF 10 | oDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAr 11 | BgNVHSMEJDAigCB7ULYTq3+BQqnzwae1RsnwQgJv/HQ5+je2xcDrka4MHTAKBggq 12 | hkjOPQQDAgNIADBFAiEA1AzzNiqrn11QGcFMvf92a5O9rhexmmDYAwLxBdxY8tEC 13 | IF8y+sswrAEB/7QiSM8U4/OV4bGux66wOcG0aOHxaARN 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgBagM2GuFRP2W/XB0 3 | w7K+w9cerWwNgglYOC7utFjugYShRANCAATKEVkOdNOTkmbcroR0qFmm1XTm51/u 4 | /AdsVvl38Fvqu7NH3c/qKfUdJaBF5jytGkdqjJWnad2kGrg/LCsaz+RC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/ca/19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgZObukzIpU5YmhZT2 3 | 5ib2VVACxDNw4hNqV4z6NM4oQ5ehRANCAASRDbXpgEPySSz4jMonIGZ0uqH8v+wR 4 | nm3BOpimwrXO02EhQOmWyV60AU4lBZEf6RuHMUU29LWrC94ZFTrO03mF 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh 5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2 6 | WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN 7 | U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ 8 | MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh 9 | WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G 10 | A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9 11 | rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6 12 | CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS 13 | XVMHPa0iyC497vdNURA= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/keystore/dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgszLZKjxiBoP/F/N6 3 | sos8vrz9xpmA9+3vwHjFMXqgbGChRANCAAQ88dSnv4RhvbEhuV5Z9EKUyCpu1CpG 4 | YhLZrkXxPQvcnohmn3Cbsr7DgsgEiDDULP0Pyeodbp/g5gGtunRxIadH 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQguNQETuKE+vnWg7gS 3 | uZRf6Ap96UkLrEcnjZZjc5SesouhRANCAAQEL36OEVCgP/i7aNys6J9pNJGa3z/h 4 | fwSicCCxZ40kg0Rgs3NvoDUVS+ylwBHfu+TSWmw6wscPWQEA0K4/TbZ5 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/tlsca/ed9a007fe080f78d1af5410dbf35cedac9781ce6808f3c3573b748eb0de142ac_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgwf+XintinolU/uHq 3 | +VTfq/HMZt1Ig/uO3PYsePxVvEahRANCAAReF/M/q6fREbsm7fEHYv5nU3e2LtlZ 4 | NRyPKW8Uij1YfaR1t3azYxckCKrSJYjrgVRrhlHCV309evXainChp/lD 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg00IwLLBKoi/9ikb6 3 | ZOAV0S1XeNGWllvlFDeczRKQn2uhRANCAARrvCsQUNRpMUkzFaC7+zV4mClo+beg 4 | 4VkUyQR5y5Fle5UVH2GigChWnUoouTO2e2acA/DUuyLDHT0emeBMhoMC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgPc3M5x+tOTwF+nKp 3 | t+LfeCHjPdzRGAgEF1PxtyApEnahRANCAATektSuSlNz/4O+T2rrhIdiluDQfXh0 4 | NupaIgex1xFIq/UYuBbrRGzhYpxGAqPqMDPO32p/ew03KIuDqnjPhE5N 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv1/composer/howtobuild.txt: -------------------------------------------------------------------------------- 1 | cryptogen generate --config=./crypto-config.yaml 2 | export FABRIC_CFG_PATH=$PWD 3 | configtxgen -profile ComposerOrdererGenesis -outputBlock ./composer-genesis.block 4 | configtxgen -profile ComposerChannel -outputCreateChannelTx ./composer-channel.tx -channelID composerchannel 5 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/composer-channel.tx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/composer-channel.tx -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/composer-genesis.block: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/composer-genesis.block -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/ca/5a6c4ce688103f8220147c6f8257eefbb5a1a8a80220c720d8152a2158021893_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgFH6mpG1eMF5aHxPT 3 | x9EYelK+x4Rsr0DwOcEAQx6CcHihRANCAAQ3itSHQBz1FH7u6C6J+DpPeFjQ96P4 4 | WvKd9m1NOm0IbYH+im0PZiKhc6ACmbecspGwtxZ4As8fWzXmFJgiIpJV 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/ca/ca.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICLzCCAdagAwIBAgIRAIt8vOTsiBPBWyNE7RX6dfcwCgYIKoZIzj0EAwIwaTEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt 5 | cGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMGkxCzAJBgNV 6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp 7 | c2NvMRQwEgYDVQQKEwtleGFtcGxlLmNvbTEXMBUGA1UEAxMOY2EuZXhhbXBsZS5j 8 | b20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ3itSHQBz1FH7u6C6J+DpPeFjQ 9 | 96P4WvKd9m1NOm0IbYH+im0PZiKhc6ACmbecspGwtxZ4As8fWzXmFJgiIpJVo18w 10 | XTAOBgNVHQ8BAf8EBAMCAaYwDwYDVR0lBAgwBgYEVR0lADAPBgNVHRMBAf8EBTAD 11 | AQH/MCkGA1UdDgQiBCBabEzmiBA/giAUfG+CV+77taGoqAIgxyDYFSohWAIYkzAK 12 | BggqhkjOPQQDAgNHADBEAiAiXeykPXGb1ThUmmV10TeX74kXOCCqg05b/QsmkUwc 13 | KAIgMbOlp0sQDf1/hBneh4le+ZvnLWIjJ4/cIMlS/ryI7hk= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/keystore/4947ca37ff6aca98aed30b2f50b64b152f22089e51cf0a70ff5ceb76e9872d66_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgT7Z7Si4n8bLYZp7z 3 | VG0zT1Na1jVRSsXZROJfkFeYt9+hRANCAATy+yoX2/Kvg+cpraErwgNpz/rugkll 4 | Gk5Iwhpg3aaNvvdJ6z8i2+jzUPJtixGEzdWH/ZwXEffrA6oJJyP0jQtX 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICDDCCAbOgAwIBAgIRAJqWoKHhtATinG8VJNgTMXUwCgYIKoZIzj0EAwIwaTEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt 5 | cGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMFgxCzAJBgNV 6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp 7 | c2NvMRwwGgYDVQQDExNvcmRlcmVyLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYI 8 | KoZIzj0DAQcDQgAE8vsqF9vyr4PnKa2hK8IDac/67oJJZRpOSMIaYN2mjb73Ses/ 9 | Itvo81DybYsRhM3Vh/2cFxH36wOqCScj9I0LV6NNMEswDgYDVR0PAQH/BAQDAgeA 10 | MAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgC 11 | IMcg2BUqIVgCGJMwCgYIKoZIzj0EAwIDRwAwRAIgWKl+h9EpAQ1IAvDtjdheG6nJ 12 | dq7Vs2+hFs9vnNv09bQCIB5s9mNGSUJHte1i5AvaIPjc/hws2eb66+bfX1QNwbhn 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgpWulWhjFbPGJB/d0 3 | D/k4aWjBNnSNLtFN2QY/pBwitQqhRANCAAT6SCy5qUTq2pppD4KLun4l/Cw1LKW5 4 | ptySEV5X03V7bH2T/dyNnzu3LrpJetOGbc4n71R/PlospymwlsfXxn42 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/tlsca/7b50b613ab7f8142a9f3c1a7b546c9f042026ffc7439fa37b6c5c0eb91ae0c1d_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgD6gfAHZtuIPiblb0 3 | EZdrYVbPqajueJxb6P5Ifd2hZBehRANCAASJn3QUVcKCp+s6lSPEP5KlWmE9rEG0 4 | kpECsAfW28vZQSIg2Ez+Tp1alA9SYN/5BtL1N6lUUoVhG3lz8uvi8zhr 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore/c6211e0b87d5ac94276dbf92e4cfadf385ee78e1c46cffb9a2e454e090736065_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg66zme6zQ30DbyTCY 3 | rFN6a5OpK279aD2iBKpVgtv0OMChRANCAATMnfON22yJYU+2+BqU8s/ZgaxO41Vk 4 | NCedJ40v/6RaJBSl5bMWQPgFEt61nBGZn3XnpqpAg8CfyIKOT9k0DpJi 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/signcerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgBagM2GuFRP2W/XB0 3 | w7K+w9cerWwNgglYOC7utFjugYShRANCAATKEVkOdNOTkmbcroR0qFmm1XTm51/u 4 | /AdsVvl38Fvqu7NH3c/qKfUdJaBF5jytGkdqjJWnad2kGrg/LCsaz+RC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/ca/19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgZObukzIpU5YmhZT2 3 | 5ib2VVACxDNw4hNqV4z6NM4oQ5ehRANCAASRDbXpgEPySSz4jMonIGZ0uqH8v+wR 4 | nm3BOpimwrXO02EhQOmWyV60AU4lBZEf6RuHMUU29LWrC94ZFTrO03mF 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh 5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2 6 | WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN 7 | U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ 8 | MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh 9 | WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G 10 | A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9 11 | rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6 12 | CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS 13 | XVMHPa0iyC497vdNURA= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/keystore/dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgszLZKjxiBoP/F/N6 3 | sos8vrz9xpmA9+3vwHjFMXqgbGChRANCAAQ88dSnv4RhvbEhuV5Z9EKUyCpu1CpG 4 | YhLZrkXxPQvcnohmn3Cbsr7DgsgEiDDULP0Pyeodbp/g5gGtunRxIadH 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQguNQETuKE+vnWg7gS 3 | uZRf6Ap96UkLrEcnjZZjc5SesouhRANCAAQEL36OEVCgP/i7aNys6J9pNJGa3z/h 4 | fwSicCCxZ40kg0Rgs3NvoDUVS+ylwBHfu+TSWmw6wscPWQEA0K4/TbZ5 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/tlsca/ed9a007fe080f78d1af5410dbf35cedac9781ce6808f3c3573b748eb0de142ac_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgwf+XintinolU/uHq 3 | +VTfq/HMZt1Ig/uO3PYsePxVvEahRANCAAReF/M/q6fREbsm7fEHYv5nU3e2LtlZ 4 | NRyPKW8Uij1YfaR1t3azYxckCKrSJYjrgVRrhlHCV309evXainChp/lD 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg00IwLLBKoi/9ikb6 3 | ZOAV0S1XeNGWllvlFDeczRKQn2uhRANCAARrvCsQUNRpMUkzFaC7+zV4mClo+beg 4 | 4VkUyQR5y5Fle5UVH2GigChWnUoouTO2e2acA/DUuyLDHT0emeBMhoMC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgPc3M5x+tOTwF+nKp 3 | t+LfeCHjPdzRGAgEF1PxtyApEnahRANCAATektSuSlNz/4O+T2rrhIdiluDQfXh0 4 | NupaIgex1xFIq/UYuBbrRGzhYpxGAqPqMDPO32p/ew03KIuDqnjPhE5N 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/composer/howtobuild.txt: -------------------------------------------------------------------------------- 1 | cryptogen generate --config=./crypto-config.yaml 2 | export FABRIC_CFG_PATH=$PWD 3 | configtxgen -profile ComposerOrdererGenesis -outputBlock ./composer-genesis.block 4 | configtxgen -profile ComposerChannel -outputCreateChannelTx ./composer-channel.tx -channelID composerchannel 5 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv11/createComposerProfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Exit on first error, print all commands. 16 | echo "Not available on this level of fabric." -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/composer-channel.tx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/composer-channel.tx -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/composer-genesis.block: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/composer-genesis.block -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/ca/5a6c4ce688103f8220147c6f8257eefbb5a1a8a80220c720d8152a2158021893_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgFH6mpG1eMF5aHxPT 3 | x9EYelK+x4Rsr0DwOcEAQx6CcHihRANCAAQ3itSHQBz1FH7u6C6J+DpPeFjQ96P4 4 | WvKd9m1NOm0IbYH+im0PZiKhc6ACmbecspGwtxZ4As8fWzXmFJgiIpJV 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/ca/ca.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICLzCCAdagAwIBAgIRAIt8vOTsiBPBWyNE7RX6dfcwCgYIKoZIzj0EAwIwaTEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt 5 | cGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMGkxCzAJBgNV 6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp 7 | c2NvMRQwEgYDVQQKEwtleGFtcGxlLmNvbTEXMBUGA1UEAxMOY2EuZXhhbXBsZS5j 8 | b20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ3itSHQBz1FH7u6C6J+DpPeFjQ 9 | 96P4WvKd9m1NOm0IbYH+im0PZiKhc6ACmbecspGwtxZ4As8fWzXmFJgiIpJVo18w 10 | XTAOBgNVHQ8BAf8EBAMCAaYwDwYDVR0lBAgwBgYEVR0lADAPBgNVHRMBAf8EBTAD 11 | AQH/MCkGA1UdDgQiBCBabEzmiBA/giAUfG+CV+77taGoqAIgxyDYFSohWAIYkzAK 12 | BggqhkjOPQQDAgNHADBEAiAiXeykPXGb1ThUmmV10TeX74kXOCCqg05b/QsmkUwc 13 | KAIgMbOlp0sQDf1/hBneh4le+ZvnLWIjJ4/cIMlS/ryI7hk= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/keystore/4947ca37ff6aca98aed30b2f50b64b152f22089e51cf0a70ff5ceb76e9872d66_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgT7Z7Si4n8bLYZp7z 3 | VG0zT1Na1jVRSsXZROJfkFeYt9+hRANCAATy+yoX2/Kvg+cpraErwgNpz/rugkll 4 | Gk5Iwhpg3aaNvvdJ6z8i2+jzUPJtixGEzdWH/ZwXEffrA6oJJyP0jQtX 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICDDCCAbOgAwIBAgIRAJqWoKHhtATinG8VJNgTMXUwCgYIKoZIzj0EAwIwaTEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt 5 | cGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZaMFgxCzAJBgNV 6 | BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp 7 | c2NvMRwwGgYDVQQDExNvcmRlcmVyLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYI 8 | KoZIzj0DAQcDQgAE8vsqF9vyr4PnKa2hK8IDac/67oJJZRpOSMIaYN2mjb73Ses/ 9 | Itvo81DybYsRhM3Vh/2cFxH36wOqCScj9I0LV6NNMEswDgYDVR0PAQH/BAQDAgeA 10 | MAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgC 11 | IMcg2BUqIVgCGJMwCgYIKoZIzj0EAwIDRwAwRAIgWKl+h9EpAQ1IAvDtjdheG6nJ 12 | dq7Vs2+hFs9vnNv09bQCIB5s9mNGSUJHte1i5AvaIPjc/hws2eb66+bfX1QNwbhn 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgpWulWhjFbPGJB/d0 3 | D/k4aWjBNnSNLtFN2QY/pBwitQqhRANCAAT6SCy5qUTq2pppD4KLun4l/Cw1LKW5 4 | ptySEV5X03V7bH2T/dyNnzu3LrpJetOGbc4n71R/PlospymwlsfXxn42 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/tlsca/7b50b613ab7f8142a9f3c1a7b546c9f042026ffc7439fa37b6c5c0eb91ae0c1d_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgD6gfAHZtuIPiblb0 3 | EZdrYVbPqajueJxb6P5Ifd2hZBehRANCAASJn3QUVcKCp+s6lSPEP5KlWmE9rEG0 4 | kpECsAfW28vZQSIg2Ez+Tp1alA9SYN/5BtL1N6lUUoVhG3lz8uvi8zhr 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/admincerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore/c6211e0b87d5ac94276dbf92e4cfadf385ee78e1c46cffb9a2e454e090736065_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg66zme6zQ30DbyTCY 3 | rFN6a5OpK279aD2iBKpVgtv0OMChRANCAATMnfON22yJYU+2+BqU8s/ZgaxO41Vk 4 | NCedJ40v/6RaJBSl5bMWQPgFEt61nBGZn3XnpqpAg8CfyIKOT9k0DpJi 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/signcerts/Admin@example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICCjCCAbCgAwIBAgIQYJ/IIUmQMuLLE8LOsguhRzAKBggqhkjOPQQDAjBpMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1w 5 | bGUuY29tMB4XDTE3MDYyNjEyNDkyNloXDTI3MDYyNDEyNDkyNlowVjELMAkGA1UE 6 | BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lz 7 | Y28xGjAYBgNVBAMMEUFkbWluQGV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZI 8 | zj0DAQcDQgAEzJ3zjdtsiWFPtvgalPLP2YGsTuNVZDQnnSeNL/+kWiQUpeWzFkD4 9 | BRLetZwRmZ9156aqQIPAn8iCjk/ZNA6SYqNNMEswDgYDVR0PAQH/BAQDAgeAMAwG 10 | A1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgWmxM5ogQP4IgFHxvglfu+7WhqKgCIMcg 11 | 2BUqIVgCGJMwCgYIKoZIzj0EAwIDSAAwRQIhAMauKcX8PeGZVeJHWkTUdpEJS7vJ 12 | B3fIwmaqZMEHxRRTAiAgDT48GHGfkCHiIE7AfcnywtES9h1kJ0102TCQ5o8JzQ== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgBagM2GuFRP2W/XB0 3 | w7K+w9cerWwNgglYOC7utFjugYShRANCAATKEVkOdNOTkmbcroR0qFmm1XTm51/u 4 | /AdsVvl38Fvqu7NH3c/qKfUdJaBF5jytGkdqjJWnad2kGrg/LCsaz+RC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/ca/19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgZObukzIpU5YmhZT2 3 | 5ib2VVACxDNw4hNqV4z6NM4oQ5ehRANCAASRDbXpgEPySSz4jMonIGZ0uqH8v+wR 4 | nm3BOpimwrXO02EhQOmWyV60AU4lBZEf6RuHMUU29LWrC94ZFTrO03mF 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL 3 | MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG 4 | cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh 5 | Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2 6 | WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN 7 | U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ 8 | MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh 9 | WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G 10 | A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9 11 | rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6 12 | CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS 13 | XVMHPa0iyC497vdNURA= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/keystore/dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgszLZKjxiBoP/F/N6 3 | sos8vrz9xpmA9+3vwHjFMXqgbGChRANCAAQ88dSnv4RhvbEhuV5Z9EKUyCpu1CpG 4 | YhLZrkXxPQvcnohmn3Cbsr7DgsgEiDDULP0Pyeodbp/g5gGtunRxIadH 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQguNQETuKE+vnWg7gS 3 | uZRf6Ap96UkLrEcnjZZjc5SesouhRANCAAQEL36OEVCgP/i7aNys6J9pNJGa3z/h 4 | fwSicCCxZ40kg0Rgs3NvoDUVS+ylwBHfu+TSWmw6wscPWQEA0K4/TbZ5 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/tlsca/ed9a007fe080f78d1af5410dbf35cedac9781ce6808f3c3573b748eb0de142ac_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgwf+XintinolU/uHq 3 | +VTfq/HMZt1Ig/uO3PYsePxVvEahRANCAAReF/M/q6fREbsm7fEHYv5nU3e2LtlZ 4 | NRyPKW8Uij1YfaR1t3azYxckCKrSJYjrgVRrhlHCV309evXainChp/lD 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg00IwLLBKoi/9ikb6 3 | ZOAV0S1XeNGWllvlFDeczRKQn2uhRANCAARrvCsQUNRpMUkzFaC7+zV4mClo+beg 4 | 4VkUyQR5y5Fle5UVH2GigChWnUoouTO2e2acA/DUuyLDHT0emeBMhoMC 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/tls/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgPc3M5x+tOTwF+nKp 3 | t+LfeCHjPdzRGAgEF1PxtyApEnahRANCAATektSuSlNz/4O+T2rrhIdiluDQfXh0 4 | NupaIgex1xFIq/UYuBbrRGzhYpxGAqPqMDPO32p/ew03KIuDqnjPhE5N 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/fabric-scripts/hlfv12/createComposerProfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Exit on first error, print all commands. 16 | echo "Not available on this level of fabric." -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/networkadmin.card: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/fabric-dev-servers/networkadmin.card -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/startFabric.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/_loader.sh 15 | 16 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 17 | #npm install --prefix "${DIR}" 18 | 19 | #source "${DIR}"/_loader.sh 20 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/stopFabric.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/_loader.sh 15 | -------------------------------------------------------------------------------- /Ch8/fabric-dev-servers/teardownFabric.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/_loader.sh 15 | -------------------------------------------------------------------------------- /Ch8/hello-network/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/hello-network/.DS_Store -------------------------------------------------------------------------------- /Ch8/hello-network/hello-network.bna: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/hello-network/hello-network.bna -------------------------------------------------------------------------------- /Ch8/hello-network/hello-network/README.md: -------------------------------------------------------------------------------- 1 | # hello-network 2 | 3 | hello network 4 | -------------------------------------------------------------------------------- /Ch8/hello-network/hello-network/hello-network@0.0.1.bna: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch8/hello-network/hello-network/hello-network@0.0.1.bna -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to ethdapp!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { StartComponent } from './components/start/start.component'; 5 | import { TransferComponent } from './components/transfer/transfer.component'; 6 | const routes: Routes = [ 7 | { path: '', redirectTo: '/start', pathMatch: 'full' }, 8 | { path: 'start', component: StartComponent }, 9 | { path: 'transfer', component: TransferComponent } 10 | ]; 11 | @NgModule({ 12 | declarations: [], 13 | imports: [ RouterModule.forRoot(routes), CommonModule ], 14 | exports: [ RouterModule ] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/app/app.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ethdapp'; 10 | } 11 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { TransferComponent } from './components/transfer/transfer.component'; 7 | import { StartComponent } from './components/start/start.component'; 8 | import { HeaderComponent } from './components/header/header.component'; 9 | import { FooterComponent } from './components/footer/footer.component'; 10 | 11 | @NgModule({ 12 | declarations: [ 13 | AppComponent, 14 | TransferComponent, 15 | StartComponent, 16 | HeaderComponent, 17 | FooterComponent 18 | ], 19 | imports: [ 20 | BrowserModule, 21 | AppRoutingModule 22 | ], 23 | providers: [], 24 | bootstrap: [AppComponent] 25 | }) 26 | export class AppModule { } 27 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/app/components/footer/footer.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |

2 | footer works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/app/components/header/header.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |

2 | header works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/start/start.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/app/components/start/start.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/start/start.component.html: -------------------------------------------------------------------------------- 1 |

2 | start works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-start', 5 | templateUrl: './start.component.html', 6 | styleUrls: ['./start.component.css'] 7 | }) 8 | export class StartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/transfer/transfer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/app/components/transfer/transfer.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/transfer/transfer.component.html: -------------------------------------------------------------------------------- 1 |

2 | transfer works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/transfer/transfer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferComponent } from './transfer.component'; 4 | 5 | describe('TransferComponent', () => { 6 | let component: TransferComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TransferComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TransferComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/app/components/transfer/transfer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-transfer', 5 | templateUrl: './transfer.component.html', 6 | styleUrls: ['./transfer.component.css'] 7 | }) 8 | export class TransferComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/assets/.gitkeep -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step2/src/favicon.ico -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ethdapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to ethdapp!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { StartComponent } from './components/start/start.component'; 5 | import { TransferComponent } from './components/transfer/transfer.component'; 6 | const routes: Routes = [ 7 | { path: '', redirectTo: '/start', pathMatch: 'full' }, 8 | { path: 'start', component: StartComponent }, 9 | { path: 'transfer', component: TransferComponent } 10 | ]; 11 | @NgModule({ 12 | declarations: [], 13 | imports: [ RouterModule.forRoot(routes), CommonModule ], 14 | exports: [ RouterModule ] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/app/app.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ethdapp'; 10 | } 11 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/app/components/footer/footer.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |

2 | footer works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/app/components/header/header.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |

2 | header works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/start/start.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/app/components/start/start.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/start/start.component.html: -------------------------------------------------------------------------------- 1 |

2 | start works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-start', 5 | templateUrl: './start.component.html', 6 | styleUrls: ['./start.component.css'] 7 | }) 8 | export class StartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/transfer/transfer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/app/components/transfer/transfer.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/transfer/transfer.component.html: -------------------------------------------------------------------------------- 1 |

2 | transfer works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/transfer/transfer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferComponent } from './transfer.component'; 4 | 5 | describe('TransferComponent', () => { 6 | let component: TransferComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TransferComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TransferComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/app/components/transfer/transfer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-transfer', 5 | templateUrl: './transfer.component.html', 6 | styleUrls: ['./transfer.component.css'] 7 | }) 8 | export class TransferComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/assets/.gitkeep -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step3/src/favicon.ico -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ethdapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'hammerjs'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | import { environment } from './environments/environment'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step3/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step4/.DS_Store -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to ethdapp!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { StartComponent } from './components/start/start.component'; 5 | import { TransferComponent } from './components/transfer/transfer.component'; 6 | const routes: Routes = [ 7 | { path: '', redirectTo: '/start', pathMatch: 'full' }, 8 | { path: 'start', component: StartComponent }, 9 | { path: 'transfer', component: TransferComponent } 10 | ]; 11 | @NgModule({ 12 | declarations: [], 13 | imports: [ RouterModule.forRoot(routes), CommonModule ], 14 | exports: [ RouterModule ] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step4/src/app/app.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ethdapp'; 10 | } 11 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | p { 2 | padding-left: 0; 3 | font-size: 11px; 4 | } 5 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Copyright (c) 2019 Company Name. All Rights Reserved.

4 |
5 |
6 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | .nav { 2 | margin-bottom: 0; 3 | padding-left: 0; 4 | list-style: none; 5 | } 6 | li { 7 | display: block; 8 | float: left; 9 | width: 100px; 10 | height: 25px; 11 | padding: 5px; 12 | } 13 | .nav>li>a { 14 | margin-bottom: 0; 15 | padding-left: 0; 16 | font-weight: 500; 17 | font-size: 12px; 18 | text-transform: uppercase; 19 | position: relative; 20 | } 21 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/start/start.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step4/src/app/components/start/start.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/start/start.component.html: -------------------------------------------------------------------------------- 1 |

2 | start works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-start', 5 | templateUrl: './start.component.html', 6 | styleUrls: ['./start.component.css'] 7 | }) 8 | export class StartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/transfer/transfer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step4/src/app/components/transfer/transfer.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/transfer/transfer.component.html: -------------------------------------------------------------------------------- 1 |

2 | transfer works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/transfer/transfer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferComponent } from './transfer.component'; 4 | 5 | describe('TransferComponent', () => { 6 | let component: TransferComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TransferComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TransferComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/app/components/transfer/transfer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-transfer', 5 | templateUrl: './transfer.component.html', 6 | styleUrls: ['./transfer.component.css'] 7 | }) 8 | export class TransferComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step4/src/assets/.gitkeep -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step4/src/favicon.ico -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ethdapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'hammerjs'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | import { environment } from './environments/environment'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step4/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step5/.DS_Store -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to ethdapp!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { StartComponent } from './components/start/start.component'; 5 | import { TransferComponent } from './components/transfer/transfer.component'; 6 | const routes: Routes = [ 7 | { path: '', redirectTo: '/start', pathMatch: 'full' }, 8 | { path: 'start', component: StartComponent }, 9 | { path: 'transfer', component: TransferComponent } 10 | ]; 11 | @NgModule({ 12 | declarations: [], 13 | imports: [ RouterModule.forRoot(routes), CommonModule ], 14 | exports: [ RouterModule ] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step5/src/app/app.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'ethdapp'; 10 | } 11 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | p { 2 | padding-left: 0; 3 | font-size: 11px; 4 | } 5 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Copyright (c) 2019 Company Name. All Rights Reserved.

4 |
5 |
6 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/header/header.component.css: -------------------------------------------------------------------------------- 1 | .nav { 2 | margin-bottom: 0; 3 | padding-left: 0; 4 | list-style: none; 5 | } 6 | li { 7 | display: block; 8 | float: left; 9 | width: 100px; 10 | height: 25px; 11 | padding: 5px; 12 | } 13 | .nav>li>a { 14 | margin-bottom: 0; 15 | padding-left: 0; 16 | font-weight: 500; 17 | font-size: 12px; 18 | text-transform: uppercase; 19 | position: relative; 20 | } 21 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'] 7 | }) 8 | export class HeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/start/start.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step5/src/app/components/start/start.component.css -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/start/start.component.html: -------------------------------------------------------------------------------- 1 |

2 | start works! 3 |

4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-start', 5 | templateUrl: './start.component.html', 6 | styleUrls: ['./start.component.css'] 7 | }) 8 | export class StartComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/transfer/transfer.component.css: -------------------------------------------------------------------------------- 1 | .transfer-container { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | .transfer-container > * { 6 | width: 100%; 7 | } 8 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/app/components/transfer/transfer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TransferComponent } from './transfer.component'; 4 | 5 | describe('TransferComponent', () => { 6 | let component: TransferComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TransferComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TransferComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step5/src/assets/.gitkeep -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/the-blockchain-developer/2e12901f13570bdecc91e32f1f75ac08f084f643/Ch9/ethdapp-step5/src/favicon.ico -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ethdapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'hammerjs'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | import { environment } from './environments/environment'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Ch9/ethdapp-step5/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to Apress Source Code 2 | 3 | Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. 4 | 5 | ## How to Contribute 6 | 7 | 1. Make sure you have a GitHub account. 8 | 2. Fork the repository for the relevant book. 9 | 3. Create a new branch on which to make your change, e.g. 10 | `git checkout -b my_code_contribution` 11 | 4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. 12 | 5. Submit a pull request. 13 | 14 | Thank you for your contribution! -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apress Source Code 2 | 3 | This repository accompanies [*The Blockchain Developer*](http://www.apress.com/9781484248461) by Elad Elrom (Apress, 2019). 4 | 5 | [comment]: #cover 6 | ![Cover image](9781484248461.jpg) 7 | 8 | Download the files as a zip using the green button, or clone the repository to your machine using Git. 9 | 10 | ## Releases 11 | 12 | Release v1.0 corresponds to the code in the published book, without corrections or updates. 13 | 14 | ## Contributions 15 | 16 | See the file Contributing.md for more information on how you can contribute to this repository. -------------------------------------------------------------------------------- /errata.md: -------------------------------------------------------------------------------- 1 | # Errata for *Book Title* 2 | 3 | On **page xx** [Summary of error]: 4 | 5 | Details of error here. Highlight key pieces in **bold**. 6 | 7 | *** 8 | 9 | On **page xx** [Summary of error]: 10 | 11 | Details of error here. Highlight key pieces in **bold**. 12 | 13 | *** --------------------------------------------------------------------------------