├── .gitignore ├── CMakeLists.txt ├── CMakeModules ├── FindGperftools.cmake └── cotire.cmake ├── CONTRIBUTORS.txt ├── Doxyfile ├── LICENSE.txt ├── README.md ├── docs ├── .gitignore ├── API.md ├── BUILD_UBUNTU.md ├── BUILD_WIN32.md ├── Blockchain-Objects.md ├── Building-on-OS-X.md ├── CLI-Wallet-Cookbook.md ├── Creating-a-new-FBA.md ├── DEV_README.md ├── Home.md ├── How-To-become-an-active-witness-in-BitShares-2.0.md ├── How-to-setup-your-witness-for-test-net-(Ubuntu-14.04).md ├── Howto-import-an-existing-delegate-as-witness-in-BitShares-2.0.md ├── Howto-propose-committee-actions.md ├── Import-BitShares-0.9.3c-wallets-into-BitShares-2.0-CLI-wallet.md ├── Import-account-to-cli-wallet.md ├── Manage-your-nodes-by-using-gnu-screen.md ├── Monitoring-accounts.md ├── Plasma---Wallet-API.md ├── README-debug_node.md ├── Scripting-websockets-easy.md ├── StealthTransfers.md ├── Testing.md ├── Wallet-2-Factor-Authentication-Protocol.md ├── Wallet-Argument-Format.md ├── Wallet-Backup.md ├── Wallet-Login-Protocol.md ├── Wallet-Merchant-Protocol.md ├── Wallet-Server-Architecture.md ├── Wallet_Full-Nodes_Witness_Nodes.md ├── Web-and-light-wallets-release-procedure.md ├── Websocket-Subscriptions.md ├── architecture.md ├── blacklizard-app-finarch.md ├── blacklizard-app-ideas.md ├── chain-locked-tx.md ├── design-issues.md ├── dpos-slot-tickets.markdown ├── draft-license │ ├── HEADER.draft │ └── LICENSE.draft ├── egenesis.md ├── private-testnet.md ├── public-testnet.md ├── resolvable-bitassets.markdown ├── theoretical-theories.markdown ├── witness-rng.md └── witness-scheduler.md ├── genesis.json ├── gui_version ├── libraries ├── CMakeLists.txt ├── app │ ├── CMakeLists.txt │ ├── api.cpp │ ├── application.cpp │ ├── database_api.cpp │ ├── impacted.cpp │ ├── include │ │ └── graphene │ │ │ └── app │ │ │ ├── api.hpp │ │ │ ├── api_access.hpp │ │ │ ├── application.hpp │ │ │ ├── database_api.hpp │ │ │ ├── full_account.hpp │ │ │ ├── impacted.hpp │ │ │ ├── plugin.hpp │ │ │ └── util.hpp │ ├── plugin.cpp │ └── util.cpp ├── chain │ ├── CMakeLists.txt │ ├── account_evaluator.cpp │ ├── account_object.cpp │ ├── assert_evaluator.cpp │ ├── asset_evaluator.cpp │ ├── asset_object.cpp │ ├── balance_evaluator.cpp │ ├── block_database.cpp │ ├── buyback.cpp │ ├── committee_member_evaluator.cpp │ ├── confidential_evaluator.cpp │ ├── database.cpp │ ├── db_balance.cpp │ ├── db_block.cpp │ ├── db_debug.cpp │ ├── db_getter.cpp │ ├── db_init.cpp │ ├── db_maint.cpp │ ├── db_management.cpp │ ├── db_market.cpp │ ├── db_notify.cpp │ ├── db_update.cpp │ ├── db_witness_schedule.cpp │ ├── evaluator.cpp │ ├── exclusive_permission_evaluator.cpp │ ├── fba_object.cpp │ ├── fork_database.cpp │ ├── genesis_state.cpp │ ├── get_config.cpp │ ├── hardfork.d │ │ ├── 000-200-preamble.hf │ │ ├── 23.hf │ │ ├── 357.hf │ │ ├── 359.hf │ │ ├── 385.hf │ │ ├── 409.hf │ │ ├── 413.hf │ │ ├── 415.hf │ │ ├── 416.hf │ │ ├── 419.hf │ │ ├── 436.hf │ │ ├── 445.hf │ │ ├── 453.hf │ │ ├── 480.hf │ │ ├── 483.hf │ │ ├── 516.hf │ │ ├── 533.hf │ │ ├── 538.hf │ │ ├── 555.hf │ │ ├── 563.hf │ │ ├── 572.hf │ │ ├── 599.hf │ │ ├── 607.hf │ │ ├── 613.hf │ │ ├── 615.hf │ │ ├── CORE_216.hf │ │ ├── CORE_429.hf │ │ └── core-143.hf │ ├── include │ │ └── graphene │ │ │ └── chain │ │ │ ├── account_evaluator.hpp │ │ │ ├── account_object.hpp │ │ │ ├── assert_evaluator.hpp │ │ │ ├── asset_evaluator.hpp │ │ │ ├── asset_object.hpp │ │ │ ├── balance_evaluator.hpp │ │ │ ├── balance_object.hpp │ │ │ ├── block_database.hpp │ │ │ ├── block_summary_object.hpp │ │ │ ├── budget_record_object.hpp │ │ │ ├── buyback.hpp │ │ │ ├── buyback_object.hpp │ │ │ ├── chain_property_object.hpp │ │ │ ├── committee_member_evaluator.hpp │ │ │ ├── committee_member_object.hpp │ │ │ ├── confidential_evaluator.hpp │ │ │ ├── confidential_object.hpp │ │ │ ├── config.hpp │ │ │ ├── custom_evaluator.hpp │ │ │ ├── database.hpp │ │ │ ├── db_with.hpp │ │ │ ├── evaluator.hpp │ │ │ ├── exceptions.hpp │ │ │ ├── exclusive_permission_evaluator.hpp │ │ │ ├── exclusive_permission_object.hpp │ │ │ ├── fba_accumulator_id.hpp │ │ │ ├── fba_object.hpp │ │ │ ├── fork_database.hpp │ │ │ ├── genesis_state.hpp │ │ │ ├── get_config.hpp │ │ │ ├── global_property_object.hpp │ │ │ ├── immutable_chain_parameters.hpp │ │ │ ├── internal_exceptions.hpp │ │ │ ├── invoice_evaluator.hpp │ │ │ ├── invoice_object.hpp │ │ │ ├── invoice_payment_evaluator.hpp │ │ │ ├── invoice_payment_object.hpp │ │ │ ├── is_authorized_asset.hpp │ │ │ ├── market_evaluator.hpp │ │ │ ├── market_object.hpp │ │ │ ├── node_property_object.hpp │ │ │ ├── operation_history_object.hpp │ │ │ ├── permissions_validator.hpp │ │ │ ├── proposal_evaluator.hpp │ │ │ ├── proposal_object.hpp │ │ │ ├── protocol │ │ │ ├── README.md │ │ │ ├── account.hpp │ │ │ ├── address.hpp │ │ │ ├── assert.hpp │ │ │ ├── asset.hpp │ │ │ ├── asset_ops.hpp │ │ │ ├── authority.hpp │ │ │ ├── balance.hpp │ │ │ ├── base.hpp │ │ │ ├── block.hpp │ │ │ ├── buyback.hpp │ │ │ ├── chain_parameters.hpp │ │ │ ├── committee_member.hpp │ │ │ ├── confidential.hpp │ │ │ ├── config.hpp │ │ │ ├── custom.hpp │ │ │ ├── exclusive_permission.hpp │ │ │ ├── ext.hpp │ │ │ ├── fba.hpp │ │ │ ├── fee_schedule.hpp │ │ │ ├── invoice.hpp │ │ │ ├── invoice_payment.hpp │ │ │ ├── market.hpp │ │ │ ├── memo.hpp │ │ │ ├── operations.hpp │ │ │ ├── proposal.hpp │ │ │ ├── protocol.hpp │ │ │ ├── special_authority.hpp │ │ │ ├── transaction.hpp │ │ │ ├── transfer.hpp │ │ │ ├── types.hpp │ │ │ ├── vesting.hpp │ │ │ ├── vindb_block.hpp │ │ │ ├── vote.hpp │ │ │ ├── withdraw_permission.hpp │ │ │ ├── witness.hpp │ │ │ └── worker.hpp │ │ │ ├── pts_address.hpp │ │ │ ├── special_authority.hpp │ │ │ ├── special_authority_object.hpp │ │ │ ├── transaction_evaluation_state.hpp │ │ │ ├── transaction_object.hpp │ │ │ ├── transfer_evaluator.hpp │ │ │ ├── vesting_balance_evaluator.hpp │ │ │ ├── vesting_balance_object.hpp │ │ │ ├── vindb_block_evaluator.hpp │ │ │ ├── vindb_block_object.hpp │ │ │ ├── vote_count.hpp │ │ │ ├── withdraw_permission_evaluator.hpp │ │ │ ├── withdraw_permission_object.hpp │ │ │ ├── witness_evaluator.hpp │ │ │ ├── witness_object.hpp │ │ │ ├── witness_schedule_object.hpp │ │ │ ├── worker_evaluator.hpp │ │ │ └── worker_object.hpp │ ├── index.cpp │ ├── invoice_evaluator.cpp │ ├── invoice_payment_evaluator.cpp │ ├── is_authorized_asset.cpp │ ├── market_evaluator.cpp │ ├── proposal_evaluator.cpp │ ├── proposal_object.cpp │ ├── protocol │ │ ├── account.cpp │ │ ├── address.cpp │ │ ├── assert.cpp │ │ ├── asset.cpp │ │ ├── asset_ops.cpp │ │ ├── authority.cpp │ │ ├── block.cpp │ │ ├── committee_member.cpp │ │ ├── confidential.cpp │ │ ├── custom.cpp │ │ ├── exclusive_permission.cpp │ │ ├── fee_schedule.cpp │ │ ├── invoice.cpp │ │ ├── invoice_payment.cpp │ │ ├── market.cpp │ │ ├── memo.cpp │ │ ├── operations.cpp │ │ ├── proposal.cpp │ │ ├── transaction.cpp │ │ ├── transfer.cpp │ │ ├── types.cpp │ │ ├── vindb_block.cpp │ │ ├── vote.cpp │ │ ├── withdraw_permission.cpp │ │ ├── witness.cpp │ │ └── worker.cpp │ ├── pts_address.cpp │ ├── special_authority.cpp │ ├── transaction_object.cpp │ ├── transfer_evaluator.cpp │ ├── vesting_balance_evaluator.cpp │ ├── vesting_balance_object.cpp │ ├── vindb_block_evaluator.cpp │ ├── withdraw_permission_evaluator.cpp │ ├── witness_evaluator.cpp │ └── worker_evaluator.cpp ├── db │ ├── CMakeLists.txt │ ├── include │ │ └── graphene │ │ │ └── db │ │ │ ├── fwd.hpp │ │ │ ├── generic_index.hpp │ │ │ ├── index.hpp │ │ │ ├── object.hpp │ │ │ ├── object_database.hpp │ │ │ ├── object_id.hpp │ │ │ ├── simple_index.hpp │ │ │ └── undo_database.hpp │ ├── index.cpp │ ├── object_database.cpp │ └── undo_database.cpp ├── deterministic_openssl_rand │ ├── CMakeLists.txt │ ├── deterministic_openssl_rand.cpp │ └── include │ │ └── graphene │ │ └── utilities │ │ └── deterministic_openssl_rand.hpp ├── egenesis │ ├── CMakeLists.txt │ ├── egenesis_brief.cpp.tmpl │ ├── egenesis_full.cpp.tmpl │ ├── egenesis_none.cpp │ ├── embed_genesis.cpp │ └── include │ │ └── graphene │ │ └── egenesis │ │ └── egenesis.hpp ├── fc │ ├── .gitignore │ ├── CMakeLists.txt │ ├── CMakeModules │ │ ├── ArgumentParser.cmake │ │ ├── FindBoost.cmake │ │ ├── FindReadline.cmake │ │ ├── FindVLD.cmake │ │ ├── ParseLibraryList.cmake │ │ ├── SetupTargetMacros.cmake │ │ ├── UseLibraryMacros.cmake │ │ └── VersionMacros.cmake │ ├── GitVersionGen │ │ ├── GetGitRevisionDescription.cmake │ │ └── GetGitRevisionDescription.cmake.in │ ├── README-ecc.md │ ├── README.md │ ├── fc.natvis │ ├── include │ │ └── fc │ │ │ ├── actor.hpp │ │ │ ├── aligned.hpp │ │ │ ├── any.hpp │ │ │ ├── api.hpp │ │ │ ├── array.hpp │ │ │ ├── asio.hpp │ │ │ ├── bitutil.hpp │ │ │ ├── bloom_filter.hpp │ │ │ ├── compress │ │ │ ├── smaz.hpp │ │ │ └── zlib.hpp │ │ │ ├── container │ │ │ ├── deque.hpp │ │ │ ├── deque_fwd.hpp │ │ │ ├── flat.hpp │ │ │ └── flat_fwd.hpp │ │ │ ├── crypto │ │ │ ├── aes.hpp │ │ │ ├── base36.hpp │ │ │ ├── base58.hpp │ │ │ ├── base64.hpp │ │ │ ├── bigint.hpp │ │ │ ├── blowfish.hpp │ │ │ ├── city.hpp │ │ │ ├── dh.hpp │ │ │ ├── digest.hpp │ │ │ ├── elliptic.hpp │ │ │ ├── hex.hpp │ │ │ ├── hmac.hpp │ │ │ ├── openssl.hpp │ │ │ ├── pke.hpp │ │ │ ├── rand.hpp │ │ │ ├── ripemd160.hpp │ │ │ ├── sha1.hpp │ │ │ ├── sha224.hpp │ │ │ ├── sha256.hpp │ │ │ └── sha512.hpp │ │ │ ├── exception │ │ │ └── exception.hpp │ │ │ ├── filesystem.hpp │ │ │ ├── fixed_string.hpp │ │ │ ├── fwd.hpp │ │ │ ├── fwd_impl.hpp │ │ │ ├── git_revision.hpp │ │ │ ├── interprocess │ │ │ ├── container.hpp │ │ │ ├── file_mapping.hpp │ │ │ ├── file_mutex.hpp │ │ │ ├── iprocess.hpp │ │ │ ├── mmap_struct.hpp │ │ │ ├── process.hpp │ │ │ └── signals.hpp │ │ │ ├── io │ │ │ ├── buffered_iostream.hpp │ │ │ ├── console.hpp │ │ │ ├── datastream.hpp │ │ │ ├── datastream_back.hpp │ │ │ ├── enum_type.hpp │ │ │ ├── fstream.hpp │ │ │ ├── iobuffer.hpp │ │ │ ├── iostream.hpp │ │ │ ├── json.hpp │ │ │ ├── json_relaxed.hpp │ │ │ ├── raw.hpp │ │ │ ├── raw_fwd.hpp │ │ │ ├── raw_unpack_file.hpp │ │ │ ├── raw_variant.hpp │ │ │ ├── sstream.hpp │ │ │ ├── stdio.hpp │ │ │ └── varint.hpp │ │ │ ├── log │ │ │ ├── appender.hpp │ │ │ ├── console_appender.hpp │ │ │ ├── file_appender.hpp │ │ │ ├── gelf_appender.hpp │ │ │ ├── log_message.hpp │ │ │ ├── logger.hpp │ │ │ └── logger_config.hpp │ │ │ ├── make_fused.hpp │ │ │ ├── network │ │ │ ├── http │ │ │ │ ├── connection.hpp │ │ │ │ ├── server.hpp │ │ │ │ └── websocket.hpp │ │ │ ├── ip.hpp │ │ │ ├── rate_limiting.hpp │ │ │ ├── resolve.hpp │ │ │ ├── tcp_socket.hpp │ │ │ ├── tcp_socket_io_hooks.hpp │ │ │ ├── udp_socket.hpp │ │ │ └── url.hpp │ │ │ ├── noncopyable.hpp │ │ │ ├── optional.hpp │ │ │ ├── platform_independence.hpp │ │ │ ├── real128.hpp │ │ │ ├── reflect │ │ │ ├── reflect.hpp │ │ │ ├── typename.hpp │ │ │ └── variant.hpp │ │ │ ├── rpc │ │ │ ├── api_connection.hpp │ │ │ ├── binary_api_connection.hpp │ │ │ ├── bstate.hpp │ │ │ ├── cli.hpp │ │ │ ├── http_api.hpp │ │ │ ├── json_connection.hpp │ │ │ ├── state.hpp │ │ │ ├── variant_connection.hpp │ │ │ ├── variant_stream.hpp │ │ │ └── websocket_api.hpp │ │ │ ├── safe.hpp │ │ │ ├── scoped_exit.hpp │ │ │ ├── shared_ptr.hpp │ │ │ ├── signal.hpp │ │ │ ├── signals.hpp │ │ │ ├── smart_ref_fwd.hpp │ │ │ ├── smart_ref_impl.hpp │ │ │ ├── static_variant.hpp │ │ │ ├── string.hpp │ │ │ ├── thread │ │ │ ├── future.hpp │ │ │ ├── mutex.hpp │ │ │ ├── non_preemptable_scope_check.hpp │ │ │ ├── priority.hpp │ │ │ ├── scoped_lock.hpp │ │ │ ├── spin_lock.hpp │ │ │ ├── spin_yield_lock.hpp │ │ │ ├── task.hpp │ │ │ ├── thread.hpp │ │ │ ├── thread_specific.hpp │ │ │ ├── unique_lock.hpp │ │ │ └── wait_condition.hpp │ │ │ ├── time.hpp │ │ │ ├── tuple.hpp │ │ │ ├── uint128.hpp │ │ │ ├── unique_ptr.hpp │ │ │ ├── utf8.hpp │ │ │ ├── utility.hpp │ │ │ ├── variant.hpp │ │ │ ├── variant_object.hpp │ │ │ ├── vector.hpp │ │ │ ├── vector_fwd.hpp │ │ │ └── wait_any.hpp │ ├── src │ │ ├── asio.cpp │ │ ├── byteswap.hpp │ │ ├── compress │ │ │ ├── miniz.c │ │ │ ├── smaz.cpp │ │ │ └── zlib.cpp │ │ ├── crypto │ │ │ ├── _digest_common.cpp │ │ │ ├── _digest_common.hpp │ │ │ ├── _elliptic_impl_priv.hpp │ │ │ ├── _elliptic_impl_pub.hpp │ │ │ ├── aes.cpp │ │ │ ├── base36.cpp │ │ │ ├── base58.cpp │ │ │ ├── base64.cpp │ │ │ ├── bigint.cpp │ │ │ ├── blowfish.cpp │ │ │ ├── city.cpp │ │ │ ├── crc.cpp │ │ │ ├── dh.cpp │ │ │ ├── elliptic_common.cpp │ │ │ ├── elliptic_impl_priv.cpp │ │ │ ├── elliptic_impl_pub.cpp │ │ │ ├── elliptic_mixed.cpp │ │ │ ├── elliptic_openssl.cpp │ │ │ ├── elliptic_secp256k1.cpp │ │ │ ├── hex.cpp │ │ │ ├── openssl.cpp │ │ │ ├── pke.cpp │ │ │ ├── rand.cpp │ │ │ ├── ripemd160.cpp │ │ │ ├── sha1.cpp │ │ │ ├── sha224.cpp │ │ │ ├── sha256.cpp │ │ │ └── sha512.cpp │ │ ├── exception.cpp │ │ ├── filesystem.cpp │ │ ├── git_revision.cpp.in │ │ ├── interprocess │ │ │ ├── file_mapping.cpp │ │ │ ├── file_mutex.cpp │ │ │ ├── mmap_struct.cpp │ │ │ ├── process.cpp │ │ │ └── signals.cpp │ │ ├── io │ │ │ ├── buffered_iostream.cpp │ │ │ ├── console.cpp │ │ │ ├── datastream.cpp │ │ │ ├── fstream.cpp │ │ │ ├── iostream.cpp │ │ │ ├── json.cpp │ │ │ ├── sstream.cpp │ │ │ └── varint.cpp │ │ ├── log │ │ │ ├── appender.cpp │ │ │ ├── console_appender.cpp │ │ │ ├── console_defines.h │ │ │ ├── file_appender.cpp │ │ │ ├── gelf_appender.cpp │ │ │ ├── log_message.cpp │ │ │ ├── logger.cpp │ │ │ └── logger_config.cpp │ │ ├── network │ │ │ ├── http │ │ │ │ ├── http_connection.cpp │ │ │ │ ├── http_server.cpp │ │ │ │ └── websocket.cpp │ │ │ ├── ip.cpp │ │ │ ├── rate_limiting.cpp │ │ │ ├── resolve.cpp │ │ │ ├── tcp_socket.cpp │ │ │ ├── udp_socket.cpp │ │ │ └── url.cpp │ │ ├── real128.cpp │ │ ├── rpc │ │ │ ├── bstate.cpp │ │ │ ├── cli.cpp │ │ │ ├── http_api.cpp │ │ │ ├── json_connection.cpp │ │ │ ├── state.cpp │ │ │ └── websocket_api.cpp │ │ ├── shared_ptr.cpp │ │ ├── string.cpp │ │ ├── thread │ │ │ ├── context.hpp │ │ │ ├── future.cpp │ │ │ ├── mutex.cpp │ │ │ ├── non_preemptable_scope_check.cpp │ │ │ ├── spin_lock.cpp │ │ │ ├── spin_yield_lock.cpp │ │ │ ├── task.cpp │ │ │ ├── thread.cpp │ │ │ ├── thread_d.hpp │ │ │ └── thread_specific.cpp │ │ ├── time.cpp │ │ ├── uint128.cpp │ │ ├── utf8.cpp │ │ ├── utf8 │ │ │ ├── ReleaseNotes │ │ │ ├── checked.h │ │ │ ├── core.h │ │ │ ├── unchecked.h │ │ │ └── utf8cpp.html │ │ ├── variant.cpp │ │ └── variant_object.cpp │ ├── tests │ │ ├── CMakeLists.txt │ │ ├── all_tests.cpp │ │ ├── api.cpp │ │ ├── bip_lock.cpp │ │ ├── blinding_test.cpp │ │ ├── bloom_test.cpp │ │ ├── compress │ │ │ └── compress.cpp │ │ ├── crypto │ │ │ ├── aes_test.cpp │ │ │ ├── base_n_tests.cpp │ │ │ ├── bigint_test.cpp │ │ │ ├── blind.cpp │ │ │ ├── blowfish_test.cpp │ │ │ ├── dh_test.cpp │ │ │ ├── ecc-interop.sh │ │ │ ├── ecc_test.cpp │ │ │ ├── log_test.cpp │ │ │ ├── log_test.py │ │ │ ├── rand_test.cpp │ │ │ └── sha_tests.cpp │ │ ├── hmac_test.cpp │ │ ├── network │ │ │ └── http │ │ │ │ └── websocket_test.cpp │ │ ├── rate_limiting.cpp │ │ ├── real128_test.cpp │ │ ├── rpc.cpp │ │ ├── sleep.cpp │ │ ├── thread │ │ │ ├── task_cancel.cpp │ │ │ └── thread_tests.cpp │ │ └── utf8_test.cpp │ └── vendor │ │ ├── boost_1.51 │ │ ├── include │ │ │ └── boost │ │ │ │ ├── process.hpp │ │ │ │ └── process │ │ │ │ ├── all.hpp │ │ │ │ ├── child.hpp │ │ │ │ ├── config.hpp │ │ │ │ ├── context.hpp │ │ │ │ ├── detail │ │ │ │ ├── basic_status.hpp │ │ │ │ ├── basic_status_service.hpp │ │ │ │ ├── posix_helpers.hpp │ │ │ │ ├── status_impl.hpp │ │ │ │ ├── systembuf.hpp │ │ │ │ └── windows_helpers.hpp │ │ │ │ ├── environment.hpp │ │ │ │ ├── handle.hpp │ │ │ │ ├── operations.hpp │ │ │ │ ├── pid_type.hpp │ │ │ │ ├── pipe.hpp │ │ │ │ ├── pistream.hpp │ │ │ │ ├── postream.hpp │ │ │ │ ├── process.hpp │ │ │ │ ├── self.hpp │ │ │ │ ├── status.hpp │ │ │ │ ├── stream_behavior.hpp │ │ │ │ ├── stream_ends.hpp │ │ │ │ ├── stream_id.hpp │ │ │ │ └── stream_type.hpp │ │ └── libs │ │ │ └── context │ │ │ ├── asm │ │ │ ├── fcontext_arm_aapcs_elf_gas.S │ │ │ ├── fcontext_i386_ms_pe_masm.asm │ │ │ ├── fcontext_i386_sysv_elf_gas.S │ │ │ ├── fcontext_i386_sysv_macho_gas.S │ │ │ ├── fcontext_mips32_o32_elf_gas.S │ │ │ ├── fcontext_ppc32_sysv_elf_gas.S │ │ │ ├── fcontext_ppc64_sysv_elf_gas.S │ │ │ ├── fcontext_x86_64_ms_pe_masm.asm │ │ │ ├── fcontext_x86_64_sysv_elf_gas.S │ │ │ └── fcontext_x86_64_sysv_macho_gas.S │ │ │ ├── fcontext.cpp │ │ │ ├── seh.cpp │ │ │ ├── stack_allocator_posix.cpp │ │ │ ├── stack_allocator_windows.cpp │ │ │ ├── stack_utils_posix.cpp │ │ │ └── stack_utils_windows.cpp │ │ ├── diff-match-patch-cpp-stl │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── diff_match_patch.h │ │ ├── diff_match_patch_test_string.cpp │ │ ├── diff_match_patch_test_wstring.cpp │ │ └── speedtest.cpp │ │ ├── secp256k1-zkp │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── COPYING │ │ ├── Makefile.am │ │ ├── README.md │ │ ├── TODO │ │ ├── autogen.sh │ │ ├── build-aux │ │ │ └── m4 │ │ │ │ └── bitcoin_secp.m4 │ │ ├── configure.ac │ │ ├── include │ │ │ └── secp256k1.h │ │ ├── libsecp256k1.pc.in │ │ ├── obj │ │ │ └── .gitignore │ │ └── src │ │ │ ├── bench.h │ │ │ ├── bench_ecdh.c │ │ │ ├── bench_internal.c │ │ │ ├── bench_rangeproof.c │ │ │ ├── bench_recover.c │ │ │ ├── bench_sign.c │ │ │ ├── bench_verify.c │ │ │ ├── borromean.h │ │ │ ├── borromean_impl.h │ │ │ ├── ecdh.h │ │ │ ├── ecdh_impl.h │ │ │ ├── ecdsa.h │ │ │ ├── ecdsa_impl.h │ │ │ ├── eckey.h │ │ │ ├── eckey_impl.h │ │ │ ├── ecmult.h │ │ │ ├── ecmult_gen.h │ │ │ ├── ecmult_gen_impl.h │ │ │ ├── ecmult_impl.h │ │ │ ├── field.h │ │ │ ├── field_10x26.h │ │ │ ├── field_10x26_impl.h │ │ │ ├── field_5x52.h │ │ │ ├── field_5x52_asm_impl.h │ │ │ ├── field_5x52_impl.h │ │ │ ├── field_5x52_int128_impl.h │ │ │ ├── field_impl.h │ │ │ ├── group.h │ │ │ ├── group_impl.h │ │ │ ├── hash.h │ │ │ ├── hash_impl.h │ │ │ ├── java │ │ │ ├── org │ │ │ │ └── bitcoin │ │ │ │ │ └── NativeSecp256k1.java │ │ │ ├── org_bitcoin_NativeSecp256k1.c │ │ │ └── org_bitcoin_NativeSecp256k1.h │ │ │ ├── num.h │ │ │ ├── num_gmp.h │ │ │ ├── num_gmp_impl.h │ │ │ ├── num_impl.h │ │ │ ├── rangeproof.h │ │ │ ├── rangeproof_impl.h │ │ │ ├── scalar.h │ │ │ ├── scalar_4x64.h │ │ │ ├── scalar_4x64_impl.h │ │ │ ├── scalar_8x32.h │ │ │ ├── scalar_8x32_impl.h │ │ │ ├── scalar_impl.h │ │ │ ├── secp256k1.c │ │ │ ├── testrand.h │ │ │ ├── testrand_impl.h │ │ │ ├── tests.c │ │ │ └── util.h │ │ └── websocketpp │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── COPYING │ │ ├── Doxyfile │ │ ├── SConstruct │ │ ├── changelog.md │ │ ├── cmake │ │ └── CMakeHelpers.cmake │ │ ├── docs │ │ ├── faq.dox │ │ ├── getting_started.dox │ │ ├── handlers.dox │ │ ├── manual.css │ │ ├── manual.dox │ │ ├── simple_broadcast_server.cpp │ │ ├── simple_count_server_thread.cpp │ │ └── tutorials.dox │ │ ├── examples │ │ ├── associative_storage │ │ │ ├── CMakeLists.txt │ │ │ └── associative_storage.cpp │ │ ├── broadcast_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── broadcast_server.cpp │ │ ├── debug_client │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── debug_client.cpp │ │ ├── debug_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── debug_server.cpp │ │ ├── dev │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── main.cpp │ │ ├── echo_client │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── echo_client.cpp │ │ ├── echo_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── echo_handler.hpp │ │ │ └── echo_server.cpp │ │ ├── echo_server_both │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── echo_server_both.cpp │ │ │ └── server.pem │ │ ├── echo_server_tls │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── dh.pem │ │ │ ├── echo_server_tls.cpp │ │ │ └── server.pem │ │ ├── enriched_storage │ │ │ ├── CMakeLists.txt │ │ │ └── enriched_storage.cpp │ │ ├── external_io_service │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── external_io_service.cpp │ │ │ └── tcp_echo_server.hpp │ │ ├── handler_switch │ │ │ ├── CMakeLists.txt │ │ │ └── handler_switch.cpp │ │ ├── iostream_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── iostream_server.cpp │ │ ├── print_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── print_server.cpp │ │ ├── scratch_client │ │ │ ├── SConscript │ │ │ └── scratch_client.cpp │ │ ├── scratch_server │ │ │ ├── SConscript │ │ │ └── scratch_server.cpp │ │ ├── simple_broadcast_server │ │ │ ├── CMakeLists.txt │ │ │ └── simple_broadcast_server.cpp │ │ ├── sip_client │ │ │ ├── CMakeLists.txt │ │ │ ├── README.txt │ │ │ ├── SConscript │ │ │ └── sip_client.cpp │ │ ├── subprotocol_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── subprotocol_server.cpp │ │ ├── telemetry_client │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── telemetry_client.cpp │ │ ├── telemetry_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── index.html │ │ │ └── telemetry_server.cpp │ │ ├── testee_client │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── testee_client.cpp │ │ ├── testee_server │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── testee_server.cpp │ │ └── utility_client │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── utility_client.cpp │ │ ├── readme.md │ │ ├── roadmap.md │ │ ├── test │ │ ├── connection │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── connection.cpp │ │ │ ├── connection_tu2.cpp │ │ │ └── connection_tu2.hpp │ │ ├── endpoint │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── endpoint.cpp │ │ ├── extension │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── extension.cpp │ │ │ └── permessage_deflate.cpp │ │ ├── http │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── a.out │ │ │ ├── parser.cpp │ │ │ ├── parser_perf.cpp │ │ │ ├── perf.out │ │ │ └── test.out │ │ ├── logger │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ └── basic.cpp │ │ ├── message_buffer │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── alloc.cpp │ │ │ ├── message.cpp │ │ │ └── pool.cpp │ │ ├── processors │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── extension_permessage_compress.cpp │ │ │ ├── hybi00.cpp │ │ │ ├── hybi07.cpp │ │ │ ├── hybi08.cpp │ │ │ ├── hybi13.cpp │ │ │ └── processor.cpp │ │ ├── random │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── none.cpp │ │ │ └── random_device.cpp │ │ ├── roles │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── client.cpp │ │ │ └── server.cpp │ │ ├── transport │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── asio │ │ │ │ ├── SConscript │ │ │ │ ├── base.cpp │ │ │ │ ├── security.cpp │ │ │ │ └── timers.cpp │ │ │ ├── hybi_util.cpp │ │ │ ├── integration.cpp │ │ │ └── iostream │ │ │ │ ├── SConscript │ │ │ │ ├── base.cpp │ │ │ │ ├── connection.cpp │ │ │ │ └── endpoint.cpp │ │ └── utility │ │ │ ├── CMakeLists.txt │ │ │ ├── SConscript │ │ │ ├── close.cpp │ │ │ ├── error.cpp │ │ │ ├── frame.cpp │ │ │ ├── sha1.cpp │ │ │ ├── uri.cpp │ │ │ └── utilities.cpp │ │ ├── tutorials │ │ ├── broadcast_tutorial │ │ │ └── broadcast_tutorial.md │ │ ├── chat_tutorial │ │ │ └── chat_tutorial.md │ │ ├── utility_client │ │ │ ├── step1.cpp │ │ │ ├── step2.cpp │ │ │ ├── step3.cpp │ │ │ ├── step4.cpp │ │ │ ├── step5.cpp │ │ │ ├── step6.cpp │ │ │ └── utility_client.md │ │ └── utility_server │ │ │ ├── step1.cpp │ │ │ ├── step2.cpp │ │ │ └── utility_server.md │ │ ├── websocketpp-config.cmake.in │ │ ├── websocketpp-configVersion.cmake.in │ │ └── websocketpp │ │ ├── CMakeLists.txt │ │ ├── base64 │ │ └── base64.hpp │ │ ├── client.hpp │ │ ├── close.hpp │ │ ├── common │ │ ├── asio.hpp │ │ ├── asio_ssl.hpp │ │ ├── chrono.hpp │ │ ├── connection_hdl.hpp │ │ ├── cpp11.hpp │ │ ├── functional.hpp │ │ ├── md5.hpp │ │ ├── memory.hpp │ │ ├── network.hpp │ │ ├── platforms.hpp │ │ ├── random.hpp │ │ ├── regex.hpp │ │ ├── stdint.hpp │ │ ├── system_error.hpp │ │ ├── thread.hpp │ │ ├── time.hpp │ │ └── type_traits.hpp │ │ ├── concurrency │ │ ├── basic.hpp │ │ └── none.hpp │ │ ├── config │ │ ├── asio.hpp │ │ ├── asio_client.hpp │ │ ├── asio_no_tls.hpp │ │ ├── asio_no_tls_client.hpp │ │ ├── boost_config.hpp │ │ ├── core.hpp │ │ ├── core_client.hpp │ │ ├── debug.hpp │ │ ├── debug_asio.hpp │ │ ├── debug_asio_no_tls.hpp │ │ ├── minimal_client.hpp │ │ └── minimal_server.hpp │ │ ├── connection.hpp │ │ ├── connection_base.hpp │ │ ├── endpoint.hpp │ │ ├── endpoint_base.hpp │ │ ├── error.hpp │ │ ├── extensions │ │ ├── extension.hpp │ │ └── permessage_deflate │ │ │ ├── disabled.hpp │ │ │ └── enabled.hpp │ │ ├── frame.hpp │ │ ├── http │ │ ├── constants.hpp │ │ ├── impl │ │ │ ├── parser.hpp │ │ │ ├── request.hpp │ │ │ └── response.hpp │ │ ├── parser.hpp │ │ ├── request.hpp │ │ └── response.hpp │ │ ├── impl │ │ ├── connection_impl.hpp │ │ ├── endpoint_impl.hpp │ │ └── utilities_impl.hpp │ │ ├── logger │ │ ├── basic.hpp │ │ ├── levels.hpp │ │ ├── stub.hpp │ │ └── syslog.hpp │ │ ├── message_buffer │ │ ├── alloc.hpp │ │ ├── message.hpp │ │ └── pool.hpp │ │ ├── processors │ │ ├── base.hpp │ │ ├── hybi00.hpp │ │ ├── hybi07.hpp │ │ ├── hybi08.hpp │ │ ├── hybi13.hpp │ │ └── processor.hpp │ │ ├── random │ │ ├── none.hpp │ │ └── random_device.hpp │ │ ├── roles │ │ ├── client_endpoint.hpp │ │ └── server_endpoint.hpp │ │ ├── server.hpp │ │ ├── sha1 │ │ └── sha1.hpp │ │ ├── transport │ │ ├── asio │ │ │ ├── base.hpp │ │ │ ├── connection.hpp │ │ │ ├── endpoint.hpp │ │ │ └── security │ │ │ │ ├── base.hpp │ │ │ │ ├── none.hpp │ │ │ │ └── tls.hpp │ │ ├── base │ │ │ ├── connection.hpp │ │ │ └── endpoint.hpp │ │ ├── debug │ │ │ ├── base.hpp │ │ │ ├── connection.hpp │ │ │ └── endpoint.hpp │ │ ├── iostream │ │ │ ├── base.hpp │ │ │ ├── connection.hpp │ │ │ └── endpoint.hpp │ │ └── stub │ │ │ ├── base.hpp │ │ │ ├── connection.hpp │ │ │ └── endpoint.hpp │ │ ├── uri.hpp │ │ ├── utf8_validator.hpp │ │ ├── utilities.hpp │ │ └── version.hpp ├── net │ ├── CMakeLists.txt │ ├── core_messages.cpp │ ├── include │ │ └── graphene │ │ │ └── net │ │ │ ├── config.hpp │ │ │ ├── core_messages.hpp │ │ │ ├── exceptions.hpp │ │ │ ├── message.hpp │ │ │ ├── message_oriented_connection.hpp │ │ │ ├── node.hpp │ │ │ ├── peer_connection.hpp │ │ │ ├── peer_database.hpp │ │ │ └── stcp_socket.hpp │ ├── message_oriented_connection.cpp │ ├── node.cpp │ ├── peer_connection.cpp │ ├── peer_database.cpp │ └── stcp_socket.cpp ├── plugins │ ├── CMakeLists.txt │ ├── account_history │ │ ├── CMakeLists.txt │ │ ├── account_history_plugin.cpp │ │ └── include │ │ │ └── graphene │ │ │ └── account_history │ │ │ └── account_history_plugin.hpp │ ├── debug_witness │ │ ├── CMakeLists.txt │ │ ├── debug_api.cpp │ │ ├── debug_witness.cpp │ │ └── include │ │ │ └── graphene │ │ │ └── debug_witness │ │ │ ├── debug_api.hpp │ │ │ └── debug_witness.hpp │ ├── delayed_node │ │ ├── CMakeLists.txt │ │ ├── delayed_node_plugin.cpp │ │ └── include │ │ │ └── graphene │ │ │ └── delayed_node │ │ │ └── delayed_node_plugin.hpp │ ├── elasticsearch │ │ ├── CMakeLists.txt │ │ ├── elasticsearch_plugin.cpp │ │ └── include │ │ │ └── graphene │ │ │ └── elasticsearch │ │ │ └── elasticsearch_plugin.hpp │ ├── market_history │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── graphene │ │ │ │ └── market_history │ │ │ │ └── market_history_plugin.hpp │ │ └── market_history_plugin.cpp │ ├── snapshot │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── graphene │ │ │ │ └── snapshot │ │ │ │ └── snapshot.hpp │ │ └── snapshot.cpp │ └── witness │ │ ├── CMakeLists.txt │ │ ├── include │ │ └── graphene │ │ │ └── witness │ │ │ └── witness.hpp │ │ └── witness.cpp ├── utilities │ ├── CMakeLists.txt │ ├── git_revision.cpp.in │ ├── include │ │ └── graphene │ │ │ └── utilities │ │ │ ├── git_revision.hpp │ │ │ ├── key_conversion.hpp │ │ │ ├── padding_ostream.hpp │ │ │ ├── string_escape.hpp │ │ │ ├── tempdir.hpp │ │ │ └── words.hpp │ ├── key_conversion.cpp │ ├── string_escape.cpp │ ├── tempdir.cpp │ └── words.cpp └── wallet │ ├── CMakeLists.txt │ ├── Doxyfile.in │ ├── api_documentation_standin.cpp │ ├── generate_api_documentation.pl │ ├── include │ └── graphene │ │ └── wallet │ │ ├── api_documentation.hpp │ │ ├── reflect_util.hpp │ │ └── wallet.hpp │ └── wallet.cpp ├── programs ├── CMakeLists.txt ├── build_helpers │ ├── CMakeLists.txt │ ├── cat-parts.cpp │ ├── check_reflect.py │ └── member_enumerator.cpp ├── cli_wallet │ ├── CMakeLists.txt │ └── main.cpp ├── delayed_node │ ├── CMakeLists.txt │ └── main.cpp ├── genesis_util │ ├── CMakeLists.txt │ ├── apply_patch.py │ ├── canonical_format.py │ ├── change_asset_symbol.py │ ├── change_bitasset_owners.py │ ├── change_key_prefix.py │ ├── convert_address.cpp │ ├── create_bloom_filter.py │ ├── generate_account_patch.py │ ├── generate_init_config.py │ ├── generate_init_patch.py │ ├── genesis_update.cpp │ ├── get_dev_key.cpp │ ├── prefix_accounts.py │ ├── python_format.py │ ├── remove.py │ ├── sort_objects.py │ ├── unprefix_asset_owners.py │ ├── unprefix_names.py │ └── upgrade_members.py ├── js_operation_serializer │ ├── CMakeLists.txt │ └── main.cpp ├── size_checker │ ├── CMakeLists.txt │ └── main.cpp └── witness_node │ ├── CMakeLists.txt │ ├── main.cpp │ └── saltpass.py └── tests ├── CMakeLists.txt ├── app └── main.cpp ├── benchmarks ├── genesis_allocation.cpp └── main.cpp ├── common ├── database_fixture.cpp └── database_fixture.hpp ├── generate_empty_blocks ├── CMakeLists.txt └── main.cpp ├── intense ├── api_stress.py ├── block_tests.cpp └── main.cpp ├── performance └── performance_tests.cpp └── tests ├── app_util_tests.cpp ├── authority_tests.cpp ├── basic_tests.cpp ├── block_tests.cpp ├── confidential_tests.cpp ├── database_api_tests.cpp ├── database_tests.cpp ├── fee_tests.cpp ├── history_api_tests.cpp ├── main.cpp ├── market_tests.cpp ├── operation_tests.cpp ├── operation_tests2.cpp ├── serialization_tests.cpp ├── swan_tests.cpp ├── uia_tests.cpp └── wallet_tests.cpp /CONTRIBUTORS.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinChain/VINchain-blockchain/c52ec3bf67c6d4700bbaf5ec903185d31a2d63ec/CONTRIBUTORS.txt -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2016 Cryptonomex Inc. 2 | Copyright (c) 2015-2017 contributors 3 | 4 | The MIT License 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | -------------------------------------------------------------------------------- /docs/Building-on-OS-X.md: -------------------------------------------------------------------------------- 1 | BitShares OS X Build Instructions 2 | =============================== 3 | 4 | 1. Install XCode and its command line tools by following the instructions here: https://guide.macports.org/#installing.xcode. 5 | In OS X 10.11 (El Capitan) and newer, you will be prompted to install developer tools when running a devloper command in the terminal. This step may not be needed. 6 | 7 | 8 | 2. Install Homebrew by following the instructions here: http://brew.sh/ 9 | 10 | 3. Initialize Homebrew: 11 | ``` 12 | brew doctor 13 | brew update 14 | ``` 15 | 16 | 4. Install dependencies: 17 | ``` 18 | brew install boost cmake git openssl autoconf automake 19 | brew link --force openssl 20 | ``` 21 | 22 | 5. *Optional.* To support importing Bitcoin wallet files: 23 | ``` 24 | brew install berkeley-db 25 | ``` 26 | 27 | 6. *Optional.* To use TCMalloc in LevelDB: 28 | ``` 29 | brew install google-perftools 30 | ``` 31 | 32 | 7. Clone the Graphene repository: 33 | ``` 34 | git clone https://github.com/cryptonomex/graphene.git 35 | cd graphene 36 | ``` 37 | 38 | 8. Build BitShares: 39 | ``` 40 | git submodule update --init --recursive 41 | cmake . 42 | make 43 | ``` -------------------------------------------------------------------------------- /docs/Creating-a-new-FBA.md: -------------------------------------------------------------------------------- 1 | 2 | Creating a new FBA involves some manual steps, as well as a hardfork which sends the fees to the FBA. 3 | 4 | - Create the FBA asset issuer account (or use existing account). 5 | - Create the FBA asset. 6 | - Issue FBA initial distribution. 7 | - If decentralized governance of the asset is desired, FBA issuer uses the `account_update_operation` with `owner_special_authority` and `active_special_authority` extensions to set its owner/active authorities to `top_holders_special_authority`. #516 8 | - FBA issuer creates buyback account for FBA with `account_create_operation` including `buyback_options` extension. #538 9 | 10 | Note, the steps with issue numbers cannot be done until the corresponding hardfork date has passed, which (as of this writing) is planned for February 2016. 11 | 12 | The asset ID of the FBA is then included in the hardfork which implements the fee redirection. Fees are then directed to the asset's buyback account, provided the asset has a buyback account; otherwise the fees go to the network. (So in the case of the first FBA in February 2016, when the hardfork to enable the above-mentioned extensions launches, any fees gathered between the redirection hardfork and the buyback account being created will go to the network. For this reason perhaps the redirection hardfork should be ~3 hours behind the extension hardforks to allow time for the final manual setup.) 13 | -------------------------------------------------------------------------------- /docs/DEV_README.md: -------------------------------------------------------------------------------- 1 | 2 | How to use fc async to do recurring tasks 3 | ----------------------------------------- 4 | 5 | _my_task = fc::async( callable, "My Task" ); 6 | _my_task = fc::schedule( callable, "My Task 2", exec_time ); 7 | 8 | Stuff to know about the code 9 | ---------------------------- 10 | 11 | `static_variant` is a *union type* which says "this variable may be either t1 or t2." It is serializable if t1 and t2 are both serializable. 12 | 13 | The file `operations.hpp` documents the available operations, and `database_fixture.hpp` is a good reference for building and submitting transactions for processing. 14 | 15 | Tests also show the way to do many things, but are often cluttered with code that generates corner cases to try to break things in every possible way. 16 | 17 | Visitors are at the end of `operations.hpp` after the large typedef for `operation` as a `static_variant`. TODO: They should be refactored into a separate header. 18 | 19 | Downcasting stuff 20 | ----------------- 21 | 22 | - You have an `object_id_type` and want to downcast it to a `key_id_type` : `key_id_type( object_id )` 23 | - You have an `operation_result` and want to downcast it to an `object_id_type` : `op_result.get()` 24 | - Since `operation_result` is a `static_variant`, the above is also how you downcast `static_variant` 25 | 26 | Debugging FC exceptions with GDB 27 | -------------------------------- 28 | 29 | - `catch throw` 30 | -------------------------------------------------------------------------------- /docs/Import-BitShares-0.9.3c-wallets-into-BitShares-2.0-CLI-wallet.md: -------------------------------------------------------------------------------- 1 | 2 | ## How to Import Large Wallets from BitShares 0.9.3 3 | 4 | In bitshares 0.9.3c, run: 5 | 6 | wallet_export_keys /tmp/final_bitshares_keys.json 7 | 8 | in bitshares 2.0 CLI wallet, run: 9 | >>> import_accounts /tmp/final_bitshares_keys.json my_password 10 | 11 | then, for each account in your wallet (run list_my_accounts to see them): 12 | 13 | >>> import_account_keys /tmp/final_bitshares_keys.json my_password my_account_name my_account_name 14 | 15 | note: in the release tag, this will create a full backup of the wallet after every key it imports. 16 | If you have thousands of keys, this is quite slow and also takes up a lot of disk space. 17 | Monitor your free disk space during the import and, if necessary, periodically erase the 18 | backups to avoid filling your disk. The latest code only saves your wallet after all keys have been imported. 19 | 20 | >>> import_balance my_account_name ["*"] true 21 | >>> list_account_balances my_account_name 22 | 23 | Verify the Results -------------------------------------------------------------------------------- /docs/Monitoring-accounts.md: -------------------------------------------------------------------------------- 1 | It is recommended that the reader has went through the following introductions: 2 | 3 | * [[Introduction to Blockchain Objects|Blockchain-Objects]] 4 | * [[Introduction to Wallet/Node daemons|Wallet_Full-Nodes_Witness_Nodes]] 5 | * [[Graphene API|API]] 6 | * [[Websocket Subscriptions|Websocket Subscriptions]] 7 | 8 | 9 | To monitor accounts, we recommend to use the `get_full_accounts` call in order to fetch 10 | the current state of an account and *automatically* subscribe to future account 11 | updates including balance update. 12 | 13 | A notification after a transaction would take the form: 14 | 15 | [[ 16 | { 17 | "owner": "1.2.3184", 18 | "balance": 1699918247, 19 | "id": "2.5.3", 20 | "asset_type": "1.3.0" 21 | }, 22 | { 23 | "most_recent_op": "2.9.74", 24 | "pending_vested_fees": 6269529, 25 | "total_core_in_orders": 0, 26 | "pending_fees": 0, 27 | "owner": "1.2.3184", 28 | "id": "2.6.3184", 29 | "lifetime_fees_paid": 50156232 30 | } 31 | ]] 32 | 33 | Please distinguish transactions from operations: Since a single transaction may contain several (independent) operations, monitoring an account may only require to investigate *operations* that change the account. -------------------------------------------------------------------------------- /docs/Wallet-Argument-Format.md: -------------------------------------------------------------------------------- 1 | When using the [Wallet Login Protocol](Wallet Login Protocol) or the [Wallet Merchant Protocol](Wallet Merchant API) it is necessary to pass arguments to and from the wallet. For security purposes these arguments are passed via the URL after the `#` so that they are kept secret from the wallet service provider. Because URLs are limited to about 2048 bytes of data the Wallet APIs pass arguments as a JSON string that has been compressed with LZMA and serialized to Base58. 2 | 3 | ## Step 1: Compress your JSON representation 4 | 5 | Using [LZMA-JS](https://github.com/nmrugg/LZMA-JS/) library to compress the JSON into a binary array. This will be the most compact form of the data. This will reduce the size of the data by up to 50%. 6 | 7 | ## Step 2: Convert to Base58 8 | 9 | Using the [bs58](http://cryptocoinjs.com/modules/misc/bs58/) library encode the compressed data in base58. Base58 is URL friendly and size efficient. After converting to base58 the result will be about 70% the size of the original JSON data. 10 | 11 | -------------------------------------------------------------------------------- /docs/Wallet_Full-Nodes_Witness_Nodes.md: -------------------------------------------------------------------------------- 1 | We need a client to connect to. Either we run a witness in (monitor mode) or use 2 | a public trusted witness. For exchanges, it is though recommended to run a 3 | full node. We can connect to the network via a seed node: 4 | 5 | programs/witness_node/witness_node -s 104.200.28.117:61705 --rpc-endpoint 127.0.0.1:8090 # FIXME? 6 | 7 | This opens up a node that we can connect to via the inluded wallet 8 | 9 | programs/cli_wallet/cli_wallet -s ws://127.0.0.1:8090 -H 127.0.0.1:8091 10 | 11 | which will open port `8091` for HTTP-RPC requests *and* has the capabilities to 12 | handle accounts while the witness_node can only answer queries to the 13 | blockchain. 14 | -------------------------------------------------------------------------------- /docs/blacklizard-app-ideas.md: -------------------------------------------------------------------------------- 1 | 2 | Introduction 3 | ------------ 4 | 5 | This paper is an incomplete draft, more of a starting point for discussion than a final product. 6 | 7 | App ideas 8 | --------- 9 | 10 | Here are some ideas for app use cases the platform should consider supporting. 11 | 12 | - Vote feature: ID verification 13 | - Vote feature: Commissioned polls 14 | - Vote feature: Secret ballot elections 15 | - LMSR based prediction markets 16 | - Custom UIA 17 | - Equitable BitAssets 18 | - Atomic cross-chain trading 19 | - Bond market 20 | - Decentralized joint ventures ("equitable UIA") 21 | - Selling equity in sale of future software / music licenses ("BitShares Play") 22 | - Crowdfunding 23 | - Sweepstakes 24 | - Market as an app? 25 | 26 | -------------------------------------------------------------------------------- /docs/chain-locked-tx.md: -------------------------------------------------------------------------------- 1 | 2 | Chain-locked transactions 3 | ------------------------- 4 | 5 | Add a chain ID to the signature. This ensures that a transaction 6 | without TaPoS cannot migrate between Graphene-based chains, and 7 | reduces the ability for the transaction to migrate to a different 8 | protocol (e.g. if your Graphene key is also a Bitcoin key, then a 9 | Graphene transaction which is parseable as a Bitcoin transaction 10 | might be able to migrate to the Bitcoin chain). 11 | 12 | Wallet functionality 13 | -------------------- 14 | 15 | The `cli_wallet` stores the `chain_id` in the wallet file. Thus a 16 | wallet file can only be used with a single chain. When creating a 17 | new wallet file, the `chain_id` can be specified on the command line; 18 | if none is specified, the embedded `chain_id` will be used by default. 19 | 20 | When connecting to an API server, the `cli_wallet` will check the 21 | chain ID provided by the server matches the client, and disconnect 22 | immediately if the check fails. 23 | 24 | Light wallet functionality 25 | -------------------------- 26 | 27 | At present, the light wallet simply uses the chain ID specified by its backing full node to sign transactions. 28 | -------------------------------------------------------------------------------- /docs/draft-license/HEADER.draft: -------------------------------------------------------------------------------- 1 | /* 2 | * This is draft license text currently under development. This license does not apply to anything right now. 3 | * 4 | * Copyright (c) 2015, Cryptonomex, Inc 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. No distribution of binaries compiled from modified versions of the code 10 | * 11 | * 2. Any modifications become property of Cryptonomex, Inc and must be licensed under these same terms 12 | * 13 | * 3. Any hosting provider is authorized to delete any version of this code at the request Cryptonomex, Inc. 14 | */ 15 | -------------------------------------------------------------------------------- /gui_version: -------------------------------------------------------------------------------- 1 | 2.0.170522 2 | -------------------------------------------------------------------------------- /libraries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory( fc ) 2 | add_subdirectory( db ) 3 | add_subdirectory( deterministic_openssl_rand ) 4 | add_subdirectory( chain ) 5 | add_subdirectory( egenesis ) 6 | add_subdirectory( net ) 7 | add_subdirectory( utilities ) 8 | add_subdirectory( app ) 9 | add_subdirectory( plugins ) 10 | add_subdirectory( wallet ) 11 | -------------------------------------------------------------------------------- /libraries/app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/app/*.hpp") 2 | file(GLOB EGENESIS_HEADERS "../egenesis/include/graphene/app/*.hpp") 3 | 4 | add_library( graphene_app 5 | api.cpp 6 | application.cpp 7 | util.cpp 8 | database_api.cpp 9 | impacted.cpp 10 | plugin.cpp 11 | ${HEADERS} 12 | ${EGENESIS_HEADERS} 13 | ) 14 | 15 | # need to link graphene_debug_witness because plugins aren't sufficiently isolated #246 16 | target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_chain fc graphene_db graphene_net graphene_utilities graphene_debug_witness ) 17 | target_include_directories( graphene_app 18 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" 19 | "${CMAKE_CURRENT_SOURCE_DIR}/../egenesis/include" ) 20 | 21 | if(MSVC) 22 | set_source_files_properties( application.cpp api.cpp database_api.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 23 | endif(MSVC) 24 | 25 | INSTALL( TARGETS 26 | graphene_app 27 | 28 | RUNTIME DESTINATION bin 29 | LIBRARY DESTINATION lib 30 | ARCHIVE DESTINATION lib 31 | ) 32 | INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/app" ) 33 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/000-200-preamble.hf: -------------------------------------------------------------------------------- 1 | /***************************************** 2 | * * 3 | * This file is automatically generated. * 4 | * To create new hardfork, please modify * 5 | * the .hf files in hardfork.d instead * 6 | * of modifying this file. * 7 | * * 8 | *****************************************/ 9 | 10 | #pragma once 11 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/23.hf: -------------------------------------------------------------------------------- 1 | // Issue #23: Withdrawal claims made before the first withdrawal period are incorrectly allowed 2 | #ifndef HARDFORK_23_TIME 3 | #define HARDFORK_23_TIME (fc::time_point_sec( 1512747600 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/357.hf: -------------------------------------------------------------------------------- 1 | // #357 Disallow publishing certain malformed price feeds 2 | #ifndef HARDFORK_357_TIME 3 | #define HARDFORK_357_TIME (fc::time_point_sec( 1444416300 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/359.hf: -------------------------------------------------------------------------------- 1 | // #359 Allow digits in asset name 2 | #ifndef HARDFORK_359_TIME 3 | #define HARDFORK_359_TIME (fc::time_point_sec( 1444416300 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/385.hf: -------------------------------------------------------------------------------- 1 | // #385 October 23 enforce PARENT.CHILD and allow short names 2 | #ifndef HARDFORK_385_TIME 3 | #define HARDFORK_385_TIME (fc::time_point_sec( 1445558400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/409.hf: -------------------------------------------------------------------------------- 1 | // #409 Allow creation of sub-assets 2 | #ifndef HARDFORK_409_TIME 3 | #define HARDFORK_409_TIME (fc::time_point_sec( 1446652800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/413.hf: -------------------------------------------------------------------------------- 1 | // #413 Add operation to claim asset fees 2 | #ifndef HARDFORK_413_TIME 3 | #define HARDFORK_413_TIME (fc::time_point_sec( 1446652800 )) 4 | #endif -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/415.hf: -------------------------------------------------------------------------------- 1 | // #415 Default accept policy for asset with no whitelist authorities 2 | #ifndef HARDFORK_415_TIME 3 | #define HARDFORK_415_TIME (fc::time_point_sec( 1446652800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/416.hf: -------------------------------------------------------------------------------- 1 | // #416 enforce_white_list is inconsistently applied 2 | #ifndef HARDFORK_416_TIME 3 | #define HARDFORK_416_TIME (fc::time_point_sec( 1446652800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/419.hf: -------------------------------------------------------------------------------- 1 | // #419 Account can pay fees in blacklisted asset 2 | #ifndef HARDFORK_419_TIME 3 | #define HARDFORK_419_TIME (fc::time_point_sec( 1446652800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/436.hf: -------------------------------------------------------------------------------- 1 | // #436 Prevent margin call from being triggered unless feed < call price 2 | #ifndef HARDFORK_436_TIME 3 | #define HARDFORK_436_TIME (fc::time_point_sec( 1450288800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/445.hf: -------------------------------------------------------------------------------- 1 | // #445 Refund create order fees on cancel 2 | #ifndef HARDFORK_445_TIME 3 | #define HARDFORK_445_TIME (fc::time_point_sec( 1450288800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/453.hf: -------------------------------------------------------------------------------- 1 | // #453 Hardfork to retroactively correct referral percentages 2 | #ifndef HARDFORK_453_TIME 3 | #define HARDFORK_453_TIME (fc::time_point_sec( 1450288800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/480.hf: -------------------------------------------------------------------------------- 1 | // #480 Fix non-BTS MIA core_exchange_rate check 2 | #ifndef HARDFORK_480_TIME 3 | #define HARDFORK_480_TIME (fc::time_point_sec( 1450378800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/483.hf: -------------------------------------------------------------------------------- 1 | // #483 Operation history numbering change 2 | #ifndef HARDFORK_483_TIME 3 | #define HARDFORK_483_TIME (fc::time_point_sec( 1450378800 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/516.hf: -------------------------------------------------------------------------------- 1 | // #516 Special authorities 2 | #ifndef HARDFORK_516_TIME 3 | #define HARDFORK_516_TIME (fc::time_point_sec( 1456250400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/533.hf: -------------------------------------------------------------------------------- 1 | // #533 Improve vote counting implementation 2 | #ifndef HARDFORK_533_TIME 3 | #define HARDFORK_533_TIME (fc::time_point_sec( 1456250400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/538.hf: -------------------------------------------------------------------------------- 1 | // #538 Buyback accounts 2 | #ifndef HARDFORK_538_TIME 3 | #define HARDFORK_538_TIME (fc::time_point_sec( 1456250400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/555.hf: -------------------------------------------------------------------------------- 1 | // #555 Buyback accounts 2 | #ifndef HARDFORK_555_TIME 3 | #define HARDFORK_555_TIME (fc::time_point_sec( 1456250400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/563.hf: -------------------------------------------------------------------------------- 1 | // #563 Stealth fee routing 2 | #ifndef HARDFORK_563_TIME 3 | #define HARDFORK_563_TIME (fc::time_point_sec( 1456250400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/572.hf: -------------------------------------------------------------------------------- 1 | // #572 Allow asset to update permission flags when no supply exists 2 | #ifndef HARDFORK_572_TIME 3 | #define HARDFORK_572_TIME (fc::time_point_sec( 1456250400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/599.hf: -------------------------------------------------------------------------------- 1 | // #599 Unpacking of extension is incorrect 2 | #ifndef HARDFORK_599_TIME 3 | #define HARDFORK_599_TIME (fc::time_point_sec( 1459789200 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/607.hf: -------------------------------------------------------------------------------- 1 | // #607 Disable negative voting on workers 2 | #ifndef HARDFORK_607_TIME 3 | #define HARDFORK_607_TIME (fc::time_point_sec( 1458752400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/613.hf: -------------------------------------------------------------------------------- 1 | // #613 Deprecate annual membership 2 | #ifndef HARDFORK_613_TIME 3 | #define HARDFORK_613_TIME (fc::time_point_sec( 1458752400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/615.hf: -------------------------------------------------------------------------------- 1 | // #615 Fix price feed expiration check, so websocket server will never spam too much data 2 | #ifndef HARDFORK_615_TIME 3 | #define HARDFORK_615_TIME (fc::time_point_sec( 1458752400 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/CORE_216.hf: -------------------------------------------------------------------------------- 1 | // bitshares-core #216 Process to reset a Smartcoin after a Black Swan 2 | #ifndef HARDFORK_CORE_216_TIME 3 | #define HARDFORK_CORE_216_TIME (fc::time_point_sec( 1512747600 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/CORE_429.hf: -------------------------------------------------------------------------------- 1 | // bitshares-core #429 rounding issue when creating assets 2 | #ifndef HARDFORK_CORE_429_TIME 3 | #define HARDFORK_CORE_429_TIME (fc::time_point_sec( 1512747600 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/hardfork.d/core-143.hf: -------------------------------------------------------------------------------- 1 | // #143 Require voted entities to exist 2 | #ifndef HARDFORK_CORE_143_TIME 3 | #define HARDFORK_CORE_143_TIME (fc::time_point_sec( 1512747600 )) 4 | #endif 5 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/exclusive_permission_evaluator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace graphene { 7 | namespace chain { 8 | 9 | class give_exclusive_permission_evaluator : public evaluator { 10 | public: 11 | typedef give_exclusive_permission_operation operation_type; 12 | 13 | void_result do_evaluate(const give_exclusive_permission_operation &o); 14 | 15 | object_id_type do_apply(const give_exclusive_permission_operation &o); 16 | }; 17 | } 18 | } // graphene::chain 19 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/get_config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Cryptonomex, Inc., and contributors. 3 | * 4 | * The MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | #pragma once 25 | 26 | #include 27 | 28 | namespace graphene { 29 | namespace chain { 30 | 31 | fc::variant_object get_config(); 32 | 33 | } 34 | } // graphene::chain 35 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/invoice_evaluator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace graphene { 7 | namespace chain { 8 | 9 | class invoice_create_evaluator : public evaluator { 10 | public: 11 | typedef invoice_create_operation operation_type; 12 | 13 | void_result do_evaluate(const invoice_create_operation &o); 14 | 15 | object_id_type do_apply(const invoice_create_operation &o); 16 | }; 17 | 18 | } 19 | } // graphene::chain 20 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/invoice_payment_evaluator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace graphene { 8 | namespace chain { 9 | 10 | class invoice_payment_create_evaluator : public evaluator { 11 | public: 12 | typedef invoice_payment_create_operation operation_type; 13 | 14 | void_result do_evaluate(const invoice_payment_create_operation &o); 15 | 16 | object_id_type do_apply(const invoice_payment_create_operation &o); 17 | }; 18 | 19 | } 20 | } // graphene::chain 21 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/invoice_payment_object.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace graphene { 8 | namespace chain { 9 | using namespace graphene::db; 10 | 11 | class invoice_payment_object; 12 | 13 | class invoice_payment_object : public abstract_object { 14 | public: 15 | static const uint8_t space_id = protocol_ids; 16 | static const uint8_t type_id = invoice_payment_object_type; 17 | 18 | account_id_type from; 19 | string report_uuid; 20 | uint32_t block_num; 21 | }; 22 | 23 | using invoice_payment_multi_index_type = multi_index_container < 24 | invoice_payment_object, 25 | indexed_by< 26 | ordered_unique < tag < by_id>, member> 27 | > 28 | >; 29 | 30 | using invoice_payment_index = generic_index; 31 | } 32 | } // graphene::chain 33 | 34 | FC_REFLECT_DERIVED( graphene::chain::invoice_payment_object, (graphene::db::object), (from)(report_uuid)(block_num) ) 35 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/README.md: -------------------------------------------------------------------------------- 1 | Protocol Definition 2 | -------------------- 3 | 4 | The classes declared in these headers provide the complete definition of the 5 | Graphene protocol and are organized according to feature. Nothing in this 6 | directory should depend upon anything other than fc or other types defined 7 | in the protocol directory. 8 | 9 | To be more specific, implementation details such as the objects defined in 10 | the object database should not be required here. 11 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Cryptonomex, Inc., and contributors. 3 | * 4 | * The MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | #pragma once 25 | 26 | #include 27 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/exclusive_permission.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace graphene { 6 | namespace chain { 7 | struct give_exclusive_permission_operation : public base_operation { 8 | struct fee_parameters_type { 9 | uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; 10 | }; 11 | 12 | account_id_type from; 13 | account_id_type to; 14 | 15 | string permission; 16 | 17 | asset fee; 18 | 19 | account_id_type fee_payer() const { return from; } 20 | 21 | void validate() const; 22 | }; 23 | } 24 | } // graphene::chain 25 | 26 | FC_REFLECT( graphene::chain::give_exclusive_permission_operation::fee_parameters_type, (fee) ) 27 | FC_REFLECT( graphene::chain::give_exclusive_permission_operation, (from)(to)(permission)(fee) ) 28 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/invoice.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace graphene { 6 | namespace chain { 7 | struct invoice_vehicle_record { 8 | account_id_type data_source; 9 | string hash; 10 | uint64_t value; 11 | asset reward; 12 | }; 13 | 14 | struct invoice_create_operation : public base_operation { 15 | struct fee_parameters_type { 16 | uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; 17 | }; 18 | 19 | account_id_type contractor; 20 | account_id_type customer; 21 | string vin; 22 | string report_uuid; 23 | 24 | asset amount; 25 | asset contractor_reward; 26 | 27 | vector records; 28 | 29 | asset fee; 30 | 31 | account_id_type fee_payer() const { return contractor; } 32 | 33 | void validate() const; 34 | }; 35 | } 36 | } // graphene::chain 37 | 38 | FC_REFLECT(graphene::chain::invoice_create_operation::fee_parameters_type, (fee)) 39 | FC_REFLECT(graphene::chain::invoice_create_operation, 40 | (contractor)(customer)(vin)(report_uuid)(amount)(contractor_reward)(records)(fee)) 41 | FC_REFLECT(graphene::chain::invoice_vehicle_record, (data_source)(hash)(value)(reward)) 42 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/invoice_payment.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace graphene { 6 | namespace chain { 7 | struct invoice_payment_create_operation : public base_operation { 8 | struct fee_parameters_type { 9 | uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; 10 | }; 11 | 12 | account_id_type from; 13 | string report_uuid; 14 | 15 | asset fee; 16 | 17 | account_id_type fee_payer() const { return from; } 18 | 19 | void validate() const; 20 | }; 21 | } 22 | } // graphene::chain 23 | 24 | FC_REFLECT( graphene::chain::invoice_payment_create_operation::fee_parameters_type, (fee) ) 25 | FC_REFLECT( graphene::chain::invoice_payment_create_operation, (from)(report_uuid)(fee) ) 26 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/protocol.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Cryptonomex, Inc., and contributors. 3 | * 4 | * The MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | #pragma once 25 | 26 | #include 27 | #include 28 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/protocol/vindb_block.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace graphene { 6 | namespace chain { 7 | struct vindb_block_create_operation : public base_operation { 8 | struct fee_parameters_type { 9 | uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; 10 | }; 11 | 12 | uint64_t block_id; 13 | string block_hash; 14 | 15 | account_id_type owner; 16 | asset fee; 17 | 18 | account_id_type fee_payer() const { return owner; } 19 | 20 | void validate() const; 21 | }; 22 | } 23 | } // graphene::chain 24 | 25 | FC_REFLECT( graphene::chain::vindb_block_create_operation::fee_parameters_type, (fee) ) 26 | FC_REFLECT( graphene::chain::vindb_block_create_operation, (block_id)(block_hash)(owner)(fee) ) 27 | -------------------------------------------------------------------------------- /libraries/chain/include/graphene/chain/vindb_block_evaluator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace graphene { 7 | namespace chain { 8 | 9 | class vindb_block_create_evaluator : public evaluator { 10 | public: 11 | typedef vindb_block_create_operation operation_type; 12 | 13 | void_result do_evaluate(const vindb_block_create_operation &o); 14 | 15 | object_id_type do_apply(const vindb_block_create_operation &o); 16 | }; 17 | 18 | } 19 | } // graphene::chain 20 | -------------------------------------------------------------------------------- /libraries/chain/protocol/exclusive_permission.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace graphene { 4 | namespace chain { 5 | void give_exclusive_permission_operation::validate() const { 6 | FC_ASSERT(fee.amount >= 0); 7 | } 8 | } 9 | } // graphene::chain -------------------------------------------------------------------------------- /libraries/chain/protocol/invoice.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace graphene { 4 | namespace chain { 5 | void invoice_create_operation::validate() const { 6 | FC_ASSERT(fee.amount >= 0); 7 | FC_ASSERT(amount.amount >= 0); 8 | FC_ASSERT(contractor_reward.amount >= 0); 9 | FC_ASSERT(contractor_reward.asset_id == amount.asset_id); 10 | 11 | for (invoice_vehicle_record record : records) { 12 | FC_ASSERT(amount.asset_id == record.reward.asset_id); 13 | FC_ASSERT(record.reward.amount >= 0); 14 | } 15 | } 16 | } 17 | } // graphene::chain 18 | -------------------------------------------------------------------------------- /libraries/chain/protocol/invoice_payment.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace graphene { 4 | namespace chain { 5 | void invoice_payment_create_operation::validate() const { 6 | FC_ASSERT(fee.amount >= 0); 7 | } 8 | } 9 | } // graphene::chain 10 | -------------------------------------------------------------------------------- /libraries/chain/protocol/vindb_block.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace graphene { 4 | namespace chain { 5 | void vindb_block_create_operation::validate() const { 6 | FC_ASSERT(fee.amount >= 0); 7 | 8 | // check owner permissions 9 | } 10 | } 11 | } // graphene::chain 12 | -------------------------------------------------------------------------------- /libraries/db/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/db/*.hpp") 2 | add_library( graphene_db undo_database.cpp index.cpp object_database.cpp ${HEADERS} ) 3 | target_link_libraries( graphene_db fc ) 4 | target_include_directories( graphene_db PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 5 | 6 | install( TARGETS 7 | graphene_db 8 | 9 | RUNTIME DESTINATION bin 10 | LIBRARY DESTINATION lib 11 | ARCHIVE DESTINATION lib 12 | ) 13 | install( FILES ${HEADERS} DESTINATION "include/graphene/db" ) 14 | -------------------------------------------------------------------------------- /libraries/deterministic_openssl_rand/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file(GLOB headers "include/graphene/utilities/*.hpp") 3 | 4 | set(sources deterministic_openssl_rand.cpp 5 | ${headers}) 6 | 7 | add_library( deterministic_openssl_rand 8 | ${sources} 9 | ${HEADERS} ) 10 | target_link_libraries( deterministic_openssl_rand fc ) 11 | target_include_directories( deterministic_openssl_rand 12 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/../blockchain/include" 14 | ) 15 | 16 | if (USE_PCH) 17 | set_target_properties(deterministic_openssl_rand PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) 18 | cotire(deterministic_openssl_rand) 19 | endif(USE_PCH) 20 | 21 | install( TARGETS 22 | deterministic_openssl_rand 23 | 24 | RUNTIME DESTINATION bin 25 | LIBRARY DESTINATION lib 26 | ARCHIVE DESTINATION lib 27 | ) 28 | install( FILES ${headers} DESTINATION "include/graphene/deterministic_openssl_rand" ) 29 | -------------------------------------------------------------------------------- /libraries/fc/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Compiled Dynamic libraries 8 | *.so 9 | *.dylib 10 | *.dll 11 | 12 | # Compiled Static libraries 13 | *.lai 14 | *.la 15 | *.a 16 | *.lib 17 | 18 | # CMake->MSVC artifacts 19 | *.sln 20 | *.vcxproj 21 | ALL_BUILD 22 | ZERO_CHECK 23 | 24 | # MSVC secondary artifacts 25 | *.suo 26 | *.vcxproj.filters 27 | *.vcxproj.user 28 | *.pdb 29 | *.ilk 30 | *.lastbuildstate 31 | *.sdf 32 | *.opensdf 33 | Debug/ 34 | Release/ 35 | 36 | CMakeCache.txt 37 | CMakeFiles 38 | Makefile 39 | *.cmake 40 | *.cbp 41 | 42 | libfc.a 43 | libfc_debug.a 44 | 45 | *.sw* 46 | 47 | fc_automoc.cpp 48 | git_revision.cpp 49 | GitSHA3.cpp 50 | 51 | task_cancel_test 52 | -------------------------------------------------------------------------------- /libraries/fc/GitVersionGen/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") 27 | configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 28 | set(HEAD_HASH "${HEAD_REF}") 29 | endif() 30 | else() 31 | # detached HEAD 32 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 33 | endif() 34 | 35 | if(NOT HEAD_HASH) 36 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 37 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 38 | endif() 39 | -------------------------------------------------------------------------------- /libraries/fc/README.md: -------------------------------------------------------------------------------- 1 | fc 2 | == 3 | 4 | **NOTE:** This fork reverts upstream commit a421e280488385cab26a42153f7ce3c8d5b6281f to avoid changing the BitShares API. 5 | 6 | FC stands for fast-compiling c++ library and provides a set of utility libraries useful 7 | for the development of asynchronous libraries. Some of the highlights include: 8 | 9 | - Cooperative Multi-Tasking Library with support for Futures, mutexes, signals. 10 | - Wrapper on Boost ASIO for handling async opperations cooperatively with easy to code synchronous style. 11 | - Reflection for C++ allowing automatic serialization in Json & Binary of C++ Structs 12 | - Automatic generation of client / server stubs for reflected interfaces with support for JSON-RPC 13 | - Cryptographic Primitives for a variaty of hashes and encryption algorithms 14 | - Logging Infrastructure 15 | - Wraps many Boost APIs, such as boost::filesystem, boost::thread, and boost::exception to acceleate compiles 16 | - Support for unofficial Boost.Process library. 17 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/aligned.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace fc { 3 | 4 | template 5 | struct aligned { 6 | union { 7 | T _align; 8 | char _data[S]; 9 | } _store; 10 | operator char*() { return _store._data; } 11 | operator const char*()const { return _store._data; } 12 | }; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | // TODO: define this without using boost 6 | typedef boost::any any; 7 | } 8 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/bitutil.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | inline uint64_t endian_reverse_u64( uint64_t x ) 7 | { 8 | return (((x >> 0x38) & 0xFF) ) 9 | | (((x >> 0x30) & 0xFF) << 0x08) 10 | | (((x >> 0x28) & 0xFF) << 0x10) 11 | | (((x >> 0x20) & 0xFF) << 0x18) 12 | | (((x >> 0x18) & 0xFF) << 0x20) 13 | | (((x >> 0x10) & 0xFF) << 0x28) 14 | | (((x >> 0x08) & 0xFF) << 0x30) 15 | | (((x ) & 0xFF) << 0x38) 16 | ; 17 | } 18 | 19 | inline uint32_t endian_reverse_u32( uint32_t x ) 20 | { 21 | return (((x >> 0x18) & 0xFF) ) 22 | | (((x >> 0x10) & 0xFF) << 0x08) 23 | | (((x >> 0x08) & 0xFF) << 0x10) 24 | | (((x ) & 0xFF) << 0x18) 25 | ; 26 | } 27 | 28 | } // namespace fc 29 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/compress/smaz.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | std::string smaz_compress( const std::string& in ); 7 | std::string smaz_decompress( const std::string& compressed ); 8 | 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/compress/zlib.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace fc 6 | { 7 | 8 | string zlib_compress(const string& in); 9 | 10 | } // namespace fc 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/container/deque.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | namespace raw { 8 | 9 | 10 | } // namespace raw 11 | 12 | } // namespace fc 13 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/container/deque_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace fc { 6 | 7 | namespace raw { 8 | template 9 | void pack( Stream& s, const std::deque& value ); 10 | template 11 | void unpack( Stream& s, std::deque& value ); 12 | } 13 | } // namespace fc 14 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/container/flat_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | using boost::container::flat_map; 9 | using boost::container::flat_set; 10 | namespace bip = boost::interprocess; 11 | 12 | namespace raw { 13 | template 14 | void pack( Stream& s, const flat_set& value ); 15 | template 16 | void unpack( Stream& s, flat_set& value ); 17 | template 18 | void pack( Stream& s, const flat_map& value ); 19 | template 20 | void unpack(Stream& s, flat_map& value); 21 | 22 | 23 | template 24 | void pack( Stream& s, const bip::vector& value ); 25 | template 26 | void unpack( Stream& s, bip::vector& value ); 27 | } // namespace raw 28 | 29 | } // fc 30 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base36.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector from_base36( const fc::string& b36 ); 8 | fc::string to_base36( const std::vector& vec ); 9 | fc::string to_base36( const char* data, size_t len ); 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base58.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | std::string to_base58( const char* d, size_t s ); 7 | std::string to_base58( const std::vector& data ); 8 | std::vector from_base58( const std::string& base58_str ); 9 | size_t from_base58( const std::string& base58_str, char* out_data, size_t out_data_len ); 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/base64.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len); 6 | inline std::string base64_encode(char const* bytes_to_encode, unsigned int in_len) { return base64_encode( (unsigned char const*)bytes_to_encode, in_len); } 7 | std::string base64_encode( const std::string& enc ); 8 | std::string base64_decode( const std::string& encoded_string); 9 | } // namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/dh.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | struct diffie_hellman { 9 | diffie_hellman():valid(0),g(5){ fc::init_openssl(); } 10 | bool generate_params( int s, uint8_t g ); 11 | bool generate_pub_key(); 12 | bool compute_shared_key( const char* buf, uint32_t s ); 13 | bool compute_shared_key( const std::vector& pubk); 14 | bool validate(); 15 | 16 | std::vector p; 17 | std::vector pub_key; 18 | std::vector priv_key; 19 | std::vector shared_key; 20 | bool valid; 21 | uint8_t g; 22 | }; 23 | 24 | } // namespace fc 25 | 26 | 27 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/digest.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | template 9 | fc::sha256 digest( const T& value ) 10 | { 11 | fc::sha256::encoder enc; 12 | fc::raw::pack( enc, value ); 13 | return enc.result(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/hex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | uint8_t from_hex( char c ); 8 | fc::string to_hex( const char* d, uint32_t s ); 9 | std::string to_hex( const std::vector& data ); 10 | 11 | /** 12 | * @return the number of bytes decoded 13 | */ 14 | size_t from_hex( const fc::string& hex_str, char* out_data, size_t out_data_len ); 15 | } 16 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/crypto/rand.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | 5 | /* provides access to the OpenSSL random number generator */ 6 | void rand_bytes(char* buf, int count); 7 | void rand_pseudo_bytes(char* buf, int count); 8 | } // namespace fc 9 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | /** 7 | * @brief Used to forward declare value types. 8 | * 9 | */ 10 | template 11 | class fwd { 12 | public: 13 | template fwd( U&& u ); 14 | template fwd( U&& u, V&& v ); 15 | template fwd( U&& u, V&& v, X&&, Y&& ); 16 | fwd(); 17 | 18 | fwd( const fwd& f ); 19 | fwd( fwd&& f ); 20 | 21 | operator const T&()const; 22 | operator T&(); 23 | 24 | T& operator*(); 25 | const T& operator*()const; 26 | const T* operator->()const; 27 | 28 | T* operator->(); 29 | bool operator !()const; 30 | 31 | template 32 | T& operator = ( U&& u ); 33 | 34 | T& operator = ( fwd&& u ); 35 | T& operator = ( const fwd& u ); 36 | 37 | ~fwd(); 38 | 39 | private: 40 | aligned _store; 41 | }; 42 | 43 | 44 | } // namespace fc 45 | 46 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/git_revision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | extern const char* const git_revision_sha; 7 | extern const uint32_t git_revision_unix_timestamp; 8 | 9 | } // end namespace fc 10 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/interprocess/file_mapping.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace boost { 6 | namespace interprocess { 7 | class file_mapping; 8 | class mapped_region; 9 | } 10 | } 11 | namespace fc { 12 | enum mode_t { 13 | read_only, 14 | write_only, 15 | read_write 16 | }; 17 | 18 | class file_mapping { 19 | public: 20 | file_mapping( const char* file, mode_t ); 21 | ~file_mapping(); 22 | private: 23 | friend class mapped_region; 24 | #ifdef _WIN64 25 | fc::fwd my; 26 | #else 27 | fc::fwd my; 28 | #endif 29 | }; 30 | 31 | class mapped_region { 32 | public: 33 | mapped_region( const file_mapping& fm, mode_t m, uint64_t start, size_t size ); 34 | mapped_region( const file_mapping& fm, mode_t m ); 35 | ~mapped_region(); 36 | void flush(); 37 | void* get_address()const; 38 | size_t get_size()const; 39 | private: 40 | fc::fwd my; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/interprocess/file_mutex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | namespace fc { 8 | class microseconds; 9 | class time_point; 10 | class path; 11 | struct context; 12 | 13 | namespace detail { class file_mutex_impl; } 14 | 15 | /** 16 | * The purpose of this class is to support synchronization of 17 | * processes, threads, and coop-threads. 18 | * 19 | * Before grabbing the lock for a thread or coop, a file_mutex will first 20 | * grab a process-level lock. After grabbing the process level lock, it will 21 | * synchronize in the same way as a local process lock. 22 | */ 23 | class file_mutex { 24 | public: 25 | file_mutex( const fc::path& filename ); 26 | ~file_mutex(); 27 | 28 | bool try_lock(); 29 | bool try_lock_for( const microseconds& rel_time ); 30 | bool try_lock_until( const time_point& abs_time ); 31 | void lock(); 32 | void unlock(); 33 | 34 | void lock_shared(); 35 | void unlock_shared(); 36 | bool try_lock_shared(); 37 | 38 | int readers()const; 39 | 40 | private: 41 | std::unique_ptr my; 42 | }; 43 | 44 | } // namespace fc 45 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/interprocess/process.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc { 5 | 6 | fc::path find_executable_in_path( const fc::string name ); 7 | 8 | /** 9 | * @brief start and manage an local process 10 | * @note this class implements reference semantics. 11 | */ 12 | class process : public iprocess 13 | { 14 | public: 15 | process(); 16 | ~process(); 17 | 18 | virtual iprocess& exec( const fc::path& exe, 19 | std::vector args, 20 | const fc::path& work_dir = fc::path(), 21 | int opts = open_all ); 22 | 23 | 24 | virtual int result(const microseconds& timeout = microseconds::maximum()); 25 | virtual void kill(); 26 | virtual fc::buffered_ostream_ptr in_stream(); 27 | virtual fc::buffered_istream_ptr out_stream(); 28 | virtual fc::buffered_istream_ptr err_stream(); 29 | 30 | class impl; 31 | private: 32 | std::unique_ptr my; 33 | }; 34 | 35 | typedef std::shared_ptr process_ptr; 36 | 37 | } // namespace fc 38 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/interprocess/signals.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc 5 | { 6 | /// handler will be called from ASIO thread 7 | void set_signal_handler( std::function handler, int signal_num ); 8 | } 9 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/io/console.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace fc 3 | { 4 | /** enables / disables echoing of console input, useful for 5 | * entering passwords on the console. 6 | */ 7 | void set_console_echo( bool enable_echo ); 8 | } // namespace fc 9 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/io/raw_unpack_file.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc 8 | { 9 | namespace raw 10 | { 11 | template 12 | void unpack_file( const fc::path& filename, T& obj ) 13 | { 14 | try { 15 | fc::file_mapping fmap( filename.generic_string().c_str(), fc::read_only); 16 | fc::mapped_region mapr( fmap, fc::read_only, 0, fc::file_size(filename) ); 17 | auto cs = (const char*)mapr.get_address(); 18 | 19 | fc::datastream ds( cs, mapr.get_size() ); 20 | fc::raw::unpack(ds,obj); 21 | } FC_RETHROW_EXCEPTIONS( info, "unpacking file ${file}", ("file",filename) ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/io/sstream.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | 7 | class stringstream : virtual public iostream { 8 | public: 9 | stringstream(); 10 | stringstream( fc::string& s); 11 | stringstream( const fc::string& s); 12 | ~stringstream(); 13 | 14 | fc::string str(); 15 | void str(const fc::string& s); 16 | 17 | void clear(); 18 | 19 | virtual bool eof()const; 20 | virtual size_t writesome( const char* buf, size_t len ); 21 | virtual size_t writesome( const std::shared_ptr& buf, size_t len, size_t offset ); 22 | virtual size_t readsome( char* buf, size_t len ); 23 | virtual size_t readsome( const std::shared_ptr& buf, size_t len, size_t offset ); 24 | virtual void close(); 25 | virtual void flush(); 26 | char peek(); 27 | 28 | private: 29 | class impl; 30 | fwd my; 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/io/stdio.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace fc 5 | { 6 | 7 | class cout_t : virtual public ostream { 8 | public: 9 | virtual size_t writesome( const char* buf, size_t len ); 10 | virtual size_t writesome( const std::shared_ptr& buf, size_t len, size_t offset ); 11 | virtual void close(); 12 | virtual void flush(); 13 | }; 14 | 15 | class cerr_t : virtual public ostream { 16 | public: 17 | virtual size_t writesome( const char* buf, size_t len ); 18 | virtual size_t writesome( const std::shared_ptr& buf, size_t len, size_t offset ); 19 | virtual void close(); 20 | virtual void flush(); 21 | }; 22 | 23 | class cin_t : virtual public istream { 24 | public: 25 | ~cin_t(); 26 | virtual size_t readsome( char* buf, size_t len ); 27 | virtual size_t readsome( const std::shared_ptr& buf, size_t len, size_t offset ); 28 | virtual istream& read( char* buf, size_t len ); 29 | virtual bool eof()const; 30 | }; 31 | 32 | extern cout_t& cout; 33 | extern cerr_t& cerr; 34 | extern cin_t& cin; 35 | 36 | extern std::shared_ptr cin_ptr; 37 | extern std::shared_ptr cout_ptr; 38 | extern std::shared_ptr cerr_ptr; 39 | } 40 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/log/file_appender.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace fc { 9 | 10 | class file_appender : public appender { 11 | public: 12 | struct config { 13 | config( const fc::path& p = "log.txt" ); 14 | 15 | fc::string format; 16 | fc::path filename; 17 | bool flush = true; 18 | bool rotate = false; 19 | microseconds rotation_interval; 20 | microseconds rotation_limit; 21 | }; 22 | file_appender( const variant& args ); 23 | ~file_appender(); 24 | virtual void log( const log_message& m )override; 25 | 26 | private: 27 | class impl; 28 | fc::shared_ptr my; 29 | }; 30 | } // namespace fc 31 | 32 | #include 33 | FC_REFLECT( fc::file_appender::config, 34 | (format)(filename)(flush)(rotate)(rotation_interval)(rotation_limit) ) 35 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/log/gelf_appender.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc 8 | { 9 | // Log appender that sends log messages in JSON format over UDP 10 | // https://www.graylog2.org/resources/gelf/specification 11 | class gelf_appender : public appender 12 | { 13 | public: 14 | struct config 15 | { 16 | string endpoint = "127.0.0.1:12201"; 17 | string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server) 18 | }; 19 | 20 | gelf_appender(const variant& args); 21 | ~gelf_appender(); 22 | virtual void log(const log_message& m) override; 23 | 24 | private: 25 | class impl; 26 | fc::shared_ptr my; 27 | }; 28 | } // namespace fc 29 | 30 | #include 31 | FC_REFLECT(fc::gelf_appender::config, 32 | (endpoint)(host)) 33 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/make_fused.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | template 7 | std::function > make_fused( const std::function& f ) { 8 | return [=]( fc::tuple<> ){ return f(); }; 9 | } 10 | template 11 | std::function) > make_fused( const std::function& f ) { 12 | return [f]( fc::tuple t){ return f(t.a); }; 13 | } 14 | template 15 | std::function) > make_fused( const std::function& f ) { 16 | return [f]( fc::tuple t){ return f(t.a,t.b); }; 17 | } 18 | template 19 | std::function) > make_fused( const std::function& f ) { 20 | return [f]( fc::tuple t){ return f(t.a,t.b,t.c); }; 21 | } 22 | template 23 | std::function) > make_fused( const std::function& f ) { 24 | return [f]( fc::tuple t){ return f(t.a,t.b,t.c,t.d); }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/rate_limiting.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace fc 9 | { 10 | namespace detail 11 | { 12 | class rate_limiting_group_impl; 13 | } 14 | 15 | class tcp_socket; 16 | 17 | class rate_limiting_group 18 | { 19 | public: 20 | rate_limiting_group(uint32_t upload_bytes_per_second, uint32_t download_bytes_per_second, uint32_t burstiness_in_seconds = 1); 21 | ~rate_limiting_group(); 22 | 23 | void set_upload_limit(uint32_t upload_bytes_per_second); 24 | uint32_t get_upload_limit() const; 25 | 26 | void set_download_limit(uint32_t download_bytes_per_second); 27 | uint32_t get_download_limit() const; 28 | 29 | uint32_t get_actual_upload_rate() const; 30 | uint32_t get_actual_download_rate() const; 31 | void set_actual_rate_time_constant(microseconds time_constant); 32 | 33 | void add_tcp_socket(tcp_socket* tcp_socket_to_limit); 34 | void remove_tcp_socket(tcp_socket* tcp_socket_to_stop_limiting); 35 | private: 36 | std::unique_ptr my; 37 | }; 38 | typedef std::shared_ptr rate_limiting_group_ptr; 39 | 40 | } // namesapce fc 41 | 42 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/resolve.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve( const std::string& host, uint16_t port ); 8 | } 9 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/tcp_socket_io_hooks.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | class tcp_socket_io_hooks 7 | { 8 | public: 9 | virtual ~tcp_socket_io_hooks() {} 10 | virtual size_t readsome(boost::asio::ip::tcp::socket& socket, char* buffer, size_t length) = 0; 11 | virtual size_t readsome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr& buffer, size_t length, size_t offset) = 0; 12 | virtual size_t writesome(boost::asio::ip::tcp::socket& socket, const char* buffer, size_t length) = 0; 13 | virtual size_t writesome(boost::asio::ip::tcp::socket& socket, const std::shared_ptr& buffer, size_t length, size_t offset) = 0; 14 | }; 15 | } // namesapce fc 16 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/network/udp_socket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | namespace ip { 8 | class endpoint; 9 | class address; 10 | } 11 | 12 | /** 13 | * The udp_socket class has reference semantics, all copies will 14 | * refer to the same underlying socket. 15 | */ 16 | class udp_socket { 17 | public: 18 | udp_socket(); 19 | udp_socket( const udp_socket& s ); 20 | ~udp_socket(); 21 | 22 | void open(); 23 | void set_receive_buffer_size( size_t s ); 24 | void bind( const fc::ip::endpoint& ); 25 | size_t receive_from( char* b, size_t l, fc::ip::endpoint& from ); 26 | size_t receive_from( const std::shared_ptr& b, size_t l, fc::ip::endpoint& from ); 27 | size_t send_to( const char* b, size_t l, const fc::ip::endpoint& to ); 28 | size_t send_to( const std::shared_ptr& b, size_t l, const fc::ip::endpoint& to ); 29 | void close(); 30 | 31 | void set_multicast_enable_loopback( bool ); 32 | void set_reuse_address( bool ); 33 | void join_multicast_group( const fc::ip::address& a ); 34 | 35 | void connect( const fc::ip::endpoint& e ); 36 | fc::ip::endpoint local_endpoint()const; 37 | 38 | private: 39 | class impl; 40 | fc::shared_ptr my; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc 4 | { 5 | class noncopyable 6 | { 7 | public: 8 | noncopyable(){} 9 | private: 10 | noncopyable( const noncopyable& ) = delete; 11 | noncopyable& operator=( const noncopyable& ) = delete; 12 | }; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/platform_independence.hpp: -------------------------------------------------------------------------------- 1 | #ifdef _MSC_VER 2 | #include 3 | #ifdef _M_X64 4 | #define __builtin_popcountll __popcnt64 5 | #else 6 | inline int __builtin_popcountll(unsigned __int64 value) 7 | { 8 | unsigned int lowBits = (unsigned int)value; 9 | int count = __popcnt(lowBits); 10 | unsigned int highBits = (unsigned int)(value >> 32); 11 | count += __popcnt(highBits); 12 | return count; 13 | } 14 | #endif 15 | #endif -------------------------------------------------------------------------------- /libraries/fc/include/fc/rpc/cli.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | namespace fc { namespace rpc { 12 | 13 | /** 14 | * Provides a simple wrapper for RPC calls to a given interface. 15 | */ 16 | class cli : public api_connection 17 | { 18 | public: 19 | ~cli(); 20 | 21 | virtual variant send_call( api_id_type api_id, string method_name, variants args = variants() ); 22 | virtual variant send_callback( uint64_t callback_id, variants args = variants() ); 23 | virtual void send_notice( uint64_t callback_id, variants args = variants() ); 24 | 25 | void start(); 26 | void stop(); 27 | void wait(); 28 | void format_result( const string& method, std::function formatter); 29 | 30 | virtual void getline( const fc::string& prompt, fc::string& line ); 31 | 32 | void set_prompt( const string& prompt ); 33 | 34 | private: 35 | void run(); 36 | 37 | std::string _prompt = ">>>"; 38 | std::map > _result_formatters; 39 | fc::future _run_complete; 40 | }; 41 | } } 42 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/rpc/http_api.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace fc { namespace rpc { 10 | 11 | class http_api_connection : public api_connection 12 | { 13 | public: 14 | http_api_connection(); 15 | ~http_api_connection(); 16 | 17 | virtual variant send_call( 18 | api_id_type api_id, 19 | string method_name, 20 | variants args = variants() ) override; 21 | virtual variant send_callback( 22 | uint64_t callback_id, 23 | variants args = variants() ) override; 24 | virtual void send_notice( 25 | uint64_t callback_id, 26 | variants args = variants() ) override; 27 | 28 | void on_request( 29 | const fc::http::request& req, 30 | const fc::http::server::response& resp ); 31 | 32 | fc::rpc::state _rpc_state; 33 | }; 34 | 35 | } } // namespace fc::rpc 36 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/rpc/variant_stream.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc 4 | { 5 | 6 | /** 7 | * Thread-safe, circular buffer for passing variants 8 | * between threads. 9 | */ 10 | class variant_stream 11 | { 12 | public: 13 | variant_stream( size_t s ); 14 | ~variant_stream(); 15 | 16 | /** producer api */ 17 | int64_t free(); // number of spaces available 18 | int64_t claim( int64_t num ); 19 | int64_t publish( int64_t pos ); 20 | int64_t wait_free(); // wait for free space 21 | 22 | // producer/consumer api 23 | variant& get( int64_t pos ); 24 | 25 | /** consumer api */ 26 | int64_t begin(); // returns the first index ready to be read 27 | int64_t end(); // returns the first index that cannot be read 28 | int64_t wait(); // wait for variants to be posted 29 | 30 | private: 31 | std::vector _variants; 32 | uint64_t _read_pos; 33 | uint64_t _write_pos; 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/rpc/websocket_api.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace fc { namespace rpc { 9 | 10 | class websocket_api_connection : public api_connection 11 | { 12 | public: 13 | websocket_api_connection( fc::http::websocket_connection& c ); 14 | ~websocket_api_connection(); 15 | 16 | virtual variant send_call( 17 | api_id_type api_id, 18 | string method_name, 19 | variants args = variants() ) override; 20 | virtual variant send_callback( 21 | uint64_t callback_id, 22 | variants args = variants() ) override; 23 | virtual void send_notice( 24 | uint64_t callback_id, 25 | variants args = variants() ) override; 26 | 27 | protected: 28 | std::string on_message( 29 | const std::string& message, 30 | bool send_message = true ); 31 | 32 | fc::http::websocket_connection& _connection; 33 | fc::rpc::state _rpc_state; 34 | }; 35 | 36 | } } // namespace fc::rpc 37 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/scoped_exit.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | 5 | template 6 | class scoped_exit { 7 | public: 8 | template 9 | scoped_exit( C&& c ):callback( std::forward(c) ){} 10 | scoped_exit( scoped_exit&& mv ):callback( std::move( mv.callback ) ){} 11 | 12 | ~scoped_exit() { 13 | try { callback(); } catch( ... ) {} 14 | } 15 | 16 | scoped_exit& operator = ( scoped_exit&& mv ) { 17 | callback = std::move(mv); 18 | return *this; 19 | } 20 | private: 21 | scoped_exit( const scoped_exit& ); 22 | scoped_exit& operator=( const scoped_exit& ); 23 | 24 | Callback callback; 25 | }; 26 | 27 | template 28 | scoped_exit make_scoped_exit( Callback&& c ) { 29 | return scoped_exit( std::forward(c) ); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/smart_ref_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | /** 5 | * @brief Used to forward declare value types and break circular dependencies or use heap allocation 6 | * 7 | * A smart reference is heap allocated, move-aware, and is gauranteed to never be null (except after a move) 8 | */ 9 | template 10 | class smart_ref { 11 | public: 12 | template smart_ref( U&& u ); 13 | template smart_ref( U&& u, V&& v ); 14 | template smart_ref( U&& u, V&& v, X&&, Y&& ); 15 | smart_ref(); 16 | 17 | smart_ref( const smart_ref& f ); 18 | smart_ref( smart_ref&& f ); 19 | 20 | operator const T&()const; 21 | operator T&(); 22 | 23 | T& operator*(); 24 | const T& operator*()const; 25 | const T* operator->()const; 26 | 27 | T* operator->(); 28 | bool operator !()const; 29 | 30 | template 31 | T& operator = ( U&& u ); 32 | 33 | T& operator = ( smart_ref&& u ); 34 | T& operator = ( const smart_ref& u ); 35 | 36 | ~smart_ref(); 37 | 38 | private: 39 | T* impl; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/non_preemptable_scope_check.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | // This file defines a macro: 6 | // ASSERT_TASK_NOT_PREEMPTED() 7 | // This macro is used to declare that the current scope is not expected to yield. 8 | // If the task does yield, it will generate an assertion. 9 | // 10 | // Use this when you you're coding somethign that must not yield, and you think you 11 | // have done it (just by virtue of the fact that you don't think you've called any 12 | // functions that could yield). This will help detect when your assumptions are 13 | // wrong and you accidentally call something that yields. 14 | // 15 | // This has no cost in release mode, and is extremely cheap in debug mode. 16 | 17 | #define FC_NON_PREEMPTABLE_SCOPE_COMBINE_HELPER(x,y) x ## y 18 | #define FC_NON_PREEMPTABLE_SCOPE_COMBINE(x,y) FC_NON_PREEMPTABLE_SCOPE_COMBINE_HELPER(x,y) 19 | 20 | #ifdef NDEBUG 21 | # define ASSERT_TASK_NOT_PREEMPTED() do {} while (0) 22 | #else 23 | # define ASSERT_TASK_NOT_PREEMPTED() fc::non_preemptable_scope_check FC_NON_PREEMPTABLE_SCOPE_COMBINE(scope_checker_, __LINE__) 24 | 25 | namespace fc 26 | { 27 | class non_preemptable_scope_check 28 | { 29 | public: 30 | non_preemptable_scope_check(); 31 | ~non_preemptable_scope_check(); 32 | }; 33 | } // namespace fc 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/priority.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _FC_PRIORITY_HPP_ 2 | #define _FC_PRIORITY_HPP_ 3 | 4 | namespace fc { 5 | /** 6 | * An integer value used to sort asynchronous tasks. The higher the 7 | * prioirty the sooner it will be run. 8 | */ 9 | class priority { 10 | public: 11 | explicit priority( int v = 0):value(v){} 12 | priority( const priority& p ):value(p.value){} 13 | bool operator < ( const priority& p )const { 14 | return value < p.value; 15 | } 16 | static priority max() { return priority(10000); } 17 | static priority min() { return priority(-10000); } 18 | static priority _internal__priority_for_short_sleeps() { return priority(-100000); } 19 | int value; 20 | }; 21 | } 22 | #endif // _FC_PRIORITY_HPP_ 23 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/scoped_lock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | template 5 | class scoped_lock { 6 | public: 7 | scoped_lock( T& l ):_lock(l) { _lock.lock(); } 8 | ~scoped_lock() { _lock.unlock(); } 9 | T& _lock; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/spin_lock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | class microseconds; 5 | class time_point; 6 | 7 | /** 8 | * @class spin_lock 9 | * @brief modified spin-lock that yields on failure, but becomes a 'spin lock' 10 | * if there are no other tasks to yield to. 11 | * 12 | * This kind of lock is lighter weight than a full mutex, but potentially slower 13 | * than a staight spin_lock. 14 | * 15 | * This spin_lock does not block the current thread, but instead attempts to use 16 | * an atomic operation to aquire the lock. If unsuccessful, then it yields to 17 | * other tasks before trying again. If there are no other tasks then yield is 18 | * a no-op and spin_lock becomes a spin-lock. 19 | */ 20 | class spin_lock { 21 | public: 22 | spin_lock(); 23 | bool try_lock(); 24 | bool try_lock_for( const microseconds& rel_time ); 25 | bool try_lock_until( const time_point& abs_time ); 26 | void lock(); 27 | void unlock(); 28 | 29 | private: 30 | enum lock_store {locked,unlocked}; 31 | int _lock; 32 | }; 33 | 34 | } // namespace fc 35 | 36 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/thread/spin_yield_lock.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace fc { 4 | class microseconds; 5 | class time_point; 6 | 7 | /** 8 | * @class spin_yield_lock 9 | * @brief modified spin-lock that yields on failure, but becomes a 'spin lock' 10 | * if there are no other tasks to yield to. 11 | * 12 | * This kind of lock is lighter weight than a full mutex, but potentially slower 13 | * than a staight spin_lock. 14 | * 15 | * This spin_yield_lock does not block the current thread, but instead attempts to use 16 | * an atomic operation to aquire the lock. If unsuccessful, then it yields to 17 | * other tasks before trying again. If there are no other tasks then yield is 18 | * a no-op and spin_yield_lock becomes a spin-lock. 19 | */ 20 | class spin_yield_lock { 21 | public: 22 | spin_yield_lock(); 23 | bool try_lock(); 24 | bool try_lock_for( const microseconds& rel_time ); 25 | bool try_lock_until( const time_point& abs_time ); 26 | void lock(); 27 | void unlock(); 28 | 29 | private: 30 | enum lock_store {locked,unlocked}; 31 | int _lock; 32 | }; 33 | 34 | } // namespace fc 35 | 36 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/utf8.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __UTF8_HPP 2 | #define __UTF8_HPP 3 | 4 | #include 5 | 6 | /// This file contains general purpose utilities related to UTF-8 <-> Unicode conversions 7 | 8 | namespace fc 9 | { 10 | 11 | std::string prune_invalid_utf8( const std::string& str ); 12 | 13 | bool is_utf8( const std::string& str ); 14 | 15 | /** Decodes utf 8 std::string into unicode string. 16 | @param input - input string to be decoded and stored in 'storage' 17 | @param storage - buffer for converted text. Cannot be nullptr. 18 | */ 19 | void decodeUtf8(const std::string& input, std::wstring* storage); 20 | 21 | /** Encodes given wide (unicode) string into UTF-8 representation. 22 | @param input - input string to be encoded and stored in 'storage' 23 | @param storage - buffer for converted text. Cannot be nullptr. 24 | */ 25 | void encodeUtf8(const std::wstring& input, std::string* storage); 26 | 27 | } /// namespace fc 28 | 29 | #endif ///__UTF8_HPP 30 | 31 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/vector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/vector_fwd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _FC_VECTOR_FWD_HPP_ 2 | #define _FC_VECTOR_FWD_HPP_ 3 | #if 0 4 | #include 5 | #else 6 | namespace fc { 7 | template class vector; 8 | }; 9 | #endif 10 | 11 | #endif // _FC_VECTOR_FWD_HPP_ 12 | -------------------------------------------------------------------------------- /libraries/fc/include/fc/wait_any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { 6 | template 7 | int wait_any( fc::future& f1, fc::future& f2, const microseconds& timeout_us = microseconds::max() ) { 8 | fc::vector p(2); 9 | p[0] = static_pointer_cast(f1.promise()); 10 | p[1] = static_pointer_cast(f2.promise()); 11 | return wait( fc::move(p), timeout_us ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /libraries/fc/src/byteswap.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | # include 5 | # define bswap_64(x) _byteswap_uint64(x) 6 | #elif defined(__APPLE__) 7 | # include 8 | # define bswap_64(x) OSSwapInt64(x) 9 | #else 10 | # include 11 | #endif 12 | -------------------------------------------------------------------------------- /libraries/fc/src/compress/zlib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "miniz.c" 4 | 5 | namespace fc 6 | { 7 | string zlib_compress(const string& in) 8 | { 9 | size_t compressed_message_length; 10 | char* compressed_message = (char*)tdefl_compress_mem_to_heap(in.c_str(), in.size(), &compressed_message_length, TDEFL_WRITE_ZLIB_HEADER | TDEFL_DEFAULT_MAX_PROBES); 11 | string result(compressed_message, compressed_message_length); 12 | free(compressed_message); 13 | return result; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/_digest_common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Common stuff for cryptographic hashes 4 | */ 5 | namespace fc { namespace detail { 6 | void shift_l( const char* in, char* out, std::size_t n, unsigned int i); 7 | void shift_r( const char* in, char* out, std::size_t n, unsigned int i); 8 | }} 9 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/_elliptic_impl_priv.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | /* private_key_impl based on libsecp256k1 5 | * used by mixed + secp256k1 6 | */ 7 | 8 | namespace fc { namespace ecc { namespace detail { 9 | 10 | 11 | const secp256k1_context_t* _get_context(); 12 | void _init_lib(); 13 | 14 | class private_key_impl 15 | { 16 | public: 17 | private_key_impl() BOOST_NOEXCEPT; 18 | private_key_impl( const private_key_impl& cpy ) BOOST_NOEXCEPT; 19 | 20 | private_key_impl& operator=( const private_key_impl& pk ) BOOST_NOEXCEPT; 21 | 22 | private_key_secret _key; 23 | }; 24 | 25 | }}} 26 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/_elliptic_impl_pub.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | /* public_key_impl implementation based on openssl 6 | * used by mixed + openssl 7 | */ 8 | 9 | namespace fc { namespace ecc { namespace detail { 10 | 11 | void _init_lib(); 12 | 13 | class public_key_impl 14 | { 15 | public: 16 | public_key_impl() BOOST_NOEXCEPT; 17 | public_key_impl( const public_key_impl& cpy ) BOOST_NOEXCEPT; 18 | public_key_impl( public_key_impl&& cpy ) BOOST_NOEXCEPT; 19 | ~public_key_impl() BOOST_NOEXCEPT; 20 | 21 | public_key_impl& operator=( const public_key_impl& pk ) BOOST_NOEXCEPT; 22 | 23 | public_key_impl& operator=( public_key_impl&& pk ) BOOST_NOEXCEPT; 24 | 25 | static int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check); 26 | 27 | EC_KEY* _key = nullptr; 28 | 29 | private: 30 | void free_key() BOOST_NOEXCEPT; 31 | }; 32 | 33 | }}} 34 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/elliptic_mixed.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include "_elliptic_impl_priv.hpp" 14 | #include "_elliptic_impl_pub.hpp" 15 | 16 | namespace fc { namespace ecc { 17 | namespace detail 18 | { 19 | const secp256k1_context_t* _get_context() { 20 | static secp256k1_context_t* ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN); 21 | return ctx; 22 | } 23 | 24 | void _init_lib() { 25 | static const secp256k1_context_t* ctx = _get_context(); 26 | static int init_o = init_openssl(); 27 | } 28 | } 29 | 30 | static const private_key_secret empty_priv; 31 | fc::sha512 private_key::get_shared_secret( const public_key& other )const 32 | { 33 | FC_ASSERT( my->_key != empty_priv ); 34 | FC_ASSERT( other.my->_key != nullptr ); 35 | public_key_data pub(other.serialize()); 36 | FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) pub.begin(), pub.size(), (unsigned char*) my->_key.data() ) ); 37 | return fc::sha512::hash( pub.begin() + 1, pub.size() - 1 ); 38 | } 39 | 40 | } } 41 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/openssl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace fc 12 | { 13 | struct openssl_scope 14 | { 15 | static path _configurationFilePath; 16 | openssl_scope() 17 | { 18 | ERR_load_crypto_strings(); 19 | OpenSSL_add_all_algorithms(); 20 | 21 | const boost::filesystem::path& boostPath = _configurationFilePath; 22 | if(boostPath.empty() == false) 23 | { 24 | std::string varSetting("OPENSSL_CONF="); 25 | varSetting += _configurationFilePath.to_native_ansi_path(); 26 | #if defined(WIN32) 27 | _putenv((char*)varSetting.c_str()); 28 | #else 29 | putenv((char*)varSetting.c_str()); 30 | #endif 31 | } 32 | 33 | OPENSSL_config(nullptr); 34 | } 35 | 36 | ~openssl_scope() 37 | { 38 | EVP_cleanup(); 39 | ERR_free_strings(); 40 | } 41 | }; 42 | 43 | path openssl_scope::_configurationFilePath; 44 | 45 | void store_configuration_path(const path& filePath) 46 | { 47 | openssl_scope::_configurationFilePath = filePath; 48 | } 49 | 50 | int init_openssl() 51 | { 52 | static openssl_scope ossl; 53 | return 0; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /libraries/fc/src/crypto/rand.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | namespace fc { 8 | 9 | void rand_bytes(char* buf, int count) 10 | { 11 | static int init = init_openssl(); 12 | 13 | int result = RAND_bytes((unsigned char*)buf, count); 14 | if (result != 1) 15 | FC_THROW("Error calling OpenSSL's RAND_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 16 | } 17 | 18 | void rand_pseudo_bytes(char* buf, int count) 19 | { 20 | static int init = init_openssl(); 21 | 22 | int result = RAND_pseudo_bytes((unsigned char*)buf, count); 23 | if (result == -1) 24 | FC_THROW("Error calling OpenSSL's RAND_pseudo_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 25 | } 26 | 27 | } // namespace fc 28 | -------------------------------------------------------------------------------- /libraries/fc/src/git_revision.cpp.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define FC_GIT_REVISION_SHA "@FC_GIT_REVISION_SHA@" 4 | #define FC_GIT_REVISION_UNIX_TIMESTAMP @FC_GIT_REVISION_UNIX_TIMESTAMP@ 5 | 6 | namespace fc { 7 | 8 | const char* const git_revision_sha = FC_GIT_REVISION_SHA; 9 | const uint32_t git_revision_unix_timestamp = FC_GIT_REVISION_UNIX_TIMESTAMP; 10 | 11 | } // end namespace fc 12 | -------------------------------------------------------------------------------- /libraries/fc/src/interprocess/file_mapping.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | 9 | file_mapping::file_mapping( const char* file, mode_t m ) : 10 | my(file, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write ) 11 | {} 12 | 13 | file_mapping::~file_mapping() {} 14 | 15 | 16 | 17 | mapped_region::mapped_region( const file_mapping& fm, mode_t m, uint64_t start, size_t size ) : 18 | my( *fm.my, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write ,start, size) 19 | {} 20 | 21 | mapped_region::mapped_region( const file_mapping& fm, mode_t m ) : 22 | my( *fm.my, m == read_only ? boost::interprocess::read_only : boost::interprocess::read_write) 23 | {} 24 | 25 | mapped_region::~mapped_region(){} 26 | 27 | void* mapped_region::get_address() const 28 | { 29 | return my->get_address(); 30 | } 31 | 32 | void mapped_region::flush() 33 | { 34 | my->flush(); 35 | } 36 | 37 | size_t mapped_region::get_size() const 38 | { 39 | return my->get_size(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /libraries/fc/src/interprocess/mmap_struct.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | namespace fc 11 | { 12 | namespace detail 13 | { 14 | size_t mmap_struct_base::size()const { return _mapped_region->get_size(); } 15 | void mmap_struct_base::flush() 16 | { 17 | _mapped_region->flush(); 18 | } 19 | 20 | void mmap_struct_base::open( const fc::path& file, size_t s, bool create ) 21 | { 22 | if( !fc::exists( file ) || fc::file_size(file) != s ) 23 | { 24 | fc::ofstream out( file ); 25 | char buffer[1024]; 26 | memset( buffer, 0, sizeof(buffer) ); 27 | 28 | size_t bytes_left = s; 29 | while( bytes_left > 0 ) 30 | { 31 | size_t to_write = std::min(bytes_left, sizeof(buffer) ); 32 | out.write( buffer, to_write ); 33 | bytes_left -= to_write; 34 | } 35 | } 36 | 37 | std::string filePath = file.to_native_ansi_path(); 38 | 39 | _file_mapping.reset( new fc::file_mapping( filePath.c_str(), fc::read_write ) ); 40 | _mapped_region.reset( new fc::mapped_region( *_file_mapping, fc::read_write, 0, s ) ); 41 | } 42 | } // namespace fc 43 | 44 | } // namespace fc 45 | -------------------------------------------------------------------------------- /libraries/fc/src/interprocess/signals.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | void set_signal_handler( std::function handler, int signal_num ) 7 | { 8 | std::shared_ptr sig_set(new boost::asio::signal_set(fc::asio::default_io_service(), signal_num)); 9 | sig_set->async_wait( 10 | [sig_set,handler]( const boost::system::error_code& err, int num ) 11 | { 12 | handler( num ); 13 | sig_set->cancel(); 14 | // set_signal_handler( handler, signal_num ); 15 | } ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libraries/fc/src/io/console.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc { 5 | 6 | #ifdef WIN32 7 | #include 8 | 9 | void set_console_echo( bool enable_echo ) 10 | { 11 | auto stdin_handle = GetStdHandle( STD_INPUT_HANDLE ); 12 | DWORD mode = 0; 13 | GetConsoleMode( stdin_handle, &mode ); 14 | if( enable_echo ) 15 | { 16 | SetConsoleMode( stdin_handle, mode | ENABLE_ECHO_INPUT ); 17 | } 18 | else 19 | { 20 | SetConsoleMode( stdin_handle, mode & (~ENABLE_ECHO_INPUT) ); 21 | } 22 | } 23 | 24 | #else // NOT WIN32 25 | #include 26 | #include 27 | 28 | void set_console_echo( bool enable_echo ) 29 | { 30 | termios oldt; 31 | tcgetattr(STDIN_FILENO, &oldt); 32 | termios newt = oldt; 33 | if( enable_echo ) 34 | { 35 | newt.c_lflag |= ECHO; 36 | } 37 | else 38 | { 39 | newt.c_lflag &= ~ECHO; 40 | } 41 | tcsetattr(STDIN_FILENO, TCSANOW, &newt); 42 | } 43 | 44 | #endif // WIN32 45 | 46 | } // namespace fc 47 | -------------------------------------------------------------------------------- /libraries/fc/src/io/datastream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | NO_RETURN void fc::detail::throw_datastream_range_error(char const* method, size_t len, int64_t over) 5 | { 6 | FC_THROW_EXCEPTION( out_of_range_exception, "${method} datastream of length ${len} over by ${over}", ("method",fc::string(method))("len",len)("over",over) ); 7 | } 8 | -------------------------------------------------------------------------------- /libraries/fc/src/io/varint.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc 5 | { 6 | void to_variant( const signed_int& var, variant& vo ) { vo = var.value; } 7 | void from_variant( const variant& var, signed_int& vo ) { vo.value = static_cast(var.as_int64()); } 8 | void to_variant( const unsigned_int& var, variant& vo ) { vo = var.value; } 9 | void from_variant( const variant& var, unsigned_int& vo ) { vo.value = static_cast(var.as_uint64()); } 10 | } 11 | -------------------------------------------------------------------------------- /libraries/fc/src/network/resolve.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve( const fc::string& host, uint16_t port ) 8 | { 9 | auto ep = fc::asio::tcp::resolve( host, std::to_string(uint64_t(port)) ); 10 | std::vector eps; 11 | eps.reserve(ep.size()); 12 | for( auto itr = ep.begin(); itr != ep.end(); ++itr ) 13 | { 14 | if( itr->address().is_v4() ) 15 | { 16 | eps.push_back( fc::ip::endpoint(itr->address().to_v4().to_ulong(), itr->port()) ); 17 | } 18 | // TODO: add support for v6 19 | } 20 | return eps; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /libraries/fc/src/shared_ptr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | retainable::retainable() 8 | :_ref_count(1) { 9 | static_assert( sizeof(_ref_count) == sizeof(boost::atomic), "failed to reserve enough space" ); 10 | } 11 | 12 | retainable::~retainable() { 13 | assert( _ref_count <= 0 ); 14 | assert( _ref_count == 0 ); 15 | } 16 | void retainable::retain() { 17 | ((boost::atomic*)&_ref_count)->fetch_add(1, boost::memory_order_relaxed ); 18 | } 19 | 20 | void retainable::release() { 21 | boost::atomic_thread_fence(boost::memory_order_acquire); 22 | if( 1 == ((boost::atomic*)&_ref_count)->fetch_sub(1, boost::memory_order_release ) ) { 23 | delete this; 24 | } 25 | } 26 | 27 | int32_t retainable::retain_count()const { 28 | return _ref_count; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /libraries/fc/src/thread/non_preemptable_scope_check.cpp: -------------------------------------------------------------------------------- 1 | #ifndef NDEBUG 2 | #include 3 | #include 4 | #include "thread_d.hpp" 5 | 6 | 7 | namespace fc 8 | { 9 | non_preemptable_scope_check::non_preemptable_scope_check() 10 | { 11 | ++thread::current().my->non_preemptable_scope_count; 12 | } 13 | 14 | non_preemptable_scope_check::~non_preemptable_scope_check() 15 | { 16 | assert(thread::current().my->non_preemptable_scope_count > 0); 17 | --thread::current().my->non_preemptable_scope_count; 18 | } 19 | } // fc 20 | #endif -------------------------------------------------------------------------------- /libraries/fc/src/thread/spin_lock.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc { 8 | #define define_self boost::atomic* self = (boost::atomic*)&_lock 9 | spin_lock::spin_lock() 10 | { 11 | define_self; 12 | new (self) boost::atomic(); 13 | static_assert( sizeof(boost::atomic) == sizeof(_lock), "" ); 14 | self->store(unlocked); 15 | } 16 | 17 | bool spin_lock::try_lock() { 18 | define_self; 19 | return self->exchange(locked, boost::memory_order_acquire)!=locked; 20 | } 21 | 22 | bool spin_lock::try_lock_for( const fc::microseconds& us ) { 23 | return try_lock_until( fc::time_point::now() + us ); 24 | } 25 | 26 | bool spin_lock::try_lock_until( const fc::time_point& abs_time ) { 27 | while( abs_time > time_point::now() ) { 28 | if( try_lock() ) 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | void spin_lock::lock() { 35 | define_self; 36 | while( self->exchange(locked, boost::memory_order_acquire)==locked) { } 37 | } 38 | 39 | void spin_lock::unlock() { 40 | define_self; 41 | self->store(unlocked, boost::memory_order_release); 42 | } 43 | 44 | #undef define_self 45 | 46 | } // namespace fc 47 | -------------------------------------------------------------------------------- /libraries/fc/src/thread/spin_yield_lock.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace fc { 8 | void yield(); 9 | 10 | #define define_self boost::atomic* self = (boost::atomic*)&_lock 11 | 12 | spin_yield_lock::spin_yield_lock() 13 | { 14 | define_self; 15 | new (self) boost::atomic(); 16 | static_assert( sizeof(boost::atomic) == sizeof(_lock), "" ); 17 | self->store(unlocked); 18 | } 19 | 20 | bool spin_yield_lock::try_lock() { 21 | define_self; 22 | return self->exchange(locked, boost::memory_order_acquire)!=locked; 23 | } 24 | 25 | bool spin_yield_lock::try_lock_for( const fc::microseconds& us ) { 26 | return try_lock_until( fc::time_point::now() + us ); 27 | } 28 | 29 | bool spin_yield_lock::try_lock_until( const fc::time_point& abs_time ) { 30 | while( abs_time > time_point::now() ) { 31 | if( try_lock() ) 32 | return true; 33 | yield(); 34 | } 35 | return false; 36 | } 37 | 38 | void spin_yield_lock::lock() { 39 | define_self; 40 | while( self->exchange(locked, boost::memory_order_acquire)==locked) { 41 | yield(); 42 | } 43 | } 44 | 45 | void spin_yield_lock::unlock() { 46 | define_self; 47 | self->store(unlocked, boost::memory_order_release); 48 | } 49 | #undef define_self 50 | 51 | } // namespace fc 52 | -------------------------------------------------------------------------------- /libraries/fc/src/utf8.cpp: -------------------------------------------------------------------------------- 1 | #include "fc/utf8.hpp" 2 | 3 | #include "utf8/checked.h" 4 | #include "utf8/core.h" 5 | #include "utf8/unchecked.h" 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace fc { 13 | 14 | bool is_utf8( const std::string& str ) 15 | { 16 | auto itr = utf8::find_invalid(str.begin(), str.end()); 17 | return utf8::is_valid( str.begin(), str.end() ); 18 | } 19 | 20 | string prune_invalid_utf8( const string& str ) { 21 | string result; 22 | 23 | auto itr = utf8::find_invalid(str.begin(), str.end()); 24 | if( itr == str.end() ) return str; 25 | 26 | result = string( str.begin(), itr ); 27 | while( itr != str.end() ) { 28 | ++itr; 29 | auto start = itr; 30 | itr = utf8::find_invalid( start, str.end()); 31 | result += string( start, itr ); 32 | } 33 | return result; 34 | } 35 | 36 | void decodeUtf8(const std::string& input, std::wstring* storage) 37 | { 38 | assert(storage != nullptr); 39 | 40 | utf8::utf8to32(input.begin(), input.end(), std::back_inserter(*storage)); 41 | } 42 | 43 | void encodeUtf8(const std::wstring& input, std::string* storage) 44 | { 45 | assert(storage != nullptr); 46 | 47 | utf8::utf32to8(input.begin(), input.end(), std::back_inserter(*storage)); 48 | } 49 | 50 | } ///namespace fc 51 | 52 | 53 | -------------------------------------------------------------------------------- /libraries/fc/src/utf8/ReleaseNotes: -------------------------------------------------------------------------------- 1 | utf8 cpp library 2 | Release 2.3.4 3 | 4 | A minor bug fix release. Thanks to all who reported bugs. 5 | 6 | Note: Version 2.3.3 contained a regression, and therefore was removed. 7 | 8 | Changes from version 2.3.2 9 | - Bug fix [39]: checked.h Line 273 and unchecked.h Line 182 have an extra ';' 10 | - Bug fix [36]: replace_invalid() only works with back_inserter 11 | 12 | Files included in the release: utf8.h, core.h, checked.h, unchecked.h, utf8cpp.html, ReleaseNotes 13 | -------------------------------------------------------------------------------- /libraries/fc/tests/all_tests.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MODULE AllTests 2 | #include 3 | 4 | -------------------------------------------------------------------------------- /libraries/fc/tests/bip_lock.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main( int argc, char** argv ) { 8 | if( argc < 2 ) return 0; 9 | fc::file_mutex m( argv[1] ); 10 | auto mptr = &m; 11 | 12 | fc::thread in("in"); 13 | 14 | std::string cmd; 15 | std::cout << ">>> "; 16 | std::cin >> cmd; 17 | int i = 0; 18 | while( !std::cin.eof() && cmd != "q" ) { 19 | ++i; 20 | fc::async( [i, cmd,mptr]() { 21 | ilog( "start ${c} ${i}", ("c",cmd)("i",i) ); 22 | if( cmd == "L" ) { 23 | mptr->lock(); 24 | } else if( cmd == "l" ) { 25 | mptr->lock_shared(); 26 | } else if( cmd == "U" ) { 27 | mptr->unlock(); 28 | } else if( cmd == "u" ) { 29 | mptr->unlock_shared(); 30 | } 31 | ilog( "end ${c} ${i}", ("c",cmd)("i",i) ); 32 | } ); 33 | fc::usleep( fc::microseconds( 1000 ) ); 34 | cmd = in.async( [&]() { 35 | std::string tmp; 36 | wdump((m.readers())); 37 | std::cin >> tmp; 38 | return tmp; 39 | } ); 40 | } 41 | std::cout << "done"; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /libraries/fc/tests/crypto/ecc-interop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #TIME=time 4 | 5 | cd "`dirname $0`"/.. 6 | 7 | echo Building ecc_test with openssl... 8 | ( 9 | cmake -D ECC_IMPL=openssl . 10 | make ecc_test 11 | mv ecc_test ecc_test.openssl 12 | ) >/dev/null 2>&1 13 | 14 | echo Building ecc_test with secp256k1... 15 | ( 16 | cmake -D ECC_IMPL=secp256k1 . 17 | make ecc_test 18 | mv ecc_test ecc_test.secp256k1 19 | ) >/dev/null 2>&1 20 | 21 | echo Building ecc_test with mixed... 22 | ( 23 | cmake -D ECC_IMPL=mixed . 24 | make ecc_test 25 | mv ecc_test ecc_test.mixed 26 | ) >/dev/null 2>&1 27 | 28 | run () { 29 | echo "Running ecc_test.$1 test ecc.interop.$2 ..." 30 | $TIME "./ecc_test.$1" test "ecc.interop.$2" 31 | } 32 | 33 | run openssl openssl 34 | run openssl openssl 35 | run secp256k1 secp256k1 36 | run secp256k1 secp256k1 37 | run mixed mixed 38 | run mixed mixed 39 | run openssl secp256k1 40 | run openssl mixed 41 | run secp256k1 openssl 42 | run secp256k1 mixed 43 | run mixed openssl 44 | run mixed secp256k1 45 | 46 | echo Done. 47 | 48 | rm -f ecc_test.openssl ecc_test.secp256k1 ecc_test.mixed ecc.interop.openssl ecc.interop.secp256k1 ecc.interop.mixed 49 | -------------------------------------------------------------------------------- /libraries/fc/tests/crypto/log_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Independent implementation of algorithm 4 | # To create log_test.txt, run ./log_test.py > log_test.txt 5 | 6 | import random 7 | 8 | rand = random.Random(1234) 9 | 10 | result = set() 11 | 12 | result.add((0, 256)) 13 | result.add(((1 << 256)-1, 0)) 14 | for i in range(256): 15 | y = (1 << i) 16 | result.add((y, 255-i)) 17 | for j in range(32): 18 | result.add((y+rand.randrange(0, y), 255-i)) 19 | 20 | def get_sem_32(y): 21 | bs = "{:0256b}".format(y) 22 | if "1" not in bs: 23 | return 0 24 | bs += 32*"0" 25 | i = bs.index("1") 26 | return ((255-i) << 24) | int(bs[i+1:i+25], 2) 27 | 28 | for y, lz in sorted(result): 29 | print("{:02x}".format(lz), "{:064x}".format(y), "{:08x}".format(get_sem_32(y))) 30 | -------------------------------------------------------------------------------- /libraries/fc/tests/crypto/rand_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | static void check_randomness( const char* buffer, size_t len ) { 8 | if (len == 0) { return; } 9 | // count bit runs and 0's / 1's 10 | unsigned int zc = 0, oc = 0, rc = 0, last = 2; 11 | for (size_t k = len; k; k--) { 12 | char c = *buffer++; 13 | for (int i = 0; i < 8; i++) { 14 | unsigned int bit = c & 1; 15 | c >>= 1; 16 | if (bit) { oc++; } else { zc++; } 17 | if (bit != last) { rc++; last = bit; } 18 | } 19 | } 20 | BOOST_CHECK_EQUAL( 8*len, zc + oc ); 21 | double E = 1 + (zc + oc) / 2.0; 22 | double variance = (E - 1) * (E - 2) / (oc + zc - 1); 23 | double sigma = sqrt(variance); 24 | BOOST_CHECK( rc > E - sigma && rc < E + sigma); 25 | } 26 | 27 | BOOST_AUTO_TEST_SUITE(fc_crypto) 28 | 29 | BOOST_AUTO_TEST_CASE(rand_test) 30 | { 31 | char buffer[128]; 32 | fc::rand_bytes( buffer, sizeof(buffer) ); 33 | check_randomness( buffer, sizeof(buffer) ); 34 | } 35 | 36 | BOOST_AUTO_TEST_CASE(pseudo_rand_test) 37 | { 38 | char buffer[10013]; 39 | fc::rand_pseudo_bytes( buffer, sizeof(buffer) ); 40 | check_randomness( buffer, sizeof(buffer) ); 41 | } 42 | 43 | BOOST_AUTO_TEST_SUITE_END() 44 | -------------------------------------------------------------------------------- /libraries/fc/tests/rpc.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | int main( int argc, char** argv ) 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /libraries/fc/tests/sleep.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main( int argc, char** argv ) 5 | { 6 | fc::thread test("test"); 7 | auto result = test.async( [=]() { 8 | while( true ) 9 | { 10 | fc::usleep( fc::microseconds(1000) ); 11 | } 12 | }); 13 | char c; 14 | std::cin >> c; 15 | test.quit(); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process.hpp 16 | * 17 | * Convenience header that includes all public Boost.Process header files. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_HPP 21 | #define BOOST_PROCESS_HPP 22 | 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process/all.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process/all.hpp 16 | * 17 | * Convenience header that includes all public Boost.Process header files. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_ALL_HPP 21 | #define BOOST_PROCESS_ALL_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process/pipe.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process/pipe.hpp 16 | * 17 | * Includes the declaration of the pipe class. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_PIPE_HPP 21 | #define BOOST_PROCESS_PIPE_HPP 22 | 23 | #include 24 | #include 25 | 26 | namespace boost { 27 | namespace process { 28 | 29 | #if defined(BOOST_PROCESS_DOXYGEN) 30 | /** 31 | * The pipe class is a type definition for stream-based classes defined by 32 | * Boost.Asio. 33 | * 34 | * The type definition is provided for convenience. You can also use Boost.Asio 35 | * classes directly for asynchronous I/O operations. 36 | */ 37 | typedef BoostAsioPipe pipe; 38 | #elif defined(BOOST_POSIX_API) 39 | typedef boost::asio::posix::stream_descriptor pipe; 40 | #elif defined(BOOST_WINDOWS_API) 41 | typedef boost::asio::windows::stream_handle pipe; 42 | #else 43 | # error "Unsupported platform." 44 | #endif 45 | 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process/status.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process/status.hpp 16 | * 17 | * Includes the declaration of the status class. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_STATUS_HPP 21 | #define BOOST_PROCESS_STATUS_HPP 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace boost { 28 | namespace process { 29 | 30 | /** 31 | * The status class to wait for processes to exit. 32 | * 33 | * The status class is a Boost.Asio I/O object and supports synchronous 34 | * and asynchronous wait operations. 35 | */ 36 | typedef detail::basic_status > status; 37 | 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process/stream_id.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process/stream_id.hpp 16 | * 17 | * Includes the declaration of the stream_id type. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_STREAM_ID_HPP 21 | #define BOOST_PROCESS_STREAM_ID_HPP 22 | 23 | #include 24 | 25 | namespace boost { 26 | namespace process { 27 | 28 | /** 29 | * Standard stream id to refer to standard streams in a cross-platform manner. 30 | */ 31 | enum std_stream_id { stdin_id, stdout_id, stderr_id }; 32 | 33 | #if defined(BOOST_PROCESS_DOXYGEN) 34 | /** 35 | * Stream id type. 36 | * 37 | * Depending on the platform the stream id type is defined to refer to standard 38 | * streams only or to support more streams. 39 | */ 40 | typedef NativeStreamId stream_id; 41 | #elif defined(BOOST_POSIX_API) 42 | typedef int stream_id; 43 | #elif defined(BOOST_WINDOWS_API) 44 | typedef std_stream_id stream_id; 45 | #endif 46 | 47 | } 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/include/boost/process/stream_type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Boost.Process 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2006, 2007 Julio M. Merino Vidal 6 | // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling 7 | // Copyright (c) 2009 Boris Schaeling 8 | // Copyright (c) 2010 Felipe Tanus, Boris Schaeling 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 11 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 12 | // 13 | 14 | /** 15 | * \file boost/process/stream_type.hpp 16 | * 17 | * Includes the declaration of the stream_type enumeration. 18 | */ 19 | 20 | #ifndef BOOST_PROCESS_STREAM_TYPE_HPP 21 | #define BOOST_PROCESS_STREAM_TYPE_HPP 22 | 23 | #include 24 | 25 | namespace boost { 26 | namespace process { 27 | 28 | /** 29 | * Stream type to differentiate between input and output streams. 30 | * 31 | * On POSIX systems another value unknown_stream is defined. It is passed 32 | * to stream behaviors for file descriptors greater than 2. 33 | */ 34 | enum stream_type { 35 | input_stream, 36 | output_stream 37 | #if defined(BOOST_POSIX_API) 38 | , unknown_stream 39 | #endif 40 | }; 41 | 42 | } 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /libraries/fc/vendor/boost_1.51/libs/context/fcontext.cpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Oliver Kowalke 2009. 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | #define BOOST_CONTEXT_SOURCE 8 | 9 | #include 10 | 11 | #include 12 | 13 | #ifdef BOOST_HAS_ABI_HEADERS 14 | # include BOOST_ABI_PREFIX 15 | #endif 16 | 17 | namespace boost { 18 | namespace ctx { 19 | namespace detail { 20 | 21 | extern "C" BOOST_CONTEXT_DECL 22 | void * BOOST_CONTEXT_CALLDECL align_stack( void * vp) 23 | { 24 | void * base = vp; 25 | if ( 0 != ( ( ( uintptr_t) base) & 15) ) 26 | base = ( char * ) ( ( ( ( uintptr_t) base) - 15) & ~0x0F); 27 | return base; 28 | } 29 | 30 | } 31 | 32 | }} 33 | 34 | #ifdef BOOST_HAS_ABI_HEADERS 35 | # include BOOST_ABI_SUFFIX 36 | #endif 37 | -------------------------------------------------------------------------------- /libraries/fc/vendor/diff-match-patch-cpp-stl/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | a.out 15 | diff_match_patch_test 16 | diff_match_patch_test_utf8 17 | CMakeLists.txt.user 18 | speedtest 19 | -------------------------------------------------------------------------------- /libraries/fc/vendor/diff-match-patch-cpp-stl/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: 3 | - gcc 4 | - clang 5 | # trusty (14.04) is now used instead of precise (12.04) 6 | sudo: required 7 | dist: trusty 8 | before_script: 9 | - mkdir build 10 | - cd build 11 | - cmake --version 12 | - cmake -DCMAKE_VERBOSE_MAKEFILE=ON .. 13 | script: make && ./diff_match_patch_test_string && ./diff_match_patch_test_wstring 14 | -------------------------------------------------------------------------------- /libraries/fc/vendor/diff-match-patch-cpp-stl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | cmake_minimum_required(VERSION 3.1) 14 | 15 | message("*** Build the test harness for C++ STL variants of Diff Match and Patch ***") 16 | message("*** http://code.google.com/p/google-diff-match-patch/ and ***") 17 | message("*** https://github.com/leutloff/diff-match-patch-cpp-stl ***") 18 | 19 | project (diff-match-patch-cpp-stl CXX) 20 | 21 | add_executable(diff_match_patch_test_wstring diff_match_patch_test_wstring.cpp) 22 | 23 | add_executable(diff_match_patch_test_string diff_match_patch_test_string.cpp) 24 | 25 | set_property(TARGET diff_match_patch_test_wstring PROPERTY CXX_STANDARD 11) 26 | set_property(TARGET diff_match_patch_test_string PROPERTY CXX_STANDARD 11) 27 | -------------------------------------------------------------------------------- /libraries/fc/vendor/diff-match-patch-cpp-stl/README.md: -------------------------------------------------------------------------------- 1 | diff-match-patch-cpp-stl 2 | ======================== 3 | 4 | [![Build Status](https://travis-ci.org/leutloff/diff-match-patch-cpp-stl.png)](https://travis-ci.org/leutloff/diff-match-patch-cpp-stl) 5 | 6 | C++ STL variant of https://code.google.com/p/google-diff-match-patch. 7 | 8 | STL Port was done by Sergey Nozhenko (snhere@gmail.com) and posted on 9 | https://code.google.com/p/google-diff-match-patch/issues/detail?id=25 10 | 11 | The STL Port is header only and works with std::wstring and std::string. 12 | 13 | Compile and run the test cases: 14 | 15 | g++ diff_match_patch_test.cpp -o diff_match_patch_test && ./diff_match_patch_test 16 | 17 | Or use CMake ... 18 | 19 | Compile and run the speedtest - requires the files speedtest1.txt and speedtest2.txt for comparison: 20 | 21 | g++ speedtest.cpp -o speedtest && ./speedtest 22 | -------------------------------------------------------------------------------- /libraries/fc/vendor/diff-match-patch-cpp-stl/speedtest.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 2 | // All Rights Reserved. 3 | // Author: fraser@google.com 4 | 5 | #include 6 | #include 7 | #include 8 | #include "diff_match_patch.h" 9 | 10 | using namespace std; 11 | 12 | wstring readFile(const char *filename) { 13 | wifstream file(filename); 14 | wstring text; 15 | getline(file, text, wstring::traits_type::to_char_type(wstring::traits_type::eof())); 16 | return text; 17 | } 18 | 19 | int main(int /* argc */, char ** /* argv */) { 20 | wstring text1 = readFile("speedtest1.txt"); 21 | wstring text2 = readFile("speedtest2.txt"); 22 | 23 | diff_match_patch dmp; 24 | dmp.Diff_Timeout = 0.0; 25 | 26 | // Execute one reverse diff as a warmup. 27 | dmp.diff_main(text2, text1, false); 28 | 29 | clock_t t = clock(); 30 | dmp.diff_main(text1, text2, false); 31 | cout << "Elapsed time: " << int((clock() - t) * 1000 / CLOCKS_PER_SEC) << " ms" << endl; 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/.gitignore: -------------------------------------------------------------------------------- 1 | bench_inv 2 | bench_ecdh 3 | bench_sign 4 | bench_verify 5 | bench_recover 6 | bench_internal 7 | tests 8 | *.exe 9 | *.so 10 | *.a 11 | !.gitignore 12 | 13 | Makefile 14 | configure 15 | .libs/ 16 | Makefile.in 17 | aclocal.m4 18 | autom4te.cache/ 19 | config.log 20 | config.status 21 | *.tar.gz 22 | *.la 23 | libtool 24 | .deps/ 25 | .dirstamp 26 | build-aux/ 27 | *.lo 28 | *.o 29 | *~ 30 | src/libsecp256k1-config.h 31 | src/libsecp256k1-config.h.in 32 | m4/libtool.m4 33 | m4/ltoptions.m4 34 | m4/ltsugar.m4 35 | m4/ltversion.m4 36 | m4/lt~obsolete.m4 37 | src/stamp-h1 38 | libsecp256k1.pc 39 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 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 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/TODO: -------------------------------------------------------------------------------- 1 | * Unit tests for fieldelem/groupelem, including ones intended to 2 | trigger fieldelem's boundary cases. 3 | * Complete constant-time operations for signing/keygen 4 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/libsecp256k1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsecp256k1 7 | Description: Optimized C library for EC operations on curve secp256k1 8 | URL: https://github.com/bitcoin/secp256k1 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs.private: @SECP_LIBS@ 12 | Libs: -L${libdir} -lsecp256k1 13 | 14 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/obj/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinChain/VINchain-blockchain/c52ec3bf67c6d4700bbaf5ec903185d31a2d63ec/libraries/fc/vendor/secp256k1-zkp/obj/.gitignore -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/borromean.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014, 2015 Gregory Maxwell * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | 8 | #ifndef _SECP256K1_BORROMEAN_H_ 9 | #define _SECP256K1_BORROMEAN_H_ 10 | 11 | #include "scalar.h" 12 | #include "field.h" 13 | #include "group.h" 14 | #include "ecmult.h" 15 | #include "ecmult_gen.h" 16 | 17 | int secp256k1_borromean_verify(const secp256k1_ecmult_context_t* ecmult_ctx, secp256k1_scalar_t *evalues, const unsigned char *e0, const secp256k1_scalar_t *s, 18 | const secp256k1_gej_t *pubs, const int *rsizes, int nrings, const unsigned char *m, int mlen); 19 | 20 | int secp256k1_borromean_sign(const secp256k1_ecmult_context_t* ecmult_ctx, const secp256k1_ecmult_gen_context_t *ecmult_gen_ctx, 21 | unsigned char *e0, secp256k1_scalar_t *s, const secp256k1_gej_t *pubs, const secp256k1_scalar_t *k, const secp256k1_scalar_t *sec, 22 | const int *rsizes, const int *secidx, int nrings, const unsigned char *m, int mlen); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/ecdh.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Pieter Wuille, Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECDH_ 8 | #define _SECP256K1_ECDH_ 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | static void secp256k1_ecdh_point_multiply(secp256k1_gej_t *r, const secp256k1_ge_t *a, const secp256k1_scalar_t *q); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/ecdsa.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECDSA_ 8 | #define _SECP256K1_ECDSA_ 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | #include "ecmult.h" 13 | 14 | typedef struct { 15 | secp256k1_scalar_t r, s; 16 | } secp256k1_ecdsa_sig_t; 17 | 18 | static int secp256k1_ecdsa_sig_parse(secp256k1_ecdsa_sig_t *r, const unsigned char *sig, int size); 19 | static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, int *size, const secp256k1_ecdsa_sig_t *a); 20 | static int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context_t *ctx, const secp256k1_ecdsa_sig_t *sig, const secp256k1_ge_t *pubkey, const secp256k1_scalar_t *message); 21 | static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context_t *ctx, secp256k1_ecdsa_sig_t *sig, const secp256k1_scalar_t *seckey, const secp256k1_scalar_t *message, const secp256k1_scalar_t *nonce, int *recid); 22 | static int secp256k1_ecdsa_sig_recover(const secp256k1_ecmult_context_t *ctx, const secp256k1_ecdsa_sig_t *sig, secp256k1_ge_t *pubkey, const secp256k1_scalar_t *message, int recid); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/java/org_bitcoin_NativeSecp256k1.c: -------------------------------------------------------------------------------- 1 | #include "org_bitcoin_NativeSecp256k1.h" 2 | #include "include/secp256k1.h" 3 | 4 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 5 | (JNIEnv* env, jclass classObject, jobject byteBufferObject) 6 | { 7 | unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); 8 | int sigLen = *((int*)(data + 32)); 9 | int pubLen = *((int*)(data + 32 + 4)); 10 | 11 | return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); 12 | } 13 | 14 | static void __javasecp256k1_attach(void) __attribute__((constructor)); 15 | static void __javasecp256k1_detach(void) __attribute__((destructor)); 16 | 17 | static void __javasecp256k1_attach(void) { 18 | secp256k1_start(SECP256K1_START_VERIFY); 19 | } 20 | 21 | static void __javasecp256k1_detach(void) { 22 | secp256k1_stop(); 23 | } 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/java/org_bitcoin_NativeSecp256k1.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_bitcoin_NativeSecp256k1 */ 4 | 5 | #ifndef _Included_org_bitcoin_NativeSecp256k1 6 | #define _Included_org_bitcoin_NativeSecp256k1 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_bitcoin_NativeSecp256k1 12 | * Method: secp256k1_ecdsa_verify 13 | * Signature: (Ljava/nio/ByteBuffer;)I 14 | */ 15 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 16 | (JNIEnv *, jclass, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/num_gmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_REPR_ 8 | #define _SECP256K1_NUM_REPR_ 9 | 10 | #include 11 | 12 | #define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) 13 | 14 | typedef struct { 15 | mp_limb_t data[2*NUM_LIMBS]; 16 | int neg; 17 | int limbs; 18 | } secp256k1_num_t; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/num_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_IMPL_H_ 8 | #define _SECP256K1_NUM_IMPL_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | #include "num.h" 15 | 16 | #if defined(USE_NUM_GMP) 17 | #include "num_gmp_impl.h" 18 | #elif defined(USE_NUM_NONE) 19 | /* Nothing. */ 20 | #else 21 | #error "Please select num implementation" 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar_t; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar_t; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /libraries/fc/vendor/secp256k1-zkp/src/testrand.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_TESTRAND_H_ 8 | #define _SECP256K1_TESTRAND_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | /* A non-cryptographic RNG used only for test infrastructure. */ 15 | 16 | /** Seed the pseudorandom number generator for testing. */ 17 | SECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16); 18 | 19 | /** Generate a pseudorandom 32-bit number. */ 20 | static uint32_t secp256k1_rand32(void); 21 | 22 | /** Generate a pseudorandom 32-byte array. */ 23 | static void secp256k1_rand256(unsigned char *b32); 24 | 25 | /** Generate a pseudorandom 32-byte array with long sequences of zero and one bits. */ 26 | static void secp256k1_rand256_test(unsigned char *b32); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/.gitattributes: -------------------------------------------------------------------------------- 1 | # Lineendings 2 | *.sln eol=crlf 3 | *.vcproj eol=crlf 4 | *.vcxproj* eol=crlf 5 | 6 | # Whitespace rules 7 | # strict (no trailing, no tabs) 8 | *.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 9 | *.hpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 10 | *.c whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 11 | *.h whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol 12 | 13 | # normal (no trailing) 14 | *.sql whitespace=trailing-space,space-before-tab,cr-at-eol 15 | *.txt whitespace=trailing-space,space-before-tab,cr-at-eol 16 | 17 | # special files which must ignore whitespace 18 | *.patch whitespace=-trailing-space 19 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: 3 | - gcc 4 | before_install: 5 | #- sudo apt-get install libboost-chrono1.48-dev libboost-regex1.48-dev libboost-system1.48-dev libboost-thread1.48-dev libboost-test1.48-dev libboost-random1.48-dev -y 6 | - sudo add-apt-repository -y ppa:boost-latest/ppa && sudo apt-get update -q && sudo apt-get install -y libboost-chrono1.55-dev libboost-random1.55-dev libboost-regex1.55-dev libboost-system1.55-dev libboost-thread1.55-dev libboost-test1.55-dev 7 | env: 8 | global: 9 | - BOOST_INCLUDES=/usr/include 10 | - BOOST_LIBS=/usr/lib/x86_64-linux-gnu 11 | script: scons -j 2 && scons test 12 | branches: 13 | only: 14 | - master 15 | - develop 16 | notifications: 17 | recipients: 18 | - travis@zaphoyd.com 19 | email: 20 | on_success: change 21 | on_failure: always 22 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/docs/manual.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3, .navpath ul { 2 | background-image: none; 3 | background-color: #333; 4 | border: none; 5 | border-bottom: 1px solid #575757; 6 | } 7 | 8 | .tablist li, .navpath li { 9 | background-image: none; 10 | background-color: #333; 11 | } 12 | 13 | .tablist a, .navpath li.navelem a { 14 | color: #ccc; 15 | text-shadow: 0px 1px 1px black; 16 | } 17 | 18 | .tablist a:hover, .navpath li.navelem a:hover { 19 | background-image: none; 20 | background-color: #444; 21 | color: #ccc; 22 | } 23 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/docs/tutorials.dox: -------------------------------------------------------------------------------- 1 | /** \page tutorials Tutorials 2 | 3 | These tutorials are works in progress, some are more complete than others. 4 | 5 | - \subpage md_tutorials_utility_client_utility_client 6 | - \subpage md_tutorials_utility_server_utility_server 7 | - \subpage md_tutorials_broadcast_tutorial_broadcast_tutorial 8 | - \subpage md_tutorials_chat_tutorial_chat_tutorial 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/associative_storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (associative_storage) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/broadcast_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (broadcast_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/broadcast_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Broadcast Server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('broadcast_server', ["broadcast_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','thread'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('broadcast_server', ["broadcast_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/debug_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | if (OPENSSL_FOUND) 6 | 7 | init_target (debug_client) 8 | 9 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 10 | 11 | link_boost () 12 | link_openssl() 13 | final_target () 14 | 15 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 16 | 17 | endif() -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/debug_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Debug client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('debug_client', ["debug_client.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] 22 | prgs += env.Program('debug_client', ["debug_client.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/debug_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (debug_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/debug_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Debug server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('debug_server', ["debug_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('debug_server', ["debug_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/dev/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | #init_target (dev) 6 | 7 | #build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | #link_boost () 10 | #final_target () 11 | 12 | #set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/dev/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env_cpp11 = env_cpp11.Clone () 11 | 12 | prgs = [] 13 | 14 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 15 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system','timer','chrono'],env_cpp11) + [platform_libs] + [polyfill_libs] 16 | prgs += env_cpp11.Program('main', ["main.cpp"], LIBS = BOOST_LIBS_CPP11) 17 | 18 | Return('prgs') 19 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (echo_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_client/SConscript: -------------------------------------------------------------------------------- 1 | ## echo_client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + ['z'] 18 | prgs += env_cpp11.Program('echo_client', ["echo_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] + ['z'] 21 | prgs += env.Program('echo_client', ["echo_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (echo_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('echo_server', ["echo_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('echo_server', ["echo_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server_both/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | 6 | if (OPENSSL_FOUND) 7 | 8 | init_target (echo_server_both) 9 | 10 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 11 | 12 | link_boost () 13 | link_openssl() 14 | final_target () 15 | 16 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 17 | 18 | endif() 19 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server_both/SConscript: -------------------------------------------------------------------------------- 1 | ## Combo plain+tls echo server 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('echo_server_both', ["echo_server_both.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] 22 | prgs += env.Program('echo_server_both', ["echo_server_both.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server_tls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | 6 | if (OPENSSL_FOUND) 7 | 8 | init_target (echo_server_tls) 9 | 10 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 11 | 12 | link_boost () 13 | link_openssl() 14 | final_target () 15 | 16 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 17 | 18 | endif() 19 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server_tls/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('echo_server_tls', ["echo_server_tls.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] 22 | prgs += env.Program('echo_server_tls', ["echo_server_tls.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/echo_server_tls/dh.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAqxMGKZB8YNV8WQnbJWwwwmifc+PfVRtd1FN5v5aQSsf6dpjX3Zlh 3 | N1NmgecsQyg4u2EWe4Umta10QzCgYaxf6QdTCg7iprLzFNw7IvWYbQ6du12NMGDr 4 | hmwA6KQKwbTgPL6mSlSlcK2wTP2FzxDTNffFu10cB/6Fj4kdQjPG0c1Koz/z7OOq 5 | BuDElJLClS8rjp3z1xvrc7gX95dFa2KaKgOAYDkpe8tfHRhHfJeIVS/whH9hzx6r 6 | OBg+E5K9JyvayrUoKgPeptRKCqo8A4YevtMLpRxMup0nMUgAIv6+BGTwPAFpwgl/ 7 | 8UIVcvjh1v95PwGDM/Q8yvIBJznBYk/e2wIBAg== 8 | -----END DH PARAMETERS----- 9 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/enriched_storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (enriched_storage) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/external_io_service/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (external_io_service) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/external_io_service/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('external_io_service', ["external_io_service.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('external_io_service', ["external_io_service.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/handler_switch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (handler_switch) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/handler_switch/handler_switch.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | typedef websocketpp::server server; 7 | 8 | using websocketpp::connection_hdl; 9 | using websocketpp::lib::placeholders::_1; 10 | using websocketpp::lib::placeholders::_2; 11 | using websocketpp::lib::bind; 12 | using websocketpp::lib::ref; 13 | 14 | void custom_on_msg(server & s, connection_hdl hdl, server::message_ptr msg) { 15 | std::cout << "Message sent to custom handler" << std::endl; 16 | } 17 | 18 | void default_on_msg(server & s, connection_hdl hdl, server::message_ptr msg) { 19 | std::cout << "Message sent to default handler" << std::endl; 20 | 21 | if (msg->get_payload() == "upgrade") { 22 | // Upgrade our connection_hdl to a full connection_ptr 23 | server::connection_ptr con = s.get_con_from_hdl(hdl); 24 | 25 | // Change the on message handler for this connection only to 26 | // custom_on_mesage 27 | con->set_message_handler(bind(&custom_on_msg,ref(s),::_1,::_2)); 28 | std::cout << "Upgrading connection to custom handler" << std::endl; 29 | } 30 | } 31 | 32 | int main() { 33 | server s; 34 | 35 | s.set_message_handler(bind(&default_on_msg,ref(s),::_1,::_2)); 36 | 37 | s.init_asio(); 38 | s.listen(9002); 39 | s.start_accept(); 40 | 41 | s.run(); 42 | } 43 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/iostream_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (iostream_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/iostream_server/SConscript: -------------------------------------------------------------------------------- 1 | ## iostream server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('iostream_server', ["iostream_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('iostream_server', ["iostream_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/print_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (print_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/print_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Print server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('print_server', ["print_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('print_server', ["print_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/print_server/print_server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | typedef websocketpp::server server; 7 | 8 | void on_message(websocketpp::connection_hdl, server::message_ptr msg) { 9 | std::cout << msg->get_payload() << std::endl; 10 | } 11 | 12 | int main() { 13 | server print_server; 14 | 15 | print_server.set_message_handler(&on_message); 16 | print_server.set_access_channels(websocketpp::log::alevel::all); 17 | print_server.set_error_channels(websocketpp::log::elevel::all); 18 | 19 | print_server.init_asio(); 20 | print_server.listen(9002); 21 | print_server.start_accept(); 22 | 23 | print_server.run(); 24 | } 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/scratch_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Scratch client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 19 | prgs += env_cpp11.Program('scratch_client', ["scratch_client.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] 22 | prgs += env.Program('utility_client', ["utility_client.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/scratch_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Scratch server example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | prgs = [] 15 | 16 | # if a C++11 environment is available build using that, otherwise use boost 17 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 18 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] + ['z'] 19 | prgs += env_cpp11.Program('scratch_server', ["scratch_server.cpp"], LIBS = ALL_LIBS) 20 | else: 21 | ALL_LIBS = boostlibs(['system','regex','random'],env) + [platform_libs] + [polyfill_libs] + [tls_libs] + ['z'] 22 | prgs += env.Program('scratch_server', ["scratch_server.cpp"], LIBS = ALL_LIBS) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/simple_broadcast_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (simple_broadcast_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/sip_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (sip_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/sip_client/README.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Checkout the project from git 4 | 5 | At the top level, run cmake: 6 | 7 | cmake -G 'Unix Makefiles' \ 8 | -D BUILD_EXAMPLES=ON \ 9 | -D WEBSOCKETPP_ROOT=/tmp/cm1 \ 10 | -D ENABLE_CPP11=OFF . 11 | 12 | and then make the example: 13 | 14 | make -C examples/sip_client 15 | 16 | Now run it: 17 | 18 | bin/sip_client ws://ws-server:80 19 | 20 | It has been tested against the repro SIP proxy from reSIProcate 21 | 22 | http://www.resiprocate.org/WebRTC_and_SIP_Over_WebSockets 23 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/sip_client/SConscript: -------------------------------------------------------------------------------- 1 | ## SIP client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('sip_client', ["sip_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('sip_client', ["sip_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/subprotocol_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (subprotocol_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/subprotocol_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('subprotocol_server', ["subprotocol_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('subprotocol_server', ["subprotocol_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/subprotocol_server/subprotocol_server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | typedef websocketpp::server server; 7 | 8 | using websocketpp::connection_hdl; 9 | using websocketpp::lib::placeholders::_1; 10 | using websocketpp::lib::placeholders::_2; 11 | using websocketpp::lib::bind; 12 | using websocketpp::lib::ref; 13 | 14 | 15 | bool validate(server & s, connection_hdl hdl) { 16 | server::connection_ptr con = s.get_con_from_hdl(hdl); 17 | 18 | std::cout << "Cache-Control: " << con->get_request_header("Cache-Control") << std::endl; 19 | 20 | const std::vector & subp_requests = con->get_requested_subprotocols(); 21 | std::vector::const_iterator it; 22 | 23 | for (it = subp_requests.begin(); it != subp_requests.end(); ++it) { 24 | std::cout << "Requested: " << *it << std::endl; 25 | } 26 | 27 | if (subp_requests.size() > 0) { 28 | con->select_subprotocol(subp_requests[0]); 29 | } 30 | 31 | return true; 32 | } 33 | 34 | int main() { 35 | try { 36 | server s; 37 | 38 | s.set_validate_handler(bind(&validate,ref(s),::_1)); 39 | 40 | s.init_asio(); 41 | s.listen(9005); 42 | s.start_accept(); 43 | 44 | s.run(); 45 | } catch (websocketpp::exception const & e) { 46 | std::cout << e.what() << std::endl; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/telemetry_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (telemetry_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/telemetry_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Telemetry client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('telemetry_client', ["telemetry_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('telemetry_client', ["telemetry_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/telemetry_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (telemetry_server) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/telemetry_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Main development example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('telemetry_server', ["telemetry_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('telemetry_server', ["telemetry_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/testee_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | if (ZLIB_FOUND) 6 | 7 | init_target (testee_client) 8 | 9 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 10 | 11 | link_boost () 12 | link_zlib() 13 | final_target () 14 | 15 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 16 | 17 | endif() -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/testee_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Autobahn test client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + ['z'] 18 | prgs += env_cpp11.Program('testee_client', ["testee_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] + ['z'] 21 | prgs += env.Program('testee_client', ["testee_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/testee_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | if (ZLIB_FOUND) 6 | 7 | init_target (testee_server) 8 | 9 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 10 | 11 | link_boost () 12 | link_zlib() 13 | final_target () 14 | 15 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 16 | 17 | endif() -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/testee_server/SConscript: -------------------------------------------------------------------------------- 1 | ## Autobahn Testee Server 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] + ['z'] 18 | prgs += env_cpp11.Program('testee_server', ["testee_server.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system'],env) + [platform_libs] + [polyfill_libs] + ['z'] 21 | prgs += env.Program('testee_server', ["testee_server.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/utility_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (utility_client) 6 | 7 | build_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "examples") 13 | 14 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/examples/utility_client/SConscript: -------------------------------------------------------------------------------- 1 | ## Utility client example 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | prgs = [] 14 | 15 | # if a C++11 environment is available build using that, otherwise use boost 16 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 17 | ALL_LIBS = boostlibs(['system'],env_cpp11) + [platform_libs] + [polyfill_libs] 18 | prgs += env_cpp11.Program('utility_client', ["utility_client.cpp"], LIBS = ALL_LIBS) 19 | else: 20 | ALL_LIBS = boostlibs(['system','random'],env) + [platform_libs] + [polyfill_libs] 21 | prgs += env.Program('utility_client', ["utility_client.cpp"], LIBS = ALL_LIBS) 22 | 23 | Return('prgs') -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/roadmap.md: -------------------------------------------------------------------------------- 1 | Complete & Tested: 2 | - Server and client roles pass all Autobahn v0.5.9 test suite tests strictly 3 | - Streaming UTF8 validation 4 | - random number generation 5 | - iostream based transport 6 | - C++11 support 7 | - LLVM/Clang support 8 | - GCC support 9 | - 64 bit support 10 | - 32 bit support 11 | - Logging 12 | - Client role 13 | - message_handler 14 | - ping_handler 15 | - pong_handler 16 | - open_handler 17 | - close_handler 18 | - echo_server & echo_server_tls 19 | - External io_service support 20 | - TLS support 21 | - exception/error handling 22 | - Timeouts 23 | - Subprotocol negotiation 24 | - validate_handler 25 | - Hybi 00/Hixie 76 legacy protocol support 26 | - Outgoing Proxy Support 27 | - socket_init_handler 28 | - tls_init_handler 29 | - tcp_init_handler 30 | 31 | Ongoing work 32 | - Performance tuning 33 | - PowerPC support 34 | - Visual Studio / Windows support 35 | - CMake build/install support 36 | - http_handler 37 | 38 | Future feature roadmap 39 | - Extension support 40 | - permessage_compress extension 41 | - Message buffer pool 42 | - flow control 43 | - tutorials & documentation 44 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/connection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (test_connection) 6 | 7 | build_test (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/connection/SConscript: -------------------------------------------------------------------------------- 1 | ## connection unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] 14 | 15 | objs = env.Object('connection_boost.o', ["connection.cpp"], LIBS = BOOST_LIBS) 16 | objs = env.Object('connection_tu2_boost.o', ["connection_tu2.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_connection_boost', ["connection_boost.o","connection_tu2_boost.o"], LIBS = BOOST_LIBS) 18 | 19 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 20 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system'],env_cpp11) + [platform_libs] + [polyfill_libs] 21 | objs += env_cpp11.Object('connection_stl.o', ["connection.cpp"], LIBS = BOOST_LIBS_CPP11) 22 | objs += env_cpp11.Object('connection_tu2_stl.o', ["connection_tu2.cpp"], LIBS = BOOST_LIBS_CPP11) 23 | prgs += env_cpp11.Program('test_connection_stl', ["connection_stl.o","connection_tu2_stl.o"], LIBS = BOOST_LIBS_CPP11) 24 | 25 | Return('prgs') 26 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/endpoint/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | if (OPENSSL_FOUND) 6 | 7 | init_target (test_endpoint) 8 | 9 | build_test (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 10 | 11 | link_boost () 12 | link_openssl () 13 | final_target () 14 | 15 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 16 | 17 | endif() -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/endpoint/SConscript: -------------------------------------------------------------------------------- 1 | ## endpoint unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] + [tls_libs] 15 | 16 | objs = env.Object('endpoint_boost.o', ["endpoint.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_endpoint_boost', ["endpoint_boost.o"], LIBS = BOOST_LIBS) 18 | 19 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 20 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 21 | objs += env_cpp11.Object('endpoint_stl.o', ["endpoint.cpp"], LIBS = BOOST_LIBS_CPP11) 22 | prgs += env_cpp11.Program('test_endpoint_stl', ["endpoint_stl.o"], LIBS = BOOST_LIBS_CPP11) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/extension/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Extension Tests 2 | file (GLOB SOURCE extension.cpp) 3 | 4 | init_target (test_extension) 5 | build_executable (${TARGET_NAME} ${SOURCE}) 6 | link_boost () 7 | final_target () 8 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 9 | 10 | if ( ZLIB_FOUND ) 11 | 12 | # Permessage-deflate tests 13 | file (GLOB SOURCE permessage_deflate.cpp) 14 | 15 | init_target (test_permessage_deflate) 16 | build_test (${TARGET_NAME} ${SOURCE}) 17 | link_boost () 18 | link_zlib() 19 | final_target () 20 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 21 | 22 | endif ( ZLIB_FOUND ) -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/extension/SConscript: -------------------------------------------------------------------------------- 1 | ## http unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] + ['z'] 14 | 15 | objs = env.Object('extension_boost.o', ["extension.cpp"], LIBS = BOOST_LIBS) 16 | objs += env.Object('permessage_deflate_boost.o', ["permessage_deflate.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_extension_boost', ["extension_boost.o"], LIBS = BOOST_LIBS) 18 | prgs += env.Program('test_permessage_deflate_boost', ["permessage_deflate_boost.o"], LIBS = BOOST_LIBS) 19 | 20 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 21 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] + ['z'] 22 | objs += env_cpp11.Object('extension_stl.o', ["extension.cpp"], LIBS = BOOST_LIBS_CPP11) 23 | objs += env_cpp11.Object('permessage_deflate_stl.o', ["permessage_deflate.cpp"], LIBS = BOOST_LIBS_CPP11) 24 | prgs += env_cpp11.Program('test_extension_stl', ["extension_stl.o"], LIBS = BOOST_LIBS_CPP11) 25 | prgs += env_cpp11.Program('test_permessage_deflate_stl', ["permessage_deflate_stl.o"], LIBS = BOOST_LIBS_CPP11) 26 | 27 | Return('prgs') 28 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/http/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES parser.cpp) 3 | 4 | init_target (test_http) 5 | 6 | build_test (${TARGET_NAME} ${SOURCE_FILES}) 7 | 8 | link_boost () 9 | final_target () 10 | 11 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 12 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/http/SConscript: -------------------------------------------------------------------------------- 1 | ## http unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework'],env) + [platform_libs] 14 | 15 | objs = env.Object('parser_boost.o', ["parser.cpp"], LIBS = BOOST_LIBS) 16 | prgs = env.Program('test_http_boost', ["parser_boost.o"], LIBS = BOOST_LIBS) 17 | 18 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 19 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] 20 | objs += env_cpp11.Object('parser_stl.o', ["parser.cpp"], LIBS = BOOST_LIBS_CPP11) 21 | prgs += env_cpp11.Program('test_http_stl', ["parser_stl.o"], LIBS = BOOST_LIBS_CPP11) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/http/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinChain/VINchain-blockchain/c52ec3bf67c6d4700bbaf5ec903185d31a2d63ec/libraries/fc/vendor/websocketpp/test/http/a.out -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/http/perf.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinChain/VINchain-blockchain/c52ec3bf67c6d4700bbaf5ec903185d31a2d63ec/libraries/fc/vendor/websocketpp/test/http/perf.out -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/http/test.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinChain/VINchain-blockchain/c52ec3bf67c6d4700bbaf5ec903185d31a2d63ec/libraries/fc/vendor/websocketpp/test/http/test.out -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/logger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | file (GLOB SOURCE_FILES *.cpp) 3 | file (GLOB HEADER_FILES *.hpp) 4 | 5 | init_target (test_logger) 6 | 7 | build_test (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 8 | 9 | link_boost () 10 | final_target () 11 | 12 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 13 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/logger/SConscript: -------------------------------------------------------------------------------- 1 | ## logger unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] 14 | 15 | objs = env.Object('logger_basic_boost.o', ["basic.cpp"], LIBS = BOOST_LIBS) 16 | prgs = env.Program('logger_basic_boost', ["logger_basic_boost.o"], LIBS = BOOST_LIBS) 17 | 18 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 19 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system'],env_cpp11) + [platform_libs] + [polyfill_libs] 20 | objs += env_cpp11.Object('logger_basic_stl.o', ["basic.cpp"], LIBS = BOOST_LIBS_CPP11) 21 | prgs += env_cpp11.Program('logger_basic_stl', ["logger_basic_stl.o"], LIBS = BOOST_LIBS_CPP11) 22 | 23 | Return('prgs') 24 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/message_buffer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test alloc message buffer strategy 2 | file (GLOB SOURCE alloc.cpp) 3 | 4 | init_target (test_message_alloc) 5 | build_executable (${TARGET_NAME} ${SOURCE}) 6 | link_boost () 7 | final_target () 8 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 9 | 10 | # Test message buffers 11 | file (GLOB SOURCE message.cpp) 12 | 13 | init_target (test_message_buffer) 14 | build_test (${TARGET_NAME} ${SOURCE}) 15 | link_boost () 16 | final_target () 17 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 18 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/message_buffer/SConscript: -------------------------------------------------------------------------------- 1 | ## message_buffer unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','system'],env) + [platform_libs] 14 | 15 | objs = env.Object('message_boost.o', ["message.cpp"], LIBS = BOOST_LIBS) 16 | objs += env.Object('alloc_boost.o', ["alloc.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_message_boost', ["message_boost.o"], LIBS = BOOST_LIBS) 18 | prgs += env.Program('test_alloc_boost', ["alloc_boost.o"], LIBS = BOOST_LIBS) 19 | 20 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 21 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] 22 | objs += env_cpp11.Object('message_stl.o', ["message.cpp"], LIBS = BOOST_LIBS_CPP11) 23 | objs += env_cpp11.Object('alloc_stl.o', ["alloc.cpp"], LIBS = BOOST_LIBS_CPP11) 24 | prgs += env_cpp11.Program('test_message_stl', ["message_stl.o"], LIBS = BOOST_LIBS_CPP11) 25 | prgs += env_cpp11.Program('test_alloc_stl', ["alloc_stl.o"], LIBS = BOOST_LIBS_CPP11) 26 | 27 | Return('prgs') 28 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/random/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test RNG policy none 2 | file (GLOB SOURCE none.cpp) 3 | 4 | init_target (test_random_none) 5 | build_test (${TARGET_NAME} ${SOURCE}) 6 | link_boost () 7 | final_target () 8 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 9 | 10 | # Test RNG policy random_device 11 | file (GLOB SOURCE random_device.cpp) 12 | 13 | init_target (test_random_random_device) 14 | build_test (${TARGET_NAME} ${SOURCE}) 15 | link_boost () 16 | final_target () 17 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 18 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/random/SConscript: -------------------------------------------------------------------------------- 1 | ## random number generation unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','random','system'],env) + [platform_libs] 14 | 15 | objs = env.Object('random_none_boost.o', ["none.cpp"], LIBS = BOOST_LIBS) 16 | objs += env.Object('random_device_boost.o', ["random_device.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_random_none_boost', ["random_none_boost.o"], LIBS = BOOST_LIBS) 18 | prgs += env.Program('test_random_device_boost', ["random_device_boost.o"], LIBS = BOOST_LIBS) 19 | 20 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 21 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] 22 | objs += env_cpp11.Object('random_none_stl.o', ["none.cpp"], LIBS = BOOST_LIBS_CPP11) 23 | objs += env_cpp11.Object('random_device_stl.o', ["random_device.cpp"], LIBS = BOOST_LIBS_CPP11) 24 | prgs += env_cpp11.Program('test_random_none_stl', ["random_none_stl.o"], LIBS = BOOST_LIBS_CPP11) 25 | prgs += env_cpp11.Program('test_random_device_stl', ["random_device_stl.o"], LIBS = BOOST_LIBS_CPP11) 26 | 27 | Return('prgs') 28 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/roles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test client role 2 | file (GLOB SOURCE client.cpp) 3 | 4 | init_target (test_roles_client) 5 | build_test (${TARGET_NAME} ${SOURCE}) 6 | link_boost () 7 | final_target () 8 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 9 | 10 | # Test server role 11 | file (GLOB SOURCE server.cpp) 12 | 13 | init_target (test_roles_server) 14 | build_test (${TARGET_NAME} ${SOURCE}) 15 | link_boost () 16 | final_target () 17 | set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test") 18 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/roles/SConscript: -------------------------------------------------------------------------------- 1 | ## role unit tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | 10 | env = env.Clone () 11 | env_cpp11 = env_cpp11.Clone () 12 | 13 | BOOST_LIBS = boostlibs(['unit_test_framework','system','random'],env) + [platform_libs] 14 | 15 | objs = env.Object('client_boost.o', ["client.cpp"], LIBS = BOOST_LIBS) 16 | objs += env.Object('server_boost.o', ["server.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_client_boost', ["client_boost.o"], LIBS = BOOST_LIBS) 18 | prgs += env.Program('test_server_boost', ["server_boost.o"], LIBS = BOOST_LIBS) 19 | 20 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 21 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework'],env_cpp11) + [platform_libs] + [polyfill_libs] 22 | objs += env_cpp11.Object('client_stl.o', ["client.cpp"], LIBS = BOOST_LIBS_CPP11) 23 | objs += env_cpp11.Object('server_stl.o', ["server.cpp"], LIBS = BOOST_LIBS_CPP11) 24 | prgs += env_cpp11.Program('test_client_stl', ["client_stl.o"], LIBS = BOOST_LIBS_CPP11) 25 | prgs += env_cpp11.Program('test_server_stl', ["server_stl.o"], LIBS = BOOST_LIBS_CPP11) 26 | 27 | Return('prgs') 28 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/test/transport/SConscript: -------------------------------------------------------------------------------- 1 | ## transport integration tests 2 | ## 3 | 4 | Import('env') 5 | Import('env_cpp11') 6 | Import('boostlibs') 7 | Import('platform_libs') 8 | Import('polyfill_libs') 9 | Import('tls_libs') 10 | 11 | env = env.Clone () 12 | env_cpp11 = env_cpp11.Clone () 13 | 14 | BOOST_LIBS = boostlibs(['unit_test_framework','system','thread','random','chrono'],env) + [platform_libs] + [tls_libs] 15 | 16 | objs = env.Object('boost_integration.o', ["integration.cpp"], LIBS = BOOST_LIBS) 17 | prgs = env.Program('test_boost_integration', ["boost_integration.o"], LIBS = BOOST_LIBS) 18 | 19 | if env_cpp11.has_key('WSPP_CPP11_ENABLED'): 20 | BOOST_LIBS_CPP11 = boostlibs(['unit_test_framework','system'],env_cpp11) + [platform_libs] + [polyfill_libs] + [tls_libs] 21 | objs += env_cpp11.Object('stl_integration.o', ["integration.cpp"], LIBS = BOOST_LIBS_CPP11) 22 | prgs += env_cpp11.Program('test_stl_integration', ["stl_integration.o"], LIBS = BOOST_LIBS_CPP11) 23 | 24 | Return('prgs') 25 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/tutorials/broadcast_tutorial/broadcast_tutorial.md: -------------------------------------------------------------------------------- 1 | Broadcast Tutorial 2 | ================== 3 | 4 | This tutorial will dig into some more nitty gritty details on how to build high 5 | scalability, high performance websocket servers for broadcast like workflows. 6 | 7 | Will go into features like: 8 | - minimizing work done in handlers 9 | - using asio thread pool mode 10 | - teaming multiple endpoints 11 | - setting accept queue depth 12 | - tuning compile time buffer sizes 13 | - prepared messages 14 | - flow control 15 | - basic operating system level tuning, particularly increasing file descriptor limits. 16 | - measuring performance with wsperf / autobahn 17 | - tuning permessage-deflate compression settings -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/tutorials/chat_tutorial/chat_tutorial.md: -------------------------------------------------------------------------------- 1 | Chat Tutorial 2 | ============= 3 | 4 | Goals of this tutorial: 5 | - Implement a realtime websocket chat server 6 | 7 | 8 | Server 9 | - Nicknames 10 | - Channels 11 | - Subprotocol 12 | - Origin restrictions 13 | - HTTP statistics page 14 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/websocketpp-config.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the websocketpp package 2 | # It defines the following variables 3 | # WEBSOCKETPP_FOUND - indicates that the module was found 4 | # WEBSOCKETPP_INCLUDE_DIR - include directories 5 | 6 | set(WEBSOCKETPP_FOUND TRUE) 7 | set(WEBSOCKETPP_INCLUDE_DIR "@INSTALL_INCLUDE_DIR@") 8 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/websocketpp-configVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@WEBSOCKETPP_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /libraries/fc/vendor/websocketpp/websocketpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | init_target("websocketpp") 2 | final_target () 3 | -------------------------------------------------------------------------------- /libraries/net/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/net/*.hpp") 2 | 3 | set(SOURCES node.cpp 4 | stcp_socket.cpp 5 | core_messages.cpp 6 | peer_database.cpp 7 | peer_connection.cpp 8 | message_oriented_connection.cpp) 9 | 10 | add_library( graphene_net ${SOURCES} ${HEADERS} ) 11 | 12 | target_link_libraries( graphene_net 13 | PUBLIC fc graphene_db ) 14 | target_include_directories( graphene_net 15 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" 16 | PRIVATE "${CMAKE_SOURCE_DIR}/libraries/chain/include" 17 | ) 18 | 19 | if(MSVC) 20 | set_source_files_properties( node.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 21 | endif(MSVC) 22 | 23 | if (USE_PCH) 24 | set_target_properties(graphene_net PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) 25 | cotire(graphene_net) 26 | endif(USE_PCH) 27 | 28 | install( TARGETS 29 | graphene_net 30 | 31 | RUNTIME DESTINATION bin 32 | LIBRARY DESTINATION lib 33 | ARCHIVE DESTINATION lib 34 | ) 35 | install( FILES ${HEADERS} DESTINATION "include/graphene/net" ) 36 | -------------------------------------------------------------------------------- /libraries/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory( witness ) 2 | add_subdirectory( account_history ) 3 | add_subdirectory( elasticsearch ) 4 | add_subdirectory( market_history ) 5 | add_subdirectory( delayed_node ) 6 | add_subdirectory( debug_witness ) 7 | add_subdirectory( snapshot ) 8 | -------------------------------------------------------------------------------- /libraries/plugins/account_history/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/account_history/*.hpp") 2 | 3 | add_library( graphene_account_history 4 | account_history_plugin.cpp 5 | ) 6 | 7 | target_link_libraries( graphene_account_history graphene_chain graphene_app ) 8 | target_include_directories( graphene_account_history 9 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | if(MSVC) 12 | set_source_files_properties( account_history_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 13 | endif(MSVC) 14 | 15 | install( TARGETS 16 | graphene_account_history 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/account_history" ) 23 | 24 | -------------------------------------------------------------------------------- /libraries/plugins/debug_witness/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/debug_witness/*.hpp") 2 | 3 | add_library( graphene_debug_witness 4 | debug_api.cpp 5 | debug_witness.cpp 6 | ) 7 | 8 | target_link_libraries( graphene_debug_witness graphene_chain graphene_app ) 9 | target_include_directories( graphene_debug_witness 10 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 11 | 12 | install( TARGETS 13 | graphene_debug_witness 14 | 15 | RUNTIME DESTINATION bin 16 | LIBRARY DESTINATION lib 17 | ARCHIVE DESTINATION lib 18 | ) 19 | -------------------------------------------------------------------------------- /libraries/plugins/delayed_node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/delayed_node/*.hpp") 2 | 3 | add_library( graphene_delayed_node 4 | delayed_node_plugin.cpp 5 | ) 6 | 7 | target_link_libraries( graphene_delayed_node graphene_chain graphene_app ) 8 | target_include_directories( graphene_delayed_node 9 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | if(MSVC) 12 | set_source_files_properties( delayed_node_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 13 | endif(MSVC) 14 | 15 | install( TARGETS 16 | graphene_delayed_node 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | -------------------------------------------------------------------------------- /libraries/plugins/elasticsearch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/elasticsearch/*.hpp") 2 | 3 | add_library( graphene_elasticsearch 4 | elasticsearch_plugin.cpp 5 | ) 6 | 7 | target_link_libraries( graphene_elasticsearch graphene_chain graphene_app curl ) 8 | target_include_directories( graphene_elasticsearch 9 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | if(MSVC) 12 | set_source_files_properties(elasticsearch_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 13 | endif(MSVC) 14 | 15 | install( TARGETS 16 | graphene_elasticsearch 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/elasticsearch" ) 23 | 24 | -------------------------------------------------------------------------------- /libraries/plugins/market_history/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/market_history/*.hpp") 2 | 3 | add_library( graphene_market_history 4 | market_history_plugin.cpp 5 | ) 6 | 7 | target_link_libraries( graphene_market_history graphene_chain graphene_app ) 8 | target_include_directories( graphene_market_history 9 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | if(MSVC) 12 | set_source_files_properties( market_history_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 13 | endif(MSVC) 14 | 15 | install( TARGETS 16 | graphene_market_history 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/market_history" ) 23 | 24 | -------------------------------------------------------------------------------- /libraries/plugins/snapshot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/snapshot/*.hpp") 2 | 3 | add_library( graphene_snapshot 4 | snapshot.cpp 5 | ) 6 | 7 | target_link_libraries( graphene_snapshot graphene_chain graphene_app ) 8 | target_include_directories( graphene_snapshot 9 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | install( TARGETS 12 | graphene_snapshot 13 | 14 | RUNTIME DESTINATION bin 15 | LIBRARY DESTINATION lib 16 | ARCHIVE DESTINATION lib 17 | ) 18 | -------------------------------------------------------------------------------- /libraries/plugins/witness/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/graphene/witness/*.hpp") 2 | 3 | add_library( graphene_witness 4 | witness.cpp 5 | ) 6 | 7 | target_link_libraries( graphene_witness graphene_chain graphene_app ) 8 | target_include_directories( graphene_witness 9 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | install( TARGETS 12 | graphene_witness 13 | 14 | RUNTIME DESTINATION bin 15 | LIBRARY DESTINATION lib 16 | ARCHIVE DESTINATION lib 17 | ) 18 | -------------------------------------------------------------------------------- /libraries/utilities/git_revision.cpp.in: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define GRAPHENE_GIT_REVISION_SHA "@GRAPHENE_GIT_REVISION_SHA@" 5 | #define GRAPHENE_GIT_REVISION_UNIX_TIMESTAMP @GRAPHENE_GIT_REVISION_UNIX_TIMESTAMP@ 6 | #define GRAPHENE_GIT_REVISION_DESCRIPTION "@GRAPHENE_GIT_REVISION_DESCRIPTION@" 7 | 8 | namespace graphene { namespace utilities { 9 | 10 | const char* const git_revision_sha = GRAPHENE_GIT_REVISION_SHA; 11 | const uint32_t git_revision_unix_timestamp = GRAPHENE_GIT_REVISION_UNIX_TIMESTAMP; 12 | const char* const git_revision_description = GRAPHENE_GIT_REVISION_DESCRIPTION; 13 | 14 | } } // end namespace graphene::utilities 15 | -------------------------------------------------------------------------------- /libraries/utilities/include/graphene/utilities/tempdir.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Cryptonomex, Inc., and contributors. 3 | * 4 | * The MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | #pragma once 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace graphene { namespace utilities { 31 | 32 | fc::path temp_directory_path(); 33 | 34 | } } // graphene::utilities 35 | -------------------------------------------------------------------------------- /libraries/utilities/include/graphene/utilities/words.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Cryptonomex, Inc., and contributors. 3 | * 4 | * The MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | #pragma once 25 | 26 | namespace graphene { namespace words { 27 | 28 | typedef const char* const_char_ptr; 29 | extern const const_char_ptr word_list[]; 30 | extern const uint32_t word_list_size; 31 | 32 | } } 33 | -------------------------------------------------------------------------------- /programs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory( build_helpers ) 2 | add_subdirectory( cli_wallet ) 3 | add_subdirectory( genesis_util ) 4 | add_subdirectory( witness_node ) 5 | add_subdirectory( delayed_node ) 6 | add_subdirectory( js_operation_serializer ) 7 | add_subdirectory( size_checker ) 8 | -------------------------------------------------------------------------------- /programs/build_helpers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_executable( cat-parts cat-parts.cpp ) 3 | if( UNIX AND NOT APPLE ) 4 | set(rt_library rt ) 5 | endif() 6 | 7 | # we only actually need Boost, but link against FC for now so we don't duplicate it. 8 | target_link_libraries( cat-parts PRIVATE fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 9 | 10 | add_executable( member_enumerator member_enumerator.cpp ) 11 | if( UNIX AND NOT APPLE ) 12 | set(rt_library rt ) 13 | endif() 14 | 15 | # we only actually need Boost, but link against FC for now so we don't duplicate it. 16 | target_link_libraries( member_enumerator PRIVATE fc graphene_app graphene_net graphene_chain graphene_egenesis_brief graphene_utilities graphene_wallet ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 17 | 18 | -------------------------------------------------------------------------------- /programs/cli_wallet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( cli_wallet main.cpp ) 2 | if( UNIX AND NOT APPLE ) 3 | set(rt_library rt ) 4 | endif() 5 | 6 | find_package( Gperftools QUIET ) 7 | if( GPERFTOOLS_FOUND ) 8 | message( STATUS "Found gperftools; compiling cli_wallet with TCMalloc") 9 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 10 | endif() 11 | 12 | target_link_libraries( cli_wallet 13 | PRIVATE graphene_app graphene_net graphene_chain graphene_egenesis_brief graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 14 | 15 | if(MSVC) 16 | set_source_files_properties( main.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) 17 | endif(MSVC) 18 | 19 | install( TARGETS 20 | cli_wallet 21 | 22 | RUNTIME DESTINATION bin 23 | LIBRARY DESTINATION lib 24 | ARCHIVE DESTINATION lib 25 | ) 26 | -------------------------------------------------------------------------------- /programs/delayed_node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( delayed_node main.cpp ) 2 | if( UNIX AND NOT APPLE ) 3 | set(rt_library rt ) 4 | endif() 5 | 6 | find_package( Gperftools QUIET ) 7 | if( GPERFTOOLS_FOUND ) 8 | message( STATUS "Found gperftools; compiling delayed_node with TCMalloc") 9 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 10 | endif() 11 | 12 | target_link_libraries( delayed_node 13 | PRIVATE graphene_app graphene_account_history graphene_market_history graphene_delayed_node graphene_chain graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 14 | 15 | install( TARGETS 16 | delayed_node 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | -------------------------------------------------------------------------------- /programs/genesis_util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_executable( genesis_update genesis_update.cpp ) 3 | if( UNIX AND NOT APPLE ) 4 | set(rt_library rt ) 5 | endif() 6 | 7 | target_link_libraries( genesis_update 8 | PRIVATE graphene_app graphene_chain graphene_egenesis_none fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 9 | 10 | install( TARGETS 11 | genesis_update 12 | 13 | RUNTIME DESTINATION bin 14 | LIBRARY DESTINATION lib 15 | ARCHIVE DESTINATION lib 16 | ) 17 | 18 | add_executable( get_dev_key get_dev_key.cpp ) 19 | 20 | target_link_libraries( get_dev_key 21 | PRIVATE graphene_app graphene_chain graphene_egenesis_none graphene_utilities fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 22 | 23 | install( TARGETS 24 | get_dev_key 25 | 26 | RUNTIME DESTINATION bin 27 | LIBRARY DESTINATION lib 28 | ARCHIVE DESTINATION lib 29 | ) 30 | 31 | add_executable( convert_address convert_address.cpp ) 32 | 33 | target_link_libraries( convert_address 34 | PRIVATE graphene_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 35 | -------------------------------------------------------------------------------- /programs/genesis_util/canonical_format.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import json 5 | import sys 6 | 7 | if len(sys.argv) < 3: 8 | print("syntax: "+sys.argv[0]+" INFILE OUTFILE") 9 | sys.exit(0) 10 | 11 | with open(sys.argv[1], "r") as infile: 12 | genesis = json.load(infile) 13 | with open(sys.argv[2], "w") as outfile: 14 | json.dump(genesis, outfile, separators=(',', ':'), sort_keys=True) 15 | -------------------------------------------------------------------------------- /programs/genesis_util/python_format.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import json 5 | import sys 6 | 7 | if len(sys.argv) < 3: 8 | print("syntax: "+sys.argv[0]+" INFILE OUTFILE") 9 | sys.exit(0) 10 | 11 | with open(sys.argv[1], "r") as infile: 12 | genesis = json.load(infile) 13 | with open(sys.argv[2], "w") as outfile: 14 | json.dump(genesis, outfile, indent=2, sort_keys=True) 15 | -------------------------------------------------------------------------------- /programs/js_operation_serializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( js_operation_serializer main.cpp ) 2 | if( UNIX AND NOT APPLE ) 3 | set(rt_library rt ) 4 | endif() 5 | 6 | target_link_libraries( js_operation_serializer 7 | PRIVATE graphene_app graphene_net graphene_chain graphene_egenesis_none graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 8 | 9 | install( TARGETS 10 | js_operation_serializer 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | -------------------------------------------------------------------------------- /programs/size_checker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( size_checker main.cpp ) 2 | if( UNIX AND NOT APPLE ) 3 | set(rt_library rt ) 4 | endif() 5 | 6 | target_link_libraries( size_checker 7 | PRIVATE graphene_chain graphene_egenesis_none fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 8 | 9 | install( TARGETS 10 | size_checker 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | -------------------------------------------------------------------------------- /programs/witness_node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( witness_node main.cpp ) 2 | if( UNIX AND NOT APPLE ) 3 | set(rt_library rt ) 4 | endif() 5 | 6 | find_package( Gperftools QUIET ) 7 | if( GPERFTOOLS_FOUND ) 8 | message( STATUS "Found gperftools; compiling witness_node with TCMalloc") 9 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 10 | endif() 11 | 12 | # We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246 13 | target_link_libraries( witness_node 14 | 15 | PRIVATE graphene_app graphene_delayed_node graphene_account_history graphene_elasticsearch graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_egenesis_full graphene_snapshot fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 16 | 17 | 18 | install( TARGETS 19 | witness_node 20 | 21 | RUNTIME DESTINATION bin 22 | LIBRARY DESTINATION lib 23 | ARCHIVE DESTINATION lib 24 | ) 25 | -------------------------------------------------------------------------------- /programs/witness_node/saltpass.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import base64 4 | import getpass 5 | import hashlib 6 | import json 7 | import os 8 | 9 | pw = getpass.getpass("enter your password: ") 10 | pw_bytes = pw.encode("utf-8") 11 | salt_bytes = os.urandom(8) 12 | salt_b64 = base64.b64encode( salt_bytes ) 13 | pw_hash = hashlib.sha256( pw_bytes + salt_bytes ).digest() 14 | pw_hash_b64 = base64.b64encode( pw_hash ) 15 | 16 | print(json.dumps( 17 | { 18 | "password_hash_b64" : pw_hash_b64.decode("ascii"), 19 | "password_salt_b64" : salt_b64.decode("ascii"), 20 | }, 21 | sort_keys=True, 22 | indent=3, separators=(',', ' : ') 23 | )) 24 | -------------------------------------------------------------------------------- /tests/benchmarks/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Cryptonomex, Inc., and contributors. 3 | * 4 | * The MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | #define BOOST_TEST_MODULE "C++ Benchmarks for Graphene Blockchain Database" 25 | #include 26 | -------------------------------------------------------------------------------- /tests/generate_empty_blocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( generate_empty_blocks main.cpp ) 2 | if( UNIX AND NOT APPLE ) 3 | set(rt_library rt ) 4 | endif() 5 | 6 | target_link_libraries( generate_empty_blocks 7 | PRIVATE graphene_app graphene_chain graphene_egenesis_none fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 8 | 9 | install( TARGETS 10 | generate_empty_blocks 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | --------------------------------------------------------------------------------