├── README.md ├── eos ├── CMakeLists.txt ├── CMakeModules │ ├── FindGperftools.cmake │ ├── cotire.cmake │ ├── doxygen.cmake │ ├── installer.cmake │ └── wasm.cmake ├── Docker │ ├── Dockerfile │ ├── README.md │ ├── config.ini │ ├── docker-compose.yml │ ├── eosc.sh │ └── start_eosd.sh ├── Doxyfile ├── HEADER ├── LICENSE.txt ├── build.sh ├── circle.yml ├── contracts │ ├── CMakeLists.txt │ ├── afc │ │ ├── CMakeLists.txt │ │ ├── afc.abi │ │ ├── afc.cpp │ │ └── afc.hpp │ ├── afs │ │ ├── CMakeLists.txt │ │ ├── afs.abi │ │ ├── afs.cpp │ │ └── afs.hpp │ ├── currency │ │ ├── CMakeLists.txt │ │ ├── currency.abi │ │ ├── currency.cpp │ │ └── currency.hpp │ ├── dataexchange │ │ ├── CMakeLists.txt │ │ ├── dataexchange.abi │ │ ├── dataexchange.cpp │ │ └── dataexchange.hpp │ ├── dice │ │ ├── README.md │ │ ├── dice.cpp │ │ └── dice.hpp │ ├── eos │ │ └── eos.cpp │ ├── eoslib │ │ ├── account.h │ │ ├── account.hpp │ │ ├── chain.h │ │ ├── contracts.dox │ │ ├── crypto.h │ │ ├── datastream.hpp │ │ ├── db.h │ │ ├── db.hpp │ │ ├── eos.hpp │ │ ├── fixedpoint.hpp │ │ ├── mainpage.md │ │ ├── math.h │ │ ├── math.hpp │ │ ├── memory.h │ │ ├── memory.hpp │ │ ├── message.h │ │ ├── message.hpp │ │ ├── print.h │ │ ├── print.hpp │ │ ├── raw.hpp │ │ ├── raw_fwd.hpp │ │ ├── real.hpp │ │ ├── rpc.dox │ │ ├── string.h │ │ ├── string.hpp │ │ ├── system.h │ │ ├── token.hpp │ │ ├── transaction.h │ │ ├── transaction.hpp │ │ ├── type_traits.hpp │ │ ├── types.h │ │ ├── types.hpp │ │ └── varint.hpp │ ├── exchange │ │ ├── CMakeLists.txt │ │ ├── exchange.abi │ │ ├── exchange.cpp │ │ └── exchange.hpp │ ├── infinite │ │ ├── CMakeLists.txt │ │ ├── infinite.cpp │ │ └── infinite.hpp │ ├── proxy │ │ ├── CMakeLists.txt │ │ ├── proxy.abi │ │ ├── proxy.cpp │ │ └── proxy.hpp │ ├── simpledb │ │ ├── CMakeLists.txt │ │ ├── simpledb.abi │ │ ├── simpledb.cpp │ │ ├── simpledb.gen.hpp │ │ └── simpledb.hpp │ ├── skeleton │ │ ├── skeleton.abi │ │ ├── skeleton.cpp │ │ └── skeleton.hpp │ ├── social │ │ ├── CMakeLists.txt │ │ └── social.cpp │ ├── storage │ │ ├── CMakeLists.txt │ │ ├── storage.abi │ │ ├── storage.cpp │ │ └── storage.hpp │ ├── test_api │ │ ├── CMakeLists.txt │ │ ├── test_account.cpp │ │ ├── test_api.cpp │ │ ├── test_api.hpp │ │ ├── test_chain.cpp │ │ ├── test_crypto.cpp │ │ ├── test_db.cpp │ │ ├── test_fixedpoint.cpp │ │ ├── test_math.cpp │ │ ├── test_message.cpp │ │ ├── test_print.cpp │ │ ├── test_real.cpp │ │ ├── test_string.cpp │ │ ├── test_transaction.cpp │ │ └── test_types.cpp │ └── tic_tac_toe │ │ ├── tic_tac_toe.abi │ │ ├── tic_tac_toe.cpp │ │ └── tic_tac_toe.hpp ├── eos.doxygen.in ├── genesis.json ├── libraries │ ├── CMakeLists.txt │ ├── abi_generator │ │ ├── CMakeLists.txt │ │ ├── abi_generator.cpp │ │ └── include │ │ │ └── eos │ │ │ └── abi_generator │ │ │ └── abi_generator.hpp │ ├── appbase │ │ ├── CMakeLists.txt │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── application.cpp │ │ ├── examples │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ └── include │ │ │ └── appbase │ │ │ ├── application.hpp │ │ │ └── plugin.hpp │ ├── chain │ │ ├── CMakeLists.txt │ │ ├── block.cpp │ │ ├── block_log.cpp │ │ ├── block_schedule.cpp │ │ ├── blockchain_configuration.cpp │ │ ├── chain_administration_interface.cpp │ │ ├── chain_controller.cpp │ │ ├── fork_database.cpp │ │ ├── get_config.cpp │ │ ├── include │ │ │ └── eos │ │ │ │ └── chain │ │ │ │ ├── README.md │ │ │ │ ├── account_object.hpp │ │ │ │ ├── action_objects.hpp │ │ │ │ ├── authority.hpp │ │ │ │ ├── authority_checker.hpp │ │ │ │ ├── balance_object.hpp │ │ │ │ ├── base.hpp │ │ │ │ ├── block.hpp │ │ │ │ ├── block_log.hpp │ │ │ │ ├── block_schedule.hpp │ │ │ │ ├── block_summary_object.hpp │ │ │ │ ├── blockchain_configuration.hpp │ │ │ │ ├── chain_administration_interface.hpp │ │ │ │ ├── chain_controller.hpp │ │ │ │ ├── chain_initializer_interface.hpp │ │ │ │ ├── config.hpp │ │ │ │ ├── exceptions.hpp │ │ │ │ ├── ext.hpp │ │ │ │ ├── fork_database.hpp │ │ │ │ ├── generated_transaction_object.hpp │ │ │ │ ├── get_config.hpp │ │ │ │ ├── global_property_object.hpp │ │ │ │ ├── immutable_chain_parameters.hpp │ │ │ │ ├── internal_exceptions.hpp │ │ │ │ ├── key_value_object.hpp │ │ │ │ ├── message.hpp │ │ │ │ ├── message_handling_contexts.hpp │ │ │ │ ├── multi_index_includes.hpp │ │ │ │ ├── permission_link_object.hpp │ │ │ │ ├── permission_object.hpp │ │ │ │ ├── producer_object.hpp │ │ │ │ ├── producer_objects.hpp │ │ │ │ ├── protocol.hpp │ │ │ │ ├── rate_limiting_object.hpp │ │ │ │ ├── record_functions.hpp │ │ │ │ ├── staked_balance_objects.hpp │ │ │ │ ├── transaction.hpp │ │ │ │ ├── transaction_object.hpp │ │ │ │ ├── types.hpp │ │ │ │ ├── wasm_interface.hpp │ │ │ │ └── wast_to_wasm.hpp │ │ ├── message_handling_contexts.cpp │ │ ├── producer_objects.cpp │ │ ├── staked_balance_objects.cpp │ │ ├── test │ │ │ ├── CMakeLists.txt │ │ │ ├── block_test.cpp │ │ │ ├── message_test.cpp │ │ │ └── test.cpp │ │ ├── transaction.cpp │ │ ├── types.cpp │ │ ├── wasm_interface.cpp │ │ └── wast_to_wasm.cpp │ ├── chainbase │ │ ├── CMakeLists.txt │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── include │ │ │ └── chainbase │ │ │ │ └── chainbase.hpp │ │ ├── src │ │ │ └── chainbase.cpp │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ └── test.cpp │ ├── egenesis │ │ ├── CMakeLists.txt │ │ ├── egenesis_brief.cpp.tmpl │ │ ├── egenesis_full.cpp.tmpl │ │ ├── egenesis_none.cpp │ │ ├── embed_genesis.cpp │ │ └── include │ │ │ └── eos │ │ │ └── egenesis │ │ │ └── egenesis.hpp │ ├── fc │ │ ├── CMakeLists.txt │ │ ├── CMakeModules │ │ │ ├── ArgumentParser.cmake │ │ │ ├── FindBoost.cmake │ │ │ ├── FindGMP.cmake │ │ │ ├── FindReadline.cmake │ │ │ ├── FindSecp256k1.cmake │ │ │ ├── FindVLD.cmake │ │ │ ├── ParseLibraryList.cmake │ │ │ ├── SetupTargetMacros.cmake │ │ │ ├── UseLibraryMacros.cmake │ │ │ └── VersionMacros.cmake │ │ ├── GitVersionGen │ │ │ └── GetGitRevisionDescription.cmake.in │ │ ├── include │ │ │ └── fc │ │ │ │ ├── actor.hpp │ │ │ │ ├── aligned.hpp │ │ │ │ ├── any.hpp │ │ │ │ ├── api.hpp │ │ │ │ ├── array.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 │ │ │ │ ├── base32.hpp │ │ │ │ ├── base36.hpp │ │ │ │ ├── base58.hpp │ │ │ │ ├── base64.hpp │ │ │ │ ├── bigint.hpp │ │ │ │ ├── blowfish.hpp │ │ │ │ ├── city.hpp │ │ │ │ ├── dh.hpp │ │ │ │ ├── digest.hpp │ │ │ │ ├── elliptic.hpp │ │ │ │ ├── equihash.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 │ │ │ │ ├── iprocess.hpp │ │ │ │ ├── mmap_struct.hpp │ │ │ │ └── process.hpp │ │ │ │ ├── io │ │ │ │ ├── buffered_iostream.hpp │ │ │ │ ├── console.hpp │ │ │ │ ├── datastream.hpp │ │ │ │ ├── enum_type.hpp │ │ │ │ ├── fstream.hpp │ │ │ │ ├── iobuffer.hpp │ │ │ │ ├── json.hpp │ │ │ │ ├── json_relaxed.hpp │ │ │ │ ├── raw.hpp │ │ │ │ ├── raw_fwd.hpp │ │ │ │ ├── raw_unpack_file.hpp │ │ │ │ ├── raw_variant.hpp │ │ │ │ ├── sstream.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 │ │ │ │ ├── ip.hpp │ │ │ │ ├── resolve.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 │ │ │ │ ├── cli.hpp │ │ │ │ ├── http_api.hpp │ │ │ │ ├── json_connection.hpp │ │ │ │ ├── variant_connection.hpp │ │ │ │ ├── variant_stream.hpp │ │ │ │ └── websocket_api.hpp │ │ │ │ ├── safe.hpp │ │ │ │ ├── scoped_exit.hpp │ │ │ │ ├── shared_ptr.hpp │ │ │ │ ├── smart_ref_fwd.hpp │ │ │ │ ├── smart_ref_impl.hpp │ │ │ │ ├── static_variant.hpp │ │ │ │ ├── string.hpp │ │ │ │ ├── time.hpp │ │ │ │ ├── tuple.hpp │ │ │ │ ├── uint128.hpp │ │ │ │ ├── unique_ptr.hpp │ │ │ │ ├── utf8.hpp │ │ │ │ ├── utility.hpp │ │ │ │ ├── variant.hpp │ │ │ │ ├── variant_object.hpp │ │ │ │ ├── vector.hpp │ │ │ │ └── vector_fwd.hpp │ │ ├── src │ │ │ ├── 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 │ │ │ │ ├── base32.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 │ │ │ │ ├── equihash.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 │ │ │ │ ├── mmap_struct.cpp │ │ │ │ └── process.cpp │ │ │ ├── io │ │ │ │ ├── buffered_iostream.cpp │ │ │ │ ├── console.cpp │ │ │ │ ├── datastream.cpp │ │ │ │ ├── fstream.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 │ │ │ │ ├── gntp.cpp │ │ │ │ ├── http │ │ │ │ │ ├── http_connection.cpp │ │ │ │ │ ├── http_server.cpp │ │ │ │ │ └── websocket.cpp │ │ │ │ ├── ip.cpp │ │ │ │ ├── ntp.cpp │ │ │ │ ├── rate_limiting.cpp │ │ │ │ ├── resolve.cpp │ │ │ │ ├── tcp_socket.cpp │ │ │ │ ├── udp_socket.cpp │ │ │ │ ├── udt_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 │ │ │ │ ├── asio │ │ │ │ │ ├── detail │ │ │ │ │ │ └── yield.hpp │ │ │ │ │ ├── round_robin.hpp │ │ │ │ │ └── yield.hpp │ │ │ │ ├── spin_lock.cpp │ │ │ │ └── spin_yield_lock.cpp │ │ │ ├── time.cpp │ │ │ ├── uint128.cpp │ │ │ ├── utf8.cpp │ │ │ ├── utf8 │ │ │ │ ├── ReleaseNotes │ │ │ │ ├── checked.h │ │ │ │ ├── core.h │ │ │ │ ├── unchecked.h │ │ │ │ └── utf8cpp.html │ │ │ ├── variant.cpp │ │ │ └── variant_object.cpp │ │ └── vendor │ │ │ └── websocketpp │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CMakeLists.txt │ │ │ ├── COPYING │ │ │ ├── Doxyfile │ │ │ ├── SConstruct │ │ │ ├── changelog.md │ │ │ ├── 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 │ │ │ │ ├── parser.cpp │ │ │ │ └── parser_perf.cpp │ │ │ ├── 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 │ ├── native_contract │ │ ├── CMakeLists.txt │ │ ├── eos_contract.cpp │ │ ├── genesis_state.cpp │ │ ├── include │ │ │ └── eos │ │ │ │ └── native_contract │ │ │ │ ├── eos_contract.hpp │ │ │ │ ├── genesis_state.hpp │ │ │ │ ├── native_contract_chain_administrator.hpp │ │ │ │ ├── native_contract_chain_initializer.hpp │ │ │ │ └── objects.hpp │ │ ├── native_contract_chain_administrator.cpp │ │ └── native_contract_chain_initializer.cpp │ ├── types │ │ ├── CMakeLists.txt │ │ ├── abi_serializer.cpp │ │ ├── asset.cpp │ │ ├── include │ │ │ └── eos │ │ │ │ └── types │ │ │ │ ├── WrenDatastream.hpp │ │ │ │ ├── WrenInt.hpp │ │ │ │ ├── abi_serializer.hpp │ │ │ │ ├── asset.hpp │ │ │ │ ├── exceptions.hpp │ │ │ │ ├── generated.hpp │ │ │ │ ├── native.hpp │ │ │ │ ├── native_impl.hpp │ │ │ │ ├── public_key.hpp │ │ │ │ ├── type_parser.hpp │ │ │ │ └── types.hpp │ │ ├── native.cpp │ │ ├── public_key.cpp │ │ ├── type_generator.cpp │ │ ├── type_parser.cpp │ │ └── types.eos │ ├── utilities │ │ ├── CMakeLists.txt │ │ ├── git_revision.cpp.in │ │ ├── include │ │ │ └── eos │ │ │ │ └── utilities │ │ │ │ ├── exception_macros.hpp │ │ │ │ ├── git_revision.hpp │ │ │ │ ├── key_conversion.hpp │ │ │ │ ├── padding_ostream.hpp │ │ │ │ ├── parallel_markers.hpp │ │ │ │ ├── rand.hpp │ │ │ │ ├── string_escape.hpp │ │ │ │ ├── tempdir.hpp │ │ │ │ └── words.hpp │ │ ├── key_conversion.cpp │ │ ├── string_escape.cpp │ │ ├── tempdir.cpp │ │ └── words.cpp │ └── wasm-jit │ │ ├── .travis.yml │ │ ├── CMakeLists.txt │ │ ├── Include │ │ ├── Emscripten │ │ │ └── Emscripten.h │ │ ├── IR │ │ │ ├── IR.h │ │ │ ├── Module.h │ │ │ ├── OperatorPrinter.h │ │ │ ├── Operators.h │ │ │ ├── Types.h │ │ │ └── Validate.h │ │ ├── Inline │ │ │ ├── BasicTypes.h │ │ │ ├── CMakeLists.txt │ │ │ ├── DenseStaticIntSet.h │ │ │ ├── Errors.h │ │ │ ├── Floats.h │ │ │ ├── Serialization.h │ │ │ ├── Timing.h │ │ │ └── UTF8.h │ │ ├── Logging │ │ │ └── Logging.h │ │ ├── Platform │ │ │ └── Platform.h │ │ ├── Runtime │ │ │ ├── Intrinsics.h │ │ │ ├── Linker.h │ │ │ ├── Runtime.h │ │ │ └── TaggedValue.h │ │ ├── WASM │ │ │ └── WASM.h │ │ └── WAST │ │ │ ├── TestScript.h │ │ │ └── WAST.h │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Source │ │ ├── Emscripten │ │ │ ├── CMakeLists.txt │ │ │ └── Emscripten.cpp │ │ ├── IR │ │ │ ├── CMakeLists.txt │ │ │ ├── DisassemblyNames.cpp │ │ │ ├── Operators.cpp │ │ │ ├── Types.cpp │ │ │ └── Validate.cpp │ │ ├── Logging │ │ │ ├── CMakeLists.txt │ │ │ └── Logging.cpp │ │ ├── Platform │ │ │ ├── CMakeLists.txt │ │ │ ├── POSIX.cpp │ │ │ └── Windows.cpp │ │ ├── Programs │ │ │ ├── Assemble.cpp │ │ │ ├── CLI.h │ │ │ ├── CMakeLists.txt │ │ │ ├── Disassemble.cpp │ │ │ ├── Test.cpp │ │ │ └── wavm.cpp │ │ ├── Runtime │ │ │ ├── CMakeLists.txt │ │ │ ├── Intrinsics.cpp │ │ │ ├── LLVMEmitIR.cpp │ │ │ ├── LLVMJIT.cpp │ │ │ ├── LLVMJIT.h │ │ │ ├── Linker.cpp │ │ │ ├── Memory.cpp │ │ │ ├── ModuleInstance.cpp │ │ │ ├── ObjectGC.cpp │ │ │ ├── Runtime.cpp │ │ │ ├── RuntimePrivate.h │ │ │ ├── Table.cpp │ │ │ ├── Threads.cpp │ │ │ └── WAVMIntrinsics.cpp │ │ ├── ThirdParty │ │ │ ├── dtoa.c │ │ │ └── xxhash │ │ │ │ ├── LICENSE │ │ │ │ ├── xxhash.c │ │ │ │ └── xxhash.h │ │ ├── WASM │ │ │ ├── CMakeLists.txt │ │ │ └── WASMSerialization.cpp │ │ └── WAST │ │ │ ├── CMakeLists.txt │ │ │ ├── Lexer.cpp │ │ │ ├── Lexer.h │ │ │ ├── NFA.cpp │ │ │ ├── NFA.h │ │ │ ├── Parse.cpp │ │ │ ├── Parse.h │ │ │ ├── ParseFunction.cpp │ │ │ ├── ParseModule.cpp │ │ │ ├── ParseNumbers.cpp │ │ │ ├── ParseTests.cpp │ │ │ ├── Print.cpp │ │ │ ├── Regexp.cpp │ │ │ └── Regexp.h │ │ ├── Test │ │ ├── Benchmark │ │ │ ├── Benchmark.cpp │ │ │ └── Benchmark.wast │ │ ├── Blake2b │ │ │ └── blake2b.wast │ │ ├── fuzz │ │ │ ├── address.wast │ │ │ ├── echo.wast │ │ │ ├── func_ptrs.wast │ │ │ ├── globals.wast │ │ │ ├── helloworld.wast │ │ │ ├── i32.wast │ │ │ ├── labels.wast │ │ │ ├── loop.wast │ │ │ ├── resizing.wast │ │ │ ├── return.wast │ │ │ ├── tee.wast │ │ │ └── tee_local.wast │ │ ├── spec │ │ │ ├── CMakeLists.txt │ │ │ ├── LICENSE │ │ │ ├── WAVM_known_failures.wast │ │ │ ├── address.wast │ │ │ ├── align.wast │ │ │ ├── binary.wast │ │ │ ├── block.wast │ │ │ ├── br.wast │ │ │ ├── br_if.wast │ │ │ ├── br_table.wast │ │ │ ├── break-drop.wast │ │ │ ├── call.wast │ │ │ ├── call_indirect.wast │ │ │ ├── comments.wast │ │ │ ├── const.wast │ │ │ ├── conversions.wast │ │ │ ├── custom_section.wast │ │ │ ├── endianness.wast │ │ │ ├── exports.wast │ │ │ ├── f32.wast │ │ │ ├── f32_bitwise.wast │ │ │ ├── f32_cmp.wast │ │ │ ├── f64.wast │ │ │ ├── f64_bitwise.wast │ │ │ ├── f64_cmp.wast │ │ │ ├── fac.wast │ │ │ ├── float_exprs.wast │ │ │ ├── float_literals.wast │ │ │ ├── float_memory.wast │ │ │ ├── float_misc.wast │ │ │ ├── forward.wast │ │ │ ├── func.wast │ │ │ ├── func_ptrs.wast │ │ │ ├── get_local.wast │ │ │ ├── globals.wast │ │ │ ├── i32.wast │ │ │ ├── i64.wast │ │ │ ├── if.wast │ │ │ ├── imports.wast │ │ │ ├── int_exprs.wast │ │ │ ├── int_literals.wast │ │ │ ├── labels.wast │ │ │ ├── left-to-right.wast │ │ │ ├── linking.wast │ │ │ ├── loop.wast │ │ │ ├── memory.wast │ │ │ ├── memory_redundancy.wast │ │ │ ├── memory_trap.wast │ │ │ ├── names.wast │ │ │ ├── nop.wast │ │ │ ├── resizing.wast │ │ │ ├── return.wast │ │ │ ├── select.wast │ │ │ ├── set_local.wast │ │ │ ├── skip-stack-guard-page.wast │ │ │ ├── stack.wast │ │ │ ├── start.wast │ │ │ ├── store_retval.wast │ │ │ ├── switch.wast │ │ │ ├── tee_local.wast │ │ │ ├── token.wast │ │ │ ├── traps.wast │ │ │ ├── typecheck.wast │ │ │ ├── unreachable.wast │ │ │ ├── unreached-invalid.wast │ │ │ ├── unwind.wast │ │ │ ├── utf8-custom-section-id.wast │ │ │ ├── utf8-import-field.wast │ │ │ └── utf8-import-module.wast │ │ ├── wast │ │ │ ├── echo.wast │ │ │ ├── helloworld.wast │ │ │ ├── skip-stack-guard-page.wast │ │ │ └── tee.wast │ │ └── zlib │ │ │ └── zlib.wast │ │ ├── afl │ │ ├── readme │ │ ├── run-afl-fuzz │ │ ├── simplify-crashes │ │ └── wast.dict │ │ └── travis-build.sh ├── plugins │ ├── CMakeLists.txt │ ├── account_history_api_plugin │ │ ├── CMakeLists.txt │ │ ├── account_history_api_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── account_history_api_plugin │ │ │ └── account_history_api_plugin.hpp │ ├── account_history_plugin │ │ ├── CMakeLists.txt │ │ ├── account_history_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── account_history_plugin │ │ │ ├── account_control_history_object.hpp │ │ │ ├── account_history_plugin.hpp │ │ │ ├── account_transaction_history_object.hpp │ │ │ ├── public_key_history_object.hpp │ │ │ └── transaction_history_object.hpp │ ├── chain_api_plugin │ │ ├── CMakeLists.txt │ │ ├── chain_api_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── chain_api_plugin │ │ │ └── chain_api_plugin.hpp │ ├── chain_plugin │ │ ├── CMakeLists.txt │ │ ├── chain_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── chain_plugin │ │ │ └── chain_plugin.hpp │ ├── database_plugin │ │ ├── CMakeLists.txt │ │ ├── database_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── database_plugin │ │ │ └── database_plugin.hpp │ ├── db_plugin │ │ ├── CMakeLists.txt │ │ ├── db_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── db_plugin │ │ │ └── db_plugin.hpp │ ├── faucet_testnet_plugin │ │ ├── CMakeLists.txt │ │ ├── faucet_testnet_plugin.cpp │ │ └── include │ │ │ └── eosio │ │ │ └── faucet_testnet_plugin │ │ │ └── faucet_testnet_plugin.hpp │ ├── http_plugin │ │ ├── CMakeLists.txt │ │ ├── http_plugin.cpp │ │ └── include │ │ │ └── eos │ │ │ └── http_plugin │ │ │ └── http_plugin.hpp │ ├── make_new_plugin.sh │ ├── net_api_plugin │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── eos │ │ │ │ └── net_api_plugin │ │ │ │ └── net_api_plugin.hpp │ │ └── net_api_plugin.cpp │ ├── net_plugin │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── eos │ │ │ │ └── net_plugin │ │ │ │ ├── message_buffer.hpp │ │ │ │ ├── net_plugin.hpp │ │ │ │ └── protocol.hpp │ │ └── net_plugin.cpp │ ├── producer_plugin │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── eos │ │ │ │ └── producer_plugin │ │ │ │ └── producer_plugin.hpp │ │ └── producer_plugin.cpp │ ├── template_plugin │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── eos │ │ │ │ └── template_plugin │ │ │ │ └── template_plugin.hpp │ │ └── template_plugin.cpp │ ├── txn_test_gen_plugin │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── include │ │ │ └── eosio │ │ │ │ └── txn_test_gen_plugin │ │ │ │ └── txn_test_gen_plugin.hpp │ │ └── txn_test_gen_plugin.cpp │ ├── wallet_api_plugin │ │ ├── CMakeLists.txt │ │ ├── include │ │ │ └── eos │ │ │ │ └── wallet_api_plugin │ │ │ │ └── wallet_api_plugin.hpp │ │ └── wallet_api_plugin.cpp │ └── wallet_plugin │ │ ├── CMakeLists.txt │ │ ├── include │ │ └── eos │ │ │ └── wallet_plugin │ │ │ ├── wallet.hpp │ │ │ ├── wallet_manager.hpp │ │ │ └── wallet_plugin.hpp │ │ ├── wallet.cpp │ │ ├── wallet_manager.cpp │ │ └── wallet_plugin.cpp ├── programs │ ├── CMakeLists.txt │ ├── abi_gen │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── codegen │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── debug_node │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── main.cpp │ ├── eos-walletd │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── eosc │ │ ├── CLI11.hpp │ │ ├── CMakeLists.txt │ │ ├── config.hpp.in │ │ ├── eosc.pot │ │ ├── help_text.cpp │ │ ├── help_text.hpp │ │ ├── httpc.cpp │ │ ├── localize.hpp │ │ └── main.cpp │ ├── eosd │ │ ├── CMakeLists.txt │ │ ├── config.hpp.in │ │ └── main.cpp │ ├── launcher │ │ ├── CMakeLists.txt │ │ ├── config.hpp.in │ │ └── main.cpp │ └── snapshot │ │ ├── .gitignore │ │ ├── dist │ │ ├── bundle-genesis.js │ │ └── bundle.js │ │ ├── genesis.html │ │ ├── lib │ │ ├── css │ │ │ ├── genesis.css │ │ │ ├── main.css │ │ │ └── snapshot.css │ │ ├── js │ │ │ ├── genesis.js │ │ │ └── ui.js │ │ └── vendor │ │ │ ├── HackTimer.min.js │ │ │ ├── HackTimerWorker.min.js │ │ │ ├── ascii-table.min.js │ │ │ ├── async.min.js │ │ │ ├── eosjs-ecc.js │ │ │ ├── logwatcher.js │ │ │ ├── stacktrace.min.js │ │ │ └── web3.min.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── readme.md │ │ ├── snapshot.csv │ │ ├── snapshot.html │ │ └── src │ │ ├── abi.js │ │ ├── calculator.js │ │ ├── class.balance.js │ │ ├── class.genesis.js │ │ ├── class.registrant.js │ │ ├── class.transaction.js │ │ ├── config.js │ │ ├── export.js │ │ ├── snapshot.js │ │ └── utils.js ├── scripts │ ├── CMakeLists.txt │ ├── install_dependencies.sh │ ├── start_npnode.sh │ ├── testnet_np │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ ├── genesis.json │ │ └── logging.json │ ├── tn_bounce.sh │ ├── tn_down.sh │ ├── tn_gen_config.sh │ ├── tn_roll.sh │ ├── tn_start_all.sh │ └── tn_up.sh ├── testnet-diagrams.sh ├── tests │ ├── CMakeLists.txt │ ├── api_tests │ │ ├── api_tests.cpp │ │ ├── extended_memory_test │ │ │ ├── CMakeLists.txt │ │ │ └── extended_memory_test.cpp │ │ ├── memory_test │ │ │ ├── CMakeLists.txt │ │ │ ├── memory_test.cpp │ │ │ └── memory_test.hpp │ │ └── table_abi_test │ │ │ ├── CMakeLists.txt │ │ │ ├── table_abi_test.abi │ │ │ ├── table_abi_test.cpp │ │ │ └── table_abi_test.hpp │ ├── common │ │ ├── database_fixture.cpp │ │ ├── database_fixture.hpp │ │ ├── expect.hpp │ │ ├── macro_support.hpp │ │ ├── main.cpp │ │ └── testing_macros.hpp │ ├── distributed-transactions-test.py │ ├── eosd_run_mongodb_test.sh │ ├── eosd_run_test.py │ ├── eosd_run_test.sh │ ├── p2p_tests │ │ ├── pump │ │ │ └── run_test.pl │ │ └── sync │ │ │ ├── message_storm.sh │ │ │ └── test.sh │ ├── restart-scenarios-test.py │ ├── run_tests.sh │ ├── slow_tests │ │ ├── deferred_tests.cpp │ │ ├── slow_tests.cpp │ │ └── wast │ │ │ ├── loop.cpp │ │ │ ├── loop.wast │ │ │ ├── simplecoin.cpp │ │ │ └── simplecoin.wast │ ├── stress_test │ │ ├── README.md │ │ ├── config.json │ │ ├── package-lock.json │ │ ├── package.json │ │ └── stress_test.js │ ├── testUtils.py │ ├── tests │ │ ├── abi_tests.cpp │ │ ├── block_schedule_tests.cpp │ │ ├── block_tests.cpp │ │ ├── chain_tests.cpp │ │ ├── contracts │ │ │ └── rate_limit_auth │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── rate_limit_auth.cpp │ │ ├── database_tests.cpp │ │ ├── message_buffer_tests.cpp │ │ ├── misc_tests.cpp │ │ ├── native_contract_tests.cpp │ │ ├── special_accounts_tests.cpp │ │ ├── types_tests.cpp │ │ ├── wallet_tests.cpp │ │ └── wasm_tests │ │ │ └── wasm_tests.cpp │ └── trans_sync_across_mixed_cluster_test.sh └── tools │ ├── CMakeLists.txt │ └── eoscpp.in ├── resource ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png └── 8.png ├── safe-sdks ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── safe │ └── sdk │ ├── bean │ ├── Action.java │ ├── Authorization.java │ ├── Bean.java │ ├── BinArgs.java │ ├── ChainInfo.java │ ├── PackagedTransaction.java │ ├── RequiredKeys.java │ ├── Transaction.java │ └── Transfer.java │ ├── client │ ├── AcountClient.java │ └── ChainClient.java │ ├── comm │ ├── Httpj.java │ ├── SHA256.java │ └── TimeUtil.java │ ├── constant │ └── EosPath.java │ ├── crypto │ ├── AESUtil.java │ ├── AccountName.java │ ├── Base58.java │ ├── EosAgentWallet.java │ ├── KeyPair.java │ ├── SimpleWallet.java │ ├── TestEC.java │ └── Wallet.java │ ├── jni │ └── EosJni.java │ └── test │ └── TestSDK.java ├── safe-server ├── pom.xml └── src │ └── main │ ├── assembly │ └── assembly.xml │ ├── java │ └── com │ │ └── safe │ │ └── server │ │ ├── SAFEProxyServer.java │ │ └── controller │ │ └── PingController.java │ └── resources │ ├── bin │ ├── clear_logs.sh │ ├── nginx_log_division.sh │ ├── start.sh │ ├── stop.sh │ ├── sync_lib.sh │ ├── sync_scripts.sh │ └── update.sh │ ├── config.properties │ ├── log4j.properties │ └── online │ ├── config.properties │ └── log4j.properties └── safe-web-pro ├── pom.xml └── src └── main ├── java └── com │ └── safe │ └── web │ ├── blockchain │ └── BlockChainClient.java │ ├── controller │ ├── InfoController.java │ └── UserController.java │ └── start │ └── SafeWebConfig.java ├── resources ├── log4j.properties ├── safe.local.properties └── safe.properties └── webapp ├── WEB-INF └── web.xml ├── browser.html ├── common ├── css │ ├── bootstrap.min.css │ ├── common.css │ ├── common.min.css │ ├── common.sass │ └── jquery.fullpage.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── js │ ├── bootstrap.min.js │ ├── jquery.fullpage.js │ ├── jquery.min.js │ └── scrolloverflow.min.js ├── css ├── browser.css ├── browser.min.css ├── browser.sass └── index.css ├── images ├── Hippopx.jpg ├── banner_bubi.png ├── banner_bubix_main.png ├── banner_bumeng_main.png ├── banner_bunuo_main.png ├── global.png └── timg.jpeg ├── index.html ├── js ├── browser.js ├── index.js ├── index_canvas.js ├── index_canvas2.js └── index_canvas3.js ├── login.html └── other ├── SAFEv1.pdf └── plugin ├── EasePack.min.js ├── TweenLite.min.js ├── exporting.js ├── highcharts.js ├── oldie.js └── series-label.js /README.md: -------------------------------------------------------------------------------- 1 | ### 汇链——基于区块链的去中心化数据交易平台 2 | 3 | ### 代码清单 4 | 5 | * 区块链基于eos3.0作为主链 6 | * safe-sdk 支持java的eos主链sdk,可以完成基础功能调用,实现了独立于keos钱包的轻量化钱包接口,可实现在线web钱包和客户端钱包等应用。 7 | * safe-server 针对数据交易服务器的实现。定义了轻量化服务器框架实现和标准数据交易接口。 8 | * safe-web-pro 目前集成交易锁官网、钱包、区块浏览器、在线钱包和交易市场几个功能模块。后期会根据专用模块拆分。 9 | 10 | ### [更多>>Wiki](https://github.com/15Koala/safe/wiki) 11 | 12 | 13 | -------------------------------------------------------------------------------- /eos/Docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | eosd: 5 | build: 6 | context: . 7 | image: eosio/eos 8 | command: /opt/eos/bin/start_eosd.sh 9 | ports: 10 | - 8888:8888 11 | - 9876:9876 12 | expose: 13 | - "8888" 14 | volumes: 15 | - eosd-data-volume:/opt/eos/bin/data-dir 16 | 17 | walletd: 18 | image: eosio/eos 19 | command: /opt/eos/bin/eos-walletd 20 | links: 21 | - eosd 22 | volumes: 23 | - walletd-data-volume:/opt/eos/bin/data-dir 24 | 25 | volumes: 26 | eosd-data-volume: 27 | walletd-data-volume: -------------------------------------------------------------------------------- /eos/Docker/eosc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Usage: 4 | # Go into cmd loop: sudo ./eosc.sh 5 | # Run single cmd: sudo ./eosc.sh 6 | 7 | PREFIX="docker exec docker_eosd_1 eosc" 8 | if [ -z $1 ] ; then 9 | while : 10 | do 11 | read -e -p "eosc " cmd 12 | history -s "$cmd" 13 | $PREFIX $cmd 14 | done 15 | else 16 | $PREFIX $@ 17 | fi 18 | -------------------------------------------------------------------------------- /eos/Docker/start_eosd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd /opt/eos/bin 3 | 4 | if [ -f '/opt/eos/bin/data-dir/config.ini' ]; then 5 | echo 6 | else 7 | cp /config.ini /opt/eos/bin/data-dir 8 | fi 9 | 10 | if [ -f '/opt/eos/bin/data-dir/genesis.json' ]; then 11 | echo 12 | else 13 | cp /genesis.json /opt/eos/bin/data-dir 14 | fi 15 | 16 | if [ -d '/opt/eos/bin/data-dir/contracts' ]; then 17 | echo 18 | else 19 | cp -r /contracts /opt/eos/bin/data-dir 20 | fi 21 | 22 | exec /opt/eos/bin/eosd $@ 23 | -------------------------------------------------------------------------------- /eos/HEADER: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Respective Authors. 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 | -------------------------------------------------------------------------------- /eos/circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | services: 3 | - docker 4 | 5 | dependencies: 6 | override: 7 | - cd ~/eos && docker build -t eosio/eos -f Docker/Dockerfile . 8 | 9 | test: 10 | pre: 11 | - sleep 5 12 | override: 13 | - docker run eosio/eos 14 | -------------------------------------------------------------------------------- /eos/contracts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(currency) 2 | add_subdirectory(exchange) 3 | add_subdirectory(infinite) 4 | add_subdirectory(proxy) 5 | add_subdirectory(test_api) 6 | add_subdirectory(simpledb) 7 | add_subdirectory(storage) 8 | #add_subdirectory(social) 9 | add_subdirectory(dataexchange) 10 | add_subdirectory(afc) 11 | add_subdirectory(afs) 12 | 13 | install( DIRECTORY eoslib DESTINATION include/ ) 14 | install( DIRECTORY skeleton DESTINATION share/ ) 15 | -------------------------------------------------------------------------------- /eos/contracts/afc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(afc "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) -------------------------------------------------------------------------------- /eos/contracts/afc/afc.abi: -------------------------------------------------------------------------------- 1 | { 2 | "types": [], 3 | "structs": [{ 4 | "name": "afc_tokens", 5 | "base": "", 6 | "fields": { 7 | "quantity": "uint64" 8 | } 9 | },{ 10 | "name": "transfer", 11 | "base": "", 12 | "fields": { 13 | "from": "account_name", 14 | "to": "account_name", 15 | "quantity": "afc_tokens" 16 | } 17 | },{ 18 | "name": "account", 19 | "base": "", 20 | "fields": { 21 | "key": "uint64", 22 | "balance": "afc_tokens" 23 | } 24 | } 25 | ], 26 | "actions": [{ 27 | "action_name": "transfer", 28 | "type": "transfer" 29 | } 30 | ], 31 | "tables": [{ 32 | "table_name": "account", 33 | "index_type": "i64", 34 | "key_names": [ 35 | "key" 36 | ], 37 | "key_types": [ 38 | "uint64" 39 | ], 40 | "type": "account" 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /eos/contracts/afs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(afs "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) -------------------------------------------------------------------------------- /eos/contracts/afs/afs.abi: -------------------------------------------------------------------------------- 1 | { 2 | "types": [], 3 | "structs": [{ 4 | "name": "afs_tokens", 5 | "base": "", 6 | "fields": { 7 | "quantity": "uint64" 8 | } 9 | },{ 10 | "name": "transfer", 11 | "base": "", 12 | "fields": { 13 | "from": "account_name", 14 | "to": "account_name", 15 | "quantity": "afs_tokens" 16 | } 17 | },{ 18 | "name": "account", 19 | "base": "", 20 | "fields": { 21 | "key": "uint64", 22 | "balance": "afs_tokens" 23 | } 24 | } 25 | ], 26 | "actions": [{ 27 | "action_name": "transfer", 28 | "type": "transfer" 29 | } 30 | ], 31 | "tables": [{ 32 | "table_name": "account", 33 | "index_type": "i64", 34 | "key_names": [ 35 | "key" 36 | ], 37 | "key_types": [ 38 | "uint64" 39 | ], 40 | "type": "account" 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /eos/contracts/currency/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(currency "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) -------------------------------------------------------------------------------- /eos/contracts/currency/currency.abi: -------------------------------------------------------------------------------- 1 | { 2 | "types": [{ 3 | "new_type_name": "account_name", 4 | "type": "name" 5 | } 6 | ], 7 | "structs": [{ 8 | "name": "transfer", 9 | "base": "", 10 | "fields": { 11 | "from": "account_name", 12 | "to": "account_name", 13 | "quantity": "uint64" 14 | } 15 | },{ 16 | "name": "account", 17 | "base": "", 18 | "fields": { 19 | "key": "name", 20 | "balance": "uint64" 21 | } 22 | } 23 | ], 24 | "actions": [{ 25 | "action_name": "transfer", 26 | "type": "transfer" 27 | } 28 | ], 29 | "tables": [{ 30 | "table_name": "account", 31 | "type": "account", 32 | "index_type": "i64", 33 | "key_names" : ["key"], 34 | "key_types" : ["name"] 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /eos/contracts/dataexchange/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(dataexchange "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) -------------------------------------------------------------------------------- /eos/contracts/eoslib/chain.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | /** 10 | * @defgroup chainapi Chain API 11 | * @brief Define API for querying internal chain state 12 | * @ingroup contractdev 13 | */ 14 | 15 | /** 16 | * @defgroup chaincapi Chain C API 17 | * @brief C API for querying internal chain state 18 | * @ingroup chainapi 19 | * @{ 20 | */ 21 | 22 | extern "C" { 23 | /** 24 | * @brief Return the set of active producers 25 | * @details Return the set of active producers 26 | * 27 | * @param producers - location to store the active producers 28 | * 29 | * Example: 30 | * @code 31 | * account_name producers[21]; 32 | * get_active_producers(producers, sizeof(account_name)*21); 33 | * @endcode 34 | */ 35 | 36 | void get_active_producers( account_name* producers, uint32_t datalen ); 37 | 38 | ///@ } chaincapi 39 | } 40 | -------------------------------------------------------------------------------- /eos/contracts/eoslib/crypto.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | extern "C" { 8 | /** 9 | * This method is implemented as: 10 | * 11 | * checksum calc_hash; 12 | * sha256( data, length, &calc_hash ); 13 | * assert( calc_hash == hash, "invalid hash" ); 14 | * 15 | * This method is optimized to a NO-OP when in fast evaluation mode 16 | */ 17 | void assert_sha256( char* data, uint32_t length, const checksum* hash ); 18 | 19 | /** 20 | * Calculates sha256( data,length) and stores result in memory pointed to by hash 21 | */ 22 | void sha256( char* data, uint32_t length, checksum* hash ); 23 | } -------------------------------------------------------------------------------- /eos/contracts/eoslib/eos.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /eos/contracts/eoslib/string.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | 8 | extern "C" { 9 | /** 10 | * Aborts processing of this message and unwinds all pending changes if the given string is not utf8 11 | * @brief Aborts processing of this message and unwinds all pending changes 12 | * @param str - string to be tested 13 | * @param len - length of the string to be tested 14 | * @param err_msg_cstr - a null terminated message to explain the reason for failure 15 | */ 16 | void assert_is_utf8( const char* str, uint32_t len, const char* err_msg_cstr ); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /eos/contracts/exchange/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(exchange "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) 4 | add_dependencies( exchange currency ) 5 | -------------------------------------------------------------------------------- /eos/contracts/infinite/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_wast_target(infinite "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 2 | -------------------------------------------------------------------------------- /eos/contracts/proxy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(proxy "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) 4 | -------------------------------------------------------------------------------- /eos/contracts/proxy/proxy.abi: -------------------------------------------------------------------------------- 1 | { 2 | "types": [{ 3 | "new_type_name": "account_name", 4 | "type": "name" 5 | } 6 | ], 7 | "structs": [{ 8 | "name": "config", 9 | "base": "", 10 | "fields": { 11 | "key": "name", 12 | "owner": "name" 13 | } 14 | },{ 15 | "name": "setowner", 16 | "base": "", 17 | "fields": { 18 | "owner": "name" 19 | } 20 | } 21 | ], 22 | "actions": [{ 23 | "action_name": "setowner", 24 | "type": "setowner" 25 | } 26 | ], 27 | "tables": [{ 28 | "table_name": "configs", 29 | "type": "config", 30 | "index_type": "i64", 31 | "key_names" : ["key"], 32 | "key_types" : ["name"] 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /eos/contracts/proxy/proxy.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | 8 | namespace proxy { 9 | 10 | //@abi action 11 | struct PACKED( set_owner ) { 12 | account_name owner; 13 | }; 14 | 15 | //@abi table 16 | struct PACKED( config ) { 17 | config( account_name o = account_name() ):owner(o){} 18 | const uint64_t key = N(config); 19 | account_name owner; 20 | }; 21 | 22 | using configs = eosio::table; 23 | 24 | } /// namespace proxy 25 | -------------------------------------------------------------------------------- /eos/contracts/simpledb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(simpledb "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) 4 | -------------------------------------------------------------------------------- /eos/contracts/simpledb/simpledb.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | 8 | /* @abi action insert1 9 | * @abi table 10 | */ 11 | struct record1 { 12 | uint64_t key; 13 | 14 | uint256 u256; 15 | uint128_t u128; 16 | uint64_t u64; 17 | uint32_t u32; 18 | uint16_t u16; 19 | uint8_t u8; 20 | 21 | int64_t i64; 22 | int32_t i32; 23 | int16_t i16; 24 | int8_t i8; 25 | 26 | price price; 27 | }; 28 | 29 | /* @abi action insert2 30 | * @abi table 31 | */ 32 | struct record2 { 33 | uint128_t key1; 34 | uint128_t key2; 35 | }; 36 | 37 | /* @abi action insert3 38 | * @abi table 39 | */ 40 | struct record3 { 41 | uint64_t key1; 42 | uint64_t key2; 43 | uint64_t key3; 44 | }; 45 | 46 | /* @abi action insertkv1 47 | * @abi table 48 | */ 49 | struct key_value1 { 50 | eosio::string key; 51 | eosio::string value; 52 | }; 53 | 54 | struct complex_type { 55 | eosio::string name; 56 | uint64_t age; 57 | }; 58 | 59 | 60 | /* @abi action insertkv2 61 | * @abi table 62 | */ 63 | struct key_value2 { 64 | eosio::string key; 65 | complex_type value; 66 | }; 67 | -------------------------------------------------------------------------------- /eos/contracts/skeleton/skeleton.abi: -------------------------------------------------------------------------------- 1 | { 2 | "types": [{ 3 | "new_type_name": "account_name", 4 | "type": "name" 5 | } 6 | ], 7 | "structs": [{ 8 | "name": "transfer", 9 | "base": "", 10 | "fields": { 11 | "from": "account_name", 12 | "to": "account_name", 13 | "amount": "uint64" 14 | } 15 | },{ 16 | "name": "account", 17 | "base": "", 18 | "fields": { 19 | "account": "name", 20 | "balance": "uint64" 21 | } 22 | } 23 | ], 24 | "actions": [{ 25 | "action_name": "transfer", 26 | "type": "transfer" 27 | } 28 | ], 29 | "tables": [{ 30 | "table_name": "account", 31 | "type": "account", 32 | "index_type": "i64", 33 | "key_names" : ["account"], 34 | "key_types" : ["name"] 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /eos/contracts/skeleton/skeleton.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | 7 | /** 8 | * The init() and apply() methods must have C calling convention so that the blockchain can lookup and 9 | * call these methods. 10 | */ 11 | extern "C" { 12 | 13 | /** 14 | * This method is called once when the contract is published or updated. 15 | */ 16 | void init() { 17 | eosio::print( "Init World!\n" ); 18 | } 19 | 20 | /// The apply method implements the dispatch of events to this contract 21 | void apply( uint64_t code, uint64_t action ) { 22 | eosio::print( "Hello World: ", eosio::name(code), "->", eosio::name(action), "\n" ); 23 | } 24 | 25 | } // extern "C" 26 | -------------------------------------------------------------------------------- /eos/contracts/skeleton/skeleton.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | 8 | 9 | -------------------------------------------------------------------------------- /eos/contracts/social/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_wast_target(social "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) -------------------------------------------------------------------------------- /eos/contracts/storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB ABI_FILES "*.abi") 2 | add_wast_target(storage "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 3 | configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) 4 | -------------------------------------------------------------------------------- /eos/contracts/test_api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_wast_target(test_api "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 2 | -------------------------------------------------------------------------------- /eos/contracts/test_api/test_chain.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | 8 | #include "test_api.hpp" 9 | 10 | #pragma pack(push, 1) 11 | struct producers { 12 | char len; 13 | account_name producers[21]; 14 | }; 15 | #pragma pack(pop) 16 | 17 | unsigned int test_chain::test_activeprods() { 18 | producers msg_prods; 19 | read_message(&msg_prods, sizeof(producers)); 20 | 21 | WASM_ASSERT(msg_prods.len == 21, "producers.len != 21"); 22 | 23 | producers api_prods; 24 | get_active_producers(api_prods.producers, sizeof(account_name)*21); 25 | 26 | for( int i = 0; i < 21 ; ++i ) { 27 | WASM_ASSERT(api_prods.producers[i] == msg_prods.producers[i], "Active producer"); 28 | } 29 | 30 | return WASM_TEST_PASS; 31 | } 32 | -------------------------------------------------------------------------------- /eos/contracts/test_api/test_print.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | 7 | #include "test_api.hpp" 8 | 9 | unsigned int test_print::test_prints() { 10 | prints("ab"); 11 | prints(nullptr); 12 | prints("c\0test_prints"); 13 | prints(0); 14 | prints("efg"); 15 | prints(0); 16 | return WASM_TEST_PASS; 17 | } 18 | 19 | unsigned int test_print::test_printi() { 20 | printi(0); 21 | printi(556644); 22 | printi(-1); 23 | return WASM_TEST_PASS; 24 | } 25 | 26 | unsigned int test_print::test_printi128() { 27 | uint128_t a(-1); 28 | uint128_t b(0); 29 | uint128_t c(87654323456); 30 | printi128(&a); 31 | printi128(&b); 32 | printi128(&c); 33 | return WASM_TEST_PASS; 34 | } 35 | 36 | unsigned int test_print::test_printn() { 37 | printn(N(abcde)); 38 | printn(N(abBde)); 39 | printn(N(1q1q1qAA)); 40 | printn(N()); 41 | printn(N(AAAAAA)); 42 | printn(N(abcdefghijk)); 43 | printn(N(abcdefghijkl)); 44 | printn(N(abcdefghijkl1)); 45 | printn(N(abcdefghijkl12)); 46 | printn(N(abcdefghijkl123)); 47 | return WASM_TEST_PASS; 48 | } 49 | -------------------------------------------------------------------------------- /eos/libraries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory( fc ) 2 | add_subdirectory( chainbase ) 3 | add_subdirectory( wasm-jit ) 4 | 5 | add_subdirectory( types ) 6 | add_subdirectory( chain ) 7 | add_subdirectory( egenesis ) 8 | add_subdirectory( utilities ) 9 | add_subdirectory( appbase ) 10 | add_subdirectory( native_contract ) 11 | add_subdirectory( abi_generator ) -------------------------------------------------------------------------------- /eos/libraries/appbase/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Daniel Larimer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /eos/libraries/appbase/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( appbase_example main.cpp ) 2 | target_link_libraries( appbase_example appbase ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 3 | -------------------------------------------------------------------------------- /eos/libraries/chain/chain_administration_interface.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | 7 | eosio::chain::chain_administration_interface::~chain_administration_interface() {} 8 | -------------------------------------------------------------------------------- /eos/libraries/chain/get_config.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | namespace eosio { namespace chain { 11 | 12 | fc::variant_object get_config() 13 | { 14 | fc::mutable_variant_object result; 15 | 16 | result["key_prefix"] = config::key_prefix; 17 | result["default_block_interval_seconds"] = config::default_block_interval_seconds; 18 | result["MaxBlockSize"] = config::default_max_block_size; 19 | result["MaxSecondsUntilExpiration"] = config::default_max_trx_lifetime; 20 | result["ProducerCount"] = config::blocks_per_round; 21 | result["irreversible_threshold_percent"] = config::irreversible_threshold_percent; 22 | return result; 23 | } 24 | 25 | } } // eosio::chain 26 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/README.md: -------------------------------------------------------------------------------- 1 | Protocol Definition 2 | -------------------- 3 | 4 | The classes declared in these headers provide the complete definition of the 5 | Eos 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 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/get_config.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace eosio { namespace chain { 10 | 11 | fc::variant_object get_config(); 12 | 13 | } } // eosio::chain 14 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/immutable_chain_parameters.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include 12 | 13 | namespace eosio { namespace chain { 14 | 15 | } } // eosio::chain 16 | 17 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/internal_exceptions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #define EOS_DECLARE_INTERNAL_EXCEPTION( exc_name, seqnum, msg ) \ 11 | FC_DECLARE_DERIVED_EXCEPTION( \ 12 | internal_ ## exc_name, \ 13 | eosio::chain::internal_exception, \ 14 | 3990000 + seqnum, \ 15 | msg \ 16 | ) 17 | 18 | namespace eosio { namespace chain { 19 | 20 | FC_DECLARE_DERIVED_EXCEPTION( internal_exception, eosio::chain::chain_exception, 3990000, "internal exception" ) 21 | 22 | EOS_DECLARE_INTERNAL_EXCEPTION( verify_auth_max_auth_exceeded, 1, "Exceeds max authority fan-out" ) 23 | EOS_DECLARE_INTERNAL_EXCEPTION( verify_auth_account_not_found, 2, "Auth account not found" ) 24 | 25 | } } // eosio::chain 26 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/multi_index_includes.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace bmi = boost::multi_index; 15 | using bmi::indexed_by; 16 | using bmi::ordered_unique; 17 | using bmi::ordered_non_unique; 18 | using bmi::composite_key; 19 | using bmi::member; 20 | using bmi::const_mem_fun; 21 | using bmi::tag; 22 | using bmi::composite_key_compare; 23 | 24 | struct by_id; 25 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/protocol.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /eos/libraries/chain/include/eos/chain/wast_to_wasm.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | #include 8 | 9 | namespace eosio { namespace chain { 10 | 11 | std::vector wast_to_wasm( const std::string& wast ); 12 | std::string wasm_to_wast( const std::vector& wasm ); 13 | std::string wasm_to_wast( const uint8_t* data, uint64_t size ); 14 | 15 | } } /// eosio::chain 16 | -------------------------------------------------------------------------------- /eos/libraries/chain/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Boost 1.64 REQUIRED COMPONENTS unit_test_framework) 2 | 3 | set(CMAKE_CXX_STANDARD 14) 4 | 5 | add_executable(chain_unit_test 6 | test.cpp 7 | block_test.cpp 8 | message_test.cpp 9 | ) 10 | target_include_directories(chain_unit_test PRIVATE ${Boost_INCLUDE_DIRS}) 11 | target_compile_definitions(chain_unit_test PRIVATE "BOOST_TEST_DYN_LINK=1") 12 | target_link_libraries(chain_unit_test ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} eos_chain) 13 | 14 | add_test(chain_unit_test chain_unit_test) 15 | -------------------------------------------------------------------------------- /eos/libraries/chain/test/block_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "eos/chain/block.hpp" 4 | 5 | BOOST_AUTO_TEST_SUITE(block_test) 6 | 7 | BOOST_AUTO_TEST_CASE(block_header_default_digest) 8 | { 9 | eosio::chain::block_header header; 10 | std::string result = header.digest().str(); 11 | BOOST_CHECK_EQUAL("075561eff2cd3ad586776fa904f0040282c5f6a261f6a8fd6a0a524d14cd2d2c", result); 12 | } 13 | 14 | BOOST_AUTO_TEST_SUITE_END() 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /eos/libraries/chain/test/message_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "eos/chain/message.hpp" 4 | 5 | BOOST_AUTO_TEST_SUITE(message_test) 6 | 7 | BOOST_AUTO_TEST_CASE(default_message) 8 | { 9 | eosio::chain::message message; 10 | std::string result = message.as(); 11 | BOOST_CHECK_EQUAL("", result); 12 | } 13 | 14 | BOOST_AUTO_TEST_SUITE_END() 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /eos/libraries/chain/test/test.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MODULE chain 2 | #include 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /eos/libraries/chainbase/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Steemit, Inc 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /eos/libraries/chainbase/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB UNIT_TESTS "*.cpp") 2 | add_executable( chainbase_test ${UNIT_TESTS} ) 3 | target_link_libraries( chainbase_test chainbase ${PLATFORM_SPECIFIC_LIBS} ) 4 | 5 | -------------------------------------------------------------------------------- /eos/libraries/egenesis/egenesis_none.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #include 7 | 8 | namespace eosio { namespace egenesis { 9 | 10 | using namespace eosio::chain; 11 | 12 | chain_id_type get_egenesis_chain_id() 13 | { 14 | return chain_id_type(); 15 | } 16 | 17 | void compute_egenesis_json( std::string& result ) 18 | { 19 | result = ""; 20 | } 21 | 22 | fc::sha256 get_egenesis_json_hash() 23 | { 24 | return fc::sha256::hash( "" ); 25 | } 26 | 27 | } } 28 | -------------------------------------------------------------------------------- /eos/libraries/egenesis/include/eos/egenesis/egenesis.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace eosio { namespace egenesis { 15 | 16 | /** 17 | * Get the chain ID of the built-in egenesis, or chain_id_type() 18 | * if none was compiled in. 19 | */ 20 | eosio::chain::chain_id_type get_egenesis_chain_id(); 21 | 22 | /** 23 | * Get the egenesis JSON, or the empty string if none was compiled in. 24 | */ 25 | void compute_egenesis_json( std::string& result ); 26 | 27 | /** 28 | * The file returned by compute_egenesis_json() should have this hash. 29 | */ 30 | fc::sha256 get_egenesis_json_hash(); 31 | 32 | } } // eosio::egenesis 33 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/crypto/base32.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector from_base32( const fc::string& b32 ); 8 | fc::string to_base32( const std::vector& vec ); 9 | fc::string to_base32( const char* data, size_t len ); 10 | } 11 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/crypto/equihash.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc { namespace equihash { 6 | 7 | struct proof 8 | { 9 | uint32_t n; 10 | uint32_t k; 11 | sha256 seed; 12 | std::vector< uint32_t > inputs; 13 | 14 | bool is_valid() const; 15 | 16 | static proof hash( uint32_t n, uint32_t k, sha256 seed ); 17 | }; 18 | 19 | } } // fc 20 | 21 | FC_REFLECT( fc::equihash::proof, (n)(k)(seed)(inputs) ) 22 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/io/fstream.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace fc { 5 | /** 6 | * Grab the full contents of a file into a string object. 7 | * NB reading a full file into memory is a poor choice 8 | * if the file may be very large. 9 | */ 10 | void read_file_contents( const fc::path& filename, std::string& result ); 11 | } 12 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/io/sstream.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | #include 4 | #include 5 | 6 | namespace fc { 7 | 8 | class stringstream : virtual public iostream { 9 | public: 10 | stringstream(); 11 | stringstream( fc::string& s); 12 | stringstream( const fc::string& s); 13 | ~stringstream(); 14 | 15 | fc::string str(); 16 | void str(const fc::string& s); 17 | 18 | void clear(); 19 | 20 | virtual bool eof()const; 21 | virtual size_t writesome( const char* buf, size_t len ); 22 | virtual size_t writesome( const std::shared_ptr& buf, size_t len, size_t offset ); 23 | virtual size_t readsome( char* buf, size_t len ); 24 | virtual size_t readsome( const std::shared_ptr& buf, size_t len, size_t offset ); 25 | virtual void close(); 26 | virtual void flush(); 27 | char peek(); 28 | 29 | private: 30 | class impl; 31 | fwd my; 32 | }; 33 | 34 | } 35 | */ 36 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/network/resolve.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace fc 6 | { 7 | std::vector resolve(boost::asio::io_service& io_service, 8 | const std::string& host, uint16_t port); 9 | } 10 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/network/udp_socket.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace fc { 9 | namespace ip { 10 | class endpoint; 11 | class address; 12 | } 13 | 14 | /** 15 | * The udp_socket class has reference semantics, all copies will 16 | * refer to the same underlying socket. 17 | */ 18 | class udp_socket { 19 | public: 20 | udp_socket(); 21 | udp_socket( const udp_socket& s ); 22 | ~udp_socket(); 23 | 24 | void initialize(boost::asio::io_service &); 25 | void open(); 26 | void send_to(const char* b, size_t l, boost::asio::ip::udp::endpoint &to); 27 | void send_to(const std::shared_ptr& b, size_t l, boost::asio::ip::udp::endpoint &to); 28 | void close(); 29 | 30 | void set_reuse_address(bool); 31 | 32 | void connect(const boost::asio::ip::udp::endpoint& e); 33 | const boost::asio::ip::udp::endpoint local_endpoint() const; 34 | 35 | private: 36 | class impl; 37 | fc::shared_ptr my; 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | void cancel() { canceled = true; } 13 | 14 | ~scoped_exit() { 15 | if (!canceled) 16 | try { callback(); } catch( ... ) {} 17 | } 18 | 19 | scoped_exit& operator = ( scoped_exit&& mv ) { 20 | callback = std::move(mv.callback); 21 | return *this; 22 | } 23 | private: 24 | scoped_exit( const scoped_exit& ); 25 | scoped_exit& operator=( const scoped_exit& ); 26 | 27 | Callback callback; 28 | bool canceled = false; 29 | }; 30 | 31 | template 32 | scoped_exit make_scoped_exit( Callback&& c ) { 33 | return scoped_exit( std::forward(c) ); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/include/fc/vector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/src/crypto/base32.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | namespace fc 5 | { 6 | std::vector from_base32( const std::string& b32 ) 7 | { 8 | auto len = cyoBase32DecodeGetLength( b32.size() ); 9 | std::vector v(len); 10 | len = cyoBase32Decode( v.data(), b32.c_str(), b32.size() ); 11 | v.resize( len ); 12 | return v; 13 | } 14 | 15 | std::string to_base32( const char* data, size_t len ) 16 | { 17 | auto s = cyoBase32EncodeGetLength(len); 18 | std::vector b32; 19 | b32.resize(s); 20 | cyoBase32Encode( b32.data(), data, len ); 21 | b32.resize( b32.size()-1); // strip the nullterm 22 | return std::string(b32.begin(),b32.end()); 23 | } 24 | 25 | std::string to_base32( const std::vector& vec ) 26 | { 27 | return to_base32( vec.data(), vec.size() ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /eos/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 | (void)init; 13 | 14 | int result = RAND_bytes((unsigned char*)buf, count); 15 | if (result != 1) 16 | FC_THROW("Error calling OpenSSL's RAND_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 17 | } 18 | 19 | void rand_pseudo_bytes(char* buf, int count) 20 | { 21 | static int init = init_openssl(); 22 | (void)init; 23 | 24 | // RAND_pseudo_bytes is deprecated in favor of RAND_bytes as of OpenSSL 1.1.0 25 | #if OPENSSL_VERSION_NUMBER < 0x10100000L 26 | int result = RAND_pseudo_bytes((unsigned char*)buf, count); 27 | if (result == -1) 28 | FC_THROW("Error calling OpenSSL's RAND_pseudo_bytes(): ${code}", ("code", (uint32_t)ERR_get_error())); 29 | #else 30 | rand_bytes(buf, count); 31 | #endif 32 | } 33 | 34 | } // namespace fc 35 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/src/io/fstream.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace fc { 13 | 14 | void read_file_contents( const fc::path& filename, std::string& result ) 15 | { 16 | const boost::filesystem::path& bfp = filename; 17 | boost::filesystem::ifstream f( bfp, std::ios::in | std::ios::binary ); 18 | // don't use fc::stringstream here as we need something with override for << rdbuf() 19 | std::stringstream ss; 20 | ss << f.rdbuf(); 21 | result = ss.str(); 22 | } 23 | 24 | } // namespace fc 25 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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() -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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() -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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() -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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') -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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() -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 ) -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/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 | -------------------------------------------------------------------------------- /eos/libraries/fc/vendor/websocketpp/websocketpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | init_target("websocketpp") 2 | final_target () 3 | -------------------------------------------------------------------------------- /eos/libraries/native_contract/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/native_contract/*.hpp") 2 | 3 | ## SORT .cpp by most likely to change / break compile 4 | add_library( eos_native_contract 5 | eos_contract.cpp 6 | native_contract_chain_initializer.cpp 7 | native_contract_chain_administrator.cpp 8 | genesis_state.cpp 9 | 10 | ${HEADERS} 11 | ) 12 | 13 | target_link_libraries( eos_native_contract eos_chain fc ) 14 | target_include_directories( eos_native_contract 15 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" ) 16 | 17 | INSTALL( TARGETS 18 | eos_native_contract 19 | 20 | RUNTIME DESTINATION bin 21 | LIBRARY DESTINATION lib 22 | ARCHIVE DESTINATION lib 23 | ) 24 | INSTALL( FILES ${HEADERS} DESTINATION "include/eos/native_contract" ) 25 | -------------------------------------------------------------------------------- /eos/libraries/native_contract/genesis_state.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #include 7 | 8 | // these are required to serialize a genesis_state 9 | #include // required for gcc in release mode 10 | 11 | namespace eosio { namespace native_contract { 12 | 13 | chain::chain_id_type genesis_state_type::compute_chain_id() const { 14 | return initial_chain_id; 15 | } 16 | 17 | } } // eosio::native_contract 18 | -------------------------------------------------------------------------------- /eos/libraries/native_contract/include/eos/native_contract/eos_contract.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace native { 12 | namespace eosio { ///< eos native currency contract 13 | namespace chain = ::eosio::chain; 14 | namespace types = ::eosio::types; 15 | 16 | void apply_eos_newaccount(chain::apply_context& context); 17 | void apply_eos_transfer(chain::apply_context& context); 18 | void apply_eos_lock(chain::apply_context& context); 19 | void apply_eos_claim(chain::apply_context&); 20 | void apply_eos_unlock(chain::apply_context&); 21 | void apply_eos_okproducer(chain::apply_context&); 22 | void apply_eos_setproducer(chain::apply_context&); 23 | void apply_eos_setproxy(chain::apply_context&); 24 | void apply_eos_setcode(chain::apply_context&); 25 | void apply_eos_updateauth(chain::apply_context&); 26 | void apply_eos_deleteauth(chain::apply_context&); 27 | void apply_eos_linkauth(chain::apply_context&); 28 | void apply_eos_unlinkauth(chain::apply_context&); 29 | 30 | } // namespace eosio 31 | } // namespace native 32 | -------------------------------------------------------------------------------- /eos/libraries/native_contract/include/eos/native_contract/native_contract_chain_administrator.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace eosio { namespace native_contract { 10 | using chain::producer_round; 11 | 12 | class native_contract_chain_administrator : public chain::chain_administration_interface { 13 | producer_round get_next_round(chainbase::database& db); 14 | chain::blockchain_configuration get_blockchain_configuration(const chainbase::database& db, 15 | const producer_round& round); 16 | }; 17 | 18 | inline std::unique_ptr make_administrator() { 19 | return std::unique_ptr(new native_contract_chain_administrator()); 20 | } 21 | 22 | } } // namespace eosio::native_contract 23 | -------------------------------------------------------------------------------- /eos/libraries/native_contract/include/eos/native_contract/objects.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | /// @file This file #include's all database objects/indices used by the C++ native contract implementation 8 | 9 | #include 10 | #include 11 | #include 12 | -------------------------------------------------------------------------------- /eos/libraries/types/include/eos/types/exceptions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace eosio { namespace types { 11 | 12 | FC_DECLARE_EXCEPTION(type_exception, 4000000, "type exception") 13 | FC_DECLARE_DERIVED_EXCEPTION(unknown_type_exception, type_exception, 14 | 4010000, "Could not find requested type") 15 | FC_DECLARE_DERIVED_EXCEPTION(duplicate_type_exception, type_exception, 16 | 4020000, "Requested type already exists") 17 | FC_DECLARE_DERIVED_EXCEPTION(invalid_type_name_exception, type_exception, 18 | 4030000, "Requested type name is invalid") 19 | FC_DECLARE_DERIVED_EXCEPTION(invalid_field_name_exception, type_exception, 20 | 4040000, "Requested field name is invalid") 21 | FC_DECLARE_DERIVED_EXCEPTION(invalid_schema_exception, type_exception, 22 | 4050000, "Schema is invalid") 23 | 24 | } } // eosio::types 25 | -------------------------------------------------------------------------------- /eos/libraries/types/include/eos/types/types.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | /// @file Exists to make including the eos types less toxic. Build error hilarity ensues if you don't include enough of 8 | /// these in the right order. 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | -------------------------------------------------------------------------------- /eos/libraries/utilities/git_revision.cpp.in: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define EOS_GIT_REVISION_SHA "@EOS_GIT_REVISION_SHA@" 5 | #define EOS_GIT_REVISION_UNIX_TIMESTAMP @EOS_GIT_REVISION_UNIX_TIMESTAMP@ 6 | #define EOS_GIT_REVISION_DESCRIPTION "@EOS_GIT_REVISION_DESCRIPTION@" 7 | 8 | namespace eosio { namespace utilities { 9 | 10 | const char* const git_revision_sha = EOS_GIT_REVISION_SHA; 11 | const uint32_t git_revision_unix_timestamp = EOS_GIT_REVISION_UNIX_TIMESTAMP; 12 | const char* const git_revision_description = EOS_GIT_REVISION_DESCRIPTION; 13 | 14 | } } // end namespace eosio::utilities 15 | -------------------------------------------------------------------------------- /eos/libraries/utilities/include/eos/utilities/git_revision.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | 8 | namespace eosio { namespace utilities { 9 | 10 | extern const char* const git_revision_sha; 11 | extern const uint32_t git_revision_unix_timestamp; 12 | extern const char* const git_revision_description; 13 | 14 | } } // end namespace eosio::utilities 15 | -------------------------------------------------------------------------------- /eos/libraries/utilities/include/eos/utilities/key_conversion.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace eosio { namespace utilities { 12 | 13 | std::string key_to_wif(const fc::sha256& private_secret ); 14 | std::string key_to_wif(const fc::ecc::private_key& key); 15 | fc::optional wif_to_key( const std::string& wif_key ); 16 | 17 | } } // end namespace eosio::utilities 18 | -------------------------------------------------------------------------------- /eos/libraries/utilities/include/eos/utilities/rand.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #ifndef RAND_HPP 6 | #define RAND_HPP 1 7 | 8 | #include 9 | 10 | namespace eosio { namespace utilities { namespace rand { 11 | 12 | /// High performance random generator 13 | /// http://xorshift.di.unimi.it/ 14 | 15 | class random { 16 | private: 17 | 18 | uint64_t seed; 19 | 20 | public: 21 | 22 | random(uint64_t seed) { 23 | this->seed = seed; 24 | } 25 | 26 | uint64_t next() { 27 | uint64_t z = (seed += UINT64_C(0x9E3779B97F4A7C15)); 28 | z = (z ^ (z >> 30)) * UINT64_C(0xBF58476D1CE4E5B9); 29 | z = (z ^ (z >> 27)) * UINT64_C(0x94D049BB133111EB); 30 | return z ^ (z >> 31); 31 | } 32 | 33 | template 34 | void shuffle(Range&& range) { 35 | int idx_count = range.size(); 36 | for (auto idx = range.rbegin(); idx != range.rend() - 1; ++idx , --idx_count) { 37 | std::swap(range.at(next() % idx_count), *idx); 38 | } 39 | } 40 | }; 41 | 42 | } } } //eosio::utilities::rand 43 | 44 | #endif // RAND_HPP 45 | -------------------------------------------------------------------------------- /eos/libraries/utilities/include/eos/utilities/string_escape.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace eosio { namespace utilities { 10 | 11 | std::string escape_string_for_c_source_code(const std::string& input); 12 | 13 | } } // end namespace eosio::utilities 14 | -------------------------------------------------------------------------------- /eos/libraries/utilities/include/eos/utilities/tempdir.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace eosio { namespace utilities { 12 | 13 | fc::path temp_directory_path(); 14 | 15 | } } // eosio::utilities 16 | -------------------------------------------------------------------------------- /eos/libraries/utilities/include/eos/utilities/words.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | namespace eosio { namespace words { 8 | 9 | typedef const char* const_char_ptr; 10 | extern const const_char_ptr word_list[]; 11 | extern const uint32_t word_list_size; 12 | 13 | } } 14 | -------------------------------------------------------------------------------- /eos/libraries/utilities/tempdir.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #include 7 | 8 | #include 9 | 10 | namespace eosio { namespace utilities { 11 | 12 | fc::path temp_directory_path() 13 | { 14 | const char* eos_tempdir = getenv("EOS_TEMPDIR"); 15 | if( eos_tempdir != nullptr ) 16 | return fc::path( eos_tempdir ); 17 | return fc::temp_directory_path() / "eos-tmp"; 18 | } 19 | 20 | } } // eosio::utilities 21 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: c++ 4 | compiler: 5 | - clang 6 | - gcc 7 | 8 | install: 9 | - if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi 10 | - if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" != "osx" ]; then export CXX="clang++-3.8" CC="clang-3.8"; fi 11 | 12 | script: ./travis-build.sh 13 | 14 | os: 15 | - linux 16 | - osx 17 | 18 | matrix: 19 | exclude: 20 | - os: osx 21 | compiler: gcc 22 | 23 | addons: 24 | apt: 25 | sources: 26 | - llvm-toolchain-precise-3.8 27 | - ubuntu-toolchain-r-test 28 | packages: 29 | - gcc-5 30 | - g++-5 31 | - libedit-dev 32 | - clang-3.8 -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/Emscripten/Emscripten.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef EMSCRIPTEN_API 4 | #define EMSCRIPTEN_API DLL_IMPORT 5 | #endif 6 | 7 | #include 8 | 9 | namespace IR { struct Module; } 10 | namespace Runtime { struct ModuleInstance; } 11 | 12 | namespace Emscripten 13 | { 14 | EMSCRIPTEN_API void initInstance(const IR::Module& module,Runtime::ModuleInstance* moduleInstance); 15 | EMSCRIPTEN_API void injectCommandArgs(const std::vector& argStrings,std::vector& outInvokeArgs); 16 | } -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/IR/IR.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Platform/Platform.h" 4 | 5 | #ifndef IR_API 6 | #define IR_API DLL_IMPORT 7 | #endif 8 | 9 | namespace IR 10 | { 11 | enum { maxMemoryPages = (Uptr)65536 }; 12 | enum { numBytesPerPage = (Uptr)65536 }; 13 | enum { numBytesPerPageLog2 = (Uptr)16 }; 14 | 15 | enum { requireSharedFlagForAtomicOperators = false }; 16 | } 17 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/Inline/BasicTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | typedef uint8_t U8; 6 | typedef int8_t I8; 7 | typedef uint16_t U16; 8 | typedef int16_t I16; 9 | typedef uint32_t U32; 10 | typedef int32_t I32; 11 | typedef uint64_t U64; 12 | typedef int64_t I64; 13 | typedef float F32; 14 | typedef double F64; 15 | 16 | // The OSX libc defines uintptr_t to be a long where U32/U64 are int. This causes uintptr_t/uint64 to be treated as distinct types for e.g. overloading. 17 | // Work around it by defining our own Uptr/Iptr that are always int type. 18 | template 19 | struct PointerIntHelper; 20 | template<> struct PointerIntHelper<4> { typedef I32 IntType; typedef U32 UnsignedIntType; }; 21 | template<> struct PointerIntHelper<8> { typedef I64 IntType; typedef U64 UnsignedIntType; }; 22 | typedef PointerIntHelper::UnsignedIntType Uptr; 23 | typedef PointerIntHelper::IntType Iptr; 24 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/Inline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PublicHeaders 2 | BasicTypes.h 3 | DenseStaticIntSet.h 4 | Errors.h 5 | Floats.h 6 | Serialization.h 7 | Timing.h 8 | UTF8.h) 9 | add_custom_target(Inline SOURCES ${PublicHeaders}) -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/Inline/Errors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Errors 9 | { 10 | // Fatal error handling. 11 | [[noreturn]] inline void fatalf(const char* messageFormat,...) 12 | { 13 | va_list varArgs; 14 | va_start(varArgs,messageFormat); 15 | std::vfprintf(stderr,messageFormat,varArgs); 16 | std::fflush(stderr); 17 | va_end(varArgs); 18 | std::abort(); 19 | } 20 | [[noreturn]] inline void fatal(const char* message) { fatalf("%s\n",message); } 21 | [[noreturn]] inline void unreachable() { fatalf("reached unreachable code\n"); } 22 | [[noreturn]] inline void unimplemented(const char* context) { fatalf("unimplemented: %s\n",context); } 23 | } 24 | 25 | // Like assert, but is never removed in any build configuration. 26 | #define errorUnless(condition) if(!(condition)) { Errors::fatalf("errorUnless(%s) failed\n",#condition); } 27 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/Logging/Logging.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef LOGGING_API 4 | #define LOGGING_API DLL_IMPORT 5 | #endif 6 | 7 | #include "Inline/BasicTypes.h" 8 | #include "Platform/Platform.h" 9 | 10 | // Debug logging. 11 | namespace Log 12 | { 13 | // Allow filtering the logging by category. 14 | enum class Category 15 | { 16 | error, 17 | debug, 18 | metrics, 19 | num 20 | }; 21 | LOGGING_API void setCategoryEnabled(Category category,bool enable); 22 | LOGGING_API bool isCategoryEnabled(Category category); 23 | 24 | // Print some categorized, formatted string, and flush the output. Newline is not included. 25 | LOGGING_API void printf(Category category,const char* format,...); 26 | }; -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Include/WASM/WASM.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef WEBASSEMBLY_API 4 | #define WEBASSEMBLY_API DLL_IMPORT 5 | #endif 6 | 7 | #include "Inline/BasicTypes.h" 8 | 9 | namespace IR { struct Module; struct DisassemblyNames; } 10 | namespace Serialization { struct InputStream; struct OutputStream; } 11 | 12 | namespace WASM 13 | { 14 | WEBASSEMBLY_API void serialize(Serialization::InputStream& stream,IR::Module& module); 15 | WEBASSEMBLY_API void serializeWithInjection(Serialization::InputStream& stream,IR::Module& module); 16 | WEBASSEMBLY_API void serialize(Serialization::OutputStream& stream,const IR::Module& module); 17 | } 18 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/Emscripten/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources Emscripten.cpp) 2 | set(PublicHeaders ${WAVM_INCLUDE_DIR}/Emscripten/Emscripten.h) 3 | include_directories(${WAVM_INCLUDE_DIR}/Emscripten) 4 | 5 | add_library(Emscripten STATIC ${Sources} ${PublicHeaders}) 6 | 7 | add_definitions(-DEMSCRIPTEN_API=DLL_EXPORT) 8 | 9 | target_link_libraries(Emscripten Logging Platform Runtime) 10 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/IR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources 2 | DisassemblyNames.cpp 3 | Operators.cpp 4 | Types.cpp 5 | Validate.cpp) 6 | 7 | set(PublicHeaders 8 | ${WAVM_INCLUDE_DIR}/IR/IR.h 9 | ${WAVM_INCLUDE_DIR}/IR/Module.h 10 | ${WAVM_INCLUDE_DIR}/IR/OperatorPrinter.h 11 | ${WAVM_INCLUDE_DIR}/IR/Operators.h 12 | ${WAVM_INCLUDE_DIR}/IR/Types.h 13 | ${WAVM_INCLUDE_DIR}/IR/Validate.h) 14 | include_directories(${WAVM_INCLUDE_DIR}/IR) 15 | 16 | add_library(IR STATIC ${Sources} ${PublicHeaders}) 17 | add_definitions(-DIR_API=DLL_EXPORT) 18 | target_link_libraries(IR Logging) 19 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/IR/Operators.cpp: -------------------------------------------------------------------------------- 1 | #include "Operators.h" 2 | 3 | namespace IR 4 | { 5 | const char* getOpcodeName(Opcode opcode) 6 | { 7 | switch(opcode) 8 | { 9 | #define VISIT_OPCODE(encoding,name,nameString,Imm,...) case Opcode::name: return nameString; 10 | ENUM_OPERATORS(VISIT_OPCODE) 11 | #undef VISIT_OPCODE 12 | default: return "unknown"; 13 | }; 14 | } 15 | } -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/Logging/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources 2 | Logging.cpp) 3 | set(PublicHeaders 4 | ${WAVM_INCLUDE_DIR}/Logging/Logging.h) 5 | include_directories(${WAVM_INCLUDE_DIR}/Logging) 6 | 7 | add_definitions(-DLOGGING_API=DLL_EXPORT) 8 | 9 | add_library(Logging STATIC ${Sources} ${PublicHeaders}) 10 | target_link_libraries(Logging Platform) 11 | 12 | # Link with dl on Linux for dladdr. 13 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 14 | target_link_libraries(Logging dl pthread) 15 | endif() 16 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/Platform/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources 2 | POSIX.cpp 3 | Windows.cpp) 4 | set(PublicHeaders 5 | ${WAVM_INCLUDE_DIR}/Platform/Platform.h) 6 | include_directories(${WAVM_INCLUDE_DIR}/Platform) 7 | 8 | add_definitions(-DPLATFORM_API=DLL_EXPORT) 9 | 10 | add_library(Platform STATIC ${Sources} ${PublicHeaders}) 11 | 12 | # Link with dl on Linux for dladdr. 13 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 14 | target_link_libraries(Platform dl pthread rt) 15 | endif() 16 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/Programs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(Assemble Assemble.cpp CLI.h) 2 | target_link_libraries(Assemble Logging IR WAST WASM) 3 | set_target_properties(Assemble PROPERTIES FOLDER Programs) 4 | 5 | add_executable(Disassemble Disassemble.cpp CLI.h) 6 | target_link_libraries(Disassemble Logging IR WAST WASM) 7 | set_target_properties(Disassemble PROPERTIES FOLDER Programs) 8 | 9 | add_executable(Test Test.cpp CLI.h) 10 | target_link_libraries(Test Logging IR WAST Runtime) 11 | set_target_properties(Test PROPERTIES FOLDER Programs) 12 | 13 | add_executable(wavm wavm.cpp CLI.h) 14 | target_link_libraries(wavm Logging IR WAST WASM Runtime Emscripten) 15 | set_target_properties(wavm PROPERTIES FOLDER Programs) 16 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/Programs/Disassemble.cpp: -------------------------------------------------------------------------------- 1 | #include "Inline/BasicTypes.h" 2 | #include "CLI.h" 3 | #include "WAST/WAST.h" 4 | #include "WASM/WASM.h" 5 | 6 | int commandMain(int argc,char** argv) 7 | { 8 | if(argc != 3) 9 | { 10 | std::cerr << "Usage: Disassemble in.wasm out.wast" << std::endl; 11 | return EXIT_FAILURE; 12 | } 13 | const char* inputFilename = argv[1]; 14 | const char* outputFilename = argv[2]; 15 | 16 | // Load the WASM file. 17 | IR::Module module; 18 | if(!loadBinaryModule(inputFilename,module)) { return EXIT_FAILURE; } 19 | 20 | // Print the module to WAST. 21 | const std::string wastString = WAST::print(module); 22 | 23 | // Write the serialized data to the output file. 24 | std::ofstream outputStream(outputFilename); 25 | outputStream.write(wastString.data(),wastString.size()); 26 | outputStream.close(); 27 | 28 | return EXIT_SUCCESS; 29 | } 30 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/Runtime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources 2 | Intrinsics.cpp 3 | Linker.cpp 4 | LLVMEmitIR.cpp 5 | LLVMJIT.cpp 6 | LLVMJIT.h 7 | Memory.cpp 8 | ModuleInstance.cpp 9 | ObjectGC.cpp 10 | Runtime.cpp 11 | RuntimePrivate.h 12 | Table.cpp 13 | Threads.cpp 14 | WAVMIntrinsics.cpp 15 | ) 16 | set(PublicHeaders 17 | ${WAVM_INCLUDE_DIR}/Runtime/Intrinsics.h 18 | ${WAVM_INCLUDE_DIR}/Runtime/Linker.h 19 | ${WAVM_INCLUDE_DIR}/Runtime/Runtime.h 20 | ${WAVM_INCLUDE_DIR}/Runtime/TaggedValue.h) 21 | include_directories(${WAVM_INCLUDE_DIR}/Runtime) 22 | 23 | add_library(Runtime STATIC ${Sources} ${PublicHeaders}) 24 | 25 | # Find an installed build of LLVM 26 | find_package(LLVM 4.0 REQUIRED CONFIG) 27 | 28 | # Include the LLVM headers 29 | include_directories(${LLVM_INCLUDE_DIRS}) 30 | add_definitions(${LLVM_DEFINITIONS}) 31 | 32 | add_definitions(-DRUNTIME_API=DLL_EXPORT) 33 | 34 | # Link against the LLVM libraries 35 | llvm_map_components_to_libnames(LLVM_LIBS support core passes mcjit native DebugInfoDWARF) 36 | target_link_libraries(Runtime Platform Logging IR ${LLVM_LIBS}) 37 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/WASM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources WASMSerialization.cpp) 2 | set(PublicHeaders ${WAVM_INCLUDE_DIR}/WASM/WASM.h) 3 | include_directories(${WAVM_INCLUDE_DIR}/WASM) 4 | 5 | add_library(WASM STATIC ${Sources} ${PublicHeaders}) 6 | add_definitions(-DWEBASSEMBLY_API=DLL_EXPORT) 7 | target_link_libraries(WASM Logging IR) 8 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/WAST/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Sources 2 | NFA.cpp 3 | NFA.h 4 | Lexer.cpp 5 | Lexer.h 6 | Parse.cpp 7 | Parse.h 8 | ParseFunction.cpp 9 | ParseNumbers.cpp 10 | ParseModule.cpp 11 | ParseTests.cpp 12 | Print.cpp 13 | Regexp.cpp 14 | Regexp.h) 15 | set(PublicHeaders 16 | ${WAVM_INCLUDE_DIR}/WAST/WAST.h 17 | ${WAVM_INCLUDE_DIR}/WAST/TestScript.h) 18 | include_directories(${WAVM_INCLUDE_DIR}/WAST) 19 | 20 | add_library(WAST STATIC ${Sources} ${PublicHeaders}) 21 | add_definitions(-DWAST_API=DLL_EXPORT) 22 | target_link_libraries(WAST Logging IR WASM) 23 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Source/WAST/Regexp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Inline/BasicTypes.h" 4 | #include "NFA.h" 5 | 6 | namespace Regexp 7 | { 8 | // Parses a regular expression from a string, and adds a recognizer for it to the given NFA 9 | // The recognizer will start from initialState, and end in finalState when the regular expression has been completely matched. 10 | void addToNFA(const char* regexpString,NFA::Builder* nfaBuilder,NFA::StateIndex initialState,NFA::StateIndex finalState); 11 | }; 12 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/Benchmark/Benchmark.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct point 5 | { 6 | double x; 7 | double y; 8 | }; 9 | 10 | int main() 11 | { 12 | // Generate a lot of uniformly distributed 2d points in the range -1,-1 to +1,+1. 13 | enum { numXSamples = 10000 }; 14 | enum { numYSamples = 10000 }; 15 | std::vector points; 16 | points.reserve(numXSamples * numYSamples); 17 | for(int x = 0;x < numXSamples;++x) 18 | { 19 | for(int y = 0;y < numXSamples;++y) 20 | { 21 | point p = {-1.0 + 2.0 * x / (numXSamples-1),-1.0 + 2.0 * y / (numYSamples-1)}; 22 | points.push_back(p); 23 | } 24 | } 25 | 26 | // Count the ratio of points inside the unit circle. 27 | int numerator = 0; 28 | int denominator = 0; 29 | for(auto pointIt = points.begin();pointIt != points.end();++pointIt) 30 | { 31 | if(pointIt->x * pointIt->x + pointIt->y * pointIt->y < 1.0) 32 | { 33 | ++numerator; 34 | } 35 | ++denominator; 36 | } 37 | 38 | // Derive the area of the unit circle. 39 | auto circleArea = 4.0 * (double)numerator / denominator; 40 | std::cout << "result: " << circleArea << std::endl; 41 | 42 | return 0; 43 | } -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/fuzz/helloworld.wast: -------------------------------------------------------------------------------- 1 | ;; WebAssembly WASM AST Hello World! program 2 | 3 | (module 4 | (import "env" "_fwrite" (func $__fwrite (param i32 i32 i32 i32) (result i32))) 5 | (import "env" "_stdout" (global $stdoutPtr (mut i32))) 6 | (import "env" "memory" (memory 1)) 7 | (export "main" (func $main)) 8 | 9 | (data (i32.const 8) "Hello World!\n") 10 | 11 | (func (export "establishStackSpace") (param i32 i32) (nop)) 12 | 13 | (func $main (result i32) 14 | (local $stdout i32) 15 | (set_local $stdout (i32.load align=4 (get_global $stdoutPtr))) 16 | 17 | (return (call $__fwrite 18 | (i32.const 8) ;; void *ptr => Address of our string 19 | (i32.const 1) ;; size_t size => Data size 20 | (i32.const 13) ;; size_t nmemb => Length of our string 21 | (get_local $stdout)) ;; stream 22 | ) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/fuzz/resizing.wast: -------------------------------------------------------------------------------- 1 | (module 2 | (memory 0) 3 | 4 | (func $load_at_zero (result i32) (i32.load (i32.const 0))) 5 | (func $store_at_zero (i32.store (i32.const 0) (i32.const 2))) 6 | 7 | (func $load_at_page_size (result i32) (i32.load (i32.const 0x10000))) 8 | (func $store_at_page_size (i32.store (i32.const 0x10000) (i32.const 3))) 9 | 10 | (func $grow (param $sz i32) (result i32) (grow_memory (get_local $sz))) 11 | (func $size (result i32) (current_memory)) 12 | 13 | (func (export "main") 14 | (drop (call $size)) 15 | (drop (call $grow (i32.const 1))) 16 | (drop (call $size)) 17 | (drop (call $load_at_zero)) 18 | (call $store_at_zero) 19 | (drop (call $load_at_zero)) 20 | (drop (call $grow (i32.const 4))) 21 | (drop (call $size)) 22 | (drop (call $load_at_zero)) 23 | (call $store_at_zero) 24 | (drop (call $load_at_zero)) 25 | (drop (call $load_at_page_size)) 26 | (call $store_at_page_size) 27 | (drop (call $load_at_page_size)) 28 | ) 29 | ) 30 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/spec/align.wast: -------------------------------------------------------------------------------- 1 | (assert_malformed 2 | (module quote 3 | "(module (memory 0) (func (drop (i64.load align=0 (i32.const 0)))))" 4 | ) 5 | "alignment" 6 | ) 7 | (assert_malformed 8 | (module quote 9 | "(module (memory 0) (func (drop (i64.load align=7 (i32.const 0)))))" 10 | ) 11 | "alignment" 12 | ) 13 | (assert_invalid 14 | (module (memory 0) (func (drop (i64.load align=16 (i32.const 0))))) 15 | "alignment" 16 | ) 17 | 18 | (assert_malformed 19 | (module quote 20 | "(module (memory 0) (func (i64.store align=0 (i32.const 0) (i64.const 0))))" 21 | ) 22 | "alignment" 23 | ) 24 | (assert_malformed 25 | (module quote 26 | "(module (memory 0) (func (i64.store align=5 (i32.const 0) (i64.const 0))))" 27 | ) 28 | "alignment" 29 | ) 30 | (assert_invalid 31 | (module (memory 0) (func (i64.store align=16 (i32.const 0) (i64.const 0)))) 32 | "alignment" 33 | ) 34 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/spec/break-drop.wast: -------------------------------------------------------------------------------- 1 | (module 2 | (func (export "br") (block (br 0))) 3 | (func (export "br_if") (block (br_if 0 (i32.const 1)))) 4 | (func (export "br_table") (block (br_table 0 (i32.const 0)))) 5 | ) 6 | 7 | (assert_return (invoke "br")) 8 | (assert_return (invoke "br_if")) 9 | (assert_return (invoke "br_table")) 10 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/spec/comments.wast: -------------------------------------------------------------------------------- 1 | ;; Test comment syntax 2 | 3 | ;;comment 4 | 5 | ;;;;;;;;;;; 6 | 7 | ;;comment 8 | 9 | ( ;;comment 10 | module;;comment 11 | );;comment 12 | 13 | ;;) 14 | ;;;) 15 | ;; ;) 16 | ;; (; 17 | 18 | (;;) 19 | 20 | (;comment;) 21 | 22 | (;;comment;) 23 | 24 | (;;;comment;) 25 | 26 | (;;;;;;;;;;;;;;) 27 | 28 | (;(((((((((( ;) 29 | 30 | (;)))))))))));) 31 | 32 | (;comment";) 33 | 34 | (;comment"";) 35 | 36 | (;comment""";) 37 | 38 | ;; ASCII 00-1F, 7F 39 | (; 40 | ;) 41 | 42 | (;Heiße Würstchen;) 43 | 44 | (;;) 45 | 46 | (;comment 47 | comment;) 48 | 49 | (;comment;) 50 | 51 | (;comment;)((;comment;) 52 | (;comment;)module(;comment;) 53 | (;comment;))(;comment;) 54 | 55 | (;comment(;nested;)comment;) 56 | 57 | (;comment 58 | (;nested 59 | ;)comment 60 | ;) 61 | 62 | (module 63 | (;comment(;nested(;further;)nested;)comment;) 64 | ) 65 | 66 | (;comment;;comment;) 67 | 68 | (;comment;;comment 69 | ;) 70 | 71 | (module 72 | (;comment;;comment(;nested;)comment;) 73 | ) -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/spec/forward.wast: -------------------------------------------------------------------------------- 1 | (module 2 | (func $even (export "even") (param $n i32) (result i32) 3 | (if (result i32) (i32.eq (get_local $n) (i32.const 0)) 4 | (then (i32.const 1)) 5 | (else (call $odd (i32.sub (get_local $n) (i32.const 1)))) 6 | ) 7 | ) 8 | 9 | (func $odd (export "odd") (param $n i32) (result i32) 10 | (if (result i32) (i32.eq (get_local $n) (i32.const 0)) 11 | (then (i32.const 0)) 12 | (else (call $even (i32.sub (get_local $n) (i32.const 1)))) 13 | ) 14 | ) 15 | ) 16 | 17 | (assert_return (invoke "even" (i32.const 13)) (i32.const 0)) 18 | (assert_return (invoke "even" (i32.const 20)) (i32.const 1)) 19 | (assert_return (invoke "odd" (i32.const 13)) (i32.const 1)) 20 | (assert_return (invoke "odd" (i32.const 20)) (i32.const 0)) 21 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/spec/token.wast: -------------------------------------------------------------------------------- 1 | ;; Test tokenization 2 | 3 | (assert_malformed 4 | (module quote "(func (drop (i32.const0)))") 5 | "unknown operator" 6 | ) 7 | (assert_malformed 8 | (module quote "(func br 0drop)") 9 | "unknown operator" 10 | ) 11 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/Test/wast/helloworld.wast: -------------------------------------------------------------------------------- 1 | ;; WebAssembly WASM AST Hello World! program 2 | 3 | (module 4 | (import "env" "_fwrite" (func $__fwrite (param i32 i32 i32 i32) (result i32))) 5 | (import "env" "_stdout" (global $stdoutPtr i32)) 6 | (import "env" "memory" (memory 1)) 7 | (export "main" (func $main)) 8 | 9 | (data (i32.const 8) "Hello World!\n") 10 | 11 | (func (export "establishStackSpace") (param i32 i32) (nop)) 12 | 13 | (func $main (result i32) 14 | (local $stdout i32) 15 | (set_local $stdout (i32.load align=4 (get_global $stdoutPtr))) 16 | 17 | (return (call $__fwrite 18 | (i32.const 8) ;; void *ptr => Address of our string 19 | (i32.const 1) ;; size_t size => Data size 20 | (i32.const 13) ;; size_t nmemb => Length of our string 21 | (get_local $stdout)) ;; stream 22 | ) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/afl/readme: -------------------------------------------------------------------------------- 1 | Scripts for helping to run the AFL (http://lcamtuf.coredump.cx/afl/) fuzzer against wavm 2 | 3 | 1) Add the directory containing the AFL binaries to your path 4 | 2) Make a directory to contain the AFL build 5 | 3) From the new directory, run /afl/run-afl-fuzz (to run a n more slave instances if the machine can handle it) 6 | -------------------------------------------------------------------------------- /eos/libraries/wasm-jit/afl/simplify-crashes: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | for f in crashes/id* ; do 3 | afl-tmin -i $f -o $f.min -m 9999999999999999999 -e -- ./bin/wavm --text @@ 4 | done 5 | -------------------------------------------------------------------------------- /eos/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(net_plugin) 2 | add_subdirectory(net_api_plugin) 3 | #add_subdirectory(p2p_plugin) 4 | add_subdirectory(http_plugin) 5 | add_subdirectory(database_plugin) 6 | add_subdirectory(db_plugin) 7 | add_subdirectory(chain_plugin) 8 | add_subdirectory(chain_api_plugin) 9 | add_subdirectory(producer_plugin) 10 | add_subdirectory(account_history_plugin) 11 | add_subdirectory(account_history_api_plugin) 12 | add_subdirectory(wallet_plugin) 13 | add_subdirectory(wallet_api_plugin) 14 | add_subdirectory(txn_test_gen_plugin) 15 | add_subdirectory(faucet_testnet_plugin) -------------------------------------------------------------------------------- /eos/plugins/account_history_api_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/account_history_api_plugin/*.hpp") 2 | add_library( account_history_api_plugin 3 | account_history_api_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( account_history_api_plugin account_history_plugin chain_plugin http_plugin appbase ) 7 | target_include_directories( account_history_api_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | account_history_api_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/account_history_api_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/account_history_api_plugin/include/eos/account_history_api_plugin/account_history_api_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | 6 | #pragma once 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | namespace eosio { 14 | 15 | using namespace appbase; 16 | 17 | class account_history_api_plugin : public plugin { 18 | public: 19 | APPBASE_PLUGIN_REQUIRES((account_history_plugin)(chain_plugin)(http_plugin)) 20 | 21 | account_history_api_plugin(); 22 | virtual ~account_history_api_plugin(); 23 | 24 | virtual void set_program_options(options_description&, options_description&) override; 25 | 26 | void plugin_initialize(const variables_map&); 27 | void plugin_startup(); 28 | void plugin_shutdown(); 29 | 30 | private: 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /eos/plugins/account_history_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/account_history_plugin/*.hpp") 2 | add_library( account_history_plugin 3 | account_history_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( account_history_plugin chain_plugin eos_chain appbase ) 7 | target_include_directories( account_history_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | account_history_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/account_history_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/chain_api_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/chain_plugin/*.hpp") 2 | add_library( chain_api_plugin 3 | chain_api_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( chain_api_plugin chain_plugin http_plugin appbase ) 7 | target_include_directories( chain_api_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | chain_api_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/chain_api_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/chain_api_plugin/include/eos/chain_api_plugin/chain_api_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace eosio { 13 | using eosio::chain::chain_controller; 14 | using std::unique_ptr; 15 | using namespace appbase; 16 | 17 | class chain_api_plugin : public plugin { 18 | public: 19 | APPBASE_PLUGIN_REQUIRES((chain_plugin)(http_plugin)) 20 | 21 | chain_api_plugin(); 22 | virtual ~chain_api_plugin(); 23 | 24 | virtual void set_program_options(options_description&, options_description&) override; 25 | 26 | void plugin_initialize(const variables_map&); 27 | void plugin_startup(); 28 | void plugin_shutdown(); 29 | 30 | private: 31 | unique_ptr my; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /eos/plugins/chain_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/chain_plugin/*.hpp") 2 | add_library( chain_plugin 3 | chain_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( chain_plugin database_plugin db_plugin eos_native_contract eos_chain appbase ) 7 | target_include_directories( chain_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | chain_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/chain_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/database_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/database_plugin/*.hpp") 2 | add_library( database_plugin 3 | database_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( database_plugin appbase chainbase fc ) 7 | target_include_directories( database_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | database_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/database_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/faucet_testnet_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eosio/faucet_testnet_plugin/*.hpp") 2 | add_library( faucet_testnet_plugin 3 | faucet_testnet_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( faucet_testnet_plugin appbase fc http_plugin chain_plugin ) 7 | target_include_directories( faucet_testnet_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | faucet_testnet_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eosio/faucet_testnet_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/faucet_testnet_plugin/include/eosio/faucet_testnet_plugin/faucet_testnet_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | #include 8 | 9 | namespace eosio { 10 | 11 | using namespace appbase; 12 | 13 | class faucet_testnet_plugin : public appbase::plugin { 14 | public: 15 | faucet_testnet_plugin(); 16 | ~faucet_testnet_plugin(); 17 | 18 | APPBASE_PLUGIN_REQUIRES((http_plugin)) 19 | virtual void set_program_options(options_description&, options_description& cfg) override; 20 | 21 | void plugin_initialize(const variables_map& options); 22 | void plugin_startup(); 23 | void plugin_shutdown(); 24 | 25 | private: 26 | std::unique_ptr my; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /eos/plugins/http_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/http_plugin/*.hpp") 2 | add_library( http_plugin 3 | http_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( http_plugin appbase fc ) 7 | target_include_directories( http_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | http_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/http_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/make_new_plugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ]; then 4 | echo Usage: $0 my_new_plugin 5 | echo ... where my_new_plugin is the name of the plugin you want to create 6 | exit 1 7 | fi 8 | 9 | pluginName=$1 10 | 11 | echo Copying template... 12 | cp -r template_plugin $pluginName 13 | 14 | echo Renaming files/directories... 15 | mv $pluginName/include/eos/template_plugin $pluginName/include/eos/$pluginName 16 | for file in `find $pluginName -type f -name '*template_plugin*'`; do mv $file `sed s/template_plugin/$pluginName/g <<< $file`; done; 17 | 18 | echo Renaming in files... 19 | find $pluginName -type f -exec sed -i "s/template_plugin/$pluginName/g" {} \; 20 | 21 | echo "Done! $pluginName is ready. Don't forget to add it to CMakeLists.txt!" 22 | -------------------------------------------------------------------------------- /eos/plugins/net_api_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/net_api_plugin/*.hpp") 2 | add_library( net_api_plugin 3 | net_api_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( net_api_plugin net_plugin http_plugin appbase ) 7 | target_include_directories( net_api_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | net_api_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/net_api_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/net_api_plugin/include/eos/net_api_plugin/net_api_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace eosio { 13 | 14 | using namespace appbase; 15 | 16 | class net_api_plugin : public plugin { 17 | public: 18 | APPBASE_PLUGIN_REQUIRES((net_plugin) (http_plugin)) 19 | 20 | net_api_plugin() = default; 21 | net_api_plugin(const net_api_plugin&) = delete; 22 | net_api_plugin(net_api_plugin&&) = delete; 23 | net_api_plugin& operator=(const net_api_plugin&) = delete; 24 | net_api_plugin& operator=(net_api_plugin&&) = delete; 25 | virtual ~net_api_plugin() override = default; 26 | 27 | virtual void set_program_options(options_description& cli, options_description& cfg) override {} 28 | void plugin_initialize(const variables_map& vm); 29 | void plugin_startup(); 30 | void plugin_shutdown() {} 31 | 32 | private: 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /eos/plugins/net_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/net_plugin/*.hpp") 2 | add_library( net_plugin 3 | net_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( net_plugin chain_plugin producer_plugin appbase fc ) 7 | target_include_directories( net_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | net_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/net_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/producer_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/producer_plugin/*.hpp") 2 | 3 | add_library( producer_plugin 4 | producer_plugin.cpp 5 | ${HEADERS} 6 | ) 7 | 8 | target_link_libraries( producer_plugin net_plugin chain_plugin appbase eos_chain eos_utilities ) 9 | target_include_directories( producer_plugin 10 | PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 11 | 12 | install( TARGETS 13 | producer_plugin 14 | 15 | RUNTIME DESTINATION bin 16 | LIBRARY DESTINATION lib 17 | ARCHIVE DESTINATION lib 18 | ) 19 | -------------------------------------------------------------------------------- /eos/plugins/template_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/template_plugin/*.hpp") 2 | add_library( template_plugin 3 | template_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( template_plugin appbase fc ) 7 | target_include_directories( template_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | template_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/template_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/template_plugin/include/eos/template_plugin/template_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | 8 | namespace eosio { 9 | 10 | using namespace appbase; 11 | 12 | /** 13 | * This is a template plugin, intended to serve as a starting point for making new plugins 14 | */ 15 | class template_plugin : public appbase::plugin { 16 | public: 17 | template_plugin(); 18 | virtual ~template_plugin(); 19 | 20 | APPBASE_PLUGIN_REQUIRES() 21 | virtual void set_program_options(options_description&, options_description& cfg) override; 22 | 23 | void plugin_initialize(const variables_map& options); 24 | void plugin_startup(); 25 | void plugin_shutdown(); 26 | 27 | private: 28 | std::unique_ptr my; 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /eos/plugins/template_plugin/template_plugin.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | 7 | namespace eosio { 8 | 9 | class template_plugin_impl { 10 | public: 11 | }; 12 | 13 | template_plugin::template_plugin():my(new template_plugin_impl()){} 14 | template_plugin::~template_plugin(){} 15 | 16 | void template_plugin::set_program_options(options_description&, options_description& cfg) { 17 | cfg.add_options() 18 | ("option-name", bpo::value()->default_value("default value"), 19 | "Option Description") 20 | ; 21 | } 22 | 23 | void template_plugin::plugin_initialize(const variables_map& options) { 24 | if(options.count("option-name")) { 25 | // Handle the option 26 | } 27 | } 28 | 29 | void template_plugin::plugin_startup() { 30 | // Make the magic happen 31 | } 32 | 33 | void template_plugin::plugin_shutdown() { 34 | // OK, that's enough magic 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /eos/plugins/txn_test_gen_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eosio/txn_test_gen_plugin/*.hpp") 2 | add_library( txn_test_gen_plugin 3 | txn_test_gen_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( txn_test_gen_plugin appbase fc http_plugin chain_plugin ) 7 | target_include_directories( txn_test_gen_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | txn_test_gen_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eosio/txn_test_gen_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/txn_test_gen_plugin/include/eosio/txn_test_gen_plugin/txn_test_gen_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | #include 8 | 9 | namespace eosio { 10 | 11 | using namespace appbase; 12 | 13 | class txn_test_gen_plugin : public appbase::plugin { 14 | public: 15 | txn_test_gen_plugin(); 16 | ~txn_test_gen_plugin(); 17 | 18 | APPBASE_PLUGIN_REQUIRES((http_plugin)) 19 | virtual void set_program_options(options_description&, options_description& cfg) override; 20 | 21 | void plugin_initialize(const variables_map& options); 22 | void plugin_startup(); 23 | void plugin_shutdown(); 24 | 25 | private: 26 | std::unique_ptr my; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /eos/plugins/wallet_api_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/wallet_api_plugin/*.hpp") 2 | add_library( wallet_api_plugin 3 | wallet_api_plugin.cpp 4 | ${HEADERS} ) 5 | 6 | target_link_libraries( wallet_api_plugin wallet_plugin http_plugin appbase ) 7 | target_include_directories( wallet_api_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 8 | 9 | install( TARGETS 10 | wallet_api_plugin 11 | 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib 14 | ARCHIVE DESTINATION lib 15 | ) 16 | install( FILES ${HEADERS} DESTINATION "include/eos/wallet_api_plugin" ) 17 | -------------------------------------------------------------------------------- /eos/plugins/wallet_api_plugin/include/eos/wallet_api_plugin/wallet_api_plugin.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace eosio { 13 | 14 | using namespace appbase; 15 | 16 | class wallet_api_plugin : public plugin { 17 | public: 18 | APPBASE_PLUGIN_REQUIRES((wallet_plugin) (http_plugin)) 19 | 20 | wallet_api_plugin() = default; 21 | wallet_api_plugin(const wallet_api_plugin&) = delete; 22 | wallet_api_plugin(wallet_api_plugin&&) = delete; 23 | wallet_api_plugin& operator=(const wallet_api_plugin&) = delete; 24 | wallet_api_plugin& operator=(wallet_api_plugin&&) = delete; 25 | virtual ~wallet_api_plugin() override = default; 26 | 27 | virtual void set_program_options(options_description& cli, options_description& cfg) override {} 28 | void plugin_initialize(const variables_map& vm); 29 | void plugin_startup(); 30 | void plugin_shutdown() {} 31 | 32 | private: 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /eos/plugins/wallet_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB HEADERS "include/eos/wallet_plugin/*.hpp") 2 | add_library( wallet_plugin 3 | wallet.cpp 4 | wallet_plugin.cpp 5 | wallet_manager.cpp 6 | ${HEADERS} ) 7 | 8 | target_link_libraries( wallet_plugin eos_chain appbase ) 9 | target_include_directories( wallet_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) 10 | 11 | install( TARGETS 12 | wallet_plugin 13 | 14 | RUNTIME DESTINATION bin 15 | LIBRARY DESTINATION lib 16 | ARCHIVE DESTINATION lib 17 | ) 18 | install( FILES ${HEADERS} DESTINATION "include/eos/wallet_plugin" ) 19 | -------------------------------------------------------------------------------- /eos/programs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory( eosd ) 2 | add_subdirectory( eosc ) 3 | add_subdirectory( eos-walletd ) 4 | add_subdirectory( launcher ) 5 | add_subdirectory( codegen ) 6 | add_subdirectory( abi_gen ) 7 | -------------------------------------------------------------------------------- /eos/programs/abi_gen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCES main.cpp) 2 | find_package(LLVM 4.0 REQUIRED CONFIG) 3 | 4 | link_directories(${LLVM_LIBRARY_DIR}) 5 | 6 | add_executable(abi_gen ${SOURCES}) 7 | 8 | set( CMAKE_CXX_STANDARD 14 ) 9 | 10 | if( UNIX AND NOT APPLE ) 11 | set(rt_library rt ) 12 | endif() 13 | 14 | find_package( Gperftools QUIET ) 15 | if( GPERFTOOLS_FOUND ) 16 | message( STATUS "Found gperftools; compiling with TCMalloc") 17 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 18 | endif() 19 | 20 | target_link_libraries(abi_gen abi_generator) 21 | 22 | 23 | install( TARGETS 24 | abi_gen 25 | RUNTIME DESTINATION bin 26 | LIBRARY DESTINATION lib 27 | ARCHIVE DESTINATION lib 28 | ) 29 | -------------------------------------------------------------------------------- /eos/programs/codegen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( codegen 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 steemd with TCMalloc") 9 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 10 | endif() 11 | 12 | target_link_libraries( codegen 13 | PRIVATE fc eos_types ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 14 | 15 | install( TARGETS 16 | codegen 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | -------------------------------------------------------------------------------- /eos/programs/debug_node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( debug_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 debug_node with TCMalloc") 9 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 10 | endif() 11 | 12 | target_link_libraries( debug_node 13 | PRIVATE eos_app eos_producer eos_debug_producer eos_chain eos_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 14 | 15 | install( TARGETS 16 | debug_node 17 | 18 | RUNTIME DESTINATION bin 19 | LIBRARY DESTINATION lib 20 | ARCHIVE DESTINATION lib 21 | ) 22 | -------------------------------------------------------------------------------- /eos/programs/eos-walletd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable( eos-walletd 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 eos-walletd with TCMalloc") 9 | list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) 10 | endif() 11 | 12 | target_link_libraries( eos-walletd 13 | PRIVATE appbase 14 | PRIVATE wallet_api_plugin wallet_plugin 15 | PRIVATE http_plugin 16 | PRIVATE eos_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 17 | 18 | install( TARGETS 19 | eos-walletd 20 | 21 | RUNTIME DESTINATION bin 22 | LIBRARY DESTINATION lib 23 | ARCHIVE DESTINATION lib 24 | ) 25 | -------------------------------------------------------------------------------- /eos/programs/eosc/config.hpp.in: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright defined in eos/LICENSE.txt 3 | * 4 | * \warning This file is machine generated. DO NOT EDIT. See config.hpp.in for changes. 5 | */ 6 | 7 | namespace eosio { namespace client { namespace config { 8 | constexpr char version_str[] = "${eosc_BUILD_VERSION}"; 9 | constexpr char locale_path[] = "${LOCALEDIR}"; 10 | constexpr char locale_domain[] = "${LOCALEDOMAIN}"; 11 | }}} 12 | -------------------------------------------------------------------------------- /eos/programs/eosc/help_text.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | #include 7 | 8 | namespace eosio { namespace client { namespace help { 9 | bool print_help_text(const fc::exception& e); 10 | }}} -------------------------------------------------------------------------------- /eos/programs/eosc/localize.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace eosio { namespace client { namespace localize { 11 | #if !defined(_) 12 | #define _(str) str 13 | #endif 14 | 15 | #define localized(str, ...) localized_with_variant((str), fc::mutable_variant_object() __VA_ARGS__ ) 16 | 17 | inline auto localized_with_variant( const char* raw_fmt, const fc::variant_object& args) { 18 | if (raw_fmt != nullptr) { 19 | try { 20 | return fc::format_string(::gettext(raw_fmt), args); 21 | } catch (...) { 22 | } 23 | return std::string(raw_fmt); 24 | } 25 | return std::string(); 26 | } 27 | }}} 28 | -------------------------------------------------------------------------------- /eos/programs/eosd/config.hpp.in: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | * 5 | * \warning This file is machine generated. DO NOT EDIT. See config.hpp.in for changes. 6 | */ 7 | #pragma once 8 | 9 | #ifndef CONFIG_HPP_IN 10 | #define CONFIG_HPP_IN 11 | 12 | namespace eosio { namespace eosd { namespace config { 13 | constexpr uint64_t version = 0x${eosd_BUILD_VERSION}; 14 | 15 | template 16 | std::string itoh(I n, size_t hlen = sizeof(I)<<1) { 17 | static const char* digits = "0123456789abcdef"; 18 | std::string r(hlen, '0'); 19 | for(size_t i = 0, j = (hlen - 1) * 4 ; i < hlen; ++i, j -= 4) 20 | r[i] = digits[(n>>j) & 0x0f]; 21 | return r; 22 | } 23 | }}} 24 | 25 | #endif // CONFIG_HPP_IN 26 | -------------------------------------------------------------------------------- /eos/programs/launcher/config.hpp.in: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | * 5 | * \warning This file is machine generated. DO NOT EDIT. See config.hpp.in for changes. 6 | */ 7 | #pragma once 8 | 9 | #ifndef CONFIG_HPP_IN 10 | #define CONFIG_HPP_IN 11 | 12 | namespace eosio { namespace launcher { namespace config { 13 | constexpr char version_str[] = "${launcher_BUILD_VERSION}"; 14 | }}} 15 | 16 | #endif // CONFIG_HPP_IN 17 | -------------------------------------------------------------------------------- /eos/programs/snapshot/.gitignore: -------------------------------------------------------------------------------- 1 | npm-debug.log* 2 | node_modules/ -------------------------------------------------------------------------------- /eos/programs/snapshot/lib/css/genesis.css: -------------------------------------------------------------------------------- 1 | h1 {font-size:20pt; letter-spacing:1px; text-transform:uppercase; font-weight:normal; color:#555;} 2 | button { width:100%; background:#6ab86a; color:white; display:block; margin-top:22px; font-size:12pt; padding:11px 0; border:5px solid rgba(0,0,0,0.1); } 3 | button:hover { background:#448b44; cursor:pointer; } 4 | 5 | .wrapper {color:#F0F0F0; padding-bottom:44px;} 6 | 7 | body { transition: all 1s ease; } 8 | body#loading {background:#333;} 9 | body#loading > * {display:none; } 10 | body#loading .loader {display:block; position:absolute; top:50%; left:50%; transform: translateX(-50%) translateY(-50%) } 11 | body#ready .loader {display:none;} 12 | 13 | body#error > * {display:none;} 14 | body .error { display:none; } 15 | body#error .error {display:block; background:rgba(255,0,0,0.3); line-height:20pt; text-align:left;} -------------------------------------------------------------------------------- /eos/programs/snapshot/lib/vendor/HackTimerWorker.min.js: -------------------------------------------------------------------------------- 1 | var f={},p=postMessage,r='hasOwnProperty';onmessage=function(e){var d=e.data,i=d.i,t=d[r]('t')?d.t:0;switch(d.n){case'a':f[i]=setInterval(function(){p(i)},t);break;case'b':if(f[r](i)){clearInterval(f[i]);delete f[i]}break;case'c':f[i]=setTimeout(function(){p(i);if(f[r](i))delete f[i]},t);break;case'd':if(f[r](i)){clearTimeout(f[i]);delete f[i]}break}} -------------------------------------------------------------------------------- /eos/programs/snapshot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "babel-cli": "^6.26.0", 4 | "babel-polyfill": "^6.26.0", 5 | "babel-preset-env": "^1.6.0" 6 | }, 7 | "scripts": { 8 | "compile": "babel ./src/*.js ./lib/js/ui.js ./lib/vendor/*.js --ignore ./lib/vendor/web3.js --plugins babel-polyfill --compact false --out-file ./dist/bundle.js && babel ./lib/js/genesis.js ./src/class.genesis.js ./src/export.js --plugins babel-polyfill --out-file ./dist/bundle-genesis.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /eos/programs/snapshot/src/class.balance.js: -------------------------------------------------------------------------------- 1 | class Balance { 2 | 3 | constructor(){ 4 | this.wallet = web3.toBigNumber(0) 5 | this.unclaimed = web3.toBigNumber(0) 6 | this.reclaimed = web3.toBigNumber(0) 7 | this.total = web3.toBigNumber(0) 8 | } 9 | 10 | set( type, balance ){ 11 | this[ type ] = balance 12 | return this //chaining 13 | } 14 | 15 | readable( type = 'total' ){ 16 | this[ type ] = formatEOS( this[ type ] ) 17 | } 18 | 19 | exists( type ){ 20 | return (typeof this[ type ] !== "undefined" && this[type].gt( 0 )) 21 | } 22 | 23 | get( type ){ 24 | return (typeof this[ type ] !== "undefined" && this[type].gt( 0 )) ? this[type] : false; 25 | } 26 | 27 | sum(){ 28 | this.total = this.wallet.plus(this.unclaimed).plus(this.reclaimed) 29 | return this //chaining 30 | } 31 | 32 | from_wei(){ 33 | //Save some dust, higher accuracy. 34 | this.total = this.total.div(WAD) 35 | this.wallet = this.wallet.div(WAD) 36 | this.unclaimed = this.unclaimed.div(WAD) 37 | this.reclaimed = this.reclaimed.div(WAD) 38 | } 39 | } -------------------------------------------------------------------------------- /eos/programs/snapshot/src/class.genesis.js: -------------------------------------------------------------------------------- 1 | class Genesis { 2 | 3 | constructor( snapshot ){ 4 | this.json = { 5 | "initial_timestamp": "2017-03-30T12:00:00", 6 | "initial_parameters": { 7 | "maintenance_interval": 86400, 8 | "maintenance_skip_slots": 3, 9 | "maximum_transaction_size": 2048, 10 | "maximum_block_size": 2048000000, 11 | "maximum_time_until_expiration": 86400, 12 | "maximum_producer_count": 1001 13 | }, 14 | "immutable_parameters": { 15 | "min_producer_count": 21 16 | }, 17 | "initial_accounts": [] 18 | } 19 | 20 | if(snapshot) { 21 | this.json.initial_accounts = snapshot.map( registrant => { return { "name": registrant.eth, "owner_key": registrant.eos, "active_key": registrant.eos, "liquid_balance": `${registrant.balance} EOS`} } ) 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /eos/programs/snapshot/src/class.transaction.js: -------------------------------------------------------------------------------- 1 | class Transaction { 2 | 3 | constructor( eth, tx, type = "transfer", amount ) { 4 | this.eth = eth 5 | this.eos = null 6 | this.hash = tx 7 | this.amount = amount 8 | this.claimed = false 9 | this.type = type 10 | } 11 | 12 | claim( eth ) { 13 | return ( eth == this.eth ) 14 | ? ( 15 | this.claimed = true, 16 | log("success", `reclaimed ${this.eth} => ${this.eos} => ${this.amount.div(WAD).toFormat(4)} EOS <<< tx: https://etherscan.io/tx/${this.hash}`) 17 | ) : log("error", `${eth} should't be claiming ${this.eth}'s transaction`) 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /eos/scripts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory( testnet_np ) 2 | 3 | configure_file(start_npnode.sh start_npnode.sh COPYONLY) 4 | configure_file(tn_bounce.sh tn_bounce.sh COPYONLY) 5 | configure_file(tn_down.sh tn_down.sh COPYONLY) 6 | configure_file(tn_gen_config.sh tn_gen_config.sh COPYONLY) 7 | configure_file(tn_roll.sh tn_roll.sh COPYONLY) 8 | configure_file(tn_start_all.sh tn_start_all.sh COPYONLY) 9 | configure_file(tn_up.sh tn_up.sh COPYONLY) 10 | -------------------------------------------------------------------------------- /eos/scripts/start_npnode.sh: -------------------------------------------------------------------------------- 1 | cd testnet_np 2 | rm -rf blocks blockchain std* 3 | cd .. 4 | ../programs/eosd/eosd --data-dir testnet_np --replay-blockchain > testnet_np/stdout.txt 2> testnet_np/stderr.txt & 5 | echo Launched eosd. 6 | echo See testnet_np/stderr.txt for eosd output. 7 | echo Synching requires at least 8 minutes, depending on network conditions. 8 | -------------------------------------------------------------------------------- /eos/scripts/testnet_np/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file(config.ini config.ini COPYONLY) 2 | configure_file(genesis.json genesis.json COPYONLY) 3 | configure_file(logging.json logging.json COPYONLY) 4 | -------------------------------------------------------------------------------- /eos/scripts/testnet_np/config.ini: -------------------------------------------------------------------------------- 1 | genesis-json = testnet_np/genesis.json 2 | block-log-dir = blocks 3 | readonly = 0 4 | send-whole-blocks = true 5 | shared-file-dir = blockchain 6 | shared-file-size = 8192 7 | http-server-address = 127.0.0.1:8888 8 | p2p-listen-endpoint = 0.0.0.0:9877 9 | p2p-server-address = localhost:9877 10 | allowed-connection = any 11 | p2p-peer-address = p2p-testnet1.eos.io:9876 12 | plugin = eosio::chain_api_plugin 13 | plugin = eosio::account_history_plugin 14 | plugin = eosio::account_history_api_plugin 15 | plugin = eosio::wallet_api_plugin 16 | plugin = eosio::wallet_plugin 17 | block-interval-seconds = 2 18 | pending-txn-depth-limit = 60 19 | sync-fetch-span = 100 20 | -------------------------------------------------------------------------------- /eos/scripts/tn_gen_config.sh: -------------------------------------------------------------------------------- 1 | cd ~testnet/STAT/build 2 | programs/launcher/launcher --servers ~/servers.json -s mesh -o ~/22mesh.json -l none $* 3 | #new config files in STAT/build/staging/tn_data_* 4 | -------------------------------------------------------------------------------- /eos/scripts/tn_start_all.sh: -------------------------------------------------------------------------------- 1 | cd ~testnet/STAT/build 2 | programs/launcher/launcher --servers ~/servers.json --nogen $* 3 | -------------------------------------------------------------------------------- /eos/testnet-diagrams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | circo ring.dot -Tpng -oring.png 4 | circo star.dot -Tpng -ostar.png 5 | fdp mesh.dot -Tpng -omesh.png 6 | -------------------------------------------------------------------------------- /eos/tests/api_tests/extended_memory_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_wast_target(extended_memory_test "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 2 | -------------------------------------------------------------------------------- /eos/tests/api_tests/memory_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_wast_target(memory_test "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 2 | -------------------------------------------------------------------------------- /eos/tests/api_tests/memory_test/memory_test.hpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file 4 | * @copyright defined in eos/LICENSE.txt 5 | */ 6 | namespace memory_test { 7 | 8 | } /// namespace memory_test 9 | 10 | -------------------------------------------------------------------------------- /eos/tests/api_tests/table_abi_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SOURCE_FILES "*.cpp") 2 | add_wast_abi_target(table_abi_test "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 3 | -------------------------------------------------------------------------------- /eos/tests/api_tests/table_abi_test/table_abi_test.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct PACKED(table1) { 5 | uint64_t key; 6 | uint128_t value1; 7 | int64_t value2; 8 | }; 9 | 10 | struct PACKED(table2) { 11 | uint128_t key1; 12 | uint128_t key2; 13 | uint64_t value1; 14 | int64_t value2; 15 | }; 16 | 17 | struct PACKED(table3) { 18 | uint64_t key1; 19 | int64_t key2; 20 | uint64_t key3; 21 | uint128_t value1; 22 | int64_t value2; 23 | }; 24 | -------------------------------------------------------------------------------- /eos/tests/common/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | extern uint32_t EOS_TESTING_GENESIS_TIMESTAMP; 10 | 11 | boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) { 12 | std::srand(time(NULL)); 13 | std::cout << "Random number generator seeded to " << time(NULL) << std::endl; 14 | const char* genesis_timestamp_str = getenv("EOS_TESTING_GENESIS_TIMESTAMP"); 15 | if( genesis_timestamp_str != nullptr ) 16 | { 17 | EOS_TESTING_GENESIS_TIMESTAMP = std::stoul( genesis_timestamp_str ); 18 | } 19 | std::cout << "EOS_TESTING_GENESIS_TIMESTAMP is " << EOS_TESTING_GENESIS_TIMESTAMP << std::endl; 20 | return nullptr; 21 | } 22 | -------------------------------------------------------------------------------- /eos/tests/stress_test/README.md: -------------------------------------------------------------------------------- 1 | # EOS STRESS TEST SCRIPT 2 | 3 | 4 | The following stress test script will send bunch of transfer transactions equally distributed to each node in the testnet: 5 | - transfer from inita to initb 6 | - transfer from initb to initc 7 | - transfer from initc to initd 8 | - ..... 9 | - transfer from initu to inita 10 | 11 | 12 | ## Requirement 13 | Node.js version 8.x.x or above 14 | 15 | ## Setup 16 | ``` 17 | npm install 18 | ``` 19 | Also ensure that your eos wallet has key for inita imported and it is unlocked 20 | 21 | ## Config 22 | - testnetUris: array of testnet uri (e.g. "http://localhost:8888") 23 | - serializeTrxNodeUri: uri of node to serialize transaction (e.g. "http://localhost:8888") 24 | - walletUri: uri of the wallet (e.g. "http://localhost:8888") 25 | - minNumOfTrxToSend: minimum number of transaction to send 26 | - numOfTrxPerBatch: number of transaction to send in batch 27 | - maxSimulHttpReqPerNode: maximum number of http request made to each node at one time 28 | 29 | ## Run 30 | ``` 31 | node stress_test.js 32 | ``` -------------------------------------------------------------------------------- /eos/tests/stress_test/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "testnetUris": [ 3 | "http://localhost:8888" 4 | ], 5 | "serializeTrxNodeUri": "http://localhost:8888", 6 | "walletUri": "http://localhost:8888", 7 | "minNumOfTrxToSend": 1000, 8 | "numOfTrxPerBatch": 100, 9 | "maxSimulHttpReqPerNode": 120 10 | } -------------------------------------------------------------------------------- /eos/tests/stress_test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stress_test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "stress_test.js", 6 | "dependencies": { 7 | "lodash": "~4.17.4", 8 | "request": "~2.83.0", 9 | "request-promise": "~4.2.2" 10 | }, 11 | "devDependencies": {}, 12 | "scripts": { 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "author": "", 16 | "license": "MIT" 17 | } 18 | -------------------------------------------------------------------------------- /eos/tests/tests/contracts/rate_limit_auth/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_wast_target(rate_limit_auth "${CMAKE_SOURCE_DIR}/contracts" ${CMAKE_CURRENT_BINARY_DIR}) 2 | -------------------------------------------------------------------------------- /eos/tests/tests/contracts/rate_limit_auth/rate_limit_auth.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright defined in eos/LICENSE.txt 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | extern "C" { 10 | void init() 11 | { 12 | } 13 | 14 | void test_auths(const currency::transfer& auth) 15 | { 16 | require_auth( auth.from ); 17 | require_auth( auth.to ); 18 | } 19 | 20 | /// The apply method implements the dispatch of events to this contract 21 | void apply( uint64_t code, uint64_t action ) 22 | { 23 | if( code == N(test1) || code == N(test5) ) 24 | { 25 | if( action == N(transfer) ) 26 | { 27 | test_auths( eosio::current_message< currency::transfer >() ); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /eos/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file( eoscpp.in eoscpp @ONLY) 2 | install( FILES ${CMAKE_CURRENT_BINARY_DIR}/eoscpp DESTINATION bin/ PERMISSIONS WORLD_EXECUTE OWNER_EXECUTE GROUP_EXECUTE WORLD_READ GROUP_READ OWNER_READ ) 3 | -------------------------------------------------------------------------------- /resource/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/1.png -------------------------------------------------------------------------------- /resource/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/2.png -------------------------------------------------------------------------------- /resource/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/3.png -------------------------------------------------------------------------------- /resource/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/4.png -------------------------------------------------------------------------------- /resource/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/5.png -------------------------------------------------------------------------------- /resource/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/6.png -------------------------------------------------------------------------------- /resource/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/7.png -------------------------------------------------------------------------------- /resource/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/resource/8.png -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/Action.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | import java.util.List; 4 | 5 | public class Action extends Bean{ 6 | 7 | private String account; 8 | public String getAccount() { 9 | return account; 10 | } 11 | public void setAccount(String account) { 12 | this.account = account; 13 | } 14 | public String getName() { 15 | return name; 16 | } 17 | public void setName(String name) { 18 | this.name = name; 19 | } 20 | public List getAuthorization() { 21 | return authorization; 22 | } 23 | public void setAuthorization(List authorization) { 24 | this.authorization = authorization; 25 | } 26 | public String getData() { 27 | return data; 28 | } 29 | public void setData(String data) { 30 | this.data = data; 31 | } 32 | private String name; 33 | private List authorization; 34 | private String data; 35 | 36 | public Action() { 37 | 38 | } 39 | 40 | public Action(String account, String name, List authorization, String data ) { 41 | this.account = account ; 42 | this.name = name; 43 | this.authorization = authorization; 44 | this.data = data; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/Authorization.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | public class Authorization { 4 | private String actor; 5 | public String getActor() { 6 | return actor; 7 | } 8 | public void setActor(String actor) { 9 | this.actor = actor; 10 | } 11 | public String getPermission() { 12 | return permission; 13 | } 14 | public void setPermission(String permission) { 15 | this.permission = permission; 16 | } 17 | private String permission; 18 | 19 | public Authorization(String actor, String permission) { 20 | this.actor = actor; 21 | this.permission = permission; 22 | } 23 | 24 | public Authorization() { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/Bean.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | 6 | public class Bean { 7 | 8 | public String toString() { 9 | ObjectMapper mapper = new ObjectMapper(); 10 | String json = null; 11 | try { 12 | json = mapper.writeValueAsString(this); 13 | } catch (JsonProcessingException e) { 14 | e.printStackTrace(); 15 | } 16 | return json; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/BinArgs.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author koala 7 | * 8 | */ 9 | public class BinArgs extends Bean{ 10 | 11 | private String binargs; 12 | public String getBinargs() { 13 | return binargs; 14 | } 15 | public void setBinargs(String binargs) { 16 | this.binargs = binargs; 17 | } 18 | public List getRequired_scope() { 19 | return required_scope; 20 | } 21 | public void setRequired_scope(List required_scope) { 22 | this.required_scope = required_scope; 23 | } 24 | public List getRequired_auth() { 25 | return required_auth; 26 | } 27 | public void setRequired_auth(List required_auth) { 28 | this.required_auth = required_auth; 29 | } 30 | private List required_scope; 31 | private List required_auth; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/PackagedTransaction.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | import java.util.List; 4 | 5 | public class PackagedTransaction extends Bean { 6 | 7 | public List getSignatures() { 8 | return signatures; 9 | } 10 | public void setSignatures(List signatures) { 11 | this.signatures = signatures; 12 | } 13 | public String getCompression() { 14 | return compression; 15 | } 16 | public void setCompression(String compression) { 17 | this.compression = compression; 18 | } 19 | public String getPacked_context_free_data() { 20 | return packed_context_free_data; 21 | } 22 | public void setPacked_context_free_data(String packed_context_free_data) { 23 | this.packed_context_free_data = packed_context_free_data; 24 | } 25 | public String getPacked_trx() { 26 | return packed_trx; 27 | } 28 | public void setPacked_trx(String packed_trx) { 29 | this.packed_trx = packed_trx; 30 | } 31 | private String compression; 32 | private String packed_context_free_data; 33 | private String packed_trx; 34 | private List signatures; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/RequiredKeys.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | import java.util.List; 4 | 5 | public class RequiredKeys extends Bean{ 6 | 7 | List required_keys; 8 | 9 | public List getRequired_keys() { 10 | return required_keys; 11 | } 12 | 13 | public void setRequired_keys(List required_keys) { 14 | this.required_keys = required_keys; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/bean/Transfer.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.bean; 2 | 3 | /** 4 | * 转账消息格式 5 | * @author koala 6 | * 7 | */ 8 | public class Transfer extends Bean{ 9 | 10 | public String getFrom() { 11 | return from; 12 | } 13 | public void setFrom(String from) { 14 | this.from = from; 15 | } 16 | public String getTo() { 17 | return to; 18 | } 19 | public void setTo(String to) { 20 | this.to = to; 21 | } 22 | public String getQuantity() { 23 | return quantity; 24 | } 25 | public void setQuantity(String quantity) { 26 | this.quantity = quantity; 27 | } 28 | 29 | public String getMemo() { 30 | return memo; 31 | } 32 | 33 | public void setMemo(String memo) { 34 | this.memo = memo; 35 | } 36 | private String from; 37 | private String to; 38 | private String quantity; 39 | private String memo; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/crypto/AccountName.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.crypto; 2 | 3 | import java.util.Random; 4 | 5 | import com.safe.sdk.comm.TimeUtil; 6 | 7 | /** 8 | * base32 account name 9 | * @author koala 10 | * 11 | */ 12 | public class AccountName { 13 | 14 | 15 | private static final char [] ALPHABET1 = "abcdefghijkmnopqrstuvwxyz.12345A".toCharArray(); 16 | private static final char [] ALPHABET2 = "abcdefghijkmnop.A".toCharArray(); 17 | 18 | public static String getRandomAccountName() { 19 | StringBuilder sb = new StringBuilder(); 20 | Random random = new Random(TimeUtil.getCurrentTs()/1000); 21 | for(int i=0;i<12;i++) { 22 | final char A = ALPHABET1[random.nextInt(ALPHABET1.length)]; 23 | if(A == 'A') continue; 24 | sb.append(A); 25 | } 26 | final char end = ALPHABET2[random.nextInt(ALPHABET2.length)]; 27 | if (end != 'A') { 28 | sb.append(end); 29 | } 30 | return sb.toString(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /safe-sdks/src/main/java/com/safe/sdk/crypto/Wallet.java: -------------------------------------------------------------------------------- 1 | package com.safe.sdk.crypto; 2 | 3 | import java.util.List; 4 | 5 | import com.safe.sdk.bean.RequiredKeys; 6 | import com.safe.sdk.bean.Transaction; 7 | 8 | /** 9 | * 具备简单的钱包功能 10 | * @author koala 11 | * 12 | */ 13 | public interface Wallet { 14 | 15 | /** 16 | * 导入私钥 17 | * @param privateKey 18 | */ 19 | public String importKey(String privateKey); 20 | 21 | /** 22 | * 获取公钥列表 23 | * @return 24 | */ 25 | public List getPublicKeys(); 26 | 27 | /** 28 | * 获取keypair列表 29 | * @return 30 | */ 31 | public List getKeyPairs(); 32 | 33 | 34 | public Transaction signTransaction(Transaction trx, RequiredKeys requiredKeys, String chainId); 35 | } 36 | -------------------------------------------------------------------------------- /safe-server/src/main/java/com/safe/server/controller/PingController.java: -------------------------------------------------------------------------------- 1 | package com.safe.server.controller; 2 | 3 | import java.util.Map; 4 | 5 | import com.admaster.comm.easynetty.core.Controller; 6 | 7 | public class PingController extends Controller { 8 | 9 | @Override 10 | public void process(Map paras, String body) { 11 | renderText("welcome to audienx-inner-proxy!"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/bin/nginx_log_division.sh: -------------------------------------------------------------------------------- 1 | # /bin/bash 2 | logs_path="/data2/nginx_log/" 3 | log_name="access.log" 4 | pid_path="/data1/nginx_log/nginx.pid" 5 | mv ${logs_path}${log_name} ${logs_path}${log_name}.$(date --date="LAST DAY" +"%Y%m%d") 6 | kill -USR1 `cat ${pid_path}` 7 | rm ${logs_path}${log_name}.$(date -d "-1 day" +"%Y%m%d") 8 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/bin/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MAIN_CLASS=com.admaster.dmp.rtqmaster.server.RTQMasterServer 4 | JAR_NAME=rtq-master.jar 5 | 6 | SH_PATH=$(cd "$(dirname "$0")"; pwd) 7 | SERVER_HOME=$SH_PATH/.. 8 | CONF_PATH=$SERVER_HOME/conf/config.properties 9 | LOG4J_PATH=$SERVER_HOME/conf/log4j.properties 10 | 11 | JAVA_OPTS="-server -Xms3G -Xmx3G -Xss256k -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+UseParallelOldGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:$SERVER_HOME/logs/gc.log -XX:NewSize=1G -XX:MaxNewSize=1G" 12 | nohup java $JAVA_OPTS -DSERVER_HOME=$SERVER_HOME -cp $SERVER_HOME/$JAR_NAME:$SERVER_HOME/lib/* $MAIN_CLASS $CONF_PATH $LOG4J_PATH 1> $SERVER_HOME/logs/debug 2>&1 & 13 | echo $! > $SERVER_HOME/logs/pid.txt 14 | echo "server started, pid: $!" 15 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/bin/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SH_PATH=$(cd "$(dirname "$0")"; pwd) 3 | 4 | SERVER_HOME=$SH_PATH/.. 5 | CONF_PATH=$SERVER_HOME/conf/config.properties 6 | LOG4J_PATH=$SERVER_HOME/conf/log4j.properties 7 | 8 | PID=`cat $SERVER_HOME/logs/pid.txt` 9 | kill $PID 10 | echo "server stopping, pid: $PID" 11 | sleep 3 12 | kill -9 $PID 13 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/bin/sync_lib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #hosts 3 | HOST_LIST=( "nrt1" "nrt2" "nrt3" "nrt4" "nrt5" "nrt6" "nrt7" "nrt8" "nrt9" "nrt10" "nrt11" "nrt12" ) 4 | 5 | #ssh port 6 | SSH="ssh -p 58404" 7 | SCP="scp -P 58404" 8 | SH_PATH=$(cd "$(dirname "$0")"; pwd) 9 | 10 | for IP in ${HOST_LIST[*]} 11 | do 12 | $SCP -r $SH_PATH/../lib/redis* $IP:"$SH_PATH/../lib/" 13 | done 14 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/bin/sync_scripts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #hosts 3 | HOST_LIST=( "nrt1" "nrt2" "nrt3" "nrt4" "nrt5" "nrt6" "nrt7" "nrt8" "nrt9" "nrt10" "nrt11" "nrt12" ) 4 | 5 | #ssh port 6 | SSH="ssh -p 58404" 7 | SCP="scp -P 58404" 8 | SH_PATH=$(cd "$(dirname "$0")"; pwd) 9 | 10 | for IP in ${HOST_LIST[*]} 11 | do 12 | $SCP -r $SH_PATH/* $IP:"$SH_PATH" 13 | $SCP -r $SH_PATH/../conf/* $IP:"$SH_PATH/../conf/" 14 | done 15 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/bin/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #hosts 3 | HOST_LIST=( "r9" "r10" "r11" "r12" ) 4 | 5 | #ssh port 6 | SSH="ssh -p 58404" 7 | SCP="scp -P 58404" 8 | SH_PATH=$(cd "$(dirname "$0")"; pwd) 9 | 10 | for IP in ${HOST_LIST[*]} 11 | do 12 | $SCP -r $SH_PATH/../redis-proxy-netty.jar $IP:"$SH_PATH"/../ 13 | echo "ssh $IP ..." 14 | $SSH $IP "$SH_PATH/stop.sh" 15 | $SSH $IP "$SH_PATH/start.sh" 16 | sleep 5 17 | done 18 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | #server 2 | server.port=8085 3 | server.ploop=10 4 | server.cloop=100 5 | server.pojo.queue=500 6 | #monitor 7 | pair.workers=20 8 | 9 | #monitor 10 | monitor.appid=23 11 | 12 | #mysql 13 | jdbc.url=jdbc:mysql://127.0.0.1:3306/safe?characterEncoding=utf8 14 | jdbc.user=root 15 | jdbc.password=root 16 | db.initialSize=1 17 | db.minIdle=1 18 | db.maxActive=20 -------------------------------------------------------------------------------- /safe-server/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, Console, RollingFile 2 | 3 | #Console 4 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 5 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 7 | 8 | #RollingFile 9 | log4j.appender.RollingFile=org.apache.log4j.DailyRollingFileAppender 10 | log4j.appender.RollingFile.File=~/logs/server.log 11 | log4j.appender.RollingFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.RollingFile.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 13 | -------------------------------------------------------------------------------- /safe-server/src/main/resources/online/config.properties: -------------------------------------------------------------------------------- 1 | #server 2 | server.port=8085 3 | server.ploop=10 4 | server.cloop=100 5 | server.pojo.queue=500 6 | #monitor 7 | pair.workers=20 8 | 9 | #monitor 10 | monitor.appid=23 11 | 12 | #mysql 13 | jdbc.url=jdbc:mysql://127.0.0.1:3306/safe?characterEncoding=utf8 14 | jdbc.user=root 15 | jdbc.password=root 16 | db.initialSize=1 17 | db.minIdle=1 18 | db.maxActive=20 -------------------------------------------------------------------------------- /safe-server/src/main/resources/online/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, Console, RollingFile 2 | 3 | #Console 4 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 5 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 7 | 8 | #RollingFile 9 | log4j.appender.RollingFile=org.apache.log4j.DailyRollingFileAppender 10 | log4j.appender.RollingFile.File=${SERVER_HOME}/logs/server.log 11 | log4j.appender.RollingFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.RollingFile.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 13 | -------------------------------------------------------------------------------- /safe-web-pro/src/main/java/com/safe/web/blockchain/BlockChainClient.java: -------------------------------------------------------------------------------- 1 | package com.safe.web.blockchain; 2 | 3 | import com.safe.sdk.client.AcountClient; 4 | import com.safe.sdk.client.ChainClient; 5 | import com.safe.sdk.crypto.SimpleWallet; 6 | import com.safe.sdk.crypto.Wallet; 7 | 8 | /** 9 | * 调用区块链的接口 10 | * @author koala 11 | * 12 | */ 13 | public class BlockChainClient { 14 | 15 | private static Wallet wallet = new SimpleWallet(); 16 | private static ChainClient chainClient; 17 | private static AcountClient ac; 18 | 19 | public static void init(String account, String privateKey, String endPointServer, Integer endPointPort) { 20 | wallet.importKey(privateKey); 21 | chainClient = new ChainClient( endPointServer, endPointPort ); 22 | ac = new AcountClient(account, wallet, chainClient); 23 | } 24 | 25 | public static Wallet getWallet() { 26 | return wallet; 27 | } 28 | 29 | public static ChainClient getChainClient() { 30 | return chainClient; 31 | } 32 | 33 | public static AcountClient getAcountClient() { 34 | return ac; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /safe-web-pro/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, Console, RollingFile 2 | 3 | #Console 4 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 5 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 7 | 8 | ##RollingFile 9 | log4j.appender.RollingFile=org.apache.log4j.DailyRollingFileAppender 10 | log4j.appender.RollingFile.File=${catalina.base}/logs/safe.log 11 | log4j.appender.RollingFile.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.RollingFile.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 13 | -------------------------------------------------------------------------------- /safe-web-pro/src/main/resources/safe.local.properties: -------------------------------------------------------------------------------- 1 | jdbcUrl = jdbc:mysql://localhost:3306/safe?characterEncoding=utf8 2 | user = root 3 | password = root 4 | devMode = true 5 | 6 | block.account = eosio 7 | block.private.key = 5JC6jNZyT5RMeea5ZhQzhXCtSTynXF3icRojv1WGKjiUcdQ5dQW 8 | block.endpoint.ip = localhost 9 | block.endpoint.port = 80 -------------------------------------------------------------------------------- /safe-web-pro/src/main/resources/safe.properties: -------------------------------------------------------------------------------- 1 | jdbcUrl = jdbc:mysql://localhost:3306/safe?characterEncoding=utf8 2 | user = root 3 | password = root 4 | devMode = false 5 | 6 | block.account = eosio 7 | block.private.key = 5JC6jNZyT5RMeea5ZhQzhXCtSTynXF3icRojv1WGKjiUcdQ5dQW 8 | block.endpoint.ip = localhost 9 | block.endpoint.port = 80 -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jfinal 5 | com.jfinal.core.JFinalFilter 6 | 7 | configClass 8 | com.safe.web.start.SafeWebConfig 9 | 10 | 11 | 12 | jfinal 13 | /* 14 | 15 | 16 | -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/css/common.css: -------------------------------------------------------------------------------- 1 | .nopadding { 2 | padding: 0; 3 | } 4 | 5 | .text_left { 6 | text-align: left; 7 | } 8 | 9 | .text_right { 10 | text-align: right; 11 | } 12 | 13 | .float_left { 14 | float: left; 15 | } 16 | 17 | .float_right { 18 | float: right; 19 | } 20 | 21 | .margin-top7 { 22 | margin-top: 7px; 23 | } 24 | -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/css/common.min.css: -------------------------------------------------------------------------------- 1 | .nopadding{padding:0}.text_left{text-align:left}.text_right{text-align:right}.float_left{float:left}.float_right{float:right}.margin-top7{margin-top:7px} 2 | -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/css/common.sass: -------------------------------------------------------------------------------- 1 | $theme_background: "#f00"; 2 | $theme_color: "#ff00ff"; 3 | 4 | $header_background: '#f00'; 5 | $header_color: '#333'; 6 | 7 | .nopadding{padding: 0;} 8 | .text_left{text-align: left;} 9 | .text_right{text-align: right;} 10 | 11 | .float_left{float: left;} 12 | .float_right{float: right;} 13 | 14 | .margin-top7{margin-top: 7px;} -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/common/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/Hippopx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/Hippopx.jpg -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/banner_bubi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/banner_bubi.png -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/banner_bubix_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/banner_bubix_main.png -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/banner_bumeng_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/banner_bumeng_main.png -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/banner_bunuo_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/banner_bunuo_main.png -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/global.png -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/images/timg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/images/timg.jpeg -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/js/index.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#fullpage').fullpage(); 3 | }); -------------------------------------------------------------------------------- /safe-web-pro/src/main/webapp/other/SAFEv1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/15Koala/safe/9a79b0f927fda25e5dadffb5be761943f12ba24d/safe-web-pro/src/main/webapp/other/SAFEv1.pdf --------------------------------------------------------------------------------