├── .dockerignore ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── MAINTAINERS.txt ├── Makefile ├── README.md ├── TravisCI_Readme.md ├── bddtests ├── .behaverc ├── api_pb2.py ├── ca_pb2.py ├── chaincode │ └── go │ │ └── table │ │ └── table.go ├── chaincode_pb2.py ├── chaincode_rbac.feature ├── compose-defaults.yml ├── devops_pb2.py ├── docker-compose-1-devmode.yml ├── docker-compose-1-exp.yml ├── docker-compose-1-profiling.yml ├── docker-compose-1.yml ├── docker-compose-2-tls-basic.yml ├── docker-compose-2.yml ├── docker-compose-3.yml ├── docker-compose-4-consensus-base.yml ├── docker-compose-4-consensus-batch-1-byzantine.yml ├── docker-compose-4-consensus-batch.yml ├── docker-compose-4-consensus-noops.yml ├── docker-compose-4-consensus-nvp0.yml ├── docker-compose-4-consensus-vp3-byzantine.yml ├── docker-compose-4.yml ├── docker-compose-5.yml ├── docker-compose-sdk-node.yml ├── docker-membersrvc-attributes-enabled.yml ├── docker-membersrvc-attributes-encryption-enabled.yml ├── environment.py ├── events_pb2.py ├── fabric_pb2.py ├── java_shim.feature ├── peer_basic.feature ├── peer_logging.feature ├── sdk.feature ├── server_admin_pb2.py ├── steps │ ├── __init__.py │ ├── bdd_grpc_util.py │ ├── bdd_test_util.py │ ├── chaincode_rbac_impl.py │ ├── coverage.py │ ├── peer_basic_impl.py │ ├── peer_logging_impl.py │ └── sdk_impl.py ├── syschaincode │ └── noop │ │ ├── chaincode.go │ │ └── chaincode_test.go ├── tlsca.cert ├── tlsca.priv └── utxo.feature ├── consensus ├── consensus.go ├── controller │ └── controller.go ├── executor │ ├── executor.go │ └── executor_test.go ├── helper │ ├── engine.go │ ├── engine_test.go │ ├── handler.go │ ├── handler_test.go │ ├── helper.go │ ├── helper_test.go │ └── persist │ │ ├── persist.go │ │ └── persist_test.go ├── noops │ ├── config.yaml │ ├── configutil.go │ ├── noops.go │ └── txq.go ├── pbft │ ├── batch.go │ ├── batch_test.go │ ├── broadcast.go │ ├── broadcast_test.go │ ├── config.yaml │ ├── deduplicator.go │ ├── external.go │ ├── fuzz_test.go │ ├── messages.pb.go │ ├── messages.proto │ ├── mock_consumer_test.go │ ├── mock_ledger_test.go │ ├── mock_network_test.go │ ├── mock_utilities_test.go │ ├── pbft-core.go │ ├── pbft-core_mock_test.go │ ├── pbft-core_test.go │ ├── pbft-persist.go │ ├── pbft.go │ ├── persist-forward.go │ ├── requeststore.go │ ├── requeststore_test.go │ ├── sign.go │ ├── util.go │ └── viewchange.go └── util │ ├── events │ ├── events.go │ └── events_test.go │ ├── messagefan.go │ └── messagefan_test.go ├── core ├── admin.go ├── admin_test.go ├── chaincode │ ├── chaincode_support.go │ ├── chaincodetest.yaml │ ├── config.go │ ├── exectransaction.go │ ├── exectransaction_test.go │ ├── handler.go │ ├── platforms │ │ ├── car │ │ │ ├── hash.go │ │ │ ├── package.go │ │ │ ├── platform.go │ │ │ └── test │ │ │ │ ├── car_test.go │ │ │ │ └── org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car │ │ ├── golang │ │ │ ├── hash.go │ │ │ ├── hash_test.go │ │ │ ├── hashtestfiles │ │ │ │ ├── a.txt │ │ │ │ ├── a │ │ │ │ │ ├── a1.txt │ │ │ │ │ └── a2.txt │ │ │ │ ├── b.txt │ │ │ │ └── b │ │ │ │ │ ├── c.txt │ │ │ │ │ └── c │ │ │ │ │ └── c1.txt │ │ │ ├── package.go │ │ │ └── platform.go │ │ ├── java │ │ │ ├── hash.go │ │ │ ├── package.go │ │ │ ├── platform.go │ │ │ └── test │ │ │ │ └── java_test.go │ │ └── platforms.go │ ├── shim │ │ ├── chaincode.go │ │ ├── chaincode.pb.go │ │ ├── chaincode.proto │ │ ├── crypto │ │ │ ├── attr │ │ │ │ ├── attr_support.go │ │ │ │ ├── attr_support_test.go │ │ │ │ └── test_resources │ │ │ │ │ ├── prek0.dump │ │ │ │ │ ├── tcert.dump │ │ │ │ │ ├── tcert_bad.dump │ │ │ │ │ └── tcert_clear.dump │ │ │ ├── crypto.go │ │ │ └── ecdsa │ │ │ │ ├── ecdsa.go │ │ │ │ ├── ecdsa_test.go │ │ │ │ ├── hash.go │ │ │ │ └── x509.go │ │ ├── handler.go │ │ ├── inprocstream.go │ │ ├── java │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ ├── commons-logging.properties │ │ │ │ ├── example │ │ │ │ │ ├── Example.java │ │ │ │ │ ├── LinkExample.java │ │ │ │ │ ├── MapExample.java │ │ │ │ │ └── SimpleSample.java │ │ │ │ └── org │ │ │ │ │ └── hyperledger │ │ │ │ │ └── java │ │ │ │ │ ├── fsm │ │ │ │ │ ├── CBDesc.java │ │ │ │ │ ├── Callback.java │ │ │ │ │ ├── CallbackKey.java │ │ │ │ │ ├── CallbackType.java │ │ │ │ │ ├── Event.java │ │ │ │ │ ├── EventDesc.java │ │ │ │ │ ├── EventKey.java │ │ │ │ │ ├── FSM.java │ │ │ │ │ ├── Transitioner.java │ │ │ │ │ └── exceptions │ │ │ │ │ │ ├── AsyncException.java │ │ │ │ │ │ ├── CancelledException.java │ │ │ │ │ │ ├── InTrasistionException.java │ │ │ │ │ │ ├── InvalidEventException.java │ │ │ │ │ │ ├── NoTransitionException.java │ │ │ │ │ │ ├── NotInTransitionException.java │ │ │ │ │ │ └── UnknownEventException.java │ │ │ │ │ ├── helper │ │ │ │ │ └── Channel.java │ │ │ │ │ └── shim │ │ │ │ │ ├── ChaincodeBase.java │ │ │ │ │ ├── ChaincodeStub.java │ │ │ │ │ ├── Handler.java │ │ │ │ │ └── NextStateInfo.java │ │ │ │ └── proto │ │ │ │ ├── chaincode.proto │ │ │ │ └── chaincodeevent.proto │ │ └── shim_test.go │ └── testdata │ │ ├── server1.key │ │ └── server1.pem ├── comm │ ├── config.go │ ├── connection.go │ └── connection_test.go ├── config.go ├── config │ └── config.go ├── container │ ├── ccintf │ │ └── ccintf.go │ ├── config.go │ ├── controller.go │ ├── controller_test.go │ ├── dockercontroller │ │ ├── dockercontroller.go │ │ └── dockercontroller_test.go │ ├── inproccontroller │ │ ├── inproccontroller.go │ │ └── inprocstream.go │ ├── util │ │ ├── dockerutil.go │ │ └── writer.go │ ├── vm.go │ └── vm_test.go ├── crypto │ ├── attributes │ │ ├── attributes.go │ │ ├── attributes_test.go │ │ ├── proto │ │ │ ├── attributes.pb.go │ │ │ └── attributes.proto │ │ └── test_resources │ │ │ ├── prek0.dump │ │ │ └── tcert.dump │ ├── client.go │ ├── client_confidentiality.go │ ├── client_crypto.go │ ├── client_ecert_handler.go │ ├── client_impl.go │ ├── client_ks.go │ ├── client_state.go │ ├── client_tca.go │ ├── client_tcert.go │ ├── client_tcert_handler.go │ ├── client_tcert_pool.go │ ├── client_tcert_pool_mt.go │ ├── client_tcert_pool_st.go │ ├── client_tx.go │ ├── crypto.go │ ├── crypto_profile.sh │ ├── crypto_protocol.go │ ├── crypto_settings.go │ ├── crypto_settings_test.go │ ├── crypto_test.go │ ├── crypto_test.yaml │ ├── node.go │ ├── node_conf.go │ ├── node_crypto.go │ ├── node_eca.go │ ├── node_grpc.go │ ├── node_impl.go │ ├── node_ks.go │ ├── node_log.go │ ├── node_sign.go │ ├── node_tca.go │ ├── node_tlsca.go │ ├── peer.go │ ├── peer_eca.go │ ├── peer_impl.go │ ├── peer_ks.go │ ├── primitives │ │ ├── aes.go │ │ ├── aes_test.go │ │ ├── crypto.go │ │ ├── ecdsa.go │ │ ├── ecies │ │ │ ├── engine.go │ │ │ ├── es.go │ │ │ ├── kg.go │ │ │ ├── params.go │ │ │ ├── pk.go │ │ │ ├── sk.go │ │ │ ├── spi.go │ │ │ └── spi_test.go │ │ ├── elliptic.go │ │ ├── hash.go │ │ ├── init.go │ │ ├── keys.go │ │ ├── primitives_test.go │ │ ├── random.go │ │ └── x509.go │ ├── utils │ │ ├── conf.go │ │ ├── errs.go │ │ ├── io.go │ │ └── slice.go │ ├── validator.go │ ├── validator_confidentiality.go │ ├── validator_impl.go │ ├── validator_state.go │ └── validator_validity_period.go ├── db │ ├── db.go │ ├── db_test.go │ └── db_test_exports.go ├── devops.go ├── devops_test.go ├── discovery │ ├── discovery.go │ └── discovery_test.go ├── fsm.go ├── fsm_test.go ├── ledger │ ├── README.md │ ├── benchmark_scripts │ │ ├── buckettree │ │ │ ├── buckettree.sh │ │ │ ├── plot.pg │ │ │ └── plots │ │ │ │ └── all.pg │ │ ├── common.sh │ │ ├── ledger │ │ │ ├── db.sh │ │ │ ├── randomTransactions.sh │ │ │ ├── singleKeyTransaction.sh │ │ │ └── test.yaml │ │ └── statemgmt │ │ │ ├── cryptoHash.sh │ │ │ └── plot.pg │ ├── blockchain.go │ ├── blockchain_indexes.go │ ├── blockchain_indexes_async.go │ ├── blockchain_indexes_async_test.go │ ├── blockchain_indexes_test.go │ ├── blockchain_test.go │ ├── genesis │ │ ├── config.go │ │ ├── genesis.go │ │ ├── genesis_test.go │ │ └── genesis_test.yaml │ ├── ledger.go │ ├── ledger_test.go │ ├── ledger_test_exports.go │ ├── perf_test.go │ ├── perfstat │ │ ├── stat.go │ │ ├── stat_holder.go │ │ └── stat_test.go │ ├── pkg_test.go │ ├── statemgmt │ │ ├── buckettree │ │ │ ├── bucket_cache.go │ │ │ ├── bucket_cache_test.go │ │ │ ├── bucket_hash.go │ │ │ ├── bucket_hash_test.go │ │ │ ├── bucket_key.go │ │ │ ├── bucket_key_test.go │ │ │ ├── bucket_node.go │ │ │ ├── bucket_node_test.go │ │ │ ├── bucket_tree_delta.go │ │ │ ├── bucket_tree_delta_test.go │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── data_key.go │ │ │ ├── data_key_test.go │ │ │ ├── data_node.go │ │ │ ├── data_nodes_delta.go │ │ │ ├── data_nodes_delta_test.go │ │ │ ├── db_helper.go │ │ │ ├── perf_test.go │ │ │ ├── pkg_test.go │ │ │ ├── range_scan_iterator.go │ │ │ ├── range_scan_iterator_test.go │ │ │ ├── snapshot_iterator.go │ │ │ ├── snapshot_iterator_test.go │ │ │ ├── state_impl.go │ │ │ ├── state_impl_test.go │ │ │ └── test.yaml │ │ ├── commons.go │ │ ├── hashable_state.go │ │ ├── perf_test.go │ │ ├── pkg_test.go │ │ ├── raw │ │ │ ├── state_impl.go │ │ │ └── state_impl_test.go │ │ ├── state │ │ │ ├── composite_range_scan_iterator.go │ │ │ ├── composite_range_scan_iterator_test.go │ │ │ ├── config.go │ │ │ ├── pkg_test.go │ │ │ ├── state.go │ │ │ ├── state_snapshot.go │ │ │ ├── state_snapshot_test.go │ │ │ ├── state_test.go │ │ │ └── test.yaml │ │ ├── state_delta.go │ │ ├── state_delta_iterator.go │ │ ├── state_delta_iterator_test.go │ │ ├── state_delta_test.go │ │ ├── test_exports.go │ │ └── trie │ │ │ ├── byteTrieKey.go │ │ │ ├── hexTrieKey.go │ │ │ ├── pkg_test.go │ │ │ ├── range_scan_iterator.go │ │ │ ├── range_scan_iterator_test.go │ │ │ ├── snapshot_iterator.go │ │ │ ├── snapshot_iterator_test.go │ │ │ ├── state_trie.go │ │ │ ├── state_trie_test.go │ │ │ ├── test.yaml │ │ │ ├── trie_db_helper.go │ │ │ ├── trie_delta.go │ │ │ ├── trie_key.go │ │ │ ├── trie_node.go │ │ │ └── trie_node_test.go │ ├── test.yaml │ ├── test │ │ ├── ledger_suite_test.go │ │ ├── ledger_test.go │ │ └── test.yaml │ ├── testutil │ │ ├── test_util.go │ │ └── test_util_test.go │ └── util │ │ ├── util.go │ │ └── util_test.go ├── logging.go ├── logging_test.go ├── peer │ ├── config.go │ ├── errors.go │ ├── handler.go │ ├── handler_sync_state.go │ ├── peer.go │ ├── peer_test.go │ └── statetransfer │ │ ├── statetransfer.go │ │ ├── statetransfer_mock_test.go │ │ └── statetransfer_test.go ├── rest │ ├── api.go │ ├── api_test.go │ ├── rest_api.go │ ├── rest_api.json │ ├── rest_api_test.go │ ├── rest_test.yaml │ └── rest_util.go ├── system_chaincode │ ├── api │ │ └── sysccapi.go │ ├── config.go │ ├── importsysccs.go │ ├── samplesyscc │ │ └── samplesyscc.go │ └── systemchaincode_test.go └── util │ ├── utils.go │ └── utils_test.go ├── devenv ├── README.md ├── Vagrantfile ├── compile_protos.sh ├── golang_buildcmd.sh ├── golang_buildpkg.sh ├── images │ └── openchain-dev-env-deployment-diagram.png ├── limits.conf ├── setup.sh ├── setupRHELonZ.sh └── tools │ └── chaintool ├── docs ├── API │ ├── AttributesUsage.md │ ├── ChaincodeAPI.md │ ├── CoreAPI.md │ ├── MemberServicesAPI.md │ └── Samples │ │ ├── Sample_1.js │ │ └── Sample_1.zip ├── FAQ │ ├── chaincode_FAQ.md │ ├── confidentiality_FAQ.md │ ├── consensus_FAQ.md │ ├── identity_management_FAQ.md │ └── usage_FAQ.md ├── Setup │ ├── Chaincode-setup.md │ ├── JAVAChaincode.md │ ├── Network-setup.md │ ├── NodeSDK-setup.md │ ├── ca-setup.md │ └── logging-control.md ├── SystemChaincodes │ └── noop.md ├── biz │ ├── DCO1.1.txt │ ├── images │ │ ├── Canonical-Use-Cases_Asset-Depository.png │ │ ├── Canonical-Use-Cases_B2BContract.png │ │ ├── Canonical-Use-Cases_Direct-Communication.png │ │ ├── Canonical-Use-Cases_Interoperability-of-Assets.png │ │ ├── Canonical-Use-Cases_Manufacturing-Supply-Chain.png │ │ ├── Canonical-Use-Cases_One-Trade-One-Contract.png │ │ ├── Canonical-Use-Cases_Separation-of-Asset-Ownership-and-Custodians-Duties.png │ │ ├── assetrepository.png │ │ ├── b2bcontract.png │ │ ├── corporate_action.png │ │ ├── exchange.png │ │ ├── interoperability_of_assets.png │ │ ├── one_contract_per_trade.png │ │ ├── separation_of_ownship_and_custodyservice.png │ │ └── supplychain.png │ └── usecases.md ├── dev-setup │ ├── build.md │ ├── devenv.md │ └── headers.txt ├── glossary.md ├── images │ ├── Architecture_Step-1.png │ ├── Architecture_Step-2.png │ ├── Architecture_Step-3.png │ ├── Architecture_Step-4.png │ ├── BuildStatus.png │ ├── Canonical-Use-Cases_Asset-Depository.png │ ├── Canonical-Use-Cases_B2BContract.png │ ├── Canonical-Use-Cases_Direct-Communication.png │ ├── Canonical-Use-Cases_Interoperability-of-Assets.png │ ├── Canonical-Use-Cases_Manufacturing-Supply-Chain.png │ ├── Canonical-Use-Cases_One-Trade-One-Contract.png │ ├── Canonical-Use-Cases_Separation-of-Asset-Ownership-and-Custodians-Duties.png │ ├── Travis_Settings.png │ ├── Travis_service.png │ ├── attributes_flow.png │ ├── refarch-api.png │ ├── refarch-app.png │ ├── refarch-block.png │ ├── refarch-chain.png │ ├── refarch-memb.png │ ├── refarch.png │ ├── sec-RACapp-depl.png │ ├── sec-RACapp-inv.png │ ├── sec-entities.png │ ├── sec-example-1.png │ ├── sec-example-2.png │ ├── sec-firstrel-1.jpg │ ├── sec-firstrel-1.png │ ├── sec-firstrel-2.png │ ├── sec-firstrel-depl.png │ ├── sec-firstrel-inv.png │ ├── sec-futrel-depl.png │ ├── sec-futrel-inv.png │ ├── sec-memserv-components.png │ ├── sec-registration-detailed.png │ ├── sec-registration-high-level.png │ ├── sec-request-tcerts-deployment.png │ ├── sec-request-tcerts-invocation.png │ ├── sec-sec-arch.png │ ├── sec-sources-1.pptx │ ├── sec-sources-2.pptx │ ├── sec-txconf-v1.2.pptx │ ├── sec-usrconf-deploy-interm.png │ ├── sec-usrconf-deploy.png │ ├── sec-usrconf-invoke-interm.png │ ├── sec-usrconf-invoke.png │ ├── top-multi-peer.png │ ├── top-single-peer.png │ └── world_view.png ├── index.md ├── protocol-spec.md ├── protocol-spec_zh.md ├── requirements.txt ├── tech │ ├── application-ACL.md │ ├── attributes.md │ └── best-practices.md └── wiki-images │ ├── sdk-current.png │ └── sdk-future.png ├── events ├── config.go ├── consumer │ ├── adapter.go │ └── consumer.go ├── events_test.go └── producer │ ├── eventhelper.go │ ├── events.go │ ├── handler.go │ ├── producer.go │ └── register_internal_events.go ├── examples ├── chaincode │ ├── chaintool │ │ └── example02 │ │ │ ├── chaincode.yaml │ │ │ └── src │ │ │ ├── chaincode │ │ │ └── chaincode_example02.go │ │ │ └── interfaces │ │ │ ├── appinit.cci │ │ │ └── org.hyperledger.chaincode.example02.cci │ └── go │ │ ├── asset_management │ │ ├── README.md │ │ ├── app │ │ │ ├── README.md │ │ │ ├── app.go │ │ │ └── app_internal.go │ │ └── asset_management.go │ │ ├── asset_management02 │ │ ├── README.md │ │ ├── asset.yaml │ │ ├── asset_management02.go │ │ ├── asset_management02_test.go │ │ ├── cert_handler.go │ │ └── depository_handler.go │ │ ├── asset_management_with_roles │ │ ├── asset.yaml │ │ ├── asset_management_with_roles.go │ │ └── asset_management_with_roles_test.go │ │ ├── authorizable_counter │ │ └── authorizable_counter.go │ │ ├── chaincode_example01 │ │ └── chaincode_example01.go │ │ ├── chaincode_example02 │ │ └── chaincode_example02.go │ │ ├── chaincode_example03 │ │ └── chaincode_example03.go │ │ ├── chaincode_example04 │ │ └── chaincode_example04.go │ │ ├── chaincode_example05 │ │ └── chaincode_example05.go │ │ ├── chaincode_example06 │ │ └── chaincode_example06.go │ │ ├── eventsender │ │ └── eventsender.go │ │ ├── map │ │ └── map.go │ │ ├── passthru │ │ └── passthru.go │ │ ├── rbac_tcerts_no_attrs │ │ ├── rbac.go │ │ └── rbac_test.go │ │ └── utxo │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── chaincode.go │ │ ├── consensus │ │ ├── consensus.go │ │ └── consensus_wrap.cxx │ │ ├── store.go │ │ └── util │ │ ├── First_500_transactions_base64_encoded_on_testnet3.txt │ │ ├── Hashes_for_first_500_transactions_on_testnet3.txt │ │ ├── dah.pb.go │ │ ├── dah.proto │ │ ├── store.go │ │ ├── util.go │ │ ├── utxo.go │ │ └── utxo_test.go └── events │ └── block-listener │ ├── README.md │ └── block-listener.go ├── gotools └── Makefile ├── images ├── app │ └── Dockerfile.in ├── base │ ├── .gitignore │ ├── Dockerfile.in │ ├── Makefile │ ├── README.md │ ├── http │ │ └── preseed.cfg │ ├── images │ │ ├── packer-overview.graffle │ │ │ ├── data.plist │ │ │ ├── image2.png │ │ │ ├── image3.png │ │ │ ├── image4.png │ │ │ ├── image5.png │ │ │ └── image6.png │ │ └── packer-overview.png │ ├── packer.json │ ├── release │ └── scripts │ │ ├── common │ │ ├── golang_crossCompileSetup.sh │ │ ├── init.sh │ │ └── setup.sh │ │ ├── docker │ │ └── init.sh │ │ └── vagrant │ │ ├── cleanup.sh │ │ ├── init.sh │ │ ├── vagrant.sh │ │ ├── virtualbox.sh │ │ └── zerodisk.sh ├── ccenv │ └── Dockerfile.in └── src │ └── Dockerfile.in ├── membersrvc ├── Dockerfile ├── ca │ ├── aca.go │ ├── aca_test.go │ ├── acap.go │ ├── ca.go │ ├── ca_test.go │ ├── ca_test.yaml │ ├── client_grpc.go │ ├── eca.go │ ├── eca_test.go │ ├── ecaa.go │ ├── ecap.go │ ├── membersrvc_test.go │ ├── tca.go │ ├── tca_test.go │ ├── tcaa.go │ ├── tcap.go │ ├── test_resources │ │ ├── ecert_test_user0.dump │ │ ├── ecert_test_user1.dump │ │ ├── ecert_test_user2.dump │ │ ├── key_test_user0.dump │ │ ├── key_test_user1.dump │ │ └── key_test_user2.dump │ ├── tlsca.go │ ├── tlsca_test.go │ ├── util.go │ └── util_test.go ├── membersrvc.yaml ├── protos │ ├── ca.pb.go │ └── ca.proto └── server.go ├── mkdocs.yml ├── peer ├── core.yaml └── main.go ├── protos ├── api.pb.go ├── api.proto ├── block.go ├── block_test.go ├── chaincode.pb.go ├── chaincode.proto ├── chaincodeevent.pb.go ├── chaincodeevent.proto ├── devops.pb.go ├── devops.proto ├── events.pb.go ├── events.proto ├── fabric.pb.go ├── fabric.proto ├── init.go ├── server_admin.pb.go ├── server_admin.proto ├── transaction.go └── transaction_test.go ├── pub ├── fabric-baseimage.md ├── fabric-membersrvc.md └── fabric-peer.md ├── scripts ├── containerlogs.sh ├── foldercopy.sh ├── goUnitTests.sh ├── goimports.sh ├── infiniteloop.sh └── provision │ ├── common.sh │ ├── docker.sh │ └── host.sh ├── sdk └── node │ ├── .gitignore │ ├── .npmignore │ ├── Makefile │ ├── README.md │ ├── bin │ ├── main.js │ ├── run-unit-tests.sh │ └── test.json │ ├── index.js │ ├── lib │ ├── hash.js │ └── protos │ │ └── google │ │ └── protobuf │ │ ├── empty.proto │ │ └── timestamp.proto │ ├── makedoc.sh │ ├── package.json │ ├── src │ ├── crypto.ts │ ├── hfc.ts │ ├── sdk_util.ts │ └── stats.ts │ ├── test │ └── unit │ │ ├── asset-mgmt-with-roles.js │ │ ├── asset-mgmt.js │ │ ├── chain-tests.js │ │ └── registrar.js │ ├── tsconfig.json │ ├── typedoc-special.d.ts │ └── typings.json ├── tools ├── busywork │ ├── .gitignore │ ├── README.md │ ├── benchmarks │ │ ├── GO_LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── benchmarks.go │ │ └── goBenchmarks.go │ ├── bin │ │ ├── Makefile │ │ ├── README.md │ │ ├── busy │ │ ├── busyTest │ │ ├── checkAgreement │ │ ├── docker_ip │ │ ├── fabricLogger │ │ ├── networkStatus │ │ ├── pprofClient │ │ ├── userModeNetwork │ │ └── wait-for-it │ ├── busywork │ │ ├── README.md │ │ ├── busywork.go │ │ └── busywork_test.go │ ├── counters │ │ ├── Makefile │ │ ├── README.md │ │ ├── counters.go │ │ ├── countersTest │ │ └── driver │ ├── prerequisites.md │ └── tcl │ │ ├── README.md │ │ ├── args.tcl │ │ ├── atExit.tcl │ │ ├── busywork.tcl │ │ ├── fabric.tcl │ │ ├── io.tcl │ │ ├── lists.tcl │ │ ├── logging.tcl │ │ ├── mathx.tcl │ │ ├── os.tcl │ │ ├── pkgIndex.tcl │ │ ├── rand.tcl │ │ ├── time.tcl │ │ └── utils_pkg.tcl └── dbutility │ ├── README.md │ ├── bddtests │ ├── environment.py │ ├── steps │ │ └── test.py │ ├── test.feature │ └── test_util.py │ ├── dump_db_stats.go │ └── dump_db_stats_test.go └── vendor ├── github.com ├── BurntSushi │ └── toml │ │ ├── COMPATIBLE │ │ ├── COPYING │ │ ├── Makefile │ │ ├── README.md │ │ ├── decode.go │ │ ├── decode_meta.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encoding_types.go │ │ ├── encoding_types_1.1.go │ │ ├── lex.go │ │ ├── parse.go │ │ ├── session.vim │ │ ├── type_check.go │ │ └── type_fields.go ├── cpuguy83 │ └── go-md2man │ │ └── md2man │ │ ├── md2man.go │ │ └── roff.go ├── fsouza │ └── go-dockerclient │ │ ├── AUTHORS │ │ ├── DOCKER-LICENSE │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.markdown │ │ ├── auth.go │ │ ├── change.go │ │ ├── client.go │ │ ├── container.go │ │ ├── env.go │ │ ├── event.go │ │ ├── exec.go │ │ ├── external │ │ └── github.com │ │ │ ├── Sirupsen │ │ │ └── logrus │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── entry.go │ │ │ │ ├── exported.go │ │ │ │ ├── formatter.go │ │ │ │ ├── hooks.go │ │ │ │ ├── json_formatter.go │ │ │ │ ├── logger.go │ │ │ │ ├── logrus.go │ │ │ │ ├── terminal_bsd.go │ │ │ │ ├── terminal_freebsd.go │ │ │ │ ├── terminal_linux.go │ │ │ │ ├── terminal_notwindows.go │ │ │ │ ├── terminal_openbsd.go │ │ │ │ ├── terminal_windows.go │ │ │ │ ├── text_formatter.go │ │ │ │ └── writer.go │ │ │ ├── docker │ │ │ └── docker │ │ │ │ ├── opts │ │ │ │ ├── envfile.go │ │ │ │ ├── hosts_unix.go │ │ │ │ ├── hosts_windows.go │ │ │ │ ├── ip.go │ │ │ │ ├── opts.go │ │ │ │ └── ulimit.go │ │ │ │ ├── pkg │ │ │ │ ├── archive │ │ │ │ │ ├── README.md │ │ │ │ │ ├── archive.go │ │ │ │ │ ├── archive_unix.go │ │ │ │ │ ├── archive_windows.go │ │ │ │ │ ├── changes.go │ │ │ │ │ ├── changes_linux.go │ │ │ │ │ ├── changes_other.go │ │ │ │ │ ├── changes_unix.go │ │ │ │ │ ├── changes_windows.go │ │ │ │ │ ├── copy.go │ │ │ │ │ ├── copy_unix.go │ │ │ │ │ ├── copy_windows.go │ │ │ │ │ ├── diff.go │ │ │ │ │ ├── example_changes.go │ │ │ │ │ ├── time_linux.go │ │ │ │ │ ├── time_unsupported.go │ │ │ │ │ └── wrap.go │ │ │ │ ├── fileutils │ │ │ │ │ └── fileutils.go │ │ │ │ ├── homedir │ │ │ │ │ └── homedir.go │ │ │ │ ├── ioutils │ │ │ │ │ ├── fmt.go │ │ │ │ │ ├── multireader.go │ │ │ │ │ ├── readers.go │ │ │ │ │ ├── scheduler.go │ │ │ │ │ ├── scheduler_gccgo.go │ │ │ │ │ ├── writeflusher.go │ │ │ │ │ └── writers.go │ │ │ │ ├── parsers │ │ │ │ │ └── parsers.go │ │ │ │ ├── pools │ │ │ │ │ └── pools.go │ │ │ │ ├── promise │ │ │ │ │ └── promise.go │ │ │ │ ├── stdcopy │ │ │ │ │ └── stdcopy.go │ │ │ │ ├── system │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── events_windows.go │ │ │ │ │ ├── filesys.go │ │ │ │ │ ├── filesys_windows.go │ │ │ │ │ ├── lstat.go │ │ │ │ │ ├── lstat_windows.go │ │ │ │ │ ├── meminfo.go │ │ │ │ │ ├── meminfo_linux.go │ │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ │ ├── meminfo_windows.go │ │ │ │ │ ├── mknod.go │ │ │ │ │ ├── mknod_windows.go │ │ │ │ │ ├── stat.go │ │ │ │ │ ├── stat_freebsd.go │ │ │ │ │ ├── stat_linux.go │ │ │ │ │ ├── stat_unsupported.go │ │ │ │ │ ├── stat_windows.go │ │ │ │ │ ├── umask.go │ │ │ │ │ ├── umask_windows.go │ │ │ │ │ ├── utimes_darwin.go │ │ │ │ │ ├── utimes_freebsd.go │ │ │ │ │ ├── utimes_linux.go │ │ │ │ │ ├── utimes_unsupported.go │ │ │ │ │ ├── xattrs_linux.go │ │ │ │ │ └── xattrs_unsupported.go │ │ │ │ ├── ulimit │ │ │ │ │ └── ulimit.go │ │ │ │ └── units │ │ │ │ │ ├── duration.go │ │ │ │ │ └── size.go │ │ │ │ └── volume │ │ │ │ └── volume.go │ │ │ └── opencontainers │ │ │ └── runc │ │ │ └── libcontainer │ │ │ └── user │ │ │ ├── MAINTAINERS │ │ │ ├── lookup.go │ │ │ ├── lookup_unix.go │ │ │ ├── lookup_unsupported.go │ │ │ └── user.go │ │ ├── image.go │ │ ├── misc.go │ │ ├── network.go │ │ ├── signal.go │ │ ├── tar.go │ │ ├── tls.go │ │ └── volume.go ├── gocraft │ └── web │ │ ├── BENCHMARK_RESULTS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cover.sh │ │ ├── logger_middleware.go │ │ ├── options_handler.go │ │ ├── panic_handler.go │ │ ├── request.go │ │ ├── response_writer.go │ │ ├── router_serve.go │ │ ├── router_setup.go │ │ ├── show_errors_middleware.go │ │ ├── static_middleware.go │ │ └── tree.go ├── golang │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── jsonpb │ │ └── jsonpb.go │ │ ├── proto │ │ ├── Makefile │ │ ├── clone.go │ │ ├── decode.go │ │ ├── encode.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── lib.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_unsafe.go │ │ ├── properties.go │ │ ├── text.go │ │ └── text_parser.go │ │ └── protoc-gen-go │ │ ├── Makefile │ │ ├── descriptor │ │ ├── Makefile │ │ ├── descriptor.pb.go │ │ └── descriptor.pb.golden │ │ ├── doc.go │ │ ├── generator │ │ ├── Makefile │ │ └── generator.go │ │ ├── internal │ │ └── grpc │ │ │ └── grpc.go │ │ ├── link_grpc.go │ │ ├── main.go │ │ └── plugin │ │ ├── Makefile │ │ ├── plugin.pb.go │ │ └── plugin.pb.golden ├── google │ └── gofuzz │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ └── fuzz.go ├── howeyc │ └── gopass │ │ ├── LICENSE.txt │ │ ├── README.md │ │ └── pass.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── trap_others.go │ │ ├── trap_windows.go │ │ └── trap_windows_1.4.go ├── kr │ ├── pretty │ │ ├── License │ │ ├── Readme │ │ ├── diff.go │ │ ├── formatter.go │ │ ├── pretty.go │ │ └── zero.go │ └── text │ │ ├── License │ │ ├── Readme │ │ ├── doc.go │ │ ├── indent.go │ │ └── wrap.go ├── looplab │ └── fsm │ │ ├── LICENSE │ │ ├── README.md │ │ ├── errors.go │ │ ├── event.go │ │ ├── fsm.go │ │ └── wercker.yml ├── magiconair │ └── properties │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── lex.go │ │ ├── load.go │ │ ├── parser.go │ │ ├── properties.go │ │ └── rangecheck.go ├── mattn │ └── go-sqlite3 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backup.go │ │ ├── callback.go │ │ ├── code │ │ ├── sqlite3-binding.c │ │ ├── sqlite3-binding.h │ │ └── sqlite3ext.h │ │ ├── doc.go │ │ ├── error.go │ │ ├── sqlite3-binding.c │ │ ├── sqlite3-binding.h │ │ ├── sqlite3.go │ │ ├── sqlite3_icu.go │ │ ├── sqlite3_libsqlite3.go │ │ ├── sqlite3_load_extension.go │ │ ├── sqlite3_omit_load_extension.go │ │ ├── sqlite3_other.go │ │ └── sqlite3_windows.go ├── mitchellh │ └── mapstructure │ │ ├── LICENSE │ │ ├── README.md │ │ ├── decode_hooks.go │ │ ├── error.go │ │ └── mapstructure.go ├── op │ └── go-logging │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backend.go │ │ ├── format.go │ │ ├── level.go │ │ ├── log_nix.go │ │ ├── log_windows.go │ │ ├── logger.go │ │ ├── memory.go │ │ ├── multi.go │ │ ├── syslog.go │ │ └── syslog_fallback.go ├── russross │ └── blackfriday │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── block.go │ │ ├── html.go │ │ ├── inline.go │ │ ├── latex.go │ │ ├── markdown.go │ │ └── smartypants.go ├── shurcooL │ └── sanitized_anchor_name │ │ ├── README.md │ │ └── main.go ├── spf13 │ ├── cast │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cast.go │ │ └── caste.go │ ├── cobra │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── bash_completions.go │ │ ├── bash_completions.md │ │ ├── cobra.go │ │ ├── command.go │ │ ├── doc_util.go │ │ ├── man_docs.go │ │ ├── man_docs.md │ │ ├── md_docs.go │ │ └── md_docs.md │ ├── jwalterweatherman │ │ ├── LICENSE │ │ ├── README.md │ │ └── thatswhyyoualwaysleaveanote.go │ ├── pflag │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bool.go │ │ ├── count.go │ │ ├── duration.go │ │ ├── flag.go │ │ ├── float32.go │ │ ├── float64.go │ │ ├── golangflag.go │ │ ├── int.go │ │ ├── int32.go │ │ ├── int64.go │ │ ├── int8.go │ │ ├── int_slice.go │ │ ├── ip.go │ │ ├── ipmask.go │ │ ├── ipnet.go │ │ ├── string.go │ │ ├── string_slice.go │ │ ├── uint.go │ │ ├── uint16.go │ │ ├── uint32.go │ │ ├── uint64.go │ │ └── uint8.go │ └── viper │ │ ├── LICENSE │ │ ├── README.md │ │ ├── util.go │ │ └── viper.go └── tecbot │ └── gorocksdb │ ├── LICENSE │ ├── README.md │ ├── backup.go │ ├── cache.go │ ├── cf_handle.go │ ├── compaction_filter.go │ ├── comparator.go │ ├── db.go │ ├── doc.go │ ├── dynflag.go │ ├── embedflag.go │ ├── env.go │ ├── filter_policy.go │ ├── gorocksdb.c │ ├── gorocksdb.h │ ├── iterator.go │ ├── merge_operator.go │ ├── options.go │ ├── options_block_based_table.go │ ├── options_compaction.go │ ├── options_compression.go │ ├── options_flush.go │ ├── options_read.go │ ├── options_write.go │ ├── slice.go │ ├── slice_transform.go │ ├── snapshot.go │ ├── util.go │ └── write_batch.go ├── golang.org └── x │ ├── crypto │ ├── LICENSE │ ├── PATENTS │ ├── hkdf │ │ └── hkdf.go │ ├── sha3 │ │ ├── doc.go │ │ ├── hashes.go │ │ ├── keccakf.go │ │ ├── register.go │ │ ├── sha3.go │ │ ├── shake.go │ │ ├── xor.go │ │ ├── xor_generic.go │ │ └── xor_unaligned.go │ └── ssh │ │ ├── buffer.go │ │ ├── certs.go │ │ ├── channel.go │ │ ├── cipher.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── common.go │ │ ├── connection.go │ │ ├── doc.go │ │ ├── handshake.go │ │ ├── kex.go │ │ ├── keys.go │ │ ├── mac.go │ │ ├── messages.go │ │ ├── mux.go │ │ ├── server.go │ │ ├── session.go │ │ ├── tcpip.go │ │ ├── terminal │ │ ├── terminal.go │ │ ├── util.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ └── util_windows.go │ │ └── transport.go │ ├── net │ ├── context │ │ └── context.go │ ├── http2 │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README │ │ ├── errors.go │ │ ├── fixed_buffer.go │ │ ├── flow.go │ │ ├── frame.go │ │ ├── gotrack.go │ │ ├── headermap.go │ │ ├── hpack │ │ │ ├── encode.go │ │ │ ├── hpack.go │ │ │ ├── huffman.go │ │ │ └── tables.go │ │ ├── http2.go │ │ ├── pipe.go │ │ ├── server.go │ │ ├── transport.go │ │ ├── write.go │ │ └── writesched.go │ ├── internal │ │ └── timeseries │ │ │ └── timeseries.go │ └── trace │ │ ├── events.go │ │ ├── histogram.go │ │ └── trace.go │ └── tools │ ├── cmd │ └── cover │ │ ├── README │ │ ├── cover.go │ │ ├── cover_test.go │ │ ├── doc.go │ │ ├── func.go │ │ └── html.go │ └── cover │ └── profile.go ├── google.golang.org └── grpc │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── PATENTS │ ├── README.md │ ├── call.go │ ├── clientconn.go │ ├── codegen.sh │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── credentials │ └── credentials.go │ ├── doc.go │ ├── grpclog │ └── logger.go │ ├── metadata │ └── metadata.go │ ├── picker.go │ ├── rpc_util.go │ ├── server.go │ ├── stream.go │ ├── trace.go │ └── transport │ ├── control.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ └── transport.go ├── google └── protobuf │ ├── empty.pb.go │ └── timestamp.pb.go ├── gopkg.in └── yaml.v2 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── vendor.json /.dockerignore: -------------------------------------------------------------------------------- 1 | obc-peer 2 | .git 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh text eol=lf 2 | *.go text eol=lf 3 | *.yaml text eol=lf 4 | *.yml text eol=lf 5 | *.md text eol=lf 6 | *.json text eol=lf 7 | *.proto text eol=lf 8 | *.py text eol=lf 9 | *.js text eol=lf 10 | *.txt text eol=lf 11 | LICENSE text eol=lf 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | ## Describe How to Reproduce 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local build binaries 2 | node-cli/node-cli 3 | *.pyc 4 | /build/* 5 | /bin 6 | .idea 7 | *.iml 8 | .DS_Store 9 | tags 10 | .tags 11 | .vagrant/ 12 | /build 13 | # Emacs backup files 14 | *~ 15 | *# 16 | .#* 17 | # bddtest log files 18 | *.log 19 | # bddtest coverage files 20 | bddtests/coverage 21 | *.cov 22 | # Makefile dummy artifacts 23 | .*-dummy 24 | # go-carpet output files 25 | go-carpet-coverage* 26 | # make node-sdk copied files 27 | sdk/node/lib/protos/* 28 | -------------------------------------------------------------------------------- /MAINTAINERS.txt: -------------------------------------------------------------------------------- 1 | Maintainers 2 | 3 | Binh Nguyen binhn binhn@us.ibm.com 4 | Sheehan Anderson srderson sheehan@us.ibm.com 5 | Tamas Blummer tamasblummer tamas@digitalasset.com 6 | Robert Fajta rfajta robert@digitalasset.com 7 | Greg Haskins ghaskins ghaskins@lseg.com 8 | Jonathan Levi JonathanLevi jonathan@levi.name 9 | Gabor Hosszu gabre gabor@digitalasset.com 10 | Simon Schubert corecode sis@zurich.ibm.com 11 | Chris Ferris christo4ferris chrisfer@us.ibm.com 12 | -------------------------------------------------------------------------------- /bddtests/.behaverc: -------------------------------------------------------------------------------- 1 | [behave] 2 | tags=~@issue_724 3 | ~@issue_767 4 | ~@issueUtxo 5 | ~@issue_477 6 | ~@issue_680 7 | ~@issue_1207 8 | ~@issue_1565 9 | ~@issue_RBAC_TCERT_With_Attributes 10 | ~@sdk 11 | -------------------------------------------------------------------------------- /bddtests/compose-defaults.yml: -------------------------------------------------------------------------------- 1 | vp: 2 | image: hyperledger/fabric-peer 3 | environment: 4 | - CORE_PEER_ADDRESSAUTODETECT=true 5 | - CORE_VM_ENDPOINT=http://172.17.0.1:2375 6 | # TODO: This is currently required due to BUG in variant logic based upon log level. 7 | - CORE_LOGGING_LEVEL=DEBUG 8 | # Startup of peer must be delayed to allow membersrvc to come up first 9 | command: sh -c "sleep 5; peer node start" 10 | #command: peer node start 11 | 12 | # Use these options if coverage desired for peers 13 | #image: hyperledger/fabric-peer-coverage 14 | #command: ./peer.test --test.coverprofile=coverage.cov node start 15 | membersrvc: 16 | image: hyperledger/fabric-membersrvc 17 | command: membersrvc 18 | -------------------------------------------------------------------------------- /bddtests/docker-compose-1-devmode.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | command: sh -c "peer node start --peer-chaincodedev" 8 | 9 | ccenv: 10 | image: hyperledger/fabric-ccenv 11 | environment: 12 | - CORE_CHAINCODE_ID_NAME=testCC 13 | - CORE_PEER_ADDRESS=vp0:30303 14 | command: bash -c "GOBIN=/opt/gopath/bin go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 && /opt/gopath/bin/chaincode_example02" 15 | links: 16 | - vp0 -------------------------------------------------------------------------------- /bddtests/docker-compose-1-exp.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | ports: 8 | - 31315:31315 9 | -------------------------------------------------------------------------------- /bddtests/docker-compose-1-profiling.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | - CORE_PEER_PROFILE_ENABLED=true 8 | ports: 9 | - 5000:6060 10 | 11 | -------------------------------------------------------------------------------- /bddtests/docker-compose-1.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | 8 | -------------------------------------------------------------------------------- /bddtests/docker-compose-2-tls-basic.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | - CORE_PEER_TLS_ENABLED=true 8 | - CORE_PEER_TLS_SERVERHOSTOVERRIDE=OBC 9 | - CORE_PEER_TLS_CERT_FILE=./bddtests/tlsca.cert 10 | - CORE_PEER_TLS_KEY_FILE=./bddtests/tlsca.priv 11 | 12 | vp1: 13 | extends: 14 | service: vp0 15 | environment: 16 | - CORE_PEER_ID=vp1 17 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 18 | links: 19 | - vp0 20 | -------------------------------------------------------------------------------- /bddtests/docker-compose-2.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | - CORE_PEER_DISCOVERY_PERIOD=1s 8 | - CORE_PEER_DISCOVERY_TOUCHPERIOD=1s 9 | 10 | vp1: 11 | extends: 12 | service: vp0 13 | environment: 14 | - CORE_PEER_ID=vp1 15 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 16 | links: 17 | - vp0 18 | -------------------------------------------------------------------------------- /bddtests/docker-compose-3.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | 8 | vp1: 9 | extends: 10 | service: vp0 11 | environment: 12 | - CORE_PEER_ID=vp1 13 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 14 | links: 15 | - vp0 16 | 17 | vp2: 18 | extends: 19 | service: vp0 20 | environment: 21 | - CORE_PEER_ID=vp2 22 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 23 | links: 24 | - vp0 25 | -------------------------------------------------------------------------------- /bddtests/docker-compose-4-consensus-base.yml: -------------------------------------------------------------------------------- 1 | vpBase: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_SECURITY_ENABLED=true 7 | - CORE_PEER_PKI_ECA_PADDR=membersrvc0:50051 8 | - CORE_PEER_PKI_TCA_PADDR=membersrvc0:50051 9 | - CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:50051 10 | - CORE_PEER_PKI_TLS_ROOTCERT_FILE=./bddtests/tlsca.cert 11 | # TODO: Currently required due to issue reading obbca configuration location 12 | - CORE_PBFT_GENERAL_N=4 13 | # The checkpoint interval in sequence numbers 14 | - CORE_PBFT_GENERAL_K=2 15 | 16 | vpBatch: 17 | extends: 18 | service: vpBase 19 | environment: 20 | - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft 21 | - CORE_PBFT_GENERAL_TIMEOUT_REQUEST=10s 22 | - CORE_PBFT_GENERAL_MODE=batch 23 | # TODO: This is used for testing as to assure deployment goes through to block 24 | - CORE_PBFT_GENERAL_BATCHSIZE=1 25 | -------------------------------------------------------------------------------- /bddtests/docker-compose-4-consensus-nvp0.yml: -------------------------------------------------------------------------------- 1 | nvp0: 2 | extends: 3 | file: docker-compose-4-consensus-base.yml 4 | service: vpBase 5 | environment: 6 | - CORE_PEER_VALIDATOR_ENABLED=false 7 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 8 | - CORE_PEER_ID=nvp0 9 | - CORE_SECURITY_ENROLLID=test_nvp0 10 | - CORE_SECURITY_ENROLLSECRET=iywrPBDEPl0K 11 | links: 12 | - membersrvc0 13 | - vp0 14 | 15 | -------------------------------------------------------------------------------- /bddtests/docker-compose-4-consensus-vp3-byzantine.yml: -------------------------------------------------------------------------------- 1 | vp3: 2 | environment: 3 | - CORE_PBFT_GENERAL_BYZANTINE=true 4 | -------------------------------------------------------------------------------- /bddtests/docker-compose-4.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | 8 | vp1: 9 | extends: 10 | service: vp0 11 | environment: 12 | - CORE_PEER_ID=vp1 13 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 14 | links: 15 | - vp0 16 | 17 | vp2: 18 | extends: 19 | service: vp0 20 | environment: 21 | - CORE_PEER_ID=vp2 22 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 23 | links: 24 | - vp0 25 | 26 | vp3: 27 | extends: 28 | service: vp0 29 | environment: 30 | - CORE_PEER_ID=vp3 31 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 32 | links: 33 | - vp0 34 | -------------------------------------------------------------------------------- /bddtests/docker-compose-5.yml: -------------------------------------------------------------------------------- 1 | vp0: 2 | extends: 3 | file: compose-defaults.yml 4 | service: vp 5 | environment: 6 | - CORE_PEER_ID=vp0 7 | 8 | vp1: 9 | extends: 10 | service: vp0 11 | environment: 12 | - CORE_PEER_ID=vp1 13 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 14 | links: 15 | - vp0 16 | 17 | vp2: 18 | extends: 19 | service: vp0 20 | environment: 21 | - CORE_PEER_ID=vp2 22 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 23 | links: 24 | - vp0 25 | 26 | vp3: 27 | extends: 28 | service: vp0 29 | environment: 30 | - CORE_PEER_ID=vp3 31 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 32 | links: 33 | - vp0 34 | 35 | vp4: 36 | extends: 37 | service: vp0 38 | environment: 39 | - CORE_PEER_ID=vp4 40 | - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 41 | links: 42 | - vp0 43 | -------------------------------------------------------------------------------- /bddtests/docker-compose-sdk-node.yml: -------------------------------------------------------------------------------- 1 | sampleApp0: 2 | image: hyperledger-sdk-node 3 | environment: 4 | - MEMBERSRVC_ADDRESS=membersrvc0:50051 5 | - PEER_ADDRESS=vp0:30303 6 | - KEY_VALUE_STORE=/tmp/hl_sdk_node_key_value_store 7 | # Startup of peer must be delayed to allow membersrvc to come up first 8 | command: node sampleSDKApp 9 | links: 10 | - membersrvc0 11 | - vp0 12 | 13 | -------------------------------------------------------------------------------- /bddtests/docker-membersrvc-attributes-enabled.yml: -------------------------------------------------------------------------------- 1 | membersrvc0: 2 | environment: 3 | - MEMBERSRVC_CA_ACA_ENABLED=true 4 | -------------------------------------------------------------------------------- /bddtests/docker-membersrvc-attributes-encryption-enabled.yml: -------------------------------------------------------------------------------- 1 | membersrvc0: 2 | environment: 3 | - MEMBERSRVC_CA_TCA_ATTRIBUTE-ENCRYPTION_ENABLED=true 4 | -------------------------------------------------------------------------------- /bddtests/sdk.feature: -------------------------------------------------------------------------------- 1 | # 2 | # Test the Hyperledger SDK 3 | # 4 | # Tags that can be used and will affect test internals: 5 | # 6 | # @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. 7 | # 8 | 9 | Feature: Node SDK 10 | As a HyperLedger developer 11 | I want to have a single test driver for the various Hyperledger SDKs 12 | 13 | 14 | @doNotDecompose 15 | @sdk 16 | Scenario Outline: test initial sdk setup 17 | 18 | Given we compose "" 19 | And I wait "5" seconds 20 | And I register thru the sample SDK app supplying username "WebAppAdmin" and secret "DJY27pEnl16d" on "sampleApp0" 21 | Then I should get a JSON response with "foo" = "bar" 22 | 23 | 24 | Examples: Consensus Options 25 | | ComposeFile | WaitTime | 26 | | docker-compose-4-consensus-batch.yml docker-compose-sdk-node.yml | 60 | 27 | #| docker-compose-4-consensus-batch.yml docker-compose-sdk-java.yml | 60 | 28 | -------------------------------------------------------------------------------- /bddtests/steps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/bddtests/steps/__init__.py -------------------------------------------------------------------------------- /bddtests/tlsca.cert: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBwTCCAUegAwIBAgIBATAKBggqhkjOPQQDAzApMQswCQYDVQQGEwJVUzEMMAoG 3 | A1UEChMDSUJNMQwwCgYDVQQDEwNPQkMwHhcNMTYwMTIxMjI0OTUxWhcNMTYwNDIw 4 | MjI0OTUxWjApMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMQwwCgYDVQQDEwNP 5 | QkMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAR6YAoPOwMzIVi+P83V79I6BeIyJeaM 6 | meqWbmwQsTRlKD6g0L0YvczQO2vp+DbxRN11okGq3O/ctcPzvPXvm7Mcbb3whgXW 7 | RjbsX6wn25tF2/hU6fQsyQLPiJuNj/yxknSjQzBBMA4GA1UdDwEB/wQEAwIChDAP 8 | BgNVHRMBAf8EBTADAQH/MA0GA1UdDgQGBAQBAgMEMA8GA1UdIwQIMAaABAECAwQw 9 | CgYIKoZIzj0EAwMDaAAwZQIxAITGmq+x5N7Q1jrLt3QFRtTKsuNIosnlV4LR54l3 10 | yyDo17Ts0YLyC0pZQFd+GURSOQIwP/XAwoMcbJJtOVeW/UL2EOqmKA2ygmWX5kte 11 | 9Lngf550S6gPEWuDQOcY95B+x3eH 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /bddtests/tlsca.priv: -------------------------------------------------------------------------------- 1 | -----BEGIN ECDSA PRIVATE KEY----- 2 | MIGkAgEBBDDSK85W5GPJ4WVYV/6I8NQuwXswMvoNJ/FzKjCgdWLAfcvYM4jO/rIo 3 | ytwrwphFijigBwYFK4EEACKhZANiAAR6YAoPOwMzIVi+P83V79I6BeIyJeaMmeqW 4 | bmwQsTRlKD6g0L0YvczQO2vp+DbxRN11okGq3O/ctcPzvPXvm7Mcbb3whgXWRjbs 5 | X6wn25tF2/hU6fQsyQLPiJuNj/yxknQ= 6 | -----END ECDSA PRIVATE KEY----- 7 | -------------------------------------------------------------------------------- /consensus/helper/engine_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package helper 18 | 19 | import "testing" 20 | 21 | func TestEngine(t *testing.T) { 22 | t.Skip("Engine functions already tested in other consensus components") 23 | } 24 | -------------------------------------------------------------------------------- /consensus/helper/handler_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package helper 18 | 19 | import "testing" 20 | 21 | func TestHandler(t *testing.T) { 22 | t.Skip("Handler functions already tested in other consensus components") 23 | } 24 | -------------------------------------------------------------------------------- /consensus/helper/helper_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package helper 18 | 19 | import "testing" 20 | 21 | func TestHelper(t *testing.T) { 22 | t.Skip("Helper functions already tested in other consensus components") 23 | } 24 | -------------------------------------------------------------------------------- /consensus/helper/persist/persist_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package persist 18 | 19 | import "testing" 20 | 21 | func TestPersist(t *testing.T) { 22 | t.Skip("Persist functions already tested in other consensus components") 23 | } 24 | -------------------------------------------------------------------------------- /consensus/noops/config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | ############################################################################### 3 | # 4 | # NOOPS PROPERTIES 5 | # 6 | # These properties may be passed as environment variables when starting up 7 | # a validating peer with prefix CORE_NOOPS. For example: 8 | # CORE_NOOPS_BLOCK_SIZE=1000 9 | # CORE_NOOPS_BLOCK_WAIT=2 10 | # 11 | ############################################################################### 12 | 13 | # Define properties for a block: A block is created whenever "size" or "wait" 14 | # occurs. When we process a block, we grab all transactions in the queue, so 15 | # the number of transactions in a block may be greater than the "size". 16 | block: 17 | # Number of transactions per block. Must be > 0. Set to 1 for testing 18 | size: 500 19 | 20 | # Time to wait for a block. 21 | # The default unit of measure is seconds. Otherwise, specify ms (milliseconds), us (microseconds), ns (nanoseconds), m (minutes) or h (hours) 22 | wait: 1s 23 | -------------------------------------------------------------------------------- /core/admin_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package core 18 | 19 | import "testing" 20 | 21 | func TestServer_Status(t *testing.T) { 22 | t.Skip("TBD") 23 | //performHandshake(t, peerClientConn) 24 | } 25 | -------------------------------------------------------------------------------- /core/chaincode/platforms/car/platform.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package car 18 | 19 | import ( 20 | pb "github.com/hyperledger/fabric/protos" 21 | ) 22 | 23 | // Platform for the CAR type 24 | type Platform struct { 25 | } 26 | 27 | // ValidateSpec validates the chaincode specification for CAR types to satisfy 28 | // the platform interface. This chaincode type currently doesn't 29 | // require anything specific so we just implicitly approve any spec 30 | func (carPlatform *Platform) ValidateSpec(spec *pb.ChaincodeSpec) error { 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /core/chaincode/platforms/car/test/org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/core/chaincode/platforms/car/test/org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car -------------------------------------------------------------------------------- /core/chaincode/platforms/golang/hashtestfiles/a.txt: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /core/chaincode/platforms/golang/hashtestfiles/a/a1.txt: -------------------------------------------------------------------------------- 1 | a1 2 | -------------------------------------------------------------------------------- /core/chaincode/platforms/golang/hashtestfiles/a/a2.txt: -------------------------------------------------------------------------------- 1 | a2 2 | -------------------------------------------------------------------------------- /core/chaincode/platforms/golang/hashtestfiles/b.txt: -------------------------------------------------------------------------------- 1 | b 2 | -------------------------------------------------------------------------------- /core/chaincode/platforms/golang/hashtestfiles/b/c.txt: -------------------------------------------------------------------------------- 1 | c 2 | -------------------------------------------------------------------------------- /core/chaincode/platforms/golang/hashtestfiles/b/c/c1.txt: -------------------------------------------------------------------------------- 1 | c1 2 | -------------------------------------------------------------------------------- /core/chaincode/shim/crypto/attr/test_resources/prek0.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/core/chaincode/shim/crypto/attr/test_resources/prek0.dump -------------------------------------------------------------------------------- /core/chaincode/shim/crypto/attr/test_resources/tcert.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC2TCCAn+gAwIBAgIQBq019NJETm+JnM9pUFY5fDAKBggqhkjOPQQDAzAxMQsw 3 | CQYDVQQGEwJVUzEUMBIGA1UEChMLSHlwZXJsZWRnZXIxDDAKBgNVBAMTA3RjYTAe 4 | Fw0xNjA1MjYxODU4MjBaFw0xNjA4MjQxODU4MjBaMDMxCzAJBgNVBAYTAlVTMRQw 5 | EgYDVQQKEwtIeXBlcmxlZGdlcjEOMAwGA1UEAxMFZGllZ28wWTATBgcqhkjOPQIB 6 | BggqhkjOPQMBBwNCAARv37sk17/Yq6Ata16fj1CacV3uvYzCwgWx2hearwfEBbEh 7 | +lfmQXYUEu7pcaEaPh+9dNVEeqyHWGqFu2mo5tufo4IBdTCCAXEwDgYDVR0PAQH/ 8 | BAQDAgeAMAwGA1UdEwEB/wQCMAAwDQYDVR0OBAYEBAECAwQwDwYDVR0jBAgwBoAE 9 | AQIDBDBKBgYqAwQFBgoEQLb0qP6OU62xQQewx5PhpJu9cnLp54+aOpSptE78GNyd 10 | vh7xNtSHD1GTouEK2RFx1YwJZHAM7OS48JTDZoPr1L4wTQYGKgMEBQYHAQH/BEDv 11 | kl2JEP0f8OQRch84Hd3o3oGJbOrUBA5eYP0TaQLzpbGop4Z3Uun2Iyllfhixr+Gq 12 | 2Xv1vuSDsbNDpObuQthJMEoGBioDBAUGCARALLtd0x7G/yc2WSSo6ag0nntWayud 13 | kaIW7NOJiWGJaOFtP+fufzIUPzYvBAuQIk3nYeOLBH/948ZyKsJQWW/LtzBKBgYq 14 | AwQFBgkEQAXgSabQSC5xHa/YXQi7nlStN81eiG/VhGfTeLvkHXPMDcULAGyKHtax 15 | l2IaAap9QetXi6pkN78lO048IhFTFCswCgYIKoZIzj0EAwMDSAAwRQIhAMSY4g4E 16 | hWh7Ey4sOpPYfJwfM82nZHboLEUzrWFwuZ+KAiBf2V0OoXPt2I2MaV1+2OQIaHcJ 17 | BF8oB65Ox67VENMNUg== 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /core/chaincode/shim/crypto/attr/test_resources/tcert_bad.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICoDCCAkagAwIBAgIRALdvx2997k0el4M6q7FoSYswCgYIKoZIzj0EAwMwMTEL 3 | MAkGA1UEBhMCVVMxFDASBgNVBAoTC0h5cGVybGVkZ2VyMQwwCgYDVQQDEwN0Y2Ew 4 | HhcNMTYwNjExMDI1NzIzWhcNMTYwOTA5MDI1NzIzWjAzMQswCQYDVQQGEwJVUzEU 5 | MBIGA1UEChMLSHlwZXJsZWRnZXIxDjAMBgNVBAMTBWRpZWdvMFkwEwYHKoZIzj0C 6 | AQYIKoZIzj0DAQcDQgAETkdTO8tIQhNbm4k01RUIRV+vfqV7cCiEe/he209CoL9w 7 | ykpkNpLWDvuuaPngwiQ3XoBpR5KkV11WLEkm6YgO/KOCATswggE3MA4GA1UdDwEB 8 | /wQEAwIHgDAMBgNVHRMBAf8EAjAAMA0GA1UdDgQGBAQBAgMEMA8GA1UdIwQIMAaA 9 | BAECAwQwGwYGKgMEBQYKBBFTb2Z0d2FyZSBFbmdpbmVlcjASBgYqAwQFBgsECEFD 10 | b21wYW55ME0GBioDBAUGBwEB/wRA3Fw686SYs3vBtSGe+NhpnLjJMXNDgTrYO8qi 11 | Q4gFvNvPZvrU+QDgBnzS/YRUSP8FS/d8NA3ur5QWyafuFeRatzBKBgYqAwQFBggE 12 | QIb+dQuwRhrYXRvJmpVDcZMacvQtPJYRX/rI0SwC9mcylgUhypfs7bbXleskX4cW 13 | Oi/WC2ntOW9MN4g2usDrCOMwKwYGKgMEBQYJBCEwMEhFQURwb3NpdGlvbi0+MTAw 14 | I2NvbXBhbnktPjEwMCMwCgYIKoZIzj0EAwMDSAAwRQIhANtfRCq+wkaSDfhpASA6 15 | 0oyUcMQWSyVaOvMfWnmRJAJAAiBcnczAputMeGMWbHdpI2aVR7yn4o+MqRVzEBy3 16 | odOIQw== 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /core/chaincode/shim/crypto/attr/test_resources/tcert_clear.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICnDCCAkGgAwIBAgIQDeV68dFWTbaf9Z5CElzSPjAKBggqhkjOPQQDAzAxMQsw 3 | CQYDVQQGEwJVUzEUMBIGA1UEChMLSHlwZXJsZWRnZXIxDDAKBgNVBAMTA3RjYTAe 4 | Fw0xNjA2MTEwMTIwNDlaFw0xNjA5MDkwMTIwNDlaMDMxCzAJBgNVBAYTAlVTMRQw 5 | EgYDVQQKEwtIeXBlcmxlZGdlcjEOMAwGA1UEAxMFZGllZ28wWTATBgcqhkjOPQIB 6 | BggqhkjOPQMBBwNCAAT8PV1TuE63bFhpDpStyT1oi1sQBg1mcqgAZ8VKiHdyqE/j 7 | tihuHuMJv8fEDLB56GwfTZNGAO0NJOykou3QVLBTo4IBNzCCATMwDgYDVR0PAQH/ 8 | BAQDAgeAMAwGA1UdEwEB/wQCMAAwDQYDVR0OBAYEBAECAwQwDwYDVR0jBAgwBoAE 9 | AQIDBDAbBgYqAwQFBgoEEVNvZnR3YXJlIEVuZ2luZWVyMBIGBioDBAUGCwQIQUNv 10 | bXBhbnkwTQYGKgMEBQYHAQH/BECHkB85vxvL+vE5aGVvbclE6A8hthYo15KSARz/ 11 | ZF5wc2JJfHIMs+M4MV00kExRitvVsOXVxYqMGHZcsyzT56jaMEoGBioDBAUGCARA 12 | 9DXfVKvsohk/E4J1UUxeELM1EMhCeTpkOFPs0mLUytGyQlL9Wuj7SAKHF3GP3Pkj 13 | AX9wZaw26RrNYRTIa0azwTAnBgYqAwQFBgkEHTAwSEVBRHBvc2l0aW9uLT4xI2Nv 14 | bXBhbnktPjIjMAoGCCqGSM49BAMDA0kAMEYCIQCw/3c2dA3KEU9jfGkPbwYxX1UK 15 | BuQzK2hmoD+CUEGtpgIhAPW+4/+IL+6A367zTuqpI//6e75pSdj43Wn2rKuhSbF9 16 | -----END CERTIFICATE----- 17 | -------------------------------------------------------------------------------- /core/chaincode/shim/crypto/crypto.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package crypto 18 | 19 | // SignatureVerifier verifies signatures 20 | type SignatureVerifier interface { 21 | 22 | // Verify verifies signature sig against verification key vk and message msg. 23 | Verify(vk, sig, msg []byte) (bool, error) 24 | } 25 | -------------------------------------------------------------------------------- /core/chaincode/shim/crypto/ecdsa/x509.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package ecdsa 18 | 19 | import ( 20 | "crypto/x509" 21 | ) 22 | 23 | func derToX509Certificate(asn1Data []byte) (*x509.Certificate, error) { 24 | return x509.ParseCertificate(asn1Data) 25 | } 26 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/commons-logging.properties: -------------------------------------------------------------------------------- 1 | # commons-logging.properties 2 | # jdk handlers 3 | handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler 4 | 5 | # default log level 6 | .level=INFO 7 | 8 | # Specific logger level 9 | example.Example.level=DEBUG 10 | example.SimpleSample.level=FINE 11 | 12 | # FileHandler options - can also be set to the ConsoleHandler 13 | # FileHandler level can be set to override the global level: 14 | java.util.logging.FileHandler.level=DEBUG 15 | 16 | # log file name for the File Handler 17 | java.util.logging.FileHandler.pattern=java-chaincode%u.log 18 | 19 | # Specify the style of output (simple or xml) 20 | java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter 21 | 22 | # Optional - Limit the size of the file (in bytes) 23 | java.util.logging.FileHandler.limit=50000 24 | 25 | # Optional - The number of files to cycle through, by 26 | # appending an integer to the base file name: 27 | java.util.logging.FileHandler.count=10 28 | 29 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/Callback.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm; 18 | 19 | public interface Callback { 20 | 21 | public void run(Event event); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/CallbackType.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm; 18 | 19 | public enum CallbackType { 20 | 21 | NONE, 22 | BEFORE_EVENT, 23 | LEAVE_STATE, 24 | ENTER_STATE, 25 | AFTER_EVENT; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/EventDesc.java: -------------------------------------------------------------------------------- 1 | package org.hyperledger.java.fsm; 2 | 3 | /** 4 | * Represents an event when initializing the FSM. 5 | * The event can have one or more source states that is valid for performing 6 | * the transition. If the FSM is in one of the source states it will end up in 7 | * the specified destination state, calling all defined callbacks as it goes. 8 | */ 9 | public class EventDesc { 10 | 11 | /** The event name used when calling for a transition */ 12 | String name; 13 | 14 | /** A slice of source states that the FSM must be in to perform a state transition */ 15 | String[] src; 16 | 17 | /** The destination state that the FSM will be in if the transition succeeds */ 18 | String dst; 19 | 20 | public EventDesc(String name, String dst, String... src) { 21 | this.name = name; 22 | this.src = src; 23 | this.dst = dst; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/Transitioner.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm; 18 | 19 | import org.hyperledger.java.fsm.exceptions.NotInTransitionException; 20 | 21 | public class Transitioner { 22 | 23 | public void transition(FSM fsm) throws NotInTransitionException { 24 | if (fsm.transition == null) { 25 | throw new NotInTransitionException(); 26 | } 27 | fsm.transition.run(); 28 | fsm.transition = null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/AsyncException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class AsyncException extends Exception { 20 | 21 | public final Exception error; 22 | 23 | public AsyncException() { 24 | this(null); 25 | } 26 | 27 | public AsyncException(Exception error) { 28 | super("Async started" + error == null ? 29 | "" : " with error " + error.toString()); 30 | this.error = error; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/CancelledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class CancelledException extends Exception { 20 | 21 | public final Exception error; 22 | 23 | public CancelledException() { 24 | this(null); 25 | } 26 | 27 | public CancelledException(Exception error) { 28 | super("The transition was cancelled" + error == null ? 29 | "" : " with error " + error.toString()); 30 | this.error = error; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/InTrasistionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class InTrasistionException extends Exception { 20 | 21 | public final String event; 22 | 23 | public InTrasistionException(String event) { 24 | super("Event '" + event + "' is inappropriate because" 25 | + " the previous trasaction had not completed"); 26 | this.event = event; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/InvalidEventException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class InvalidEventException extends Exception { 20 | 21 | public final String event; 22 | public final String state; 23 | 24 | public InvalidEventException(String event, String state) { 25 | super("Event '" + event + "' is innappropriate" 26 | + " given the current state, " + state); 27 | this.event = event; 28 | this.state = state; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/NoTransitionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class NoTransitionException extends Exception { 20 | 21 | public final Exception error; 22 | 23 | public NoTransitionException() { 24 | this(null); 25 | } 26 | 27 | public NoTransitionException(Exception error) { 28 | super("No transition occurred" + (error == null ? "" : " because of error " + error.toString())); 29 | this.error = error; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/NotInTransitionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class NotInTransitionException extends Exception { 20 | 21 | public NotInTransitionException() { 22 | super("The transition is inappropriate" 23 | + " because there is no state change in progress"); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/fsm/exceptions/UnknownEventException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.fsm.exceptions; 18 | 19 | public class UnknownEventException extends Exception { 20 | 21 | public final String event; 22 | 23 | public UnknownEventException(String event) { 24 | super("Event '" + event + "' does not exist"); 25 | this.event = event; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/java/org/hyperledger/java/shim/NextStateInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright DTCC 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package org.hyperledger.java.shim; 18 | 19 | import protos.Chaincode.ChaincodeMessage; 20 | 21 | public class NextStateInfo { 22 | 23 | public ChaincodeMessage message; 24 | public boolean sendToCC; 25 | 26 | public NextStateInfo(ChaincodeMessage message, boolean sendToCC) { 27 | this.message = message; 28 | this.sendToCC = sendToCC; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/chaincode/shim/java/src/main/proto/chaincodeevent.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | syntax = "proto3"; 17 | package protos; 18 | 19 | //Chaincode is used for events and registrations that are specific to chaincode 20 | //string type - "chaincode" 21 | message ChaincodeEvent { 22 | string chaincodeID = 1; 23 | string txID = 2; 24 | string eventName = 3; 25 | bytes payload = 4; 26 | } 27 | -------------------------------------------------------------------------------- /core/crypto/attributes/test_resources/prek0.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/core/crypto/attributes/test_resources/prek0.dump -------------------------------------------------------------------------------- /core/crypto/attributes/test_resources/tcert.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC2TCCAn+gAwIBAgIQBq019NJETm+JnM9pUFY5fDAKBggqhkjOPQQDAzAxMQsw 3 | CQYDVQQGEwJVUzEUMBIGA1UEChMLSHlwZXJsZWRnZXIxDDAKBgNVBAMTA3RjYTAe 4 | Fw0xNjA1MjYxODU4MjBaFw0xNjA4MjQxODU4MjBaMDMxCzAJBgNVBAYTAlVTMRQw 5 | EgYDVQQKEwtIeXBlcmxlZGdlcjEOMAwGA1UEAxMFZGllZ28wWTATBgcqhkjOPQIB 6 | BggqhkjOPQMBBwNCAARv37sk17/Yq6Ata16fj1CacV3uvYzCwgWx2hearwfEBbEh 7 | +lfmQXYUEu7pcaEaPh+9dNVEeqyHWGqFu2mo5tufo4IBdTCCAXEwDgYDVR0PAQH/ 8 | BAQDAgeAMAwGA1UdEwEB/wQCMAAwDQYDVR0OBAYEBAECAwQwDwYDVR0jBAgwBoAE 9 | AQIDBDBKBgYqAwQFBgoEQLb0qP6OU62xQQewx5PhpJu9cnLp54+aOpSptE78GNyd 10 | vh7xNtSHD1GTouEK2RFx1YwJZHAM7OS48JTDZoPr1L4wTQYGKgMEBQYHAQH/BEDv 11 | kl2JEP0f8OQRch84Hd3o3oGJbOrUBA5eYP0TaQLzpbGop4Z3Uun2Iyllfhixr+Gq 12 | 2Xv1vuSDsbNDpObuQthJMEoGBioDBAUGCARALLtd0x7G/yc2WSSo6ag0nntWayud 13 | kaIW7NOJiWGJaOFtP+fufzIUPzYvBAuQIk3nYeOLBH/948ZyKsJQWW/LtzBKBgYq 14 | AwQFBgkEQAXgSabQSC5xHa/YXQi7nlStN81eiG/VhGfTeLvkHXPMDcULAGyKHtax 15 | l2IaAap9QetXi6pkN78lO048IhFTFCswCgYIKoZIzj0EAwMDSAAwRQIhAMSY4g4E 16 | hWh7Ey4sOpPYfJwfM82nZHboLEUzrWFwuZ+KAiBf2V0OoXPt2I2MaV1+2OQIaHcJ 17 | BF8oB65Ox67VENMNUg== 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /core/crypto/client_tcert_pool.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package crypto 18 | 19 | type tCertPool interface { 20 | init(client *clientImpl) error 21 | 22 | Start() error 23 | 24 | Stop() error 25 | 26 | GetNextTCerts(nCerts int, attributes ...string) ([]*TCertBlock, error) 27 | 28 | AddTCert(tCertBlock *TCertBlock) (err error) 29 | } 30 | -------------------------------------------------------------------------------- /core/crypto/crypto_profile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -f "crypto.test" ] 4 | then 5 | echo Removing crypto.test 6 | rm crypto.test 7 | fi 8 | 9 | echo Compile, banchmark, pprof... 10 | 11 | go test -c 12 | #./crypto.test -test.cpuprofile=crypto.prof 13 | #./crypto.test -test.bench BenchmarkConfidentialTCertHExecuteTransaction -test.run XXX -test.cpuprofile=crypto.prof 14 | ./crypto.test -test.bench BenchmarkTransaction -test.run XXX -test.cpuprofile=crypto.prof 15 | #./crypto.test -test.run TestParallelInitClose -test.cpuprofile=crypto.prof 16 | go tool pprof crypto.test crypto.prof -------------------------------------------------------------------------------- /core/crypto/node.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package crypto 18 | 19 | // Utility functions 20 | 21 | func eTypeToString(eType NodeType) string { 22 | switch eType { 23 | case NodeClient: 24 | return "client" 25 | case NodePeer: 26 | return "peer" 27 | case NodeValidator: 28 | return "validator" 29 | } 30 | return "Invalid Type" 31 | } 32 | -------------------------------------------------------------------------------- /core/crypto/primitives/ecies/params.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package ecies 18 | 19 | import ( 20 | "crypto" 21 | "crypto/cipher" 22 | "hash" 23 | ) 24 | 25 | // Params ECIES parameters 26 | type Params struct { 27 | Hash func() hash.Hash 28 | hashAlgo crypto.Hash 29 | Cipher func([]byte) (cipher.Block, error) 30 | BlockSize int 31 | KeyLen int 32 | } 33 | -------------------------------------------------------------------------------- /core/crypto/primitives/elliptic.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package primitives 18 | 19 | import ( 20 | "crypto/elliptic" 21 | ) 22 | 23 | var ( 24 | defaultCurve elliptic.Curve 25 | ) 26 | 27 | // GetDefaultCurve returns the default elliptic curve used by the crypto layer 28 | func GetDefaultCurve() elliptic.Curve { 29 | return defaultCurve 30 | } 31 | -------------------------------------------------------------------------------- /core/crypto/primitives/random.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package primitives 18 | 19 | import "crypto/rand" 20 | 21 | // GetRandomBytes returns len random looking bytes 22 | func GetRandomBytes(len int) ([]byte, error) { 23 | key := make([]byte, len) 24 | 25 | // TODO: rand could fill less bytes then len 26 | _, err := rand.Read(key) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | return key, nil 32 | } 33 | 34 | // GetRandomNonce returns a random byte array of length NonceSize 35 | func GetRandomNonce() ([]byte, error) { 36 | return GetRandomBytes(NonceSize) 37 | } 38 | -------------------------------------------------------------------------------- /core/crypto/utils/slice.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package utils 18 | 19 | // Clone clones the passed slice 20 | func Clone(src []byte) []byte { 21 | clone := make([]byte, len(src)) 22 | copy(clone, src) 23 | 24 | return clone 25 | } 26 | -------------------------------------------------------------------------------- /core/ledger/README.md: -------------------------------------------------------------------------------- 1 | ## Ledger Package 2 | 3 | This package implements the ledger, which includes the blockchain and global state. 4 | 5 | If you're looking for API to work with the blockchain or state, look in `ledger.go`. This is the file where all public functions are exposed and is extensively documented. The sections in the file are: 6 | 7 | ### Transaction-batch functions 8 | 9 | These are functions that consensus should call. `BeginTxBatch` followed by `CommitTxBatch` or `RollbackTxBatch`. These functions will add a block to the blockchain with the specified transactions. 10 | 11 | ### World-state functions 12 | 13 | These functions are used to modify the global state. They would generally be called by the VM based on requests from chaincode. 14 | 15 | ### Blockchain functions 16 | 17 | These functions can be used to retrieve blocks/transactions from the blockchain or other information such as the blockchain size. Addition of blocks to the blockchain is done though the transaction-batch related functions. 18 | -------------------------------------------------------------------------------- /core/ledger/benchmark_scripts/buckettree/plot.pg: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/gnuplot 2 | reset 3 | 4 | # Chart specific settings 5 | set ylabel "milli second" 6 | set xlabel "Existing Data" 7 | set title "Buckettree performance" 8 | 9 | # General settings 10 | set key reverse Left outside 11 | set grid 12 | set terminal postscript dashed color 13 | set style data linespoints 14 | 15 | # plot command 16 | plot dataFile using 1:($2/1000000) title "time taken" 17 | -------------------------------------------------------------------------------- /core/ledger/benchmark_scripts/ledger/db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source ../common.sh 3 | 4 | PKG_PATH="github.com/hyperledger/fabric/core/ledger" 5 | FUNCTION_NAME="BenchmarkDB" 6 | NUM_CPUS=1 7 | CHART_DATA_COLUMN="Number of Bytes" 8 | 9 | setupAndCompileTest 10 | 11 | KVSize=1000 12 | MaxKeySuffix=1000000 13 | KeyPrefix=ChaincodeKey_ 14 | 15 | CHART_COLUMN_VALUE=$KVSize 16 | 17 | ## now populate the db with 'MaxKeySuffix' number of key-values 18 | TEST_PARAMS="-KVSize=$KVSize, -PopulateDB=true, -MaxKeySuffix=$MaxKeySuffix, -KeyPrefix=$KeyPrefix" 19 | executeTest 20 | 21 | # now perform random access test. If you want to perform the random access test 22 | TEST_PARAMS="-KVSize=$KVSize, -PopulateDB=false, -MaxKeySuffix=$MaxKeySuffix, -KeyPrefix=$KeyPrefix" 23 | executeTest 24 | 25 | # now perform random access test after clearing OS file-system cache. If you want to perform the random access test 26 | clearOSCache 27 | executeTest 28 | -------------------------------------------------------------------------------- /core/ledger/benchmark_scripts/ledger/singleKeyTransaction.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source ../common.sh 3 | 4 | PKG_PATH="github.com/hyperledger/fabric/core/ledger" 5 | FUNCTION_NAME="BenchmarkLedgerSingleKeyTransaction" 6 | NUM_CPUS=4 7 | CHART_DATA_COLUMN="Number of Bytes" 8 | 9 | setupAndCompileTest 10 | 11 | Key=key 12 | KVSize=100 13 | BatchSize=100 14 | NumBatches=10000 15 | NumWritesToLedger=2 16 | 17 | CHART_COLUMN_VALUE=$KVSize 18 | 19 | TEST_PARAMS="-Key=$Key, -KVSize=$KVSize, -BatchSize=$BatchSize, -NumBatches=$NumBatches, -NumWritesToLedger=$NumWritesToLedger" 20 | executeTest 21 | -------------------------------------------------------------------------------- /core/ledger/benchmark_scripts/ledger/test.yaml: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Peer section 4 | # 5 | ############################################################################### 6 | peer: 7 | 8 | ledger: 9 | state: 10 | dataStructure: 11 | configs: 12 | numBuckets: 1000003 13 | maxGroupingAtEachLevel: 5 14 | bucketCacheSize: 100 15 | -------------------------------------------------------------------------------- /core/ledger/benchmark_scripts/statemgmt/cryptoHash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source ../common.sh 3 | 4 | PKG_PATH="github.com/hyperledger/fabric/core/ledger/statemgmt" 5 | FUNCTION_NAME="BenchmarkCryptoHash" 6 | NUM_CPUS=1 7 | CHART_DATA_COLUMN="Number of Bytes" 8 | 9 | setupAndCompileTest 10 | 11 | for i in 1 5 10 20 50 100 200 400 600 800 1000 2000 5000 10000 20000 50000 100000; do 12 | TEST_PARAMS="-NumBytes=$i" 13 | CHART_COLUMN_VALUE=$i 14 | executeTest 15 | done 16 | 17 | constructChart 18 | -------------------------------------------------------------------------------- /core/ledger/benchmark_scripts/statemgmt/plot.pg: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/gnuplot 2 | reset 3 | 4 | # Chart specific settings 5 | set ylabel "nano second" 6 | set xlabel "Number of bytes" 7 | set title "CryptoHash performance" 8 | set logscale xy 10 9 | 10 | # General settings 11 | set key reverse Left outside 12 | set grid 13 | set terminal postscript dashed color 14 | set style data linespoints 15 | 16 | # plot command 17 | plot dataFile using 1:2 title "time taken", \ 18 | "" using 1:($2/$1) title "time taken per byte" 19 | -------------------------------------------------------------------------------- /core/ledger/perfstat/stat_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package perfstat 18 | 19 | import "testing" 20 | 21 | func TestSkipAll(t *testing.T) { 22 | t.Skip(`No tests in this package for now - This package contains code that is used in performance measurement.`) 23 | } 24 | -------------------------------------------------------------------------------- /core/ledger/statemgmt/buckettree/test.yaml: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Peer section 4 | # 5 | ############################################################################### 6 | peer: 7 | # Path on the file system where peer will store data 8 | fileSystemPath: /var/hyperledger/test/ledger/statemgmt/buckettree/testdb 9 | ledger: 10 | state: 11 | dataStructure: 12 | name: buckettree 13 | configs: 14 | numBuckets: 19 15 | maxGroupingAtEachLevel: 3 16 | -------------------------------------------------------------------------------- /core/ledger/statemgmt/pkg_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package statemgmt 18 | 19 | import ( 20 | "os" 21 | "testing" 22 | 23 | "github.com/hyperledger/fabric/core/ledger/testutil" 24 | ) 25 | 26 | var testParams []string 27 | 28 | func TestMain(m *testing.M) { 29 | testParams = testutil.ParseTestParams() 30 | os.Exit(m.Run()) 31 | } 32 | -------------------------------------------------------------------------------- /core/ledger/statemgmt/raw/state_impl_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package raw 18 | 19 | import "testing" 20 | 21 | func TestSkipAll(t *testing.T) { 22 | t.Skip(`No tests in this package for now - This package is only experimental as yet. 23 | The primary use of this package as yet is to measure what maximum performance we can get from a very basic state implementation 24 | that doe not implement any hash computation function`) 25 | } 26 | -------------------------------------------------------------------------------- /core/ledger/statemgmt/state/test.yaml: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Peer section 4 | # 5 | ############################################################################### 6 | peer: 7 | # Path on the file system where peer will store data 8 | fileSystemPath: /var/hyperledger/test/ledge/statemgmt/state/testdb 9 | 10 | ledger: 11 | 12 | state: 13 | 14 | # Control the number state deltas that are maintained. This takes additional 15 | # disk space, but allow the state to be rolled backwards and forwards 16 | # without the need to replay transactions. 17 | deltaHistorySize: 500 18 | dataStructure: 19 | name: buckettree 20 | configs: 21 | numBuckets: 10009 22 | maxGroupingAtEachLevel: 10 23 | -------------------------------------------------------------------------------- /core/ledger/statemgmt/trie/test.yaml: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Peer section 4 | # 5 | ############################################################################### 6 | peer: 7 | # Path on the file system where peer will store data 8 | fileSystemPath: /var/hyperledger/test/ledger/statemgmt/trie/testdb 9 | -------------------------------------------------------------------------------- /core/ledger/test.yaml: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Peer section 4 | # 5 | ############################################################################### 6 | peer: 7 | # Path on the file system where peer will store data 8 | fileSystemPath: /var/hyperledger/test/ledger_test 9 | 10 | ledger: 11 | 12 | state: 13 | 14 | # Control the number state deltas that are maintained. This takes additional 15 | # disk space, but allow the state to be rolled backwards and forwards 16 | # without the need to replay transactions. 17 | deltaHistorySize: 500 18 | -------------------------------------------------------------------------------- /core/ledger/test/test.yaml: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Peer section 4 | # 5 | ############################################################################### 6 | peer: 7 | # Path on the file system where peer will store data 8 | fileSystemPath: /var/hyperledger/test/ledger_test 9 | 10 | ledger: 11 | 12 | state: 13 | 14 | # Control the number state deltas that are maintained. This takes additional 15 | # disk space, but allow the state to be rolled backwards and forwards 16 | # without the need to replay transactions. 17 | deltaHistorySize: 500 18 | -------------------------------------------------------------------------------- /core/ledger/testutil/test_util_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package testutil 18 | 19 | import "testing" 20 | 21 | func TestSkipAll(t *testing.T) { 22 | t.Skip(`No tests in this package for now - This package contains only utility functions that are meant to be used by other functional tests`) 23 | } 24 | -------------------------------------------------------------------------------- /devenv/compile_protos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eux 4 | 5 | # Compile protos 6 | ALL_PROTO_FILES="$(find . -name "*.proto" -exec readlink -f {} \;)" 7 | PROTO_DIRS="$(dirname $ALL_PROTO_FILES | sort | uniq)" 8 | PROTO_DIRS_WITHOUT_JAVA_AND_SDK="$(printf '%s\n' $PROTO_DIRS | grep -v "shim/java" | grep -v "/sdk")" 9 | for dir in $PROTO_DIRS_WITHOUT_JAVA_AND_SDK; do 10 | cd "$dir" 11 | protoc --proto_path="$dir" --go_out=plugins=grpc:. "$dir"/*.proto 12 | done 13 | -------------------------------------------------------------------------------- /devenv/golang_buildcmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | for arch in 8 6; do 4 | for cmd in a c g l; do 5 | go tool dist install -v cmd/$arch$cmd 6 | done 7 | done 8 | exit 0 9 | -------------------------------------------------------------------------------- /devenv/golang_buildpkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -z "$1" ]; then 3 | echo 'GOOS is not specified' 1>&2 4 | exit 2 5 | else 6 | export GOOS=$1 7 | if [ "$GOOS" = "windows" ]; then 8 | export CGO_ENABLED=0 9 | fi 10 | fi 11 | shift 12 | if [ -n "$1" ]; then 13 | export GOARCH=$1 14 | fi 15 | cd $GOROOT/src 16 | go tool dist install -v pkg/runtime 17 | go install -v -a std 18 | -------------------------------------------------------------------------------- /devenv/images/openchain-dev-env-deployment-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/devenv/images/openchain-dev-env-deployment-diagram.png -------------------------------------------------------------------------------- /devenv/tools/chaintool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/devenv/tools/chaintool -------------------------------------------------------------------------------- /docs/API/ChaincodeAPI.md: -------------------------------------------------------------------------------- 1 | # Chaincode APIs 2 | 3 | When the `Init`, `Invoke` or `Query` function of a chaincode is called, the fabric passes the `stub *shim.ChaincodeStub` parameter. This `stub` can be used to call APIs to access to the ledger services, transaction context, or to invoke other chaincodes. 4 | 5 | The current APIs are defined in the [shim package](https://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim), generated by `godoc`. However, it includes functions from [chaincode.pb.go](https://github.com/hyperledger/fabric/blob/master/core/chaincode/shim/chaincode.pb.go) such as `func (*Column) XXX_OneofFuncs` that are not intended as public API. The best is to look at the function definitions in [chaincode.go](https://github.com/hyperledger/fabric/blob/master/core/chaincode/shim/chaincode.go) and [chaincode samples](https://github.com/hyperledger/fabric/tree/master/examples/chaincode) for usage. 6 | -------------------------------------------------------------------------------- /docs/API/Samples/Sample_1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/API/Samples/Sample_1.zip -------------------------------------------------------------------------------- /docs/FAQ/consensus_FAQ.md: -------------------------------------------------------------------------------- 1 | ## Consensus Algorithm 2 | 3 |   4 | ##### Which Consensus Algorithm is used in the fabric? 5 | The fabric is built on a pluggable architecture such that developers can configure their deployment with the consensus module that best suits their needs. The initial release package will offer three consensus implementations for users to select from: 1) No-op (consensus ignored); and 2) Batch PBFT. 6 | -------------------------------------------------------------------------------- /docs/SystemChaincodes/noop.md: -------------------------------------------------------------------------------- 1 | ### NO-OP system chaincode 2 | NO-OP is a system chaincode that does nothing when invoked. The parameters of the invoke transaction are stored on the ledger so it is possible to encode arbitrary data into them. 3 | 4 | #### Functions and valid options 5 | - Invoke transactions have to be called with *'execute'* as function name and at least one argument. Only the **first argument** is used. Note that it should be **encoded with BASE64**. 6 | - Only one type of query is supported: *'getTran'* (passed as a function name). GetTran has to get a transaction ID as argument in hexadecimal format. The function looks up the corresponding transaction's (if any) **first argument** and tries to **decode it as a BASE64 encoded string**. 7 | 8 | #### Testing 9 | NO-OP has unit tests checking invocation and queries using proper/improper arguments. The chaincode implementation provides a facility for mocking the ledger under the chaincode (*mockLedgerH* in struct *chaincode.SystemChaincode*). This should only be used for testing as it is dangerous to rely on global variables in memory that can hold state across invokes. 10 | -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_Asset-Depository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_Asset-Depository.png -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_B2BContract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_B2BContract.png -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_Direct-Communication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_Direct-Communication.png -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_Interoperability-of-Assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_Interoperability-of-Assets.png -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_Manufacturing-Supply-Chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_Manufacturing-Supply-Chain.png -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_One-Trade-One-Contract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_One-Trade-One-Contract.png -------------------------------------------------------------------------------- /docs/biz/images/Canonical-Use-Cases_Separation-of-Asset-Ownership-and-Custodians-Duties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/Canonical-Use-Cases_Separation-of-Asset-Ownership-and-Custodians-Duties.png -------------------------------------------------------------------------------- /docs/biz/images/assetrepository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/assetrepository.png -------------------------------------------------------------------------------- /docs/biz/images/b2bcontract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/b2bcontract.png -------------------------------------------------------------------------------- /docs/biz/images/corporate_action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/corporate_action.png -------------------------------------------------------------------------------- /docs/biz/images/exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/exchange.png -------------------------------------------------------------------------------- /docs/biz/images/interoperability_of_assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/interoperability_of_assets.png -------------------------------------------------------------------------------- /docs/biz/images/one_contract_per_trade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/one_contract_per_trade.png -------------------------------------------------------------------------------- /docs/biz/images/separation_of_ownship_and_custodyservice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/separation_of_ownship_and_custodyservice.png -------------------------------------------------------------------------------- /docs/biz/images/supplychain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/biz/images/supplychain.png -------------------------------------------------------------------------------- /docs/dev-setup/headers.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright [COPYRIGHT OWNER] All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /docs/images/Architecture_Step-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Architecture_Step-1.png -------------------------------------------------------------------------------- /docs/images/Architecture_Step-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Architecture_Step-2.png -------------------------------------------------------------------------------- /docs/images/Architecture_Step-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Architecture_Step-3.png -------------------------------------------------------------------------------- /docs/images/Architecture_Step-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Architecture_Step-4.png -------------------------------------------------------------------------------- /docs/images/BuildStatus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/BuildStatus.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_Asset-Depository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_Asset-Depository.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_B2BContract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_B2BContract.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_Direct-Communication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_Direct-Communication.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_Interoperability-of-Assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_Interoperability-of-Assets.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_Manufacturing-Supply-Chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_Manufacturing-Supply-Chain.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_One-Trade-One-Contract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_One-Trade-One-Contract.png -------------------------------------------------------------------------------- /docs/images/Canonical-Use-Cases_Separation-of-Asset-Ownership-and-Custodians-Duties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Canonical-Use-Cases_Separation-of-Asset-Ownership-and-Custodians-Duties.png -------------------------------------------------------------------------------- /docs/images/Travis_Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Travis_Settings.png -------------------------------------------------------------------------------- /docs/images/Travis_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/Travis_service.png -------------------------------------------------------------------------------- /docs/images/attributes_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/attributes_flow.png -------------------------------------------------------------------------------- /docs/images/refarch-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/refarch-api.png -------------------------------------------------------------------------------- /docs/images/refarch-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/refarch-app.png -------------------------------------------------------------------------------- /docs/images/refarch-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/refarch-block.png -------------------------------------------------------------------------------- /docs/images/refarch-chain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/refarch-chain.png -------------------------------------------------------------------------------- /docs/images/refarch-memb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/refarch-memb.png -------------------------------------------------------------------------------- /docs/images/refarch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/refarch.png -------------------------------------------------------------------------------- /docs/images/sec-RACapp-depl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-RACapp-depl.png -------------------------------------------------------------------------------- /docs/images/sec-RACapp-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-RACapp-inv.png -------------------------------------------------------------------------------- /docs/images/sec-entities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-entities.png -------------------------------------------------------------------------------- /docs/images/sec-example-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-example-1.png -------------------------------------------------------------------------------- /docs/images/sec-example-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-example-2.png -------------------------------------------------------------------------------- /docs/images/sec-firstrel-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-firstrel-1.jpg -------------------------------------------------------------------------------- /docs/images/sec-firstrel-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-firstrel-1.png -------------------------------------------------------------------------------- /docs/images/sec-firstrel-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-firstrel-2.png -------------------------------------------------------------------------------- /docs/images/sec-firstrel-depl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-firstrel-depl.png -------------------------------------------------------------------------------- /docs/images/sec-firstrel-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-firstrel-inv.png -------------------------------------------------------------------------------- /docs/images/sec-futrel-depl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-futrel-depl.png -------------------------------------------------------------------------------- /docs/images/sec-futrel-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-futrel-inv.png -------------------------------------------------------------------------------- /docs/images/sec-memserv-components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-memserv-components.png -------------------------------------------------------------------------------- /docs/images/sec-registration-detailed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-registration-detailed.png -------------------------------------------------------------------------------- /docs/images/sec-registration-high-level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-registration-high-level.png -------------------------------------------------------------------------------- /docs/images/sec-request-tcerts-deployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-request-tcerts-deployment.png -------------------------------------------------------------------------------- /docs/images/sec-request-tcerts-invocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-request-tcerts-invocation.png -------------------------------------------------------------------------------- /docs/images/sec-sec-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-sec-arch.png -------------------------------------------------------------------------------- /docs/images/sec-sources-1.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-sources-1.pptx -------------------------------------------------------------------------------- /docs/images/sec-sources-2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-sources-2.pptx -------------------------------------------------------------------------------- /docs/images/sec-txconf-v1.2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-txconf-v1.2.pptx -------------------------------------------------------------------------------- /docs/images/sec-usrconf-deploy-interm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-usrconf-deploy-interm.png -------------------------------------------------------------------------------- /docs/images/sec-usrconf-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-usrconf-deploy.png -------------------------------------------------------------------------------- /docs/images/sec-usrconf-invoke-interm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-usrconf-invoke-interm.png -------------------------------------------------------------------------------- /docs/images/sec-usrconf-invoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/sec-usrconf-invoke.png -------------------------------------------------------------------------------- /docs/images/top-multi-peer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/top-multi-peer.png -------------------------------------------------------------------------------- /docs/images/top-single-peer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/top-single-peer.png -------------------------------------------------------------------------------- /docs/images/world_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/images/world_view.png -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | python-markdown-math==0.2 2 | -------------------------------------------------------------------------------- /docs/tech/best-practices.md: -------------------------------------------------------------------------------- 1 | ## Hyperledger Fabric Development Best Practices 2 | 3 | (This page is under construction.) 4 | -------------------------------------------------------------------------------- /docs/wiki-images/sdk-current.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/wiki-images/sdk-current.png -------------------------------------------------------------------------------- /docs/wiki-images/sdk-future.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/docs/wiki-images/sdk-future.png -------------------------------------------------------------------------------- /events/consumer/adapter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package consumer 18 | 19 | import ( 20 | ehpb "github.com/hyperledger/fabric/protos" 21 | ) 22 | 23 | //EventAdapter is the interface by which a openchain event client registers interested events and 24 | //receives messages from the openchain event Server 25 | type EventAdapter interface { 26 | GetInterestedEvents() ([]*ehpb.Interest, error) 27 | Recv(msg *ehpb.Event) (bool, error) 28 | Disconnected(err error) 29 | } 30 | -------------------------------------------------------------------------------- /examples/chaincode/chaintool/example02/chaincode.yaml: -------------------------------------------------------------------------------- 1 | 2 | # ---------------------------------- 3 | # chaincode example02 4 | # ---------------------------------- 5 | # 6 | # Copyright (C) 2016 - Hyperledger 7 | # All rights reserved 8 | # 9 | 10 | Schema: 1 11 | Name: org.hyperledger.chaincode.example02 12 | Version: 0.1-SNAPSHOT 13 | 14 | Platform: 15 | Name: org.hyperledger.chaincode.golang 16 | Version: 1 17 | 18 | Provides: [self] # 'self' is a keyword that means there should be $name.cci (e.g. org.hyperledger.chaincode.example02.cci) 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /examples/chaincode/chaintool/example02/src/interfaces/appinit.cci: -------------------------------------------------------------------------------- 1 | 2 | message Party { 3 | string entity = 1; 4 | int32 value = 2; 5 | } 6 | 7 | message Init { 8 | Party partyA = 1; 9 | Party partyB = 2; 10 | } 11 | -------------------------------------------------------------------------------- /examples/chaincode/chaintool/example02/src/interfaces/org.hyperledger.chaincode.example02.cci: -------------------------------------------------------------------------------- 1 | 2 | message PaymentParams { 3 | string partySrc = 1; 4 | string partyDst = 2; 5 | int32 amount = 3; 6 | } 7 | 8 | message Entity { 9 | string id = 1; 10 | } 11 | 12 | message BalanceResult { 13 | int32 balance = 1; 14 | } 15 | 16 | transactions { 17 | void MakePayment(PaymentParams) = 1; 18 | void DeleteAccount(Entity) = 2; 19 | } 20 | 21 | queries { 22 | BalanceResult CheckBalance(Entity) = 1; 23 | } 24 | -------------------------------------------------------------------------------- /examples/chaincode/go/utxo/Dockerfile: -------------------------------------------------------------------------------- 1 | from hyperledger/fabric-baseimage 2 | 3 | RUN apt-get update && apt-get install pkg-config autoconf libtool -y 4 | RUN cd /tmp && git clone https://github.com/bitcoin/secp256k1.git && cd secp256k1/ 5 | WORKDIR /tmp/secp256k1 6 | RUN ./autogen.sh 7 | RUN ./configure --enable-module-recovery 8 | RUN make 9 | RUN ./tests 10 | RUN make install 11 | 12 | WORKDIR /tmp 13 | RUN apt-get install libtool libboost1.55-all-dev -y 14 | RUN git clone https://github.com/libbitcoin/libbitcoin-consensus.git 15 | WORKDIR /tmp/libbitcoin-consensus 16 | RUN ./autogen.sh 17 | RUN ./configure 18 | RUN make 19 | RUN make install 20 | 21 | # Now SWIG 22 | WORKDIR /tmp 23 | # Need pcre lib for building 24 | RUN apt-get install libpcre3-dev -y 25 | RUN wget http://prdownloads.sourceforge.net/swig/swig-3.0.8.tar.gz && tar xvf swig-3.0.8.tar.gz 26 | WORKDIR /tmp/swig-3.0.8 27 | RUN ./autogen.sh 28 | RUN ./configure 29 | RUN make 30 | RUN make install 31 | 32 | # Now add this for SWIG execution requirement to get missing stubs-32.h header file 33 | RUN apt-get install g++-multilib -y 34 | 35 | ENV CGO_LDFLAGS="-L/usr/local/lib/ -lbitcoin-consensus -lstdc++" 36 | -------------------------------------------------------------------------------- /examples/chaincode/go/utxo/util/dah.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | syntax = "proto3"; 18 | 19 | package utxo; 20 | 21 | message TX { 22 | uint32 version = 1; 23 | uint32 lockTime = 2; 24 | message TXIN { 25 | uint32 ix = 1; 26 | bytes sourceHash = 2; 27 | bytes script = 3; 28 | uint32 sequence = 4; 29 | } 30 | repeated TXIN txin = 3; 31 | 32 | message TXOUT { 33 | uint64 value = 1; 34 | bytes script = 2; 35 | bytes color = 3; 36 | uint64 quantity = 4; 37 | } 38 | repeated TXOUT txout = 4; 39 | repeated bytes blocks = 5; 40 | uint64 fee = 6; 41 | } 42 | -------------------------------------------------------------------------------- /images/app/Dockerfile.in: -------------------------------------------------------------------------------- 1 | FROM hyperledger/fabric-src:latest 2 | RUN mkdir -p /var/hyperledger/db 3 | COPY bin/* $GOPATH/bin/ 4 | WORKDIR $GOPATH/src/github.com/hyperledger/fabric 5 | -------------------------------------------------------------------------------- /images/base/.gitignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | -------------------------------------------------------------------------------- /images/base/Dockerfile.in: -------------------------------------------------------------------------------- 1 | FROM _DOCKER_BASE_ 2 | COPY scripts /hyperledger/baseimage/scripts 3 | RUN /hyperledger/baseimage/scripts/common/init.sh 4 | RUN /hyperledger/baseimage/scripts/docker/init.sh 5 | RUN /hyperledger/baseimage/scripts/common/setup.sh 6 | -------------------------------------------------------------------------------- /images/base/images/packer-overview.graffle/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/images/base/images/packer-overview.graffle/image2.png -------------------------------------------------------------------------------- /images/base/images/packer-overview.graffle/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/images/base/images/packer-overview.graffle/image3.png -------------------------------------------------------------------------------- /images/base/images/packer-overview.graffle/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/images/base/images/packer-overview.graffle/image4.png -------------------------------------------------------------------------------- /images/base/images/packer-overview.graffle/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/images/base/images/packer-overview.graffle/image5.png -------------------------------------------------------------------------------- /images/base/images/packer-overview.graffle/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/images/base/images/packer-overview.graffle/image6.png -------------------------------------------------------------------------------- /images/base/images/packer-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/images/base/images/packer-overview.png -------------------------------------------------------------------------------- /images/base/release: -------------------------------------------------------------------------------- 1 | 0.0.10 2 | -------------------------------------------------------------------------------- /images/base/scripts/common/golang_crossCompileSetup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | helpme() 4 | { 5 | cat <> /etc/network/interfaces 16 | -------------------------------------------------------------------------------- /images/base/scripts/vagrant/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | # Install headers so that we may build the vbox drivers layer 7 | apt-get install -y build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev unzip 8 | 9 | sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers 10 | sed -i -e 's/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers 11 | 12 | # Tweak sshd to prevent DNS resolution (speed up logins) 13 | echo 'UseDNS no' >> /etc/ssh/sshd_config 14 | 15 | # Remove 5s grub timeout to speed up booting 16 | cat < /etc/default/grub 17 | # If you change this file, run 'update-grub' afterwards to update 18 | # /boot/grub/grub.cfg. 19 | 20 | GRUB_DEFAULT=0 21 | GRUB_TIMEOUT=0 22 | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` 23 | GRUB_CMDLINE_LINUX_DEFAULT="quiet" 24 | GRUB_CMDLINE_LINUX="debian-installer=en_US" 25 | EOF 26 | 27 | update-grub 28 | -------------------------------------------------------------------------------- /images/base/scripts/vagrant/vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | # Vagrant specific 7 | date > /etc/vagrant_box_build_time 8 | 9 | # Installing vagrant keys 10 | mkdir -pm 700 /home/vagrant/.ssh 11 | wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys 12 | chmod 0600 /home/vagrant/.ssh/authorized_keys 13 | chown -R vagrant /home/vagrant/.ssh 14 | -------------------------------------------------------------------------------- /images/base/scripts/vagrant/virtualbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | apt-get install --yes virtualbox-guest-utils 6 | -------------------------------------------------------------------------------- /images/base/scripts/vagrant/zerodisk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Zero out the free space to save space in the final image: 4 | dd if=/dev/zero of=/EMPTY bs=1M 5 | rm -f /EMPTY 6 | 7 | # Sync to ensure that the delete completes before this moves on. 8 | sync 9 | sync 10 | sync 11 | -------------------------------------------------------------------------------- /images/ccenv/Dockerfile.in: -------------------------------------------------------------------------------- 1 | FROM hyperledger/fabric-src:latest 2 | COPY bin/* /usr/local/bin/ 3 | -------------------------------------------------------------------------------- /images/src/Dockerfile.in: -------------------------------------------------------------------------------- 1 | FROM hyperledger/fabric-baseimage:latest 2 | ADD gopath.tar.bz2 $GOPATH/src/github.com/hyperledger/fabric 3 | -------------------------------------------------------------------------------- /membersrvc/Dockerfile: -------------------------------------------------------------------------------- 1 | from hyperledger/fabric-baseimage:latest 2 | # Copy GOPATH src and install Peer 3 | RUN mkdir -p /var/hyperledger/db 4 | WORKDIR $GOPATH/src/github.com/hyperledger/fabric/ 5 | COPY . . 6 | WORKDIR membersrvc 7 | RUN pwd 8 | RUN CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install && cp $GOPATH/src/github.com/hyperledger/fabric/membersrvc/membersrvc.yaml $GOPATH/bin 9 | # RUN CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install 10 | -------------------------------------------------------------------------------- /membersrvc/ca/client_grpc.go: -------------------------------------------------------------------------------- 1 | package ca 2 | 3 | import ( 4 | "time" 5 | 6 | pb "github.com/hyperledger/fabric/membersrvc/protos" 7 | "google.golang.org/grpc" 8 | 9 | "github.com/spf13/viper" 10 | ) 11 | 12 | //GetClientConn returns a connection to the server located on *address*. 13 | func GetClientConn(address string, serverName string) (*grpc.ClientConn, error) { 14 | var opts []grpc.DialOption 15 | opts = append(opts, grpc.WithInsecure()) 16 | opts = append(opts, grpc.WithTimeout(time.Second*3)) 17 | return grpc.Dial(address, opts...) 18 | } 19 | 20 | //GetACAClient returns a client to Attribute Certificate Authority. 21 | func GetACAClient() (*grpc.ClientConn, pb.ACAPClient, error) { 22 | conn, err := GetClientConn(viper.GetString("aca.address"), viper.GetString("aca.server-name")) 23 | if err != nil { 24 | return nil, nil, err 25 | } 26 | 27 | client := pb.NewACAPClient(conn) 28 | 29 | return conn, client, nil 30 | } 31 | -------------------------------------------------------------------------------- /membersrvc/ca/test_resources/ecert_test_user0.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/membersrvc/ca/test_resources/ecert_test_user0.dump -------------------------------------------------------------------------------- /membersrvc/ca/test_resources/ecert_test_user1.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/membersrvc/ca/test_resources/ecert_test_user1.dump -------------------------------------------------------------------------------- /membersrvc/ca/test_resources/ecert_test_user2.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/fabric/fd7d34e07fdef96cbc11216337a6aca530dce846/membersrvc/ca/test_resources/ecert_test_user2.dump -------------------------------------------------------------------------------- /membersrvc/ca/test_resources/key_test_user0.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN ECDSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: AES-256-CBC,7af376757b4a587ac1d7a187192eb5e9 4 | 5 | zZCWUTmd7IVh+3Vp0XlRTh1rOGWjVkMb2HG4JIY1IUue4vbZP+HyxQZ424WsOP3w 6 | lBqdksRY1oHN+KFU6RRvGH54qOuI2MULGRMK80d5Q0eqGX09FaO1pBPbQiNud0n5 7 | uk4jlt6b+4RLKfBghbqk0UqBMeg9gECU5zF5MH3/+H8= 8 | -----END ECDSA PRIVATE KEY----- 9 | -------------------------------------------------------------------------------- /membersrvc/ca/test_resources/key_test_user1.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN ECDSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: AES-256-CBC,54fe446e7249adc2b762039808a5a434 4 | 5 | OM4MzGtsERUCRN6P4c0uKOcNFvkcm6Z3rjpa4b37k3FB5tB2r699I2XghEnr2ifq 6 | 1L1LDuRHS2SqayTjeAHCty86mw9aBjKeCBqyZPPUGw0s8AvxUw1cr0YXiqIbveXt 7 | 5pDRPd39T1baJWGGLtNyTlnsyCTaBs8SPYi7wjyvXpo= 8 | -----END ECDSA PRIVATE KEY----- 9 | -------------------------------------------------------------------------------- /membersrvc/ca/test_resources/key_test_user2.dump: -------------------------------------------------------------------------------- 1 | -----BEGIN ECDSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: AES-256-CBC,97b5487e373a4728f206bb4fb81ba331 4 | 5 | nhNzsdwpN8HHclaYvEHL8sjesdTnEavIzX5H/X2HSqigKEyNJFV56fzHrkGIrd5r 6 | dKAn/966dPD+PIaJTkVY1hXUpaXeJf58v/ZefW8soZxJAw1scOsTDWRuzobIuC60 7 | pr6mIeFHRSdb/39gLBznjpI6FVJApQQTJJt9ODpbaUE= 8 | -----END ECDSA PRIVATE KEY----- 9 | -------------------------------------------------------------------------------- /protos/chaincodeevent.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: chaincodeevent.proto 3 | // DO NOT EDIT! 4 | 5 | package protos 6 | 7 | import proto "github.com/golang/protobuf/proto" 8 | import fmt "fmt" 9 | import math "math" 10 | 11 | // Reference imports to suppress errors if they are not otherwise used. 12 | var _ = proto.Marshal 13 | var _ = fmt.Errorf 14 | var _ = math.Inf 15 | 16 | // Chaincode is used for events and registrations that are specific to chaincode 17 | // string type - "chaincode" 18 | type ChaincodeEvent struct { 19 | ChaincodeID string `protobuf:"bytes,1,opt,name=chaincodeID" json:"chaincodeID,omitempty"` 20 | TxID string `protobuf:"bytes,2,opt,name=txID" json:"txID,omitempty"` 21 | EventName string `protobuf:"bytes,3,opt,name=eventName" json:"eventName,omitempty"` 22 | Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` 23 | } 24 | 25 | func (m *ChaincodeEvent) Reset() { *m = ChaincodeEvent{} } 26 | func (m *ChaincodeEvent) String() string { return proto.CompactTextString(m) } 27 | func (*ChaincodeEvent) ProtoMessage() {} 28 | -------------------------------------------------------------------------------- /protos/chaincodeevent.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | syntax = "proto3"; 17 | package protos; 18 | 19 | //Chaincode is used for events and registrations that are specific to chaincode 20 | //string type - "chaincode" 21 | message ChaincodeEvent { 22 | string chaincodeID = 1; 23 | string txID = 2; 24 | string eventName = 3; 25 | bytes payload = 4; 26 | } 27 | -------------------------------------------------------------------------------- /protos/init.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package protos 18 | 19 | import "github.com/op/go-logging" 20 | 21 | var logger *logging.Logger 22 | 23 | func init() { 24 | // Create package logger. 25 | logger = logging.MustGetLogger("protos") 26 | } 27 | -------------------------------------------------------------------------------- /pub/fabric-baseimage.md: -------------------------------------------------------------------------------- 1 | ## Hyperledger Fabric Base image 2 | 3 | The base image used in the creation of the hyperledger/fabric-peer and hyperledger/fabric-membersrvc images for the [Hyperledger Fabric project](https://github.com/hyperledger/fabric). 4 | 5 | ## Usage 6 | 7 | This image is used in the Hyperledger Fabric [build process](http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/build/). 8 | -------------------------------------------------------------------------------- /scripts/containerlogs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/gopath/src/github.com/hyperledger/fabric/bddtests 4 | 5 | count=$(git ls-files -o | wc -l) 6 | 7 | git ls-files -o 8 | 9 | echo ">>>>>>>>> CONTAINERS LOG FILES <<<<<<<<<<<<" 10 | 11 | for (( i=1; i<"$count";i++ )) 12 | 13 | do 14 | 15 | file=$(echo $(git ls-files -o | sed "${i}q;d")) 16 | 17 | echo "$file" 18 | 19 | cat $file | curl -sT - chunk.io 20 | 21 | done 22 | echo " >>>>> testsummary log file <<<< " 23 | cat testsummary.log | curl -sT - chunk.io 24 | -------------------------------------------------------------------------------- /scripts/foldercopy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$2" != "hyperledger" ]; then 4 | 5 | echo " Pull Request number is $1 " 6 | echo " User Name is $2 " 7 | echo " Repository Name is $3 " 8 | 9 | mkdir -p $HOME/gopath/src/github.com/hyperledger 10 | 11 | echo "hyperledger/fabric folder created" 12 | 13 | git clone -ql $HOME/gopath/src/github.com/$2/$3 $HOME/gopath/src/github.com/hyperledger/fabric 14 | 15 | echo "linked $2 user repo into hyperledger/fabric folder" 16 | 17 | fi 18 | -------------------------------------------------------------------------------- /scripts/goUnitTests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | echo "Cleaning membership services folder" 6 | rm -rf membersrvc/ca/.ca/ 7 | 8 | echo -n "Obtaining list of tests to run.." 9 | PKGS=`go list github.com/hyperledger/fabric/... | grep -v /vendor/ | grep -v /examples/` 10 | echo "DONE!" 11 | 12 | echo -n "Starting peer.." 13 | CID=`docker run -dit -p 30303:30303 hyperledger/fabric-peer peer node start` 14 | cleanup() { 15 | echo "Stopping peer.." 16 | docker kill $CID 2>&1 > /dev/null 17 | } 18 | trap cleanup 0 19 | echo "DONE!" 20 | 21 | echo "Running tests..." 22 | go test -cover -p 1 -timeout=20m $PKGS 23 | -------------------------------------------------------------------------------- /scripts/goimports.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | declare -a arr=("./consensus" "./core" "./events" "./examples" "./membersrvc" "./peer" "./protos") 6 | 7 | for i in "${arr[@]}" 8 | do 9 | OUTPUT="$(goimports -l $i)" 10 | if [[ $OUTPUT ]]; then 11 | echo "The following files contain goimports errors" 12 | echo $OUTPUT 13 | echo "The goimports command must be run for these files" 14 | exit 1 15 | fi 16 | done 17 | -------------------------------------------------------------------------------- /scripts/infiniteloop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Use this script as the command for the cli Docker container 3 | # in the compose-consensus-4 set. It keeps the container up while we wait for other setup to complete 4 | 5 | set -e 6 | 7 | while true 8 | do 9 | echo "ttd" 10 | sleep 10m 11 | done 12 | -------------------------------------------------------------------------------- /scripts/provision/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Add any logic that is common to both the peer and docker environments here 4 | 5 | apt-get update -qq 6 | 7 | # Used by CHAINTOOL 8 | apt-get install -y default-jre 9 | -------------------------------------------------------------------------------- /sdk/node/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | node_modules/* 3 | /.idea/ 4 | /node.iml 5 | /typings/ 6 | /doc/ 7 | /lib/ 8 | -------------------------------------------------------------------------------- /sdk/node/.npmignore: -------------------------------------------------------------------------------- 1 | .project 2 | node_modules/* 3 | /.idea/ 4 | /node.iml 5 | -------------------------------------------------------------------------------- /sdk/node/bin/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "memberServicesUrl": "grpc://localhost:50051", 3 | "peers": [ "grpc://localhost:30303" ], 4 | "registrar": { "name": "WebAppAdmin", "secret": "DJY27pEnl16d" }, 5 | "numUsers": 5, 6 | "iterations": 10, 7 | "tests": [ 8 | { 9 | "type": "invoke", 10 | "chaincodeID": "mycc", 11 | "fcn": "invoke", 12 | "args": ["a", "b", "1"] 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sdk/node/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 IBM 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Licensed Materials - Property of IBM 18 | * © Copyright IBM Corp. 2016 19 | */ 20 | module.exports = require('./lib/hfc'); 21 | -------------------------------------------------------------------------------- /sdk/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hfc", 3 | "version": "0.0.2", 4 | "bin": "./bin/main.js", 5 | "typings": "hfc.d.ts", 6 | "main": "index.js", 7 | "dependencies": { 8 | "aes-js": "^1.0.0", 9 | "asn1": "https://github.com/mcavage/node-asn1", 10 | "asn1js": "^1.2.12", 11 | "bn.js": "^4.11.3", 12 | "crypto": "0.0.3", 13 | "debug": "^2.2.0", 14 | "elliptic": "^6.2.3", 15 | "events": "^1.1.0", 16 | "fs": "0.0.2", 17 | "grpc": "^0.13.2-pre1", 18 | "js-sha3": "^0.5.1", 19 | "json-stringify-safe": "^5.0.1", 20 | "jsrsasign": "^5.0.10", 21 | "jssha": "^2.1.0", 22 | "node-uuid": "^1.4.7", 23 | "node.extend": "^1.1.5", 24 | "pkijs": "^1.3.19", 25 | "sjcl": "^1.0.3", 26 | "sleep": "^3.0.1", 27 | "tar-fs": "^1.13.0", 28 | "url": "^0.11.0", 29 | "util": "^0.10.3", 30 | "uuidv4": "^0.3.1" 31 | }, 32 | "devDependencies": { 33 | "tape": "^4.5.1" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sdk/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "moduleResolution": "node", 5 | "sourceMap": true, 6 | "target": "es5", 7 | "declaration": true, 8 | "outDir": "./lib" 9 | }, 10 | "files": [ 11 | "typings/globals/node/index.d.ts", 12 | "typings/globals/debug/index.d.ts", 13 | "./src/hfc.ts", 14 | "./src/crypto.ts", 15 | "./src/stats.ts", 16 | "./src/sdk_util.ts" 17 | ], 18 | "exclude": [ 19 | "node_modules" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /sdk/node/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "debug": "registry:dt/debug#0.0.0+20160317120654", 4 | "node": "registry:dt/node#6.0.0+20160523035754" 5 | } 6 | } -------------------------------------------------------------------------------- /tools/busywork/.gitignore: -------------------------------------------------------------------------------- 1 | # Emacs backups and temporaries 2 | *~ 3 | *# 4 | # Private make files 5 | private.mk 6 | # Executables 7 | counters/counters 8 | benchmarks/benchmarks 9 | 10 | -------------------------------------------------------------------------------- /tools/busywork/benchmarks/README.md: -------------------------------------------------------------------------------- 1 | # Benchmarks 2 | 3 | This directory contains benchmarks, and a Makefile to run the benchmarks. 4 | 5 | ### crypto-ubench 6 | 7 | This target runs a set of microbenchmarks for the Go cryptographic primitives 8 | used by the Hyperledger fabric. Simply execute 9 | 10 | make crypto-ubench 11 | 12 | to run the microbenchmarks. You can define `TIMES` on the make command line to 13 | define how many times each run is made. The default is 1 run; If `TIMES` > 1 14 | then the results are averaged. Define `ENV` to define an environment or 15 | wrapper-command. For example 16 | 17 | make crypto-ubench ENV=time TIMES=3 18 | 19 | runs each benchmark 3 times and also reports the elapsed time. 20 | -------------------------------------------------------------------------------- /tools/busywork/bin/docker_ip: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $1 : `docker inspect --format {{.Name}} $1` : `docker inspect --format {{.NetworkSettings.IPAddress}} $1` 4 | -------------------------------------------------------------------------------- /tools/busywork/busywork/README.md: -------------------------------------------------------------------------------- 1 | # The Go *busywork* package 2 | 3 | Currently not much here, other than some infrastructire that allows a 4 | **busywork** application to effectively "throw exceptions" rather than 5 | verbosely/redundantly passing irrecoverable errors up the stack. 6 | -------------------------------------------------------------------------------- /tools/busywork/tcl/README.md: -------------------------------------------------------------------------------- 1 | # Tcl 2 | 3 | This directory contains the source code of the Tcl packages defined in 4 | [**pkgIndex.tcl**](pkgIndex.tcl). 5 | 6 | * [**busywork**](busywork.tcl) Support for common **busywork** operations. 7 | Procedures in this package are defined in the **::busywork** namespace. 8 | 9 | * [**fabric**](fabric.tcl) Support for Hyperledger fabric related 10 | operations. Procedures in this package are defined in the **::fabric** 11 | namespace. 12 | 13 | * [**utils**](utils_pkg.tcl) - A set of odds-and-ends collected over the years 14 | for things like list processing, argument handling, random numbers, I/O, 15 | logging and subprocesses. Most of the procedures included here are defined 16 | in the global namespace, however **mathx.tcl** defines some procedures in 17 | the **::math** namespace. 18 | -------------------------------------------------------------------------------- /tools/busywork/tcl/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | # Tcl package index file, version 1.1 2 | # This file is generated by the "pkg_mkIndex" command 3 | # and sourced either when an application starts up or 4 | # by a "package unknown" script. It invokes the 5 | # "package ifneeded" command to set up package-related 6 | # information so that packages will be loaded automatically 7 | # in response to "package require" commands. When this 8 | # script is sourced, the variable $dir must contain the 9 | # full path name of this file's directory. 10 | 11 | package ifneeded busywork 0.0 [list source [file join $dir busywork.tcl]] 12 | package ifneeded fabric 0.0 [list source [file join $dir fabric.tcl]] 13 | package ifneeded utils 0.0 [list source [file join $dir utils_pkg.tcl]] 14 | -------------------------------------------------------------------------------- /tools/busywork/tcl/utils_pkg.tcl: -------------------------------------------------------------------------------- 1 | # utils_pkg.tcl - Define the 'utils' package 2 | 3 | # Copyright IBM Corp. 2016. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | proc utils_pkg {} { 18 | 19 | set dir [file dirname [info script]] 20 | 21 | # Load Tcl source files 22 | 23 | source $dir/logging.tcl 24 | source $dir/io.tcl 25 | 26 | source $dir/atExit.tcl 27 | source $dir/args.tcl 28 | source $dir/lists.tcl 29 | source $dir/mathx.tcl 30 | source $dir/os.tcl 31 | source $dir/rand.tcl 32 | source $dir/time.tcl 33 | } 34 | 35 | utils_pkg 36 | 37 | package provide utils 0.0 38 | -------------------------------------------------------------------------------- /tools/dbutility/bddtests/environment.py: -------------------------------------------------------------------------------- 1 | import test_util 2 | import os 3 | 4 | def before_feature(context, feature): 5 | print("\nRunning go build") 6 | cmd = ["go", "build", "../dump_db_stats.go"] 7 | test_util.cli_call(context, cmd, expect_success=True) 8 | print("go build complete") 9 | 10 | def after_feature(context, feature): 11 | print("Deleting utility binary") 12 | os.remove("./dump_db_stats") 13 | -------------------------------------------------------------------------------- /tools/dbutility/bddtests/steps/test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | 4 | import test_util 5 | 6 | @given(u'I create a dir "{dirPath}"') 7 | def step_impl(context, dirPath): 8 | os.makedirs(dirPath, 0755); 9 | 10 | @then(u'I should delete dir "{dirPath}"') 11 | def step_impl(contxt, dirPath): 12 | shutil.rmtree(dirPath) 13 | 14 | @when(u'I execute utility with no flag') 15 | def step_impl(context): 16 | cmd = ["./dump_db_stats"] 17 | context.output, context.error, context.returncode = test_util.cli_call(context, cmd, expect_success=False) 18 | 19 | @when(u'I execute utility with flag "{flag}" and path "{path}"') 20 | def step_impl(context, flag, path): 21 | cmd = ["./dump_db_stats"] 22 | cmd.append(flag) 23 | cmd.append(path) 24 | context.output, context.error, context.returncode = test_util.cli_call(context, cmd, expect_success=False) 25 | 26 | @then(u'I should get a process exit code "{expectedReturncode}"') 27 | def step_impl(context, expectedReturncode): 28 | assert (str(context.returncode) == expectedReturncode), "Return code: expected (%s), instead found (%s)" % (expectedReturncode, context.returncode) 29 | -------------------------------------------------------------------------------- /tools/dbutility/bddtests/test.feature: -------------------------------------------------------------------------------- 1 | Feature: test dump_db_stat utility 2 | As a user 3 | I want to invoke dump_db_stat utility 4 | 5 | Scenario: no flag 6 | When I execute utility with no flag 7 | Then I should get a process exit code "3" 8 | 9 | Scenario: wrong flag 10 | When I execute utility with flag "-dbDir1" and path "nonExistingDir" 11 | Then I should get a process exit code "2" 12 | 13 | Scenario: dbDirNotExists 14 | When I execute utility with flag "-dbDir" and path "nonExistingDir" 15 | Then I should get a process exit code "4" 16 | 17 | Scenario: wrongDBDir 18 | Given I create a dir "testDir" 19 | When I execute utility with flag "-dbDir" and path "testDir" 20 | Then I should get a process exit code "5" 21 | Then I should delete dir "testDir" 22 | -------------------------------------------------------------------------------- /tools/dbutility/bddtests/test_util.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | def cli_call(context, arg_list, expect_success=True): 4 | p = subprocess.Popen(arg_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 5 | output, error = p.communicate() 6 | if p.returncode != 0: 7 | if output is not None: 8 | print("Output:\n" + output) 9 | if error is not None: 10 | print("Error Message:\n" + error) 11 | if expect_success: 12 | raise subprocess.CalledProcessError(p.returncode, arg_list, output) 13 | return output, error, p.returncode 14 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md) 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "github.com/russross/blackfriday" 5 | ) 6 | 7 | func Render(doc []byte) []byte { 8 | renderer := RoffRenderer(0) 9 | extensions := 0 10 | extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS 11 | extensions |= blackfriday.EXTENSION_TABLES 12 | extensions |= blackfriday.EXTENSION_FENCED_CODE 13 | extensions |= blackfriday.EXTENSION_AUTOLINK 14 | extensions |= blackfriday.EXTENSION_SPACE_HEADERS 15 | extensions |= blackfriday.EXTENSION_FOOTNOTES 16 | extensions |= blackfriday.EXTENSION_TITLEBLOCK 17 | 18 | return blackfriday.Markdown(doc, renderer, extensions) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/DOCKER-LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | You can find the Docker license at the following link: 6 | https://raw.githubusercontent.com/docker/docker/master/LICENSE 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: \ 2 | all \ 3 | vendor \ 4 | lint \ 5 | vet \ 6 | fmt \ 7 | fmtcheck \ 8 | pretest \ 9 | test \ 10 | cov \ 11 | clean 12 | 13 | SRCS = $(shell git ls-files '*.go' | grep -v '^external/') 14 | PKGS = ./. ./testing 15 | 16 | all: test 17 | 18 | vendor: 19 | @ go get -v github.com/mjibson/party 20 | party -d external -c -u 21 | 22 | lint: 23 | @ go get -v github.com/golang/lint/golint 24 | $(foreach file,$(SRCS),golint $(file) || exit;) 25 | 26 | vet: 27 | @-go get -v golang.org/x/tools/cmd/vet 28 | $(foreach pkg,$(PKGS),go vet $(pkg);) 29 | 30 | fmt: 31 | gofmt -w $(SRCS) 32 | 33 | fmtcheck: 34 | $(foreach file,$(SRCS),gofmt $(file) | diff -u $(file) - || exit;) 35 | 36 | pretest: lint vet fmtcheck 37 | 38 | test: pretest 39 | $(foreach pkg,$(PKGS),go test $(pkg) || exit;) 40 | 41 | cov: 42 | @ go get -v github.com/axw/gocov/gocov 43 | @ go get golang.org/x/tools/cmd/cover 44 | gocov test | gocov report 45 | 46 | clean: 47 | $(foreach pkg,$(PKGS),go clean $(pkg) || exit;) 48 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/change.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 go-dockerclient authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package docker 6 | 7 | import "fmt" 8 | 9 | // ChangeType is a type for constants indicating the type of change 10 | // in a container 11 | type ChangeType int 12 | 13 | const ( 14 | // ChangeModify is the ChangeType for container modifications 15 | ChangeModify ChangeType = iota 16 | 17 | // ChangeAdd is the ChangeType for additions to a container 18 | ChangeAdd 19 | 20 | // ChangeDelete is the ChangeType for deletions from a container 21 | ChangeDelete 22 | ) 23 | 24 | // Change represents a change in a container. 25 | // 26 | // See https://goo.gl/9GsTIF for more details. 27 | type Change struct { 28 | Path string 29 | Kind ChangeType 30 | } 31 | 32 | func (change *Change) String() string { 33 | var kind string 34 | switch change.Kind { 35 | case ChangeModify: 36 | kind = "C" 37 | case ChangeAdd: 38 | kind = "A" 39 | case ChangeDelete: 40 | kind = "D" 41 | } 42 | return fmt.Sprintf("%s %s", kind, change.Path) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # (Unreleased) 2 | 3 | logrus/core: improve performance of text formatter by 40% 4 | logrus/core: expose `LevelHooks` type 5 | 6 | # 0.8.2 7 | 8 | logrus: fix more Fatal family functions 9 | 10 | # 0.8.1 11 | 12 | logrus: fix not exiting on `Fatalf` and `Fatalln` 13 | 14 | # 0.8.0 15 | 16 | logrus: defaults to stderr instead of stdout 17 | hooks/sentry: add special field for `*http.Request` 18 | formatter/text: ignore Windows for colors 19 | 20 | # 0.7.3 21 | 22 | formatter/\*: allow configuration of timestamp layout 23 | 24 | # 0.7.2 25 | 26 | formatter/text: Add configuration option for time format (#158) 27 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type JSONFormatter struct { 9 | // TimestampFormat sets the format used for marshaling timestamps. 10 | TimestampFormat string 11 | } 12 | 13 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 14 | data := make(Fields, len(entry.Data)+3) 15 | for k, v := range entry.Data { 16 | switch v := v.(type) { 17 | case error: 18 | // Otherwise errors are ignored by `encoding/json` 19 | // https://github.com/Sirupsen/logrus/issues/137 20 | data[k] = v.Error() 21 | default: 22 | data[k] = v 23 | } 24 | } 25 | prefixFieldClashes(data) 26 | 27 | timestampFormat := f.TimestampFormat 28 | if timestampFormat == "" { 29 | timestampFormat = DefaultTimestampFormat 30 | } 31 | 32 | data["time"] = entry.Time.Format(timestampFormat) 33 | data["msg"] = entry.Message 34 | data["level"] = entry.Level.String() 35 | 36 | serialized, err := json.Marshal(data) 37 | if err != nil { 38 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 39 | } 40 | return append(serialized, '\n'), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | 3 | package logrus 4 | 5 | import "syscall" 6 | 7 | const ioctlReadTermios = syscall.TIOCGETA 8 | 9 | type Termios syscall.Termios 10 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_freebsd.go: -------------------------------------------------------------------------------- 1 | /* 2 | Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin. 3 | */ 4 | package logrus 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios struct { 13 | Iflag uint32 14 | Oflag uint32 15 | Cflag uint32 16 | Lflag uint32 17 | Cc [20]uint8 18 | Ispeed uint32 19 | Ospeed uint32 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTerminal returns true if the given file descriptor is a terminal. 16 | func IsTerminal() bool { 17 | fd := syscall.Stdout 18 | var termios Termios 19 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 20 | return err == 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_openbsd.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import "syscall" 4 | 5 | const ioctlReadTermios = syscall.TIOCGETA 6 | 7 | type Termios syscall.Termios 8 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if the given file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stdout 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() *io.PipeWriter { 10 | reader, writer := io.Pipe() 11 | 12 | go logger.writerScanner(reader) 13 | runtime.SetFinalizer(writer, writerFinalizer) 14 | 15 | return writer 16 | } 17 | 18 | func (logger *Logger) writerScanner(reader *io.PipeReader) { 19 | scanner := bufio.NewScanner(reader) 20 | for scanner.Scan() { 21 | logger.Print(scanner.Text()) 22 | } 23 | if err := scanner.Err(); err != nil { 24 | logger.Errorf("Error while reading from Writer: %s", err) 25 | } 26 | reader.Close() 27 | } 28 | 29 | func writerFinalizer(writer *io.PipeWriter) { 30 | writer.Close() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package opts 4 | 5 | import "fmt" 6 | 7 | var DefaultHost = fmt.Sprintf("unix://%s", DefaultUnixSocket) 8 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package opts 4 | 5 | import "fmt" 6 | 7 | var DefaultHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultHTTPPort) 8 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/ip.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // IpOpt type that hold an IP 9 | type IpOpt struct { 10 | *net.IP 11 | } 12 | 13 | func NewIpOpt(ref *net.IP, defaultVal string) *IpOpt { 14 | o := &IpOpt{ 15 | IP: ref, 16 | } 17 | o.Set(defaultVal) 18 | return o 19 | } 20 | 21 | func (o *IpOpt) Set(val string) error { 22 | ip := net.ParseIP(val) 23 | if ip == nil { 24 | return fmt.Errorf("%s is not an ip address", val) 25 | } 26 | *o.IP = ip 27 | return nil 28 | } 29 | 30 | func (o *IpOpt) String() string { 31 | if *o.IP == nil { 32 | return "" 33 | } 34 | return o.IP.String() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/ulimit.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ulimit" 7 | ) 8 | 9 | type UlimitOpt struct { 10 | values *map[string]*ulimit.Ulimit 11 | } 12 | 13 | func NewUlimitOpt(ref *map[string]*ulimit.Ulimit) *UlimitOpt { 14 | if ref == nil { 15 | ref = &map[string]*ulimit.Ulimit{} 16 | } 17 | return &UlimitOpt{ref} 18 | } 19 | 20 | func (o *UlimitOpt) Set(val string) error { 21 | l, err := ulimit.Parse(val) 22 | if err != nil { 23 | return err 24 | } 25 | 26 | (*o.values)[l.Name] = l 27 | 28 | return nil 29 | } 30 | 31 | func (o *UlimitOpt) String() string { 32 | var out []string 33 | for _, v := range *o.values { 34 | out = append(out, v.String()) 35 | } 36 | 37 | return fmt.Sprintf("%v", out) 38 | } 39 | 40 | func (o *UlimitOpt) GetList() []*ulimit.Ulimit { 41 | var ulimits []*ulimit.Ulimit 42 | for _, v := range *o.values { 43 | ulimits = append(ulimits, v) 44 | } 45 | 46 | return ulimits 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/README.md: -------------------------------------------------------------------------------- 1 | This code provides helper functions for dealing with archive files. 2 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "syscall" 7 | 8 | "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system" 9 | ) 10 | 11 | func statDifferent(oldStat *system.Stat_t, newStat *system.Stat_t) bool { 12 | // Don't look at size for dirs, its not a good measure of change 13 | if oldStat.Mode() != newStat.Mode() || 14 | oldStat.Uid() != newStat.Uid() || 15 | oldStat.Gid() != newStat.Gid() || 16 | oldStat.Rdev() != newStat.Rdev() || 17 | // Don't look at size for dirs, its not a good measure of change 18 | (oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR && 19 | (!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) { 20 | return true 21 | } 22 | return false 23 | } 24 | 25 | func (info *FileInfo) isDir() bool { 26 | return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system" 5 | ) 6 | 7 | func statDifferent(oldStat *system.Stat_t, newStat *system.Stat_t) bool { 8 | 9 | // Don't look at size for dirs, its not a good measure of change 10 | if oldStat.ModTime() != newStat.ModTime() || 11 | oldStat.Mode() != newStat.Mode() || 12 | oldStat.Size() != newStat.Size() && !oldStat.IsDir() { 13 | return true 14 | } 15 | return false 16 | } 17 | 18 | func (info *FileInfo) isDir() bool { 19 | return info.parent == nil || info.stat.IsDir() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "path/filepath" 7 | ) 8 | 9 | func normalizePath(path string) string { 10 | return filepath.ToSlash(path) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | func normalizePath(path string) string { 8 | return filepath.FromSlash(path) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/time_linux.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "syscall" 5 | "time" 6 | ) 7 | 8 | func timeToTimespec(time time.Time) (ts syscall.Timespec) { 9 | if time.IsZero() { 10 | // Return UTIME_OMIT special value 11 | ts.Sec = 0 12 | ts.Nsec = ((1 << 30) - 2) 13 | return 14 | } 15 | return syscall.NsecToTimespec(time.UnixNano()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/time_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package archive 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | func timeToTimespec(time time.Time) (ts syscall.Timespec) { 11 | nsec := int64(0) 12 | if !time.IsZero() { 13 | nsec = time.UnixNano() 14 | } 15 | return syscall.NsecToTimespec(nsec) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/fmt.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | // FprintfIfNotEmpty prints the string value if it's not empty 9 | func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) { 10 | if value != "" { 11 | return fmt.Fprintf(w, format, value) 12 | } 13 | return 0, nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/scheduler.go: -------------------------------------------------------------------------------- 1 | // +build !gccgo 2 | 3 | package ioutils 4 | 5 | func callSchedulerIfNecessary() { 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/scheduler_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build gccgo 2 | 3 | package ioutils 4 | 5 | import ( 6 | "runtime" 7 | ) 8 | 9 | func callSchedulerIfNecessary() { 10 | //allow or force Go scheduler to switch context, without explicitly 11 | //forcing this will make it hang when using gccgo implementation 12 | runtime.Gosched() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/writeflusher.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "sync" 7 | ) 8 | 9 | type WriteFlusher struct { 10 | sync.Mutex 11 | w io.Writer 12 | flusher http.Flusher 13 | flushed bool 14 | } 15 | 16 | func (wf *WriteFlusher) Write(b []byte) (n int, err error) { 17 | wf.Lock() 18 | defer wf.Unlock() 19 | n, err = wf.w.Write(b) 20 | wf.flushed = true 21 | wf.flusher.Flush() 22 | return n, err 23 | } 24 | 25 | // Flush the stream immediately. 26 | func (wf *WriteFlusher) Flush() { 27 | wf.Lock() 28 | defer wf.Unlock() 29 | wf.flushed = true 30 | wf.flusher.Flush() 31 | } 32 | 33 | func (wf *WriteFlusher) Flushed() bool { 34 | wf.Lock() 35 | defer wf.Unlock() 36 | return wf.flushed 37 | } 38 | 39 | func NewWriteFlusher(w io.Writer) *WriteFlusher { 40 | var flusher http.Flusher 41 | if f, ok := w.(http.Flusher); ok { 42 | flusher = f 43 | } else { 44 | flusher = &NopFlusher{} 45 | } 46 | return &WriteFlusher{w: w, flusher: flusher} 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise/promise.go: -------------------------------------------------------------------------------- 1 | package promise 2 | 3 | // Go is a basic promise implementation: it wraps calls a function in a goroutine, 4 | // and returns a channel which will later return the function's return value. 5 | func Go(f func() error) chan error { 6 | ch := make(chan error, 1) 7 | go func() { 8 | ch <- f() 9 | }() 10 | return ch 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/errors.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | ErrNotSupportedPlatform = errors.New("platform and architecture is not supported") 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/filesys.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | func MkdirAll(path string, perm os.FileMode) error { 10 | return os.MkdirAll(path, perm) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/lstat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Lstat takes a path to a file and returns 10 | // a system.Stat_t type pertaining to that file. 11 | // 12 | // Throws an error if the file does not exist 13 | func Lstat(path string) (*Stat_t, error) { 14 | s := &syscall.Stat_t{} 15 | if err := syscall.Lstat(path, s); err != nil { 16 | return nil, err 17 | } 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/lstat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // Some explanation for my own sanity, and hopefully maintainers in the 10 | // future. 11 | // 12 | // Lstat calls os.Lstat to get a fileinfo interface back. 13 | // This is then copied into our own locally defined structure. 14 | // Note the Linux version uses fromStatT to do the copy back, 15 | // but that not strictly necessary when already in an OS specific module. 16 | 17 | func Lstat(path string) (*Stat_t, error) { 18 | fi, err := os.Lstat(path) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | return &Stat_t{ 24 | name: fi.Name(), 25 | size: fi.Size(), 26 | mode: fi.Mode(), 27 | modTime: fi.ModTime(), 28 | isDir: fi.IsDir()}, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // MemInfo contains memory statistics of the host system. 4 | type MemInfo struct { 5 | // Total usable RAM (i.e. physical RAM minus a few reserved bits and the 6 | // kernel binary code). 7 | MemTotal int64 8 | 9 | // Amount of free memory. 10 | MemFree int64 11 | 12 | // Total amount of swap space available. 13 | SwapTotal int64 14 | 15 | // Amount of swap space that is currently unused. 16 | SwapFree int64 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows 2 | 3 | package system 4 | 5 | func ReadMemInfo() (*MemInfo, error) { 6 | return nil, ErrNotSupportedPlatform 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/mknod.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Mknod creates a filesystem node (file, device special file or named pipe) named path 10 | // with attributes specified by mode and dev 11 | func Mknod(path string, mode uint32, dev int) error { 12 | return syscall.Mknod(path, mode, dev) 13 | } 14 | 15 | // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. 16 | // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, 17 | // then the top 12 bits of the minor 18 | func Mkdev(major int64, minor int64) uint32 { 19 | return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/mknod_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | func Mknod(path string, mode uint32, dev int) error { 6 | return ErrNotSupportedPlatform 7 | } 8 | 9 | func Mkdev(major int64, minor int64) uint32 { 10 | panic("Mkdev not implemented on Windows.") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Stat_t type contains status of a file. It contains metadata 10 | // like permission, owner, group, size, etc about a file 11 | type Stat_t struct { 12 | mode uint32 13 | uid uint32 14 | gid uint32 15 | rdev uint64 16 | size int64 17 | mtim syscall.Timespec 18 | } 19 | 20 | func (s Stat_t) Mode() uint32 { 21 | return s.mode 22 | } 23 | 24 | func (s Stat_t) Uid() uint32 { 25 | return s.uid 26 | } 27 | 28 | func (s Stat_t) Gid() uint32 { 29 | return s.gid 30 | } 31 | 32 | func (s Stat_t) Rdev() uint64 { 33 | return s.rdev 34 | } 35 | 36 | func (s Stat_t) Size() int64 { 37 | return s.size 38 | } 39 | 40 | func (s Stat_t) Mtim() syscall.Timespec { 41 | return s.mtim 42 | } 43 | 44 | func (s Stat_t) GetLastModification() syscall.Timespec { 45 | return s.Mtim() 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*Stat_t, error) { 9 | return &Stat_t{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // Stat takes a path to a file and returns 18 | // a system.Stat_t type pertaining to that file. 19 | // 20 | // Throws an error if the file does not exist 21 | func Stat(path string) (*Stat_t, error) { 22 | s := &syscall.Stat_t{} 23 | if err := syscall.Stat(path, s); err != nil { 24 | return nil, err 25 | } 26 | return fromStatT(s) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*Stat_t, error) { 9 | return &Stat_t{size: s.Size, 10 | mode: s.Mode, 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: s.Rdev, 14 | mtim: s.Mtim}, nil 15 | } 16 | 17 | // FromStatT exists only on linux, and loads a system.Stat_t from a 18 | // syscal.Stat_t. 19 | func FromStatT(s *syscall.Stat_t) (*Stat_t, error) { 20 | return fromStatT(s) 21 | } 22 | 23 | // Stat takes a path to a file and returns 24 | // a system.Stat_t type pertaining to that file. 25 | // 26 | // Throws an error if the file does not exist 27 | func Stat(path string) (*Stat_t, error) { 28 | s := &syscall.Stat_t{} 29 | if err := syscall.Stat(path, s); err != nil { 30 | return nil, err 31 | } 32 | return fromStatT(s) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.Stat_t type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*Stat_t, error) { 11 | return &Stat_t{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtimespec}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "time" 8 | ) 9 | 10 | type Stat_t struct { 11 | name string 12 | size int64 13 | mode os.FileMode 14 | modTime time.Time 15 | isDir bool 16 | } 17 | 18 | func (s Stat_t) Name() string { 19 | return s.name 20 | } 21 | 22 | func (s Stat_t) Size() int64 { 23 | return s.size 24 | } 25 | 26 | func (s Stat_t) Mode() os.FileMode { 27 | return s.mode 28 | } 29 | 30 | func (s Stat_t) ModTime() time.Time { 31 | return s.modTime 32 | } 33 | 34 | func (s Stat_t) IsDir() bool { 35 | return s.isDir 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/umask.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | func Umask(newmask int) (oldmask int, err error) { 10 | return syscall.Umask(newmask), nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/umask_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | func Umask(newmask int) (oldmask int, err error) { 6 | // should not be called on cli code path 7 | return 0, ErrNotSupportedPlatform 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_darwin.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | func LUtimesNano(path string, ts []syscall.Timespec) error { 6 | return ErrNotSupportedPlatform 7 | } 8 | 9 | func UtimesNano(path string, ts []syscall.Timespec) error { 10 | return syscall.UtimesNano(path, ts) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | func LUtimesNano(path string, ts []syscall.Timespec) error { 9 | var _path *byte 10 | _path, err := syscall.BytePtrFromString(path) 11 | if err != nil { 12 | return err 13 | } 14 | 15 | if _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS { 16 | return err 17 | } 18 | 19 | return nil 20 | } 21 | 22 | func UtimesNano(path string, ts []syscall.Timespec) error { 23 | return syscall.UtimesNano(path, ts) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | func LUtimesNano(path string, ts []syscall.Timespec) error { 9 | // These are not currently available in syscall 10 | AT_FDCWD := -100 11 | AT_SYMLINK_NOFOLLOW := 0x100 12 | 13 | var _path *byte 14 | _path, err := syscall.BytePtrFromString(path) 15 | if err != nil { 16 | return err 17 | } 18 | 19 | if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(AT_FDCWD), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(AT_SYMLINK_NOFOLLOW), 0, 0); err != 0 && err != syscall.ENOSYS { 20 | return err 21 | } 22 | 23 | return nil 24 | } 25 | 26 | func UtimesNano(path string, ts []syscall.Timespec) error { 27 | return syscall.UtimesNano(path, ts) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/utimes_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!darwin 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | func LUtimesNano(path string, ts []syscall.Timespec) error { 8 | return ErrNotSupportedPlatform 9 | } 10 | 11 | func UtimesNano(path string, ts []syscall.Timespec) error { 12 | return ErrNotSupportedPlatform 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/xattrs_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | func Lgetxattr(path string, attr string) ([]byte, error) { 6 | return nil, ErrNotSupportedPlatform 7 | } 8 | 9 | func Lsetxattr(path string, attr string, data []byte, flags int) error { 10 | return ErrNotSupportedPlatform 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Tianon Gravi (@tianon) 2 | Aleksa Sarai (@cyphar) 3 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 2 | 3 | package user 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // Unix-specific path to the passwd and group formatted files. 11 | const ( 12 | unixPasswdPath = "/etc/passwd" 13 | unixGroupPath = "/etc/group" 14 | ) 15 | 16 | func GetPasswdPath() (string, error) { 17 | return unixPasswdPath, nil 18 | } 19 | 20 | func GetPasswd() (io.ReadCloser, error) { 21 | return os.Open(unixPasswdPath) 22 | } 23 | 24 | func GetGroupPath() (string, error) { 25 | return unixGroupPath, nil 26 | } 27 | 28 | func GetGroup() (io.ReadCloser, error) { 29 | return os.Open(unixGroupPath) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/lookup_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 2 | 3 | package user 4 | 5 | import "io" 6 | 7 | func GetPasswdPath() (string, error) { 8 | return "", ErrUnsupported 9 | } 10 | 11 | func GetPasswd() (io.ReadCloser, error) { 12 | return nil, ErrUnsupported 13 | } 14 | 15 | func GetGroupPath() (string, error) { 16 | return "", ErrUnsupported 17 | } 18 | 19 | func GetGroup() (io.ReadCloser, error) { 20 | return nil, ErrUnsupported 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gocraft/web/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Jonathan Novak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/gocraft/web/cover.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | go test -covermode=count -coverprofile=count.out . 4 | go tool cover -html=count.out 5 | go tool cover -func=count.out -------------------------------------------------------------------------------- /vendor/github.com/gocraft/web/logger_middleware.go: -------------------------------------------------------------------------------- 1 | package web 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "time" 7 | ) 8 | 9 | // Logger can be set to your own logger. Logger only applies to the LoggerMiddleware. 10 | var Logger = log.New(os.Stdout, "", 0) 11 | 12 | // LoggerMiddleware is generic middleware that will log requests to Logger (by default, Stdout). 13 | func LoggerMiddleware(rw ResponseWriter, req *Request, next NextMiddlewareFunc) { 14 | startTime := time.Now() 15 | 16 | next(rw, req) 17 | 18 | duration := time.Since(startTime).Nanoseconds() 19 | var durationUnits string 20 | switch { 21 | case duration > 2000000: 22 | durationUnits = "ms" 23 | duration /= 1000000 24 | case duration > 1000: 25 | durationUnits = "μs" 26 | duration /= 1000 27 | default: 28 | durationUnits = "ns" 29 | } 30 | 31 | Logger.Printf("[%d %s] %d '%s'\n", duration, durationUnits, rw.StatusCode(), req.URL.Path) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/gocraft/web/options_handler.go: -------------------------------------------------------------------------------- 1 | package web 2 | 3 | import ( 4 | "net/http" 5 | "reflect" 6 | "strings" 7 | ) 8 | 9 | func (r *Router) genericOptionsHandler(ctx reflect.Value, methods []string) func(rw ResponseWriter, req *Request) { 10 | return func(rw ResponseWriter, req *Request) { 11 | if r.optionsHandler.IsValid() { 12 | invoke(r.optionsHandler, ctx, []reflect.Value{reflect.ValueOf(rw), reflect.ValueOf(req), reflect.ValueOf(methods)}) 13 | } else { 14 | rw.Header().Add("Access-Control-Allow-Methods", strings.Join(methods, ", ")) 15 | rw.WriteHeader(http.StatusOK) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gocraft/web/panic_handler.go: -------------------------------------------------------------------------------- 1 | package web 2 | 3 | import ( 4 | "log" 5 | "os" 6 | ) 7 | 8 | // PanicReporter can receive panics that happen when serving a request and report them to a log of some sort. 9 | type PanicReporter interface { 10 | // Panic is called with the URL of the request, the result of calling recover, and the stack. 11 | Panic(url string, err interface{}, stack string) 12 | } 13 | 14 | // PanicHandler will be logged to in panic conditions (eg, division by zero in an app handler). 15 | // Applications can set web.PanicHandler = your own logger, if they wish. 16 | // In terms of logging the requests / responses, see logger_middleware. That is a completely separate system. 17 | var PanicHandler = PanicReporter(logPanicReporter{ 18 | log: log.New(os.Stderr, "ERROR ", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile), 19 | }) 20 | 21 | type logPanicReporter struct { 22 | log *log.Logger 23 | } 24 | 25 | func (l logPanicReporter) Panic(url string, err interface{}, stack string) { 26 | l.log.Printf("PANIC\nURL: %v\nERROR: %v\nSTACK:\n%s\n", url, err, stack) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/google/gofuzz/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 Google Inc. All rights reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package fuzz is a library for populating go objects with random values. 18 | package fuzz 19 | -------------------------------------------------------------------------------- /vendor/github.com/howeyc/gopass/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Chris Howey 2 | 3 | Permission to use, copy, modify, and distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/howeyc/gopass/README.md: -------------------------------------------------------------------------------- 1 | # getpasswd in Go [![GoDoc](https://godoc.org/github.com/howeyc/gopass?status.svg)](https://godoc.org/github.com/howeyc/gopass) [![Build Status](https://secure.travis-ci.org/howeyc/gopass.png?branch=master)](http://travis-ci.org/howeyc/gopass) 2 | 3 | Retrieve password from user terminal or piped input without echo. 4 | 5 | Verified on BSD, Linux, and Windows. 6 | 7 | Example: 8 | ```go 9 | package main 10 | 11 | import "fmt" 12 | import "github.com/howeyc/gopass" 13 | 14 | func main() { 15 | fmt.Printf("Password: ") 16 | 17 | // Silent. For printing *'s use gopass.GetPasswdMasked() 18 | pass, err := gopass.GetPasswd() 19 | if err != nil { 20 | // Handle gopass.ErrInterrupted or getch() read error 21 | } 22 | 23 | // Do something with pass 24 | } 25 | ``` 26 | 27 | Caution: Multi-byte characters not supported! 28 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 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 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pretty/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2012 Keith Rarick 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pretty/Readme: -------------------------------------------------------------------------------- 1 | package pretty 2 | 3 | import "github.com/kr/pretty" 4 | 5 | Package pretty provides pretty-printing for Go values. 6 | 7 | Documentation 8 | 9 | http://godoc.org/github.com/kr/pretty 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pretty/zero.go: -------------------------------------------------------------------------------- 1 | package pretty 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | func nonzero(v reflect.Value) bool { 8 | switch v.Kind() { 9 | case reflect.Bool: 10 | return v.Bool() 11 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 12 | return v.Int() != 0 13 | case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 14 | return v.Uint() != 0 15 | case reflect.Float32, reflect.Float64: 16 | return v.Float() != 0 17 | case reflect.Complex64, reflect.Complex128: 18 | return v.Complex() != complex(0, 0) 19 | case reflect.String: 20 | return v.String() != "" 21 | case reflect.Struct: 22 | for i := 0; i < v.NumField(); i++ { 23 | if nonzero(getField(v, i)) { 24 | return true 25 | } 26 | } 27 | return false 28 | case reflect.Array: 29 | for i := 0; i < v.Len(); i++ { 30 | if nonzero(v.Index(i)) { 31 | return true 32 | } 33 | } 34 | return false 35 | case reflect.Map, reflect.Interface, reflect.Slice, reflect.Ptr, reflect.Chan, reflect.Func: 36 | return !v.IsNil() 37 | case reflect.UnsafePointer: 38 | return v.Pointer() != 0 39 | } 40 | return true 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/kr/text/License: -------------------------------------------------------------------------------- 1 | Copyright 2012 Keith Rarick 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/kr/text/Readme: -------------------------------------------------------------------------------- 1 | This is a Go package for manipulating paragraphs of text. 2 | 3 | See http://go.pkgdoc.org/github.com/kr/text for full documentation. 4 | -------------------------------------------------------------------------------- /vendor/github.com/kr/text/doc.go: -------------------------------------------------------------------------------- 1 | // Package text provides rudimentary functions for manipulating text in 2 | // paragraphs. 3 | package text 4 | -------------------------------------------------------------------------------- /vendor/github.com/looplab/fsm/wercker.yml: -------------------------------------------------------------------------------- 1 | box: wercker/golang 2 | 3 | build: 4 | steps: 5 | # Sets the go workspace and places you package 6 | # at the right place in the workspace tree 7 | - setup-go-workspace 8 | 9 | # Gets the dependencies 10 | - script: 11 | name: go get 12 | code: | 13 | cd $WERCKER_SOURCE_DIR 14 | go version 15 | go get -t ./... 16 | 17 | # Build the project 18 | - script: 19 | name: go build 20 | code: | 21 | go build ./... 22 | 23 | # Test the project 24 | - script: 25 | name: go test 26 | code: | 27 | go get golang.org/x/tools/cmd/cover 28 | go get github.com/axw/gocov/gocov 29 | go get github.com/mattn/goveralls 30 | git checkout master 31 | goveralls -service wercker.com -repotoken $COVERALLS_TOKEN 32 | -------------------------------------------------------------------------------- /vendor/github.com/magiconair/properties/rangecheck.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2014 Frank Schroeder. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package properties 6 | 7 | import ( 8 | "fmt" 9 | "math" 10 | ) 11 | 12 | // make this a var to overwrite it in a test 13 | var is32Bit = ^uint(0) == math.MaxUint32 14 | 15 | // intRangeCheck checks if the value fits into the int type and 16 | // panics if it does not. 17 | func intRangeCheck(key string, v int64) int { 18 | if is32Bit && (v < math.MinInt32 || v > math.MaxInt32) { 19 | panic(fmt.Sprintf("Value %d for key %s out of range", v, key)) 20 | } 21 | return int(v) 22 | } 23 | 24 | // uintRangeCheck checks if the value fits into the uint type and 25 | // panics if it does not. 26 | func uintRangeCheck(key string, v uint64) uint { 27 | if is32Bit && v > math.MaxUint32 { 28 | panic(fmt.Sprintf("Value %d for key %s out of range", v, key)) 29 | } 30 | return uint(v) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c: -------------------------------------------------------------------------------- 1 | #ifndef USE_LIBSQLITE3 2 | # include "code/sqlite3-binding.c" 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h: -------------------------------------------------------------------------------- 1 | #ifndef USE_LIBSQLITE3 2 | #include "code/sqlite3-binding.h" 3 | #else 4 | #include 5 | #endif 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_icu.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build icu 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo LDFLAGS: -licuuc -licui18n 11 | #cgo CFLAGS: -DSQLITE_ENABLE_ICU 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_libsqlite3.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build libsqlite3 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DUSE_LIBSQLITE3 11 | #cgo LDFLAGS: -lsqlite3 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_load_extension.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build !sqlite_omit_load_extension 6 | 7 | package sqlite3 8 | 9 | /* 10 | #include 11 | #include 12 | */ 13 | import "C" 14 | import ( 15 | "errors" 16 | "unsafe" 17 | ) 18 | 19 | func (c *SQLiteConn) loadExtensions(extensions []string) error { 20 | rv := C.sqlite3_enable_load_extension(c.db, 1) 21 | if rv != C.SQLITE_OK { 22 | return errors.New(C.GoString(C.sqlite3_errmsg(c.db))) 23 | } 24 | 25 | for _, extension := range extensions { 26 | cext := C.CString(extension) 27 | defer C.free(unsafe.Pointer(cext)) 28 | rv = C.sqlite3_load_extension(c.db, cext, nil, nil) 29 | if rv != C.SQLITE_OK { 30 | return errors.New(C.GoString(C.sqlite3_errmsg(c.db))) 31 | } 32 | } 33 | 34 | rv = C.sqlite3_enable_load_extension(c.db, 0) 35 | if rv != C.SQLITE_OK { 36 | return errors.New(C.GoString(C.sqlite3_errmsg(c.db))) 37 | } 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_omit_load_extension.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build sqlite_omit_load_extension 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -DSQLITE_OMIT_LOAD_EXTENSION 11 | */ 12 | import "C" 13 | import ( 14 | "errors" 15 | ) 16 | 17 | func (c *SQLiteConn) loadExtensions(extensions []string) error { 18 | return errors.New("Extensions have been disabled for static builds") 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_other.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build !windows 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -I. 11 | #cgo linux LDFLAGS: -ldl 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | // +build windows 6 | 7 | package sqlite3 8 | 9 | /* 10 | #cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe 11 | #cgo windows,386 CFLAGS: -D_localtime32=localtime 12 | #cgo LDFLAGS: -lmingwex -lmingw32 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.0.0-rc1 (2016-02-11) 4 | 5 | Time flies and it has been three years since this package was first released. 6 | There have been a couple of API changes I have wanted to do for some time but 7 | I've tried to maintain backwards compatibility. Some inconsistencies in the 8 | API have started to show, proper vendor support in Go out of the box and 9 | the fact that `go vet` will give warnings -- I have decided to bump the major 10 | version. 11 | 12 | * Make eg. `Info` and `Infof` do different things. You want to change all calls 13 | to `Info` with a string format go to `Infof` etc. In many cases, `go vet` will 14 | guide you. 15 | * `Id` in `Record` is now called `ID` 16 | 17 | ## 1.0.0 (2013-02-21) 18 | 19 | Initial release 20 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Alec Thomas 2 | Guilhem Lettron 3 | Ivan Daniluk 4 | Nimi Wariboko Jr 5 | Róbert Selvek 6 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/syslog_fallback.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build windows plan9 6 | 7 | package logging 8 | 9 | import ( 10 | "fmt" 11 | ) 12 | 13 | type Priority int 14 | 15 | type SyslogBackend struct { 16 | } 17 | 18 | func NewSyslogBackend(prefix string) (b *SyslogBackend, err error) { 19 | return nil, fmt.Errorf("Platform does not support syslog") 20 | } 21 | 22 | func NewSyslogBackendPriority(prefix string, priority Priority) (b *SyslogBackend, err error) { 23 | return nil, fmt.Errorf("Platform does not support syslog") 24 | } 25 | 26 | func (b *SyslogBackend) Log(level Level, calldepth int, rec *Record) error { 27 | return fmt.Errorf("Platform does not support syslog") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/README.md: -------------------------------------------------------------------------------- 1 | # sanitized_anchor_name [![Build Status](https://travis-ci.org/shurcooL/sanitized_anchor_name.svg?branch=master)](https://travis-ci.org/shurcooL/sanitized_anchor_name) [![GoDoc](https://godoc.org/github.com/shurcooL/sanitized_anchor_name?status.svg)](https://godoc.org/github.com/shurcooL/sanitized_anchor_name) 2 | 3 | Package sanitized_anchor_name provides a func to create sanitized anchor names. 4 | 5 | Its logic can be reused by multiple packages to create interoperable anchor names and links to those anchors. 6 | 7 | At this time, it does not try to ensure that generated anchor names are unique, that responsibility falls on the caller. 8 | 9 | Installation 10 | ------------ 11 | 12 | ```bash 13 | go get -u github.com/shurcooL/sanitized_anchor_name 14 | ``` 15 | 16 | Example 17 | ------- 18 | 19 | ```Go 20 | anchorName := sanitized_anchor_name.Create("This is a header") 21 | 22 | fmt.Println(anchorName) 23 | 24 | // Output: 25 | // this-is-a-header 26 | ``` 27 | 28 | License 29 | ------- 30 | 31 | - [MIT License](http://opensource.org/licenses/mit-license.php) 32 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/sanitized_anchor_name/main.go: -------------------------------------------------------------------------------- 1 | // Package sanitized_anchor_name provides a func to create sanitized anchor names. 2 | // 3 | // Its logic can be reused by multiple packages to create interoperable anchor names 4 | // and links to those anchors. 5 | // 6 | // At this time, it does not try to ensure that generated anchor names 7 | // are unique, that responsibility falls on the caller. 8 | package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" 9 | 10 | import "unicode" 11 | 12 | // Create returns a sanitized anchor name for the given text. 13 | func Create(text string) string { 14 | var anchorName []rune 15 | var futureDash = false 16 | for _, r := range []rune(text) { 17 | switch { 18 | case unicode.IsLetter(r) || unicode.IsNumber(r): 19 | if futureDash && len(anchorName) > 0 { 20 | anchorName = append(anchorName, '-') 21 | } 22 | futureDash = false 23 | anchorName = append(anchorName, unicode.ToLower(r)) 24 | default: 25 | futureDash = true 26 | } 27 | } 28 | return string(anchorName) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cast/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/man_docs.md: -------------------------------------------------------------------------------- 1 | # Generating Man Pages For Your Own cobra.Command 2 | 3 | Generating bash completions from a cobra command is incredibly easy. An example is as follows: 4 | 5 | ```go 6 | package main 7 | 8 | import ( 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | func main() { 13 | cmd := &cobra.Command{ 14 | Use: "test", 15 | Short: "my test program", 16 | } 17 | header := &cobra.GenManHeader{ 18 | Title: "MINE", 19 | Section: "3", 20 | } 21 | cmd.GenManTree(header, "/tmp") 22 | } 23 | ``` 24 | 25 | That will get you a man page `/tmp/test.1` 26 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/jwalterweatherman/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/spf13/viper/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Steve Francia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Thomas Adam 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/README.md: -------------------------------------------------------------------------------- 1 | # gorocksdb, a Go wrapper for RocksDB 2 | 3 | [![Build Status](https://travis-ci.org/tecbot/gorocksdb.png)](https://travis-ci.org/tecbot/gorocksdb) [![GoDoc](https://godoc.org/github.com/tecbot/gorocksdb?status.png)](http://godoc.org/github.com/tecbot/gorocksdb) 4 | 5 | ## Install 6 | 7 | There exist two options to install gorocksdb. 8 | You can use either a own shared library or you use the embedded RocksDB version from [CockroachDB](https://github.com/cockroachdb/c-rocksdb). 9 | 10 | To install the embedded version (it might take a while): 11 | 12 | go get -tags=embed github.com/tecbot/gorocksdb 13 | 14 | If you want to go the way with the shared library you'll need to build 15 | [RocksDB](https://github.com/facebook/rocksdb) before on your machine. 16 | If you built RocksDB you can install gorocksdb now: 17 | 18 | CGO_CFLAGS="-I/path/to/rocksdb/include" \ 19 | CGO_LDFLAGS="-L/path/to/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" \ 20 | go get github.com/tecbot/gorocksdb -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/cache.go: -------------------------------------------------------------------------------- 1 | package gorocksdb 2 | 3 | // #include "rocksdb/c.h" 4 | import "C" 5 | 6 | // Cache is a cache used to store data read from data in memory. 7 | type Cache struct { 8 | c *C.rocksdb_cache_t 9 | } 10 | 11 | // NewLRUCache creates a new LRU Cache object with the capacity given. 12 | func NewLRUCache(capacity int) *Cache { 13 | return NewNativeCache(C.rocksdb_cache_create_lru(C.size_t(capacity))) 14 | } 15 | 16 | // NewNativeCache creates a Cache object. 17 | func NewNativeCache(c *C.rocksdb_cache_t) *Cache { 18 | return &Cache{c} 19 | } 20 | 21 | // Destroy deallocates the Cache object. 22 | func (c *Cache) Destroy() { 23 | C.rocksdb_cache_destroy(c.c) 24 | c.c = nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/cf_handle.go: -------------------------------------------------------------------------------- 1 | package gorocksdb 2 | 3 | // #include 4 | // #include "rocksdb/c.h" 5 | import "C" 6 | import "unsafe" 7 | 8 | // ColumnFamilyHandle represents a handle to a ColumnFamily. 9 | type ColumnFamilyHandle struct { 10 | c *C.rocksdb_column_family_handle_t 11 | } 12 | 13 | // NewNativeColumnFamilyHandle creates a ColumnFamilyHandle object. 14 | func NewNativeColumnFamilyHandle(c *C.rocksdb_column_family_handle_t) *ColumnFamilyHandle { 15 | return &ColumnFamilyHandle{c} 16 | } 17 | 18 | // UnsafeGetCFHandler returns the underlying c column family handle. 19 | func (h *ColumnFamilyHandle) UnsafeGetCFHandler() unsafe.Pointer { 20 | return unsafe.Pointer(h.c) 21 | } 22 | 23 | // Destroy calls the destructor of the underlying column family handle. 24 | func (h *ColumnFamilyHandle) Destroy() { 25 | C.rocksdb_column_family_handle_destroy(h.c) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/dynflag.go: -------------------------------------------------------------------------------- 1 | // !build embed 2 | 3 | package gorocksdb 4 | 5 | // #cgo LDFLAGS: -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy 6 | import "C" 7 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/embedflag.go: -------------------------------------------------------------------------------- 1 | // +build embed 2 | 3 | package gorocksdb 4 | 5 | // #cgo CXXFLAGS: -std=c++11 6 | // #cgo CPPFLAGS: -I${SRCDIR}/../../cockroachdb/c-lz4/internal/lib 7 | // #cgo CPPFLAGS: -I${SRCDIR}/../../cockroachdb/c-rocksdb/internal/include 8 | // #cgo CPPFLAGS: -I${SRCDIR}/../../cockroachdb/c-snappy/internal 9 | // #cgo LDFLAGS: -lstdc++ 10 | // #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup 11 | // #cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all -lrt 12 | import "C" 13 | 14 | import ( 15 | _ "github.com/cockroachdb/c-lz4" 16 | _ "github.com/cockroachdb/c-rocksdb" 17 | _ "github.com/cockroachdb/c-snappy" 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/gorocksdb.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rocksdb/c.h" 3 | 4 | // This API provides convenient C wrapper functions for rocksdb client. 5 | 6 | /* Base */ 7 | 8 | extern void gorocksdb_destruct_handler(void* state); 9 | 10 | /* CompactionFilter */ 11 | 12 | extern rocksdb_compactionfilter_t* gorocksdb_compactionfilter_create(uintptr_t idx); 13 | 14 | /* Comparator */ 15 | 16 | extern rocksdb_comparator_t* gorocksdb_comparator_create(uintptr_t idx); 17 | 18 | /* Filter Policy */ 19 | 20 | extern rocksdb_filterpolicy_t* gorocksdb_filterpolicy_create(uintptr_t idx); 21 | extern void gorocksdb_filterpolicy_delete_filter(void* state, const char* v, size_t s); 22 | 23 | /* Merge Operator */ 24 | 25 | extern rocksdb_mergeoperator_t* gorocksdb_mergeoperator_create(uintptr_t idx); 26 | extern void gorocksdb_mergeoperator_delete_value(void* state, const char* v, size_t s); 27 | 28 | /* Slice Transform */ 29 | 30 | extern rocksdb_slicetransform_t* gorocksdb_slicetransform_create(uintptr_t idx); 31 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/options_compression.go: -------------------------------------------------------------------------------- 1 | package gorocksdb 2 | 3 | // CompressionOptions represents options for different compression algorithms like Zlib. 4 | type CompressionOptions struct { 5 | WindowBits int 6 | Level int 7 | Strategy int 8 | } 9 | 10 | // NewDefaultCompressionOptions creates a default CompressionOptions object. 11 | func NewDefaultCompressionOptions() *CompressionOptions { 12 | return NewCompressionOptions(-14, -1, 0) 13 | } 14 | 15 | // NewCompressionOptions creates a CompressionOptions object. 16 | func NewCompressionOptions(windowBits, level, strategy int) *CompressionOptions { 17 | return &CompressionOptions{ 18 | WindowBits: windowBits, 19 | Level: level, 20 | Strategy: strategy, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/options_flush.go: -------------------------------------------------------------------------------- 1 | package gorocksdb 2 | 3 | // #include "rocksdb/c.h" 4 | import "C" 5 | 6 | // FlushOptions represent all of the available options when manual flushing the 7 | // database. 8 | type FlushOptions struct { 9 | c *C.rocksdb_flushoptions_t 10 | } 11 | 12 | // NewDefaultFlushOptions creates a default FlushOptions object. 13 | func NewDefaultFlushOptions() *FlushOptions { 14 | return NewNativeFlushOptions(C.rocksdb_flushoptions_create()) 15 | } 16 | 17 | // NewNativeFlushOptions creates a FlushOptions object. 18 | func NewNativeFlushOptions(c *C.rocksdb_flushoptions_t) *FlushOptions { 19 | return &FlushOptions{c} 20 | } 21 | 22 | // SetWait specify if the flush will wait until the flush is done. 23 | // Default: true 24 | func (opts *FlushOptions) SetWait(value bool) { 25 | C.rocksdb_flushoptions_set_wait(opts.c, boolToChar(value)) 26 | } 27 | 28 | // Destroy deallocates the FlushOptions object. 29 | func (opts *FlushOptions) Destroy() { 30 | C.rocksdb_flushoptions_destroy(opts.c) 31 | opts.c = nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/slice.go: -------------------------------------------------------------------------------- 1 | package gorocksdb 2 | 3 | // #include 4 | import "C" 5 | import "unsafe" 6 | 7 | // Slice is used as a wrapper for non-copy values 8 | type Slice struct { 9 | data *C.char 10 | size C.size_t 11 | freed bool 12 | } 13 | 14 | // NewSlice returns a slice with the given data. 15 | func NewSlice(data *C.char, size C.size_t) *Slice { 16 | return &Slice{data, size, false} 17 | } 18 | 19 | // Data returns the data of the slice. 20 | func (s *Slice) Data() []byte { 21 | return charToByte(s.data, s.size) 22 | } 23 | 24 | // Size returns the size of the data. 25 | func (s *Slice) Size() int { 26 | return int(s.size) 27 | } 28 | 29 | // Free frees the slice data. 30 | func (s *Slice) Free() { 31 | if !s.freed { 32 | C.free(unsafe.Pointer(s.data)) 33 | s.freed = true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/tecbot/gorocksdb/snapshot.go: -------------------------------------------------------------------------------- 1 | package gorocksdb 2 | 3 | // #include "rocksdb/c.h" 4 | import "C" 5 | 6 | // Snapshot provides a consistent view of read operations in a DB. 7 | type Snapshot struct { 8 | c *C.rocksdb_snapshot_t 9 | cDb *C.rocksdb_t 10 | } 11 | 12 | // NewNativeSnapshot creates a Snapshot object. 13 | func NewNativeSnapshot(c *C.rocksdb_snapshot_t, cDb *C.rocksdb_t) *Snapshot { 14 | return &Snapshot{c, cDb} 15 | } 16 | 17 | // Release removes the snapshot from the database's list of snapshots. 18 | func (s *Snapshot) Release() { 19 | C.rocksdb_release_snapshot(s.cDb, s.c) 20 | s.c, s.cDb = nil, nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386 appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | */ 18 | package ssh // import "golang.org/x/crypto/ssh" 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "syscall" 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | const ioctlWriteTermios = syscall.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | // These constants are declared here, rather than importing 8 | // them from the syscall package as some syscall packages, even 9 | // on linux, for example gccgo, do not declare them. 10 | const ioctlReadTermios = 0x5401 // syscall.TCGETS 11 | const ioctlWriteTermios = 0x5402 // syscall.TCSETS 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/cmd/cover/README: -------------------------------------------------------------------------------- 1 | NOTE: For Go releases 1.5 and later, this tool lives in the 2 | standard repository. The code here is not maintained. 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/cmd/cover/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Cover is a program for analyzing the coverage profiles generated by 7 | 'go test -coverprofile=cover.out'. 8 | 9 | Cover is also used by 'go test -cover' to rewrite the source code with 10 | annotations to track which parts of each function are executed. 11 | It operates on one Go source file at a time, computing approximate 12 | basic block information by studying the source. It is thus more portable 13 | than binary-rewriting coverage tools, but also a little less capable. 14 | For instance, it does not probe inside && and || expressions, and can 15 | be mildly confused by single statements with multiple function literals. 16 | 17 | For usage information, please see: 18 | go help testflag 19 | go tool cover -help 20 | 21 | No longer maintained: 22 | 23 | For Go releases 1.5 and later, this tool lives in the 24 | standard repository. The code here is not maintained. 25 | 26 | */ 27 | package main // import "golang.org/x/tools/cmd/cover" 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to grpc! Here is some guideline 4 | and information about how to do so. 5 | 6 | ## Getting started 7 | 8 | ### Legal requirements 9 | 10 | In order to protect both you and ourselves, you will need to sign the 11 | [Contributor License Agreement](https://cla.developers.google.com/clas). 12 | 13 | ### Filing Issues 14 | When filing an issue, make sure to answer these five questions: 15 | 16 | 1. What version of Go are you using (`go version`)? 17 | 2. What operating system and processor architecture are you using? 18 | 3. What did you do? 19 | 4. What did you expect to see? 20 | 5. What did you see instead? 21 | 22 | ### Contributing code 23 | Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. 24 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codegen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script serves as an example to demonstrate how to generate the gRPC-Go 4 | # interface and the related messages from .proto file. 5 | # 6 | # It assumes the installation of i) Google proto buffer compiler at 7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen 8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have 9 | # not, please install them first. 10 | # 11 | # We recommend running this script at $GOPATH/src. 12 | # 13 | # If this is not what you need, feel free to make your own scripts. Again, this 14 | # script is for demonstration purpose. 15 | # 16 | proto=$1 17 | protoc --go_out=plugins=grpc:. $proto 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Code; DO NOT EDIT 2 | 3 | package codes 4 | 5 | import "fmt" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i+1 >= Code(len(_Code_index)) { 13 | return fmt.Sprintf("Code(%d)", i) 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package grpc implements an RPC system called gRPC. 3 | 4 | See https://github.com/grpc/grpc for more information about gRPC. 5 | */ 6 | package grpc // import "google.golang.org/grpc" 7 | --------------------------------------------------------------------------------