├── core ├── common │ ├── git_commit_version │ │ ├── .gitignore │ │ ├── git_commit_version.hpp │ │ ├── git_commit_version.cpp.in │ │ ├── CMakeLists.txt │ │ └── git_commit_version.sh │ ├── outcome2.cpp │ ├── smoothing │ │ └── CMakeLists.txt │ ├── uri_parser │ │ └── CMakeLists.txt │ ├── fmt_fwd.hpp │ ├── append.hpp │ ├── cmp.hpp │ ├── libp2p │ │ ├── CMakeLists.txt │ │ └── multi │ │ │ └── multiaddress_fmt.hpp │ ├── endian.hpp │ ├── default_t.hpp │ ├── std_function_signature.hpp │ ├── prometheus │ │ └── since.hpp │ └── logger.hpp ├── vm │ ├── actor │ │ ├── cgo │ │ │ ├── .gitignore │ │ │ └── go_actors.sh │ │ ├── builtin │ │ │ ├── CMakeLists.txt │ │ │ ├── states │ │ │ │ ├── cron │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── v0 │ │ │ │ │ │ └── cron_actor_state.hpp │ │ │ │ ├── init │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── account │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── v0 │ │ │ │ │ │ └── account_actor_state.hpp │ │ │ │ │ └── account_actor_state.hpp │ │ │ │ ├── system │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── system_actor_state.hpp │ │ │ │ │ └── v0 │ │ │ │ │ │ └── system_actor_state.hpp │ │ │ │ ├── verified_registry │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── payment_channel │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── multisig │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── market │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── reward │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── miner │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── v3 │ │ │ │ │ │ └── miner_actor_state.cpp │ │ │ │ │ └── v4 │ │ │ │ │ │ └── miner_actor_state.cpp │ │ │ │ └── storage_power │ │ │ │ │ └── CMakeLists.txt │ │ │ ├── types │ │ │ │ ├── reward │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── storage_power │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── v0 │ │ │ │ │ │ └── claim.hpp │ │ │ │ │ └── v2 │ │ │ │ │ │ └── claim.hpp │ │ │ │ ├── multisig │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── market │ │ │ │ │ ├── deal_info_manager │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── v2 │ │ │ │ │ │ └── pending_proposals.hpp │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── miner │ │ │ │ │ ├── v3 │ │ │ │ │ │ └── expiration.hpp │ │ │ │ │ ├── cron_event_payload.hpp │ │ │ │ │ └── dispute_info.hpp │ │ │ │ ├── verified_registry │ │ │ │ │ └── policy.hpp │ │ │ │ └── payment_channel │ │ │ │ │ └── policy.hpp │ │ │ ├── v0 │ │ │ │ ├── cron │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── system │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── system_actor.hpp │ │ │ │ ├── account │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── init │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── reward │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── multisig │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── market │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── verified_registry │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── payment_channel │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── miner │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── storage_power │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── storage_power_actor_utils.cpp │ │ │ ├── v2 │ │ │ │ ├── cron │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── cron_actor.cpp │ │ │ │ │ └── cron_actor.hpp │ │ │ │ ├── init │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── init_actor.cpp │ │ │ │ │ └── init_actor.hpp │ │ │ │ ├── system │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── system_actor.cpp │ │ │ │ │ └── system_actor.hpp │ │ │ │ ├── reward │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── account │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── account_actor.cpp │ │ │ │ │ └── account_actor.hpp │ │ │ │ ├── miner │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── multisig │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── storage_power │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── verified_registry │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── market │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── payment_channel │ │ │ │ │ └── CMakeLists.txt │ │ │ │ └── CMakeLists.txt │ │ │ ├── v3 │ │ │ │ ├── cron │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── cron_actor.cpp │ │ │ │ │ └── cron_actor.hpp │ │ │ │ ├── init │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── init_actor.cpp │ │ │ │ │ └── init_actor.hpp │ │ │ │ ├── system │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── system_actor.cpp │ │ │ │ │ └── system_actor.hpp │ │ │ │ ├── account │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── account_actor.cpp │ │ │ │ │ └── account_actor.hpp │ │ │ │ ├── miner │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── storage_power │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── storage_power_actor_utils.hpp │ │ │ │ ├── multisig │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── payment_channel │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── payment_channel_actor_utils.hpp │ │ │ │ │ └── payment_channel_actor.cpp │ │ │ │ ├── verified_registry │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── market │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── reward │ │ │ │ │ └── reward_actor.hpp │ │ │ ├── utils │ │ │ │ ├── init_actor_utils.hpp │ │ │ │ └── reward_actor_utils.hpp │ │ │ └── methods │ │ │ │ └── system.hpp │ │ └── code.hpp │ ├── version │ │ └── CMakeLists.txt │ ├── exit_code │ │ └── CMakeLists.txt │ ├── toolchain │ │ └── CMakeLists.txt │ ├── state │ │ ├── CMakeLists.txt │ │ ├── state_tree_error.cpp │ │ └── state_tree_error.hpp │ ├── message │ │ └── CMakeLists.txt │ ├── interpreter │ │ └── CMakeLists.txt │ ├── fvm │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── dvm │ │ └── CMakeLists.txt │ └── runtime │ │ └── consensus_fault_types.hpp ├── storage │ ├── ipfs │ │ ├── graphsync │ │ │ ├── CMakeLists.txt │ │ │ ├── impl │ │ │ │ └── network │ │ │ │ │ └── marshalling │ │ │ │ │ ├── protobuf │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ └── message_parser.hpp │ │ │ └── extension_dedup.hpp │ │ ├── api_ipfs_datastore │ │ │ ├── CMakeLists.txt │ │ │ ├── api_ipfs_datastore_error.hpp │ │ │ └── api_ipfs_datastore_error.cpp │ │ ├── impl │ │ │ └── ipfs_datastore_error.cpp │ │ └── ipfs_datastore_error.hpp │ ├── chain │ │ └── CMakeLists.txt │ ├── map_prefix │ │ └── CMakeLists.txt │ ├── mpool │ │ └── CMakeLists.txt │ ├── amt │ │ └── CMakeLists.txt │ ├── in_memory │ │ └── CMakeLists.txt │ ├── unixfs │ │ ├── CMakeLists.txt │ │ └── unixfs.proto │ ├── hamt │ │ └── CMakeLists.txt │ ├── car │ │ ├── CMakeLists.txt │ │ └── cids_index │ │ │ └── CMakeLists.txt │ ├── compacter │ │ └── CMakeLists.txt │ ├── leveldb │ │ └── CMakeLists.txt │ ├── piece │ │ ├── CMakeLists.txt │ │ └── impl │ │ │ ├── piece_storage_error.hpp │ │ │ └── piece_storage_error.cpp │ ├── filestore │ │ ├── CMakeLists.txt │ │ └── path.hpp │ ├── keystore │ │ ├── CMakeLists.txt │ │ └── keystore_error.hpp │ ├── face │ │ └── cow.hpp │ ├── ipld │ │ ├── CMakeLists.txt │ │ └── selector.hpp │ └── CMakeLists.txt ├── drand │ ├── CMakeLists.txt │ ├── example │ │ └── CMakeLists.txt │ └── impl │ │ ├── CMakeLists.txt │ │ └── http.hpp ├── markets │ ├── retrieval │ │ ├── CMakeLists.txt │ │ ├── client │ │ │ └── CMakeLists.txt │ │ └── provider │ │ │ └── CMakeLists.txt │ ├── storage │ │ ├── CMakeLists.txt │ │ ├── chain_events │ │ │ └── CMakeLists.txt │ │ ├── client │ │ │ ├── import_manager │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ └── provider │ │ │ ├── storage_provider_error.hpp │ │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── discovery │ │ └── CMakeLists.txt │ └── pieceio │ │ ├── CMakeLists.txt │ │ └── pieceio_error.hpp ├── codec │ ├── rle │ │ └── CMakeLists.txt │ ├── json │ │ ├── CMakeLists.txt │ │ └── json_errors.hpp │ ├── CMakeLists.txt │ └── cbor │ │ ├── CMakeLists.txt │ │ ├── cbor_dump.hpp │ │ ├── fwd.hpp │ │ └── README.md ├── api │ ├── CMakeLists.txt │ ├── rpc │ │ ├── CMakeLists.txt │ │ ├── web_socket_client_error.cpp │ │ └── web_socket_client_error.hpp │ ├── visit.hpp │ ├── storage_miner │ │ └── CMakeLists.txt │ ├── wallet │ │ ├── CMakeLists.txt │ │ └── ledger_wallet.hpp │ ├── types │ │ └── ledger_key_info.hpp │ └── full_node │ │ └── CMakeLists.txt ├── primitives │ ├── sector │ │ └── CMakeLists.txt │ ├── block │ │ └── CMakeLists.txt │ ├── resources │ │ └── CMakeLists.txt │ ├── stored_counter │ │ └── CMakeLists.txt │ ├── address │ │ └── CMakeLists.txt │ ├── sector_file │ │ └── CMakeLists.txt │ ├── tipset │ │ └── CMakeLists.txt │ ├── rle_bitset │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── cid │ │ └── CMakeLists.txt │ ├── piece │ │ ├── CMakeLists.txt │ │ └── piece_error.hpp │ └── chain_epoch │ │ └── chain_epoch.hpp ├── crypto │ ├── sha │ │ ├── CMakeLists.txt │ │ └── sha256.hpp │ ├── signature │ │ └── CMakeLists.txt │ ├── hasher │ │ └── CMakeLists.txt │ ├── blake2 │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── bls │ │ └── CMakeLists.txt │ └── secp256k1 │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── secp256k1_error.hpp ├── cli │ ├── CMakeLists.txt │ ├── validate │ │ ├── cid.hpp │ │ └── address.hpp │ └── node │ │ └── CMakeLists.txt ├── config │ ├── CMakeLists.txt │ └── profile_config.hpp ├── fslock │ ├── CMakeLists.txt │ ├── fslock_error.hpp │ └── fslock_error.cpp ├── sector_storage │ ├── zerocomm │ │ ├── CMakeLists.txt │ │ └── zerocomm.hpp │ ├── fetch_handler.hpp │ └── stores │ │ └── storage_error.hpp ├── data_transfer │ └── CMakeLists.txt ├── sectorblocks │ └── CMakeLists.txt ├── blockchain │ ├── production │ │ ├── CMakeLists.txt │ │ └── block_producer.hpp │ ├── CMakeLists.txt │ └── block_validator │ │ └── CMakeLists.txt ├── clock │ ├── CMakeLists.txt │ ├── impl │ │ ├── utc_clock_impl.hpp │ │ ├── utc_clock_impl.cpp │ │ └── chain_epoch_clock_impl.hpp │ ├── chain_epoch_clock.cpp │ └── utc_clock.hpp ├── adt │ ├── cid_key.hpp │ ├── cid_key.cpp │ ├── address_key.hpp │ └── address_key.cpp ├── node │ └── node_version.hpp ├── miner │ ├── miner_version.hpp │ └── storage_fsm │ │ └── precommit_policy.hpp ├── remote_worker │ ├── CMakeLists.txt │ └── remote_worker_api.hpp ├── proofs │ └── proof_param_provider.hpp └── paych │ └── CMakeLists.txt ├── docker ├── mainnet │ ├── .gitignore │ └── genesis.car ├── interopnet │ ├── .gitignore │ ├── genesis.car │ └── fuhon-node.cfg ├── node_entrypoint.sh ├── miner_entrypoint.sh ├── README.md ├── docker-compose-mainnet.yml └── docker-compose-interopnet.yml ├── codecov.yml ├── .dockerignore ├── .clang-tidy-ignore ├── cmake ├── toolchain │ ├── cxx17.cmake │ ├── gcc-8_cxx17.cmake │ ├── gcc-9_cxx17.cmake │ ├── clang-8_cxx17.cmake │ ├── clang-9_cxx17.cmake │ └── flags │ │ ├── sanitize_undefined.cmake │ │ ├── sanitize_memory.cmake │ │ └── sanitize_leak.cmake ├── san │ ├── clang-8_cxx17_msan.cmake │ ├── clang-8_cxx17_tsan.cmake │ ├── clang-9_cxx17_asan.cmake │ ├── clang-8_cxx17_ubsan.cmake │ ├── clang-8_cxx17_lsan.cmake │ ├── gcc-8_cxx17_asan.cmake │ └── clang-8_cxx17_asan.cmake ├── print.cmake ├── Hunter │ └── passwords.cmake ├── clang-tidy.cmake ├── clang-format.cmake └── modules │ └── Findcppcodec.cmake ├── test ├── testutil │ ├── resources │ │ ├── mpool.car │ │ ├── genesis.car │ │ ├── compacter.car │ │ ├── block_validator.car │ │ ├── payload_selective.car │ │ ├── unpad_medium_file.txt │ │ ├── node │ │ │ └── lotus-key-import.key │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── mocks │ │ ├── std_function.hpp │ │ ├── primitives │ │ │ └── stored_counter_mock.hpp │ │ ├── miner │ │ │ ├── precommit_policy_mock.hpp │ │ │ └── events_mock.hpp │ │ ├── clock │ │ │ └── utc_clock_mock.hpp │ │ ├── cpp-ledger │ │ │ └── ledger_device_mock.hpp │ │ ├── markets │ │ │ └── storage │ │ │ │ └── chain_events │ │ │ │ └── chain_events_mock.hpp │ │ ├── vm │ │ │ └── interpreter │ │ │ │ └── interpreter_mock.hpp │ │ └── cbor_blake │ │ │ └── cbor_blake_ipld_mock.hpp │ ├── context_wait.hpp │ ├── storage │ │ ├── CMakeLists.txt │ │ └── base_leveldb_test.hpp │ └── peer_id.hpp ├── core │ ├── node │ │ ├── CMakeLists.txt │ │ └── main │ │ │ └── CMakeLists.txt │ ├── vm │ │ ├── actor │ │ │ ├── builtin │ │ │ │ ├── states │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── miner │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── types │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── market │ │ │ │ │ │ ├── deal_info_manager │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── v0 │ │ │ │ │ ├── cron │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── init │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── miner │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── account │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── multisig_actor │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── power │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── market │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── payment_channel │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── reward │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── verified_registry │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── v2 │ │ │ │ │ ├── cron │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── init │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── account │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── miner │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── reward │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── multisig_actor │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── power │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── market │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── payment_channel │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── verified_registry │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ └── CMakeLists.txt │ │ │ │ └── v3 │ │ │ │ │ ├── cron │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── init │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── account │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── miner │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── multisig_actor │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── market │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── payment_channel │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── verified_registry │ │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ ├── exit_code │ │ │ └── CMakeLists.txt │ │ ├── message │ │ │ └── CMakeLists.txt │ │ ├── interpreter │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ └── state │ │ │ └── CMakeLists.txt │ ├── codec │ │ ├── rleplus │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ ├── json │ │ │ └── CMakeLists.txt │ │ └── cbor │ │ │ ├── light_reader │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ ├── primitives │ │ ├── bitvec │ │ │ └── CMakeLists.txt │ │ ├── cid │ │ │ └── CMakeLists.txt │ │ ├── go │ │ │ └── CMakeLists.txt │ │ ├── piece │ │ │ └── CMakeLists.txt │ │ ├── sector_file │ │ │ └── CMakeLists.txt │ │ ├── rle_bitset │ │ │ └── CMakeLists.txt │ │ ├── address │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ └── tipset │ │ │ └── CMakeLists.txt │ ├── fsm │ │ └── CMakeLists.txt │ ├── markets │ │ ├── CMakeLists.txt │ │ ├── pieceio │ │ │ └── CMakeLists.txt │ │ ├── storage │ │ │ ├── chain_events │ │ │ │ └── CMakeLists.txt │ │ │ └── provider │ │ │ │ └── CMakeLists.txt │ │ ├── discovery │ │ │ └── CMakeLists.txt │ │ └── retrieval │ │ │ ├── protocol │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ ├── common │ │ ├── math │ │ │ └── CMakeLists.txt │ │ └── bitsutil_test.cpp │ ├── sector_storage │ │ └── zerocomm │ │ │ └── CMakeLists.txt │ ├── storage │ │ ├── unixfs │ │ │ ├── CMakeLists.txt │ │ │ └── go │ │ │ │ └── go.mod │ │ ├── amt │ │ │ └── CMakeLists.txt │ │ ├── hamt │ │ │ └── CMakeLists.txt │ │ ├── piece │ │ │ └── CMakeLists.txt │ │ ├── filestore │ │ │ └── CMakeLists.txt │ │ ├── ipfs │ │ │ ├── graphsync │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ ├── mpool │ │ │ └── CMakeLists.txt │ │ ├── keystore │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ └── leveldb │ │ │ └── CMakeLists.txt │ ├── serialization │ │ └── CMakeLists.txt │ ├── fslock │ │ └── CMakeLists.txt │ ├── api │ │ ├── CMakeLists.txt │ │ └── version_test.cpp │ ├── sectorblocks │ │ └── CMakeLists.txt │ ├── blockchain │ │ └── CMakeLists.txt │ ├── proofs │ │ └── CMakeLists.txt │ ├── clock │ │ └── CMakeLists.txt │ ├── test_vectors │ │ └── CMakeLists.txt │ ├── paych │ │ └── CMakeLists.txt │ ├── adt │ │ └── CMakeLists.txt │ └── crypto │ │ └── CMakeLists.txt ├── libs │ ├── CMakeLists.txt │ ├── ledger_test │ │ └── CMakeLists.txt │ └── cpp-ledger │ │ └── CMakeLists.txt └── CMakeLists.txt ├── libs ├── CMakeLists.txt └── cpp-ledger │ ├── CMakeLists.txt │ ├── common │ └── const.hpp │ ├── filecoin │ └── CMakeLists.txt │ └── ledger │ ├── utils.hpp │ ├── ledger_admin_hid.hpp │ └── CMakeLists.txt ├── .github ├── pre-commit-hook.sh └── workflows │ ├── tsan-ignorelist.txt │ └── ubsan-ignorelist.txt ├── deps ├── CMakeLists.txt └── libsecp256k1.cmake ├── housekeeping └── codecov.sh └── .clang-format /core/common/git_commit_version/.gitignore: -------------------------------------------------------------------------------- 1 | git_commit_version.cpp 2 | -------------------------------------------------------------------------------- /docker/mainnet/.gitignore: -------------------------------------------------------------------------------- 1 | fuhon-miner-repo 2 | fuhon-node-repo 3 | -------------------------------------------------------------------------------- /docker/interopnet/.gitignore: -------------------------------------------------------------------------------- 1 | fuhon-miner-repo 2 | fuhon-node-repo 3 | -------------------------------------------------------------------------------- /core/vm/actor/cgo/.gitignore: -------------------------------------------------------------------------------- 1 | go_actors.h 2 | go_actors.a 3 | go_actors.sha 4 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "test" # exclude 'test' directory from coverage 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | cmake-build-debug 2 | cmake-build 3 | docker/interopnet 4 | docker/mainnet 5 | -------------------------------------------------------------------------------- /docker/mainnet/genesis.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/docker/mainnet/genesis.car -------------------------------------------------------------------------------- /.clang-tidy-ignore: -------------------------------------------------------------------------------- 1 | build/.* 2 | cmake-build-debug/.* 3 | cmake/.* 4 | test/.* 5 | deps/.* 6 | .*\.pb\.h 7 | .*\.pb\.cc 8 | -------------------------------------------------------------------------------- /docker/interopnet/genesis.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/docker/interopnet/genesis.car -------------------------------------------------------------------------------- /cmake/toolchain/cxx17.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_STANDARD 17) 2 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 3 | set(CMAKE_CXX_EXTENSIONS OFF) 4 | -------------------------------------------------------------------------------- /test/testutil/resources/mpool.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/test/testutil/resources/mpool.car -------------------------------------------------------------------------------- /test/testutil/resources/genesis.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/test/testutil/resources/genesis.car -------------------------------------------------------------------------------- /test/testutil/resources/compacter.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/test/testutil/resources/compacter.car -------------------------------------------------------------------------------- /cmake/toolchain/gcc-8_cxx17.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-8.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/cxx17.cmake) 3 | -------------------------------------------------------------------------------- /test/testutil/resources/block_validator.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/test/testutil/resources/block_validator.car -------------------------------------------------------------------------------- /test/testutil/resources/payload_selective.car: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/test/testutil/resources/payload_selective.car -------------------------------------------------------------------------------- /test/testutil/resources/unpad_medium_file.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filecoin-project/cpp-filecoin/HEAD/test/testutil/resources/unpad_medium_file.txt -------------------------------------------------------------------------------- /libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(cpp-ledger) 7 | -------------------------------------------------------------------------------- /test/core/node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(main) 7 | -------------------------------------------------------------------------------- /.github/pre-commit-hook.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | cd $(git rev-parse --show-toplevel) 4 | ./.github/make-workflows.sh 5 | git add .github/workflows 6 | -------------------------------------------------------------------------------- /cmake/toolchain/gcc-9_cxx17.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain-util.cmake) 2 | require_compiler(gcc-9 g++-9) 3 | include(${CMAKE_CURRENT_LIST_DIR}/cxx17.cmake) 4 | -------------------------------------------------------------------------------- /cmake/san/clang-8_cxx17_msan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_memory.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/clang-8_cxx17.cmake) 3 | -------------------------------------------------------------------------------- /cmake/san/clang-8_cxx17_tsan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_thread.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/clang-8_cxx17.cmake) 3 | -------------------------------------------------------------------------------- /cmake/san/clang-9_cxx17_asan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/clang-9_cxx17.cmake) 3 | -------------------------------------------------------------------------------- /core/storage/ipfs/graphsync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(impl) 7 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/states/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(miner) 6 | -------------------------------------------------------------------------------- /cmake/san/clang-8_cxx17_ubsan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_undefined.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/clang-8_cxx17.cmake) 3 | -------------------------------------------------------------------------------- /cmake/toolchain/clang-8_cxx17.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain-util.cmake) 2 | require_compiler(clang-8 clang++-8) 3 | include(${CMAKE_CURRENT_LIST_DIR}/cxx17.cmake) 4 | -------------------------------------------------------------------------------- /cmake/toolchain/clang-9_cxx17.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain-util.cmake) 2 | require_compiler(clang-9 clang++-9) 3 | include(${CMAKE_CURRENT_LIST_DIR}/cxx17.cmake) 4 | -------------------------------------------------------------------------------- /core/drand/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(impl) 7 | add_subdirectory(example) 8 | -------------------------------------------------------------------------------- /test/core/codec/rleplus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | addtest(rle_plus_codec_test 2 | rle_plus_codec_test.cpp 3 | ) 4 | 5 | target_link_libraries(rle_plus_codec_test 6 | rle_plus_codec 7 | ) 8 | -------------------------------------------------------------------------------- /test/testutil/resources/node/lotus-key-import.key: -------------------------------------------------------------------------------- 1 | 7b2254797065223a22626c73222c22507269766174654b6579223a2269746e7830596e335943794e64327378684751717030733479365331697849796f3566693631476a7555453d227d -------------------------------------------------------------------------------- /.github/workflows/tsan-ignorelist.txt: -------------------------------------------------------------------------------- 1 | # False positive `in boost::asio` `conditionally_enabled_mutex`. 2 | # See https://github.com/boostorg/beast/issues/1142. 3 | race:conditionally_enabled_mutex 4 | -------------------------------------------------------------------------------- /deps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | include(filecoin-ffi.cmake) 7 | include(libsecp256k1.cmake) 8 | -------------------------------------------------------------------------------- /libs/cpp-ledger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(ledger) 7 | add_subdirectory(filecoin) 8 | -------------------------------------------------------------------------------- /test/testutil/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(resources) 7 | add_subdirectory(storage) 8 | -------------------------------------------------------------------------------- /core/markets/retrieval/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(client) 7 | add_subdirectory(provider) 8 | -------------------------------------------------------------------------------- /test/core/primitives/bitvec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(bitvec_test 7 | bitvec_test.cpp 8 | ) 9 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/types/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(market) 6 | add_subdirectory(miner) 7 | -------------------------------------------------------------------------------- /cmake/print.cmake: -------------------------------------------------------------------------------- 1 | function(print) 2 | message(STATUS "[${CMAKE_PROJECT_NAME}] ${ARGV}") 3 | endfunction() 4 | 5 | function(fatal_error) 6 | message(FATAL_ERROR "[${CMAKE_PROJECT_NAME}] ${ARGV}") 7 | endfunction() 8 | 9 | -------------------------------------------------------------------------------- /test/core/codec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(cbor) 7 | add_subdirectory(json) 8 | add_subdirectory(rleplus) 9 | -------------------------------------------------------------------------------- /core/codec/rle/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(rle_plus_codec 2 | rle_plus_encoding_stream.cpp 3 | rle_plus_errors.cpp 4 | ) 5 | 6 | target_link_libraries(rle_plus_codec 7 | Boost::boost 8 | outcome 9 | ) 10 | -------------------------------------------------------------------------------- /docker/node_entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # if first arg looks like a flag, assume we want to run fuhon-node 6 | if [ "${1:0:1}" = '-' ]; then 7 | set -- fuhon-node "$@" 8 | fi 9 | 10 | exec "$@" 11 | -------------------------------------------------------------------------------- /core/markets/storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(chain_events) 7 | add_subdirectory(client) 8 | add_subdirectory(provider) 9 | -------------------------------------------------------------------------------- /docker/miner_entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # if first arg looks like a flag, assume we want to run fuhon-miner 6 | if [ "${1:0:1}" = '-' ]; then 7 | set -- fuhon-miner "$@" 8 | fi 9 | 10 | exec "$@" 11 | -------------------------------------------------------------------------------- /cmake/san/clang-8_cxx17_lsan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_leak.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) 3 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) 4 | -------------------------------------------------------------------------------- /cmake/san/gcc-8_cxx17_asan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/gcc-8.cmake) 3 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) 4 | -------------------------------------------------------------------------------- /core/storage/ipfs/graphsync/impl/network/marshalling/protobuf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_proto_library(graphsync_proto 5 | message.proto 6 | ) 7 | -------------------------------------------------------------------------------- /.github/workflows/ubsan-ignorelist.txt: -------------------------------------------------------------------------------- 1 | # Known issue in RapidJSON library 2 | # (https://github.com/Tencent/rapidjson/issues/1724). Waiting for the next 3 | # release (https://github.com/Tencent/rapidjson/issues/1006). 4 | src:*rapidjson/internal/stack.h 5 | -------------------------------------------------------------------------------- /cmake/san/clang-8_cxx17_asan.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/flags/sanitize_address.cmake) 2 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/compiler/clang-8.cmake) 3 | include(${CMAKE_CURRENT_LIST_DIR}/../toolchain/cxx17.cmake) 4 | -------------------------------------------------------------------------------- /test/core/primitives/cid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(cid_test 5 | cid_test.cpp 6 | ) 7 | target_link_libraries(cid_test 8 | cid 9 | ) 10 | -------------------------------------------------------------------------------- /core/api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(full_node) 7 | add_subdirectory(rpc) 8 | add_subdirectory(storage_miner) 9 | add_subdirectory(wallet) 10 | -------------------------------------------------------------------------------- /core/primitives/sector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(sector 5 | sector.cpp) 6 | 7 | target_link_libraries(sector 8 | outcome 9 | ) 10 | -------------------------------------------------------------------------------- /core/storage/chain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(msg_waiter 5 | msg_waiter.cpp 6 | ) 7 | target_link_libraries(msg_waiter 8 | message 9 | ) 10 | -------------------------------------------------------------------------------- /core/storage/map_prefix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(map_prefix 5 | prefix.cpp 6 | ) 7 | target_link_libraries(map_prefix 8 | outcome 9 | ) 10 | -------------------------------------------------------------------------------- /core/storage/mpool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(mpool 5 | mpool.cpp 6 | ) 7 | target_link_libraries(mpool 8 | message 9 | sync 10 | ) 11 | -------------------------------------------------------------------------------- /test/libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(cpp-ledger) 6 | 7 | # Unlock only if you need to test physical Ledger device 8 | # add_subdirectory(ledger_test) 9 | -------------------------------------------------------------------------------- /core/crypto/sha/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(filecoin_sha INTERFACE) 7 | target_link_libraries(filecoin_sha INTERFACE 8 | p2p::p2p_sha 9 | ) 10 | -------------------------------------------------------------------------------- /core/markets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(discovery) 7 | add_subdirectory(pieceio) 8 | add_subdirectory(retrieval) 9 | add_subdirectory(storage) 10 | -------------------------------------------------------------------------------- /core/vm/version/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(version 7 | version.cpp 8 | ) 9 | 10 | target_link_libraries(version 11 | const 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/fsm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(fsm_test 7 | fsm_test.cpp 8 | ) 9 | target_link_libraries(fsm_test 10 | outcome 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/markets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(discovery) 7 | add_subdirectory(pieceio) 8 | add_subdirectory(retrieval) 9 | add_subdirectory(storage) 10 | -------------------------------------------------------------------------------- /test/core/node/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(node_test 7 | node_test.cpp 8 | ) 9 | target_link_libraries(node_test 10 | node_builder 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/primitives/go/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(go_test 7 | math_test.cpp 8 | ) 9 | target_link_libraries(go_test 10 | Boost::boost 11 | ) 12 | -------------------------------------------------------------------------------- /core/codec/json/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(json 7 | json.cpp 8 | json_errors.cpp 9 | ) 10 | target_link_libraries(json 11 | cid 12 | ) 13 | -------------------------------------------------------------------------------- /core/common/outcome2.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "common/outcome2.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc, OutcomeError, e) { 9 | return fc::enumStr(e); 10 | } 11 | -------------------------------------------------------------------------------- /core/crypto/signature/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(signature 7 | signature.cpp 8 | ) 9 | target_link_libraries(signature 10 | outcome 11 | ) 12 | -------------------------------------------------------------------------------- /core/storage/amt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(amt 7 | amt.cpp 8 | ) 9 | target_link_libraries(amt 10 | cbor 11 | cid 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/exit_code/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(exit_code 7 | impl/exit_code.cpp 8 | ) 9 | target_link_libraries(exit_code 10 | outcome 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/primitives/piece/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(piece_test 7 | piece_test.cpp 8 | ) 9 | target_link_libraries(piece_test 10 | piece 11 | ) 12 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 7 | 8 | add_subdirectory(core) 9 | add_subdirectory(libs) 10 | add_subdirectory(testutil) 11 | -------------------------------------------------------------------------------- /test/core/common/math/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(math_test 7 | math_test.cpp 8 | ) 9 | target_link_libraries(math_test 10 | Boost::filesystem 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/markets/pieceio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(pieceio_test 7 | pieceio_test.cpp 8 | ) 9 | target_link_libraries(pieceio_test 10 | pieceio 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(types) 6 | add_subdirectory(states) 7 | add_subdirectory(v0) 8 | add_subdirectory(v2) 9 | add_subdirectory(v3) 10 | -------------------------------------------------------------------------------- /core/storage/in_memory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(in_memory_storage 5 | in_memory_storage.cpp 6 | ) 7 | target_link_libraries(in_memory_storage 8 | outcome 9 | ) 10 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(states) 7 | add_subdirectory(types) 8 | add_subdirectory(v0) 9 | add_subdirectory(v2) 10 | add_subdirectory(v3) 11 | -------------------------------------------------------------------------------- /core/vm/actor/cgo/go_actors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if ! [ -e go_actors.a ] || ! [ -e go_actors.sha ] || ! shasum -s -c go_actors.sha; then 5 | go build -buildmode=c-archive go_actors.go cgo.go 6 | shasum go_actors.go go.mod go.sum c_actors.h go_actors.sh > go_actors.sha 7 | fi 8 | -------------------------------------------------------------------------------- /test/core/vm/exit_code/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(exit_code_test 7 | exit_code_test.cpp 8 | ) 9 | target_link_libraries(exit_code_test 10 | exit_code 11 | ) 12 | -------------------------------------------------------------------------------- /core/common/smoothing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(alpha_beta_filter 5 | alpha_beta_filter.cpp 6 | ) 7 | 8 | target_link_libraries(alpha_beta_filter 9 | Boost::boost 10 | ) 11 | -------------------------------------------------------------------------------- /core/storage/unixfs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(unixfs 5 | unixfs.cpp 6 | ) 7 | target_link_libraries(unixfs 8 | cbor 9 | filecoin_hasher 10 | ipld_traverser 11 | ) 12 | -------------------------------------------------------------------------------- /core/cli/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cli INTERFACE) 7 | target_link_libraries(cli INTERFACE 8 | Boost::program_options 9 | fmt::fmt 10 | ) 11 | 12 | add_subdirectory(node) 13 | -------------------------------------------------------------------------------- /core/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(filecoin_config 7 | profile_config.cpp 8 | ) 9 | target_link_libraries(filecoin_config 10 | Boost::boost 11 | const 12 | ) 13 | -------------------------------------------------------------------------------- /core/crypto/hasher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(filecoin_hasher 7 | hasher.cpp 8 | ) 9 | target_link_libraries(filecoin_hasher 10 | blake2 11 | filecoin_sha 12 | ) 13 | -------------------------------------------------------------------------------- /core/primitives/block/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(block INTERFACE) 7 | target_link_libraries(block INTERFACE 8 | address 9 | amt 10 | cbor 11 | signature 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cron_actor_state 7 | bind_states.cpp 8 | ) 9 | target_link_libraries(cron_actor_state 10 | cbor 11 | ) 12 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(init_actor_state 7 | bind_states.cpp 8 | ) 9 | target_link_libraries(init_actor_state 10 | cbor 11 | ) 12 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/reward/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(reward_types 7 | reward_actor_calculus.cpp 8 | ) 9 | target_link_libraries(reward_types 10 | actor 11 | ) 12 | -------------------------------------------------------------------------------- /core/crypto/blake2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(blake2 7 | blake2b160.cpp 8 | ) 9 | target_link_libraries(blake2 10 | OpenSSL::Crypto 11 | blob 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /core/fslock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(fslock 7 | fslock.cpp 8 | fslock_error.cpp 9 | ) 10 | 11 | target_link_libraries(fslock 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(account_actor_state 7 | bind_states.cpp 8 | ) 9 | target_link_libraries(account_actor_state 10 | cbor 11 | ) 12 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(system_actor_state 7 | bind_states.cpp 8 | ) 9 | target_link_libraries(system_actor_state 10 | cbor 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/vm/message/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(message_test 7 | message_test.cpp 8 | ) 9 | target_link_libraries(message_test 10 | message 11 | secp256k1_provider 12 | ) 13 | -------------------------------------------------------------------------------- /core/primitives/resources/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(resources 7 | active_resources.cpp 8 | ) 9 | 10 | target_link_libraries(resources 11 | Boost::boost 12 | ) 13 | -------------------------------------------------------------------------------- /core/sector_storage/zerocomm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(zerocomm 7 | zerocomm.cpp 8 | ) 9 | 10 | target_link_libraries(zerocomm 11 | cid 12 | comm_cid 13 | piece 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(market) 7 | add_subdirectory(miner) 8 | add_subdirectory(multisig) 9 | add_subdirectory(reward) 10 | add_subdirectory(storage_power) 11 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/storage_power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_power_types 7 | bind_types.cpp 8 | ) 9 | target_link_libraries(storage_power_types 10 | cbor 11 | ) 12 | -------------------------------------------------------------------------------- /libs/cpp-ledger/common/const.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace ledger { 11 | 12 | constexpr size_t kPathLength = 5; 13 | 14 | } // namespace ledger 15 | -------------------------------------------------------------------------------- /test/core/sector_storage/zerocomm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd.All Rights Reserved. 3 | # SPDX - License - Identifier : Apache - 2.0 4 | # 5 | 6 | addtest(zerocomm_test 7 | zerocomm_test.cpp) 8 | target_link_libraries(zerocomm_test 9 | zerocomm 10 | ) 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/core/storage/unixfs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(unixfs_test 7 | unixfs_test.cpp 8 | ) 9 | target_link_libraries(unixfs_test 10 | unixfs 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /core/crypto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(blake2) 7 | add_subdirectory(bls) 8 | add_subdirectory(hasher) 9 | add_subdirectory(secp256k1) 10 | add_subdirectory(sha) 11 | add_subdirectory(signature) 12 | -------------------------------------------------------------------------------- /core/storage/hamt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(hamt 7 | hamt.cpp 8 | ) 9 | target_link_libraries(hamt 10 | blob 11 | cbor 12 | cid 13 | filecoin_sha 14 | outcome 15 | ) 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cron_actor_v0 7 | cron_actor.cpp 8 | ) 9 | target_link_libraries(cron_actor_v0 10 | cron_actor_state 11 | actor 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cron_actor_v2 7 | cron_actor.cpp 8 | ) 9 | target_link_libraries(cron_actor_v2 10 | cron_actor_state 11 | actor 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cron_actor_v3 7 | cron_actor.cpp 8 | ) 9 | target_link_libraries(cron_actor_v3 10 | cron_actor_state 11 | actor 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/markets/storage/chain_events/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(chain_events_test 7 | chain_events_test.cpp 8 | ) 9 | target_link_libraries(chain_events_test 10 | chain_events 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/storage/amt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(amt_test 7 | amt_test.cpp 8 | ) 9 | target_link_libraries(amt_test 10 | amt 11 | hexutil 12 | ipfs_datastore_in_memory 13 | ) 14 | -------------------------------------------------------------------------------- /test/libs/ledger_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(ledger_test 7 | ledger_test.cpp 8 | ) 9 | target_link_libraries(ledger_test 10 | wallet 11 | in_memory_storage 12 | cbor 13 | ) 14 | -------------------------------------------------------------------------------- /core/data_transfer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(data_transfer 7 | dt.cpp 8 | ) 9 | target_link_libraries(data_transfer 10 | cbor_stream 11 | graphsync 12 | stream_open_queue 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(init_actor_v2 7 | init_actor.cpp 8 | ) 9 | target_link_libraries(init_actor_v2 10 | actor 11 | outcome 12 | hamt 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(init_actor_v3 7 | init_actor.cpp 8 | ) 9 | target_link_libraries(init_actor_v3 10 | actor 11 | outcome 12 | hamt 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/toolchain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(toolchain 7 | impl/toolchain.cpp 8 | impl/common_address_matcher.cpp 9 | ) 10 | 11 | target_link_libraries(toolchain 12 | actor 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/serialization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(serialization_vectors_test 7 | serialization_vectors_test.cpp 8 | ) 9 | target_link_libraries(serialization_vectors_test 10 | rpc 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/storage/hamt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(hamt_test 7 | hamt_test.cpp 8 | ) 9 | target_link_libraries(hamt_test 10 | hamt 11 | hexutil 12 | ipfs_datastore_in_memory 13 | ) 14 | -------------------------------------------------------------------------------- /core/api/rpc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(rpc 7 | ws.cpp 8 | wsc.cpp 9 | web_socket_client_error.cpp 10 | ) 11 | target_link_libraries(rpc 12 | api 13 | json 14 | tipset 15 | ) 16 | -------------------------------------------------------------------------------- /core/storage/car/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(car 5 | car.cpp 6 | ) 7 | target_link_libraries(car 8 | file 9 | ipld_traverser 10 | p2p::p2p_uvarint 11 | ) 12 | 13 | add_subdirectory(cids_index) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(system_actor_v0 7 | system_actor.cpp 8 | ) 9 | target_link_libraries(system_actor_v0 10 | system_actor_state 11 | actor 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(system_actor_v2 7 | system_actor.cpp 8 | ) 9 | target_link_libraries(system_actor_v2 10 | system_actor_state 11 | actor 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(system_actor_v3 7 | system_actor.cpp 8 | ) 9 | target_link_libraries(system_actor_v3 10 | system_actor_state 11 | actor 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(builtin) 7 | 8 | addtest(invoker_test 9 | invoker_test.cpp 10 | ) 11 | target_link_libraries(invoker_test 12 | actor 13 | hamt 14 | ) 15 | -------------------------------------------------------------------------------- /core/crypto/bls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(bls_provider 7 | impl/bls_provider_impl.cpp 8 | ) 9 | 10 | target_link_libraries(bls_provider 11 | blob 12 | filecoin_ffi 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/multisig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(multisig_types 7 | transaction.cpp 8 | ) 9 | target_link_libraries(multisig_types 10 | actor 11 | address 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/storage/piece/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(piece_storage_test 7 | piece_storage_test.cpp 8 | ) 9 | target_link_libraries(piece_storage_test 10 | piece_storage 11 | in_memory_storage 12 | ) 13 | -------------------------------------------------------------------------------- /core/api/visit.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | namespace fc::api { 9 | 10 | template 11 | void visit(A &&a, const F &f) { 12 | visit(a, a, f); 13 | } 14 | } // namespace fc::api 15 | -------------------------------------------------------------------------------- /core/common/uri_parser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(uri_parser 5 | uri_parser.cpp 6 | percent_encoding.cpp 7 | ) 8 | # any library is linked to include GSL 9 | target_link_libraries(uri_parser 10 | outcome 11 | ) 12 | -------------------------------------------------------------------------------- /core/markets/discovery/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(discovery 7 | impl/discovery_impl.cpp 8 | ) 9 | target_link_libraries(discovery 10 | address 11 | cbor 12 | cbor_stream 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(verified_registry_actor_state 7 | bind_states.cpp 8 | ) 9 | target_link_libraries(verified_registry_actor_state 10 | cbor 11 | ) 12 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/reward/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(reward_actor_v2 7 | reward_actor.cpp 8 | ) 9 | target_link_libraries(reward_actor_v2 10 | reward_actor_state 11 | reward_actor_v0 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/markets/discovery/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(discovery_test 7 | discovery_test.cpp 8 | ) 9 | target_link_libraries(discovery_test 10 | address 11 | discovery 12 | in_memory_storage 13 | ) 14 | -------------------------------------------------------------------------------- /core/drand/example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_executable(drand_example 7 | drand_example.cpp 8 | ) 9 | target_link_libraries(drand_example 10 | Boost::boost 11 | clock 12 | drand_http 13 | logger 14 | ) 15 | -------------------------------------------------------------------------------- /core/markets/storage/chain_events/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(chain_events 7 | impl/chain_events_impl.cpp 8 | ) 9 | target_link_libraries(chain_events 10 | api_ipfs_datastore 11 | miner_actor_state 12 | ) 13 | -------------------------------------------------------------------------------- /core/storage/compacter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(compacter 5 | compacter.cpp 6 | queue.cpp 7 | ) 8 | target_link_libraries(compacter 9 | cids_index 10 | interpreter 11 | map_prefix 12 | tipset 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/fslock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(fslock_test 7 | fslock_test.cpp 8 | ) 9 | 10 | target_link_libraries(fslock_test 11 | fslock 12 | base_fs_test 13 | filestore 14 | ) 15 | -------------------------------------------------------------------------------- /test/core/vm/interpreter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(interpreter_cache_test 7 | interpreter_cache_test.cpp 8 | ) 9 | target_link_libraries(interpreter_cache_test 10 | interpreter 11 | in_memory_storage 12 | ) 13 | -------------------------------------------------------------------------------- /core/primitives/stored_counter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(stored_counter 7 | stored_counter.cpp 8 | ) 9 | target_link_libraries(stored_counter 10 | outcome 11 | p2p::p2p_uvarint 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(account_actor_v0 7 | account_actor.cpp 8 | ) 9 | target_link_libraries(account_actor_v0 10 | account_actor_state 11 | actor 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(init_actor_v0 7 | init_actor.cpp 8 | ) 9 | target_link_libraries(init_actor_v0 10 | init_actor_state 11 | actor 12 | outcome 13 | hamt 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(account_actor_v2 7 | account_actor.cpp 8 | ) 9 | target_link_libraries(account_actor_v2 10 | account_actor_state 11 | actor 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(account_actor_v3 7 | account_actor.cpp 8 | ) 9 | target_link_libraries(account_actor_v3 10 | account_actor_state 11 | actor 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/vm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | if (TESTING_ACTORS) 7 | add_subdirectory(actor) 8 | endif() 9 | 10 | add_subdirectory(exit_code) 11 | add_subdirectory(interpreter) 12 | add_subdirectory(message) 13 | add_subdirectory(state) 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(cron_actor_v0_test 7 | cron_actor_test.cpp 8 | ) 9 | target_link_libraries(cron_actor_v0_test 10 | cron_actor_v0 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(init_actor_v0_test 7 | init_actor_test.cpp 8 | ) 9 | target_link_libraries(init_actor_v0_test 10 | init_actor_v0 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(cron_actor_v2_test 7 | cron_actor_test.cpp 8 | ) 9 | target_link_libraries(cron_actor_v2_test 10 | cron_actor_v2 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(init_actor_v2_test 7 | init_actor_test.cpp 8 | ) 9 | target_link_libraries(init_actor_v2_test 10 | init_actor_v2 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/cron/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(cron_actor_v3_test 7 | cron_actor_test.cpp 8 | ) 9 | target_link_libraries(cron_actor_v3_test 10 | cron_actor_v3 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/init/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(init_actor_v3_test 7 | init_actor_test.cpp 8 | ) 9 | target_link_libraries(init_actor_v3_test 10 | init_actor_v3 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /core/api/storage_miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_miner_api 7 | storage_api.cpp 8 | ) 9 | target_link_libraries(storage_miner_api 10 | p2p::p2p 11 | remote_worker 12 | jwt 13 | miner_version 14 | ) 15 | -------------------------------------------------------------------------------- /core/api/wallet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(wallet 7 | local_wallet.cpp 8 | ledger_wallet.cpp 9 | ledger.cpp 10 | ) 11 | target_link_libraries(wallet 12 | address 13 | rpc 14 | ledger_filecoin 15 | ) 16 | -------------------------------------------------------------------------------- /core/markets/pieceio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(pieceio 7 | pieceio_impl.cpp 8 | pieceio_error.cpp 9 | ) 10 | target_link_libraries(pieceio 11 | comm_cid 12 | piece 13 | piece_data 14 | proofs 15 | ) 16 | -------------------------------------------------------------------------------- /core/common/fmt_fwd.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | namespace fmt { 9 | inline namespace v6 { 10 | template 11 | struct formatter; 12 | } // namespace v6 13 | } // namespace fmt 14 | -------------------------------------------------------------------------------- /core/storage/ipfs/api_ipfs_datastore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(api_ipfs_datastore 7 | api_ipfs_datastore.cpp 8 | api_ipfs_datastore_error.cpp 9 | ) 10 | target_link_libraries(api_ipfs_datastore 11 | outcome 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/codec/json/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(json_test 7 | json_test.cpp 8 | ) 9 | 10 | target_link_libraries(json_test 11 | api 12 | json 13 | address 14 | rle_plus_codec 15 | ) 16 | -------------------------------------------------------------------------------- /test/core/primitives/sector_file/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(sector_file_test 7 | sector_file_test.cpp 8 | ) 9 | 10 | target_link_libraries(sector_file_test 11 | sector_file 12 | base_fs_test 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/types/market/deal_info_manager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(deal_info_manager_test 7 | deal_info_manager_test.cpp 8 | ) 9 | target_link_libraries(deal_info_manager_test 10 | deal_info_manager 11 | ) 12 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(miner_actor_v0_test 7 | miner_actor_v0_test.cpp 8 | ) 9 | target_link_libraries(miner_actor_v0_test 10 | miner_actor_v0 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/state/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(state_tree_test 7 | state_tree_test.cpp 8 | ) 9 | target_link_libraries(state_tree_test 10 | hexutil 11 | ipfs_datastore_in_memory 12 | state_tree 13 | toolchain 14 | ) 15 | -------------------------------------------------------------------------------- /core/primitives/address/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(address 5 | address.cpp 6 | address_codec.cpp 7 | ) 8 | target_link_libraries(address 9 | Boost::boost 10 | blake2 11 | blob 12 | cbor 13 | outcome 14 | json 15 | ) 16 | -------------------------------------------------------------------------------- /core/sectorblocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(sectorblocks 7 | impl/blocks_impl.cpp 8 | ) 9 | 10 | target_link_libraries(sectorblocks 11 | outcome 12 | miner 13 | piece 14 | logger 15 | ) 16 | -------------------------------------------------------------------------------- /core/storage/leveldb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(leveldb 5 | leveldb.cpp 6 | leveldb_batch.cpp 7 | leveldb_error.cpp 8 | leveldb_cursor.cpp 9 | ) 10 | target_link_libraries(leveldb 11 | leveldb::leveldb 12 | logger 13 | ) 14 | -------------------------------------------------------------------------------- /core/storage/piece/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(piece_storage 7 | impl/piece_storage_impl.cpp 8 | impl/piece_storage_error.cpp 9 | ) 10 | target_link_libraries(piece_storage 11 | cbor 12 | outcome 13 | piece 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(miner_actor_v2 7 | miner_actor.cpp 8 | miner_actor_utils.cpp 9 | ) 10 | target_link_libraries(miner_actor_v2 11 | miner_actor_state 12 | miner_actor_v0 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(miner_actor_v3 7 | miner_actor.cpp 8 | miner_actor_utils.cpp 9 | ) 10 | target_link_libraries(miner_actor_v3 11 | miner_actor_state 12 | miner_actor_v2 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/types/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(deal_info_manager) 6 | 7 | addtest(deal_proposal_test 8 | deal_proposal_test.cpp 9 | ) 10 | target_link_libraries(deal_proposal_test 11 | market_types 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(account_actor_v0_test 7 | account_actor_test.cpp 8 | ) 9 | target_link_libraries(account_actor_v0_test 10 | account_actor_v0 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(account_actor_v2_test 7 | account_actor_test.cpp 8 | ) 9 | target_link_libraries(account_actor_v2_test 10 | account_actor_v2 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(miner_actor_v2_test 7 | miner_actor_v2_test.cpp 8 | ) 9 | target_link_libraries(miner_actor_v2_test 10 | miner_actor_v2 11 | ipfs_datastore_in_memory 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/reward/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(reward_actor_v2_test 7 | reward_actor_v2_test.cpp 8 | ) 9 | target_link_libraries(reward_actor_v2_test 10 | reward_actor_v2 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/account/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(account_actor_v3_test 7 | account_actor_test.cpp 8 | ) 9 | target_link_libraries(account_actor_v3_test 10 | account_actor_v3 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(miner_actor_v3_test 7 | miner_actor_v3_test.cpp 8 | ) 9 | target_link_libraries(miner_actor_v3_test 10 | miner_actor_v3 11 | ipfs_datastore_in_memory 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /test/libs/cpp-ledger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(cpp_ledger_test 7 | apdu_wrapper_test.cpp 8 | ledger_utils_test.cpp 9 | ledger_filecoin_test.cpp 10 | ) 11 | target_link_libraries(cpp_ledger_test 12 | ledger_filecoin 13 | ) 14 | -------------------------------------------------------------------------------- /core/blockchain/production/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | #Copyright Soramitsu Co., Ltd.All Rights Reserved. 3 | #SPDX - License - Identifier : Apache - 2.0 4 | # 5 | 6 | add_library(block_producer 7 | block_producer.cpp 8 | ) 9 | target_link_libraries(block_producer 10 | bls_provider 11 | interpreter 12 | tipset 13 | weight_calculator 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(payment_channel_actor_state 7 | bind_states.cpp 8 | ) 9 | target_link_libraries(payment_channel_actor_state 10 | address 11 | array 12 | cbor 13 | ) 14 | -------------------------------------------------------------------------------- /docker/interopnet/fuhon-node.cfg: -------------------------------------------------------------------------------- 1 | # use interopnet profile, corresponds to "make interopnet" lotus target 2 | profile=interopnet 3 | 4 | bootstrap=/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWNrfmrVfsEVP1c2RspsNGuL1K5gKq31q8bBSRPfR1CSEo 5 | bootstrap=/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWJm8N3QLEwa8cQvqG9chfwvfpVoXiNHeTZ2rbriU7k9xQ 6 | -------------------------------------------------------------------------------- /housekeeping/codecov.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -xe 2 | 3 | buildDir=$1 4 | token=$2 5 | 6 | which git 7 | 8 | 9 | if [ -z "$buildDir" ]; then 10 | echo "buildDir is empty" 11 | exit 1 12 | fi 13 | 14 | if [ -z "$token" ]; then 15 | echo "token arg is empty" 16 | exit 2 17 | fi 18 | 19 | bash <(curl -s https://codecov.io/bash) -s $buildDir -t $token 20 | -------------------------------------------------------------------------------- /test/core/storage/filestore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(filestore_test 5 | filesystem/filesystem_file_test.cpp 6 | filesystem/filesystem_filestore_test.cpp 7 | ) 8 | target_link_libraries(filestore_test 9 | base_fs_test 10 | filestore 11 | ) 12 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/multisig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(multisig_actor_state 7 | multisig_actor_state.cpp 8 | bind_states.cpp 9 | ) 10 | target_link_libraries(multisig_actor_state 11 | cbor 12 | multisig_types 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/market/deal_info_manager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | 7 | add_library(deal_info_manager 8 | impl/deal_info_manager_impl.cpp 9 | ) 10 | target_link_libraries(deal_info_manager 11 | logger 12 | tipset 13 | api 14 | ) 15 | -------------------------------------------------------------------------------- /test/core/api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(api_version_test 7 | version_test.cpp 8 | ) 9 | 10 | addtest(full_node_api_test 11 | full_node_api_test.cpp 12 | ) 13 | target_link_libraries(full_node_api_test 14 | api 15 | rpc 16 | ) 17 | -------------------------------------------------------------------------------- /test/core/sectorblocks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd.All Rights Reserved. 3 | # SPDX - License - Identifier : Apache - 2.0 4 | # 5 | 6 | addtest(sectorblocks_test 7 | sectorblocks_test.cpp) 8 | 9 | target_link_libraries(sectorblocks_test 10 | base_fs_test 11 | sectorblocks 12 | in_memory_storage 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/storage/ipfs/graphsync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(graphsync_acceptance_test 7 | graphsync_acceptance_test.cpp 8 | graphsync_acceptance_common.cpp 9 | ) 10 | target_link_libraries(graphsync_acceptance_test 11 | graphsync 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/multisig_actor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(multisig_actor_v0_test 7 | multisig_actor_test.cpp 8 | ) 9 | target_link_libraries(multisig_actor_v0_test 10 | multisig_actor_v0 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/multisig_actor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(multisig_actor_v2_test 7 | multisig_actor_test.cpp 8 | ) 9 | target_link_libraries(multisig_actor_v2_test 10 | multisig_actor_v2 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/multisig_actor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(multisig_actor_v3_test 7 | multisig_actor_test.cpp 8 | ) 9 | target_link_libraries(multisig_actor_v3_test 10 | multisig_actor_v3 11 | ipfs_datastore_in_memory 12 | ) 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/reward/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(reward_actor_v0 7 | reward_actor.cpp 8 | ) 9 | target_link_libraries(reward_actor_v0 10 | reward_actor_state 11 | actor 12 | address 13 | exit_code 14 | outcome 15 | ) 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/storage_power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_power_actor_v3 7 | storage_power_actor.cpp 8 | ) 9 | target_link_libraries(storage_power_actor_v3 10 | storage_power_actor_state 11 | storage_power_actor_v2 12 | ) 13 | -------------------------------------------------------------------------------- /libs/cpp-ledger/filecoin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(ledger_filecoin 7 | impl/ledger_filecoin_manager.cpp 8 | impl/ledger_filecoin_impl.cpp 9 | impl/utils.cpp 10 | ) 11 | target_link_libraries(ledger_filecoin 12 | ledger_device 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/storage/mpool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(mpool_test 7 | message_pool_test.cpp 8 | ) 9 | target_link_libraries(mpool_test 10 | car 11 | in_memory_storage 12 | interpreter 13 | ipfs_datastore_in_memory 14 | mpool 15 | ) 16 | -------------------------------------------------------------------------------- /core/codec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(cbor) 7 | add_subdirectory(json) 8 | add_subdirectory(rle) 9 | 10 | add_library(cbor_types 11 | cbor/cbor_types.cpp 12 | ) 13 | target_link_libraries(cbor_types 14 | address 15 | signature 16 | ) 17 | -------------------------------------------------------------------------------- /test/core/blockchain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(block_validator_test 7 | block_validator_test.cpp 8 | ) 9 | target_link_libraries(block_validator_test 10 | block_validator 11 | car 12 | in_memory_storage 13 | proof_param_provider 14 | ) 15 | -------------------------------------------------------------------------------- /core/codec/cbor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cbor 7 | cbor_decode_stream.cpp 8 | cbor_dump.cpp 9 | cbor_encode_stream.cpp 10 | cbor_errors.cpp 11 | cbor_resolve.cpp 12 | ) 13 | target_link_libraries(cbor 14 | cid 15 | outcome 16 | ) 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/multisig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(multisig_actor_v0 7 | multisig_actor.cpp 8 | multisig_actor_utils.cpp 9 | ) 10 | target_link_libraries(multisig_actor_v0 11 | multisig_actor_state 12 | actor 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/multisig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(multisig_actor_v2 7 | multisig_actor.cpp 8 | multisig_actor_utils.cpp 9 | ) 10 | target_link_libraries(multisig_actor_v2 11 | multisig_actor_state 12 | actor 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/multisig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(multisig_actor_v3 7 | multisig_actor.cpp 8 | multisig_actor_utils.cpp 9 | ) 10 | target_link_libraries(multisig_actor_v3 11 | multisig_actor_state 12 | actor 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/state/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(state_tree 7 | state_tree_error.cpp 8 | impl/state_tree_impl.cpp 9 | ) 10 | target_link_libraries(state_tree 11 | address_key 12 | Boost::boost 13 | dvm 14 | hamt 15 | init_actor_state 16 | ) 17 | -------------------------------------------------------------------------------- /deps/libsecp256k1.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(libsecp256k1 7 | libsecp256k1/src/gen_context.c 8 | libsecp256k1/src/secp256k1.c 9 | ) 10 | target_include_directories(libsecp256k1 PUBLIC 11 | libsecp256k1/include 12 | ) 13 | disable_clang_tidy(libsecp256k1) 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(storage_power_actor_v0_test 7 | storage_power_actor_v0_test.cpp 8 | ) 9 | target_link_libraries(storage_power_actor_v0_test 10 | ipfs_datastore_in_memory 11 | storage_power_actor_v0 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(storage_power_actor_v2_test 7 | storage_power_actor_v2_test.cpp 8 | ) 9 | target_link_libraries(storage_power_actor_v2_test 10 | ipfs_datastore_in_memory 11 | storage_power_actor_v2 12 | ) 13 | -------------------------------------------------------------------------------- /core/storage/filestore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(filestore 5 | filestore_error.cpp 6 | impl/filesystem/filesystem_file.cpp 7 | impl/filesystem/filesystem_filestore.cpp 8 | ) 9 | target_link_libraries(filestore 10 | Boost::filesystem 11 | outcome 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/proofs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd.All Rights Reserved. 3 | # SPDX - License - Identifier : Apache - 2.0 4 | # 5 | 6 | addtest(proofs_test 7 | proofs_test.cpp 8 | ) 9 | 10 | target_link_libraries(proofs_test 11 | proof_param_provider 12 | proofs 13 | piece 14 | base_fs_test 15 | piece_data 16 | ) 17 | -------------------------------------------------------------------------------- /test/core/storage/keystore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(keystore_test 5 | filesystem_keystore_test.cpp 6 | in_memory_keystore_test.cpp 7 | ) 8 | target_link_libraries(keystore_test 9 | address 10 | base_fs_test 11 | keystore 12 | secp256k1_provider 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(market_actor_v0_test 7 | market_actor_test.cpp 8 | ) 9 | target_link_libraries(market_actor_v0_test 10 | comm_cid 11 | ipfs_datastore_in_memory 12 | market_actor_v0 13 | piece 14 | ) 15 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(market_actor_v2_test 7 | market_actor_test.cpp 8 | ) 9 | target_link_libraries(market_actor_v2_test 10 | comm_cid 11 | ipfs_datastore_in_memory 12 | market_actor_v2 13 | piece 14 | ) 15 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(market_actor_v3_test 7 | market_actor_test.cpp 8 | ) 9 | target_link_libraries(market_actor_v3_test 10 | comm_cid 11 | ipfs_datastore_in_memory 12 | market_actor_v3 13 | piece 14 | ) 15 | -------------------------------------------------------------------------------- /test/testutil/mocks/std_function.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/std_function_signature.hpp" 9 | 10 | namespace fc { 11 | template 12 | using MockStdFunction = ::testing::MockFunction>; 13 | } // namespace fc 14 | -------------------------------------------------------------------------------- /cmake/Hunter/passwords.cmake: -------------------------------------------------------------------------------- 1 | hunter_upload_password( 2 | # REPO_OWNER + REPO = https://github.com/forexample/hunter-cache 3 | REPO_OWNER "soramitsu" 4 | REPO "hunter-binary-cache" 5 | 6 | # USERNAME = warchant 7 | USERNAME "$ENV{GITHUB_HUNTER_USERNAME}" 8 | 9 | # PASSWORD = GitHub token saved as a secure environment variable 10 | PASSWORD "$ENV{GITHUB_HUNTER_TOKEN}" 11 | ) 12 | -------------------------------------------------------------------------------- /core/clock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(clock 7 | chain_epoch_clock.cpp 8 | impl/chain_epoch_clock_impl.cpp 9 | impl/utc_clock_impl.cpp 10 | time.cpp 11 | ) 12 | target_link_libraries(clock 13 | Boost::date_time 14 | const 15 | outcome 16 | ) 17 | -------------------------------------------------------------------------------- /core/clock/impl/utc_clock_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "clock/utc_clock.hpp" 9 | 10 | namespace fc::clock { 11 | class UTCClockImpl : public UTCClock { 12 | public: 13 | microseconds nowMicro() const override; 14 | }; 15 | } // namespace fc::clock 16 | -------------------------------------------------------------------------------- /core/common/append.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc { 11 | template 12 | inline void append(std::vector &l, const std::vector &r) { 13 | l.insert(l.end(), r.begin(), r.end()); 14 | } 15 | } // namespace fc 16 | -------------------------------------------------------------------------------- /core/vm/message/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(message 7 | message.cpp 8 | impl/message_signer_impl.cpp 9 | ) 10 | 11 | target_link_libraries(message 12 | Boost::boost 13 | address 14 | logger 15 | keystore 16 | outcome 17 | signature 18 | ) 19 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(payment_channel_actor_v0_test 7 | payment_channel_actor_test.cpp 8 | ) 9 | target_link_libraries(payment_channel_actor_v0_test 10 | ipfs_datastore_in_memory 11 | payment_channel_actor_v0 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/reward/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(reward_actor_v0_test 7 | reward_actor_v0_test.cpp 8 | reward_actor_calculus_v0_test.cpp 9 | ) 10 | target_link_libraries(reward_actor_v0_test 11 | reward_actor_v0 12 | ipfs_datastore_in_memory 13 | ) 14 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(payment_channel_actor_v2_test 7 | payment_channel_actor_test.cpp 8 | ) 9 | target_link_libraries(payment_channel_actor_v2_test 10 | ipfs_datastore_in_memory 11 | payment_channel_actor_v2 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(payment_channel_actor_v3_test 7 | payment_channel_actor_test.cpp 8 | ) 9 | target_link_libraries(payment_channel_actor_v3_test 10 | ipfs_datastore_in_memory 11 | payment_channel_actor_v3 12 | ) 13 | -------------------------------------------------------------------------------- /cmake/clang-tidy.cmake: -------------------------------------------------------------------------------- 1 | if(NOT CLANG_TIDY_BIN) 2 | find_program(CLANG_TIDY_BIN clang-tidy) 3 | endif() 4 | 5 | if(NOT CLANG_TIDY_BIN) 6 | message(FATAL_ERROR "clang-tidy is not installed. Aborting...") 7 | else() 8 | message(STATUS "clang-tidy has been found: ${CLANG_TIDY_BIN}") 9 | endif() 10 | 11 | set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_BIN}) 12 | set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_BIN}) 13 | -------------------------------------------------------------------------------- /core/blockchain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(block_validator) 7 | add_subdirectory(production) 8 | 9 | add_library(weight_calculator 10 | impl/weight_calculator_impl.cpp 11 | ) 12 | target_link_libraries(weight_calculator 13 | state_tree 14 | tipset 15 | ) 16 | 17 | -------------------------------------------------------------------------------- /core/blockchain/block_validator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(block_validator 7 | validator.cpp 8 | ) 9 | target_link_libraries(block_validator 10 | bls_provider 11 | outcome 12 | address 13 | clock 14 | interpreter 15 | map_prefix 16 | tipset 17 | ) 18 | -------------------------------------------------------------------------------- /core/primitives/sector_file/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(sector_file 5 | sector_file.cpp) 6 | 7 | target_link_libraries(sector_file 8 | sector 9 | piece 10 | runs_utils 11 | logger 12 | piece_data 13 | comm_cid 14 | proofs 15 | ) 16 | -------------------------------------------------------------------------------- /core/vm/interpreter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(interpreter 7 | impl/interpreter_impl.cpp 8 | impl/cached_interpreter.cpp 9 | ) 10 | target_link_libraries(interpreter 11 | amt 12 | block_validator 13 | message 14 | runtime 15 | weight_calculator 16 | ) 17 | -------------------------------------------------------------------------------- /test/core/markets/storage/provider/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(stored_ask_test 7 | stored_ask_test.cpp 8 | ) 9 | target_link_libraries(stored_ask_test 10 | fuhon_stored_ask 11 | secp256k1_provider 12 | bls_provider 13 | in_memory_storage 14 | miner_types 15 | ) 16 | -------------------------------------------------------------------------------- /core/common/cmp.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #define FC_OPERATOR_NOT_EQUAL_2(L, R) \ 9 | inline bool operator!=(const L &l, const R &r) { \ 10 | return !(l == r); \ 11 | } 12 | #define FC_OPERATOR_NOT_EQUAL(T) FC_OPERATOR_NOT_EQUAL_2(T, T) 13 | -------------------------------------------------------------------------------- /core/primitives/tipset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(tipset 5 | chain.cpp 6 | file.cpp 7 | load.cpp 8 | tipset.cpp 9 | tipset_key.cpp 10 | ) 11 | target_link_libraries(tipset 12 | block 13 | cid 14 | const 15 | logger 16 | state_tree 17 | version 18 | ) 19 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(market_actor_state 7 | market_actor_state.cpp 8 | v3/market_actor_state.cpp 9 | bind_states.cpp 10 | ) 11 | target_link_libraries(market_actor_state 12 | cbor 13 | toolchain 14 | market_types 15 | ) 16 | -------------------------------------------------------------------------------- /test/core/codec/cbor/light_reader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(light_actor_reader_test 7 | light_actor_reader.cpp 8 | ) 9 | target_link_libraries(light_actor_reader_test 10 | cbor 11 | miner_actor_state 12 | storage_power_actor_state 13 | ipfs_datastore_in_memory 14 | ) 15 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(verified_registry_actor_v0_test 7 | verified_registry_actor_test.cpp 8 | ) 9 | target_link_libraries(verified_registry_actor_v0_test 10 | ipfs_datastore_in_memory 11 | verified_registry_actor_v0 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(verified_registry_actor_v2_test 7 | verified_registry_actor_test.cpp 8 | ) 9 | target_link_libraries(verified_registry_actor_v2_test 10 | ipfs_datastore_in_memory 11 | verified_registry_actor_v2 12 | ) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(account) 6 | add_subdirectory(cron) 7 | add_subdirectory(init) 8 | add_subdirectory(market) 9 | add_subdirectory(miner) 10 | add_subdirectory(multisig_actor) 11 | add_subdirectory(payment_channel) 12 | add_subdirectory(verified_registry) 13 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v3/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(verified_registry_actor_v3_test 7 | verified_registry_actor_test.cpp 8 | ) 9 | target_link_libraries(verified_registry_actor_v3_test 10 | ipfs_datastore_in_memory 11 | verified_registry_actor_v3 12 | ) 13 | -------------------------------------------------------------------------------- /test/testutil/resources/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | set(TEST_RESOURCES_PATH "${PROJECT_SOURCE_DIR}/test/testutil/resources") 7 | configure_file( 8 | "${PROJECT_SOURCE_DIR}/test/testutil/resources/resources.hpp.in" 9 | "${PROJECT_SOURCE_DIR}/test/testutil/resources/resources.hpp" 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /core/storage/filestore/path.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc::storage::filestore { 11 | 12 | /** Directory separator character */ 13 | const char DELIMITER = '/'; 14 | 15 | using Path = std::string; 16 | 17 | } // namespace fc::storage::filestore 18 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/storage_power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_power_actor_v2 7 | storage_power_actor.cpp 8 | storage_power_actor_utils.cpp 9 | ) 10 | target_link_libraries(storage_power_actor_v2 11 | storage_power_actor_state 12 | storage_power_actor_v0 13 | ) 14 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/system/system_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v2/system/system_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v2::system { 9 | 10 | const ActorExports exports{exportMethod()}; 11 | 12 | } // namespace fc::vm::actor::builtin::v2::system 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/system/system_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v3/system/system_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v3::system { 9 | 10 | const ActorExports exports{exportMethod()}; 11 | 12 | } // namespace fc::vm::actor::builtin::v3::system 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(payment_channel_actor_v3 7 | payment_channel_actor.cpp 8 | ) 9 | target_link_libraries(payment_channel_actor_v3 10 | payment_channel_actor_state 11 | actor 12 | array 13 | outcome 14 | signature 15 | ) 16 | -------------------------------------------------------------------------------- /core/crypto/secp256k1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(secp256k1_provider 5 | impl/secp256k1_provider_impl.cpp 6 | impl/secp256k1_sha256_provider_impl.cpp 7 | impl/secp256k1_error.cpp 8 | ) 9 | target_link_libraries(secp256k1_provider 10 | filecoin_sha 11 | libsecp256k1 12 | outcome 13 | ) 14 | -------------------------------------------------------------------------------- /core/primitives/rle_bitset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(rle_bitset INTERFACE) 7 | target_link_libraries(rle_bitset INTERFACE 8 | cbor 9 | rle_plus_codec 10 | ) 11 | 12 | add_library(runs_utils 13 | runs_utils.cpp 14 | ) 15 | target_link_libraries(runs_utils 16 | outcome 17 | ) 18 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/miner/v3/expiration.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/types/miner/v2/expiration.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::miner { 11 | using ExpirationQueue = v2::miner::ExpirationQueue; 12 | } // namespace fc::vm::actor::builtin::v3::miner 13 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(market_actor_v0 7 | market_actor.cpp 8 | market_actor_utils.cpp 9 | ) 10 | target_link_libraries(market_actor_v0 11 | market_actor_state 12 | actor 13 | array 14 | balance_table 15 | cid_key 16 | piece 17 | ) 18 | -------------------------------------------------------------------------------- /test/core/clock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(time_test 7 | time_test.cpp 8 | ) 9 | target_link_libraries(time_test 10 | clock 11 | ) 12 | 13 | addtest(chain_epoch_clock_test 14 | chain_epoch_clock_test.cpp 15 | ) 16 | target_link_libraries(chain_epoch_clock_test 17 | clock 18 | ) 19 | -------------------------------------------------------------------------------- /test/core/storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_subdirectory(amt) 5 | add_subdirectory(car) 6 | add_subdirectory(filestore) 7 | add_subdirectory(hamt) 8 | add_subdirectory(keystore) 9 | add_subdirectory(ipfs) 10 | add_subdirectory(leveldb) 11 | add_subdirectory(mpool) 12 | add_subdirectory(piece) 13 | add_subdirectory(unixfs) 14 | -------------------------------------------------------------------------------- /core/codec/cbor/cbor_dump.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc { 11 | using BytesIn = gsl::span; 12 | class CID; 13 | std::string dumpBytes(BytesIn); 14 | std::string dumpCid(const CID &); 15 | std::string dumpCbor(BytesIn); 16 | } // namespace fc 17 | -------------------------------------------------------------------------------- /core/markets/storage/client/import_manager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_market_import_manager 7 | import_manager.cpp 8 | ) 9 | target_link_libraries(storage_market_import_manager 10 | Boost::boost 11 | car 12 | file 13 | memory_indexed_car 14 | outcome 15 | unixfs 16 | ) 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/reward/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(reward_actor_state 7 | reward_actor_state.cpp 8 | v0/reward_actor_state.cpp 9 | v2/reward_actor_state.cpp 10 | bind_states.cpp 11 | ) 12 | target_link_libraries(reward_actor_state 13 | cbor 14 | reward_types 15 | ) 16 | -------------------------------------------------------------------------------- /core/vm/fvm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(fvm_stub 7 | stub.cpp 8 | ) 9 | target_link_libraries(fvm_stub 10 | blob 11 | ) 12 | 13 | add_library(fvm 14 | fvm.cpp 15 | ) 16 | target_link_libraries(fvm 17 | circulating 18 | filecoin_ffi 19 | outcome 20 | keystore 21 | ) 22 | -------------------------------------------------------------------------------- /core/adt/cid_key.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/cid/cid.hpp" 9 | 10 | namespace fc::adt { 11 | struct CidKeyer { 12 | using Key = CID; 13 | 14 | static Bytes encode(const Key &key); 15 | 16 | static outcome::result decode(BytesIn key); 17 | }; 18 | } // namespace fc::adt 19 | -------------------------------------------------------------------------------- /core/crypto/secp256k1/README.md: -------------------------------------------------------------------------------- 1 | Reference implementation is 2 | https://github.com/ipsn/go-secp256k1/blob/master/secp256.go 3 | (commit 4 | 43bfef0653c5a154ac1fff973f03b2664b394d3c). 5 | 6 | It is a standalone clone of of `secp256k1` from https://github.com/ethereum/go-ethereum repository. 7 | 8 | It uses as default: 9 | - SHA256 as digest algorithm 10 | - Uncompressed form of `PublicKey` 11 | - compact form of `Signature` 12 | -------------------------------------------------------------------------------- /core/api/types/ledger_key_info.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/address/address.hpp" 9 | 10 | namespace fc::api { 11 | using primitives::address::Address; 12 | 13 | struct LedgerKeyInfo { 14 | Address address; 15 | std::vector path; 16 | }; 17 | 18 | } // namespace fc::api 19 | -------------------------------------------------------------------------------- /core/node/node_version.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/git_commit_version/git_commit_version.hpp" 9 | 10 | namespace fc::node { 11 | using common::git_commit_version::getGitPrettyVersion; 12 | 13 | const std::string kNodeVersion = "Fuhon Node " + getGitPrettyVersion(); 14 | } // namespace fc::node 15 | -------------------------------------------------------------------------------- /core/vm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(actor) 7 | add_subdirectory(dvm) 8 | add_subdirectory(exit_code) 9 | add_subdirectory(fvm) 10 | add_subdirectory(interpreter) 11 | add_subdirectory(message) 12 | add_subdirectory(runtime) 13 | add_subdirectory(state) 14 | add_subdirectory(toolchain) 15 | add_subdirectory(version) 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(verified_registry_actor_v0 7 | verified_registry_actor.cpp 8 | verified_registry_actor_utils.cpp 9 | ) 10 | target_link_libraries(verified_registry_actor_v0 11 | verified_registry_actor_state 12 | actor 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(verified_registry_actor_v2 7 | verified_registry_actor.cpp 8 | verified_registry_actor_utils.cpp 9 | ) 10 | target_link_libraries(verified_registry_actor_v2 11 | verified_registry_actor_state 12 | actor 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/verified_registry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(verified_registry_actor_v3 7 | verified_registry_actor.cpp 8 | verified_registry_actor_utils.cpp 9 | ) 10 | target_link_libraries(verified_registry_actor_v3 11 | verified_registry_actor_state 12 | actor 13 | outcome 14 | ) 15 | -------------------------------------------------------------------------------- /core/miner/miner_version.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/git_commit_version/git_commit_version.hpp" 9 | 10 | namespace fc::miner { 11 | using common::git_commit_version::getGitPrettyVersion; 12 | 13 | const std::string kMinerVersion = "Fuhon Miner " + getGitPrettyVersion(); 14 | } // namespace fc::miner 15 | -------------------------------------------------------------------------------- /test/core/storage/unixfs/go/go.mod: -------------------------------------------------------------------------------- 1 | module unixfs 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/ipfs/go-blockservice v0.1.3 7 | github.com/ipfs/go-datastore v0.4.4 8 | github.com/ipfs/go-ipfs-blockstore v1.0.0 9 | github.com/ipfs/go-ipfs-chunker v0.0.5 10 | github.com/ipfs/go-ipfs-exchange-offline v0.0.1 11 | github.com/ipfs/go-merkledag v0.3.2 12 | github.com/ipfs/go-unixfs v0.2.4 13 | github.com/stretchr/testify v1.5.1 14 | ) 15 | -------------------------------------------------------------------------------- /core/clock/impl/utc_clock_impl.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "clock/impl/utc_clock_impl.hpp" 7 | 8 | namespace fc::clock { 9 | microseconds UTCClockImpl::nowMicro() const { 10 | return std::chrono::duration_cast( 11 | std::chrono::system_clock::now().time_since_epoch()); 12 | } 13 | } // namespace fc::clock 14 | -------------------------------------------------------------------------------- /core/remote_worker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_executable(remote_worker_main 7 | main.cpp 8 | remote_worker_api.cpp 9 | ) 10 | target_link_libraries(remote_worker_main 11 | Boost::program_options 12 | filecoin_config 13 | remote_index 14 | fetch_handler 15 | worker 16 | proof_param_provider 17 | ) 18 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/init/init_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v2/init/init_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v2::init { 9 | 10 | const ActorExports exports{ 11 | exportMethod(), 12 | exportMethod(), 13 | }; 14 | } // namespace fc::vm::actor::builtin::v2::init 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(market_actor_v2 7 | market_actor.cpp 8 | market_actor_utils.cpp 9 | ) 10 | target_link_libraries(market_actor_v2 11 | market_actor_state 12 | market_actor_v0 13 | actor 14 | array 15 | balance_table 16 | cid_key 17 | piece 18 | ) 19 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/init/init_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v3/init/init_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v3::init { 9 | 10 | const ActorExports exports{ 11 | exportMethod(), 12 | exportMethod(), 13 | }; 14 | } // namespace fc::vm::actor::builtin::v3::init 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(market_actor_v3 7 | market_actor.cpp 8 | market_actor_utils.cpp 9 | ) 10 | target_link_libraries(market_actor_v3 11 | market_actor_state 12 | market_actor_v2 13 | actor 14 | array 15 | balance_table 16 | cid_key 17 | piece 18 | ) 19 | -------------------------------------------------------------------------------- /core/primitives/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(address) 7 | add_subdirectory(block) 8 | add_subdirectory(cid) 9 | add_subdirectory(piece) 10 | add_subdirectory(resources) 11 | add_subdirectory(rle_bitset) 12 | add_subdirectory(sector) 13 | add_subdirectory(sector_file) 14 | add_subdirectory(stored_counter) 15 | add_subdirectory(tipset) 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/utils/init_actor_utils.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/utils/actor_utils.hpp" 9 | 10 | namespace fc::vm::actor::builtin::utils { 11 | 12 | using InitUtils = ActorUtils; 13 | using InitUtilsPtr = std::shared_ptr; 14 | 15 | } // namespace fc::vm::actor::builtin::utils 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/cron/cron_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v2/cron/cron_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v2::cron { 9 | 10 | const ActorExports exports{ 11 | exportMethod(), 12 | exportMethod(), 13 | }; 14 | } // namespace fc::vm::actor::builtin::v2::cron 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/cron/cron_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v3/cron/cron_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v3::cron { 9 | 10 | const ActorExports exports{ 11 | exportMethod(), 12 | exportMethod(), 13 | }; 14 | } // namespace fc::vm::actor::builtin::v3::cron 15 | -------------------------------------------------------------------------------- /core/clock/chain_epoch_clock.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "clock/chain_epoch_clock.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::clock, EpochAtTimeError, e) { 9 | using fc::clock::EpochAtTimeError; 10 | if (e == EpochAtTimeError::kBeforeGenesis) { 11 | return "Input time is before genesis time"; 12 | } 13 | return "Unknown error"; 14 | } 15 | -------------------------------------------------------------------------------- /core/common/libp2p/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cbor_stream 7 | cbor_buffering.cpp 8 | cbor_stream.cpp 9 | ) 10 | target_link_libraries(cbor_stream 11 | cbor 12 | ) 13 | 14 | add_library(stream_open_queue 15 | stream_open_queue.cpp 16 | ) 17 | target_link_libraries(stream_open_queue 18 | p2p::p2p 19 | ) 20 | -------------------------------------------------------------------------------- /core/sector_storage/fetch_handler.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "api/rpc/ws.hpp" 9 | #include "sector_storage/stores/store.hpp" 10 | 11 | namespace fc::sector_storage { 12 | 13 | api::AuthRouteHandler serveHttp( 14 | const std::shared_ptr &local_store); 15 | 16 | } // namespace fc::sector_storage 17 | -------------------------------------------------------------------------------- /core/storage/ipfs/api_ipfs_datastore/api_ipfs_datastore_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::storage::ipfs { 11 | 12 | enum class ApiIpfsDatastoreError { 13 | kNotSupproted = 1, 14 | }; 15 | 16 | } 17 | 18 | OUTCOME_HPP_DECLARE_ERROR(fc::storage::ipfs, ApiIpfsDatastoreError); 19 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/market/v2/pending_proposals.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/types/market/v0/pending_proposals.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v2::market { 11 | 12 | using PendingProposals = v0::market::PendingProposals; 13 | 14 | } // namespace fc::vm::actor::builtin::v2::market 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/utils/reward_actor_utils.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/utils/actor_utils.hpp" 9 | 10 | namespace fc::vm::actor::builtin::utils { 11 | 12 | using RewardUtils = ActorUtils; 13 | using RewardUtilsPtr = std::shared_ptr; 14 | 15 | } // namespace fc::vm::actor::builtin::utils 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(payment_channel_actor_v0 7 | payment_channel_actor.cpp 8 | payment_channel_actor_utils.cpp 9 | ) 10 | target_link_libraries(payment_channel_actor_v0 11 | payment_channel_actor_state 12 | actor 13 | array 14 | outcome 15 | signature 16 | ) 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/payment_channel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(payment_channel_actor_v2 7 | payment_channel_actor.cpp 8 | payment_channel_actor_utils.cpp 9 | ) 10 | target_link_libraries(payment_channel_actor_v2 11 | payment_channel_actor_state 12 | actor 13 | array 14 | outcome 15 | signature 16 | ) 17 | -------------------------------------------------------------------------------- /core/cli/validate/cid.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "cli/validate/with.hpp" 9 | #include "primitives/cid/cid.hpp" 10 | 11 | namespace fc { 12 | CLI_VALIDATE(CID) { 13 | return validateWith(out, values, [](const std::string &value) { 14 | return CID::fromString(value).value(); 15 | }); 16 | } 17 | } // namespace fc 18 | -------------------------------------------------------------------------------- /core/primitives/cid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cid 7 | cid.cpp 8 | ) 9 | 10 | target_link_libraries(cid 11 | Boost::boost 12 | blake2 13 | cbor 14 | p2p::p2p_cid 15 | ) 16 | 17 | add_library(comm_cid 18 | comm_cid.cpp 19 | ) 20 | 21 | target_link_libraries(comm_cid 22 | cid 23 | outcome 24 | ) 25 | -------------------------------------------------------------------------------- /core/crypto/sha/sha256.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc::crypto::sha { 11 | using Hash256 = std::array; 12 | 13 | inline Hash256 sha256(gsl::span input) { 14 | return libp2p::crypto::sha256(input).value(); 15 | } 16 | } // namespace fc::crypto::sha 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/verified_registry/policy.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/types.hpp" 9 | 10 | namespace fc::vm::actor::builtin::types::verified_registry { 11 | using primitives::StoragePower; 12 | 13 | extern StoragePower kMinVerifiedDealSize; 14 | } // namespace fc::vm::actor::builtin::types::verified_registry 15 | -------------------------------------------------------------------------------- /core/vm/state/state_tree_error.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/state/state_tree_error.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::vm::state, StateTreeError, e) { 9 | using fc::vm::state::StateTreeError; 10 | 11 | if (e == StateTreeError::kStateNotFound) { 12 | return "StateTreeError: state not found"; 13 | } 14 | return "unknown error"; 15 | } 16 | -------------------------------------------------------------------------------- /libs/cpp-ledger/ledger/utils.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "cpp-ledger/common/types.hpp" 9 | 10 | namespace ledger { 11 | 12 | std::string convertToString(const std::wstring &wstr); 13 | 14 | void put2bytes(Bytes &bytes, uint16_t value); 15 | 16 | uint16_t getFromBytes(Byte byte1, Byte byte2); 17 | 18 | } // namespace ledger 19 | -------------------------------------------------------------------------------- /test/core/primitives/rle_bitset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(rle_bitset_test 7 | rle_bitset_test.cpp 8 | ) 9 | target_link_libraries(rle_bitset_test 10 | rle_bitset 11 | hexutil 12 | ) 13 | 14 | addtest(runs_utils_test 15 | runs_utils_test.cpp 16 | ) 17 | 18 | target_link_libraries(runs_utils_test 19 | runs_utils 20 | ) 21 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/states/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(miner_actor_state_test 7 | miner_actor_state_v0_test.cpp 8 | miner_actor_state_v2_test.cpp 9 | miner_actor_state_v3_test.cpp 10 | ) 11 | target_link_libraries(miner_actor_state_test 12 | ipfs_datastore_in_memory 13 | miner_types 14 | miner_actor_state 15 | ) 16 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(account) 6 | add_subdirectory(cron) 7 | add_subdirectory(init) 8 | add_subdirectory(market) 9 | add_subdirectory(miner) 10 | add_subdirectory(multisig_actor) 11 | add_subdirectory(payment_channel) 12 | add_subdirectory(power) 13 | add_subdirectory(reward) 14 | add_subdirectory(verified_registry) 15 | -------------------------------------------------------------------------------- /test/core/vm/actor/builtin/v2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | add_subdirectory(account) 6 | add_subdirectory(cron) 7 | add_subdirectory(init) 8 | add_subdirectory(market) 9 | add_subdirectory(miner) 10 | add_subdirectory(multisig_actor) 11 | add_subdirectory(payment_channel) 12 | add_subdirectory(power) 13 | add_subdirectory(reward) 14 | add_subdirectory(verified_registry) 15 | -------------------------------------------------------------------------------- /core/common/endian.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include "common/bytes.hpp" 10 | 11 | namespace fc::common { 12 | inline void putUint64BigEndian(Bytes &l, uint64_t n) { 13 | l.resize(l.size() + sizeof(n)); 14 | boost::endian::store_big_u64(&(*(l.end() - sizeof(n))), n); 15 | } 16 | } // namespace fc::common 17 | -------------------------------------------------------------------------------- /core/common/git_commit_version/git_commit_version.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc::common::git_commit_version { 11 | 12 | /** 13 | * Returns string containing git most recent tag and commit hash. 14 | */ 15 | const std::string &getGitPrettyVersion(); 16 | } // namespace fc::common::git_commit_version 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/account/account_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v2/account/account_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v2::account { 9 | 10 | const ActorExports exports{ 11 | exportMethod(), 12 | exportMethod(), 13 | }; 14 | } // namespace fc::vm::actor::builtin::v2::account 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(account) 7 | add_subdirectory(cron) 8 | add_subdirectory(init) 9 | add_subdirectory(market) 10 | add_subdirectory(miner) 11 | add_subdirectory(multisig) 12 | add_subdirectory(payment_channel) 13 | add_subdirectory(storage_power) 14 | add_subdirectory(system) 15 | add_subdirectory(verified_registry) 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/account/account_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v3/account/account_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v3::account { 9 | 10 | const ActorExports exports{ 11 | exportMethod(), 12 | exportMethod(), 13 | }; 14 | } // namespace fc::vm::actor::builtin::v3::account 15 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/storage_power/storage_power_actor_utils.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v2/storage_power/storage_power_actor_utils.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::storage_power { 11 | using PowerUtils = v2::storage_power::PowerUtils; 12 | } // namespace fc::vm::actor::builtin::v3::storage_power 13 | -------------------------------------------------------------------------------- /core/adt/cid_key.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "adt/cid_key.hpp" 7 | #include "common/span.hpp" 8 | 9 | namespace fc::adt { 10 | Bytes CidKeyer::encode(const Key &key) { 11 | return key.toBytes().value(); 12 | } 13 | 14 | outcome::result CidKeyer::decode(BytesIn key) { 15 | return CID::fromBytes(key); 16 | } 17 | } // namespace fc::adt 18 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/market/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(deal_info_manager) 7 | 8 | add_library(market_types 9 | v0/pending_proposals.cpp 10 | v3/pending_proposals.cpp 11 | bind_types.cpp 12 | ) 13 | target_link_libraries(market_types 14 | PUBLIC utf8::utf8 15 | actor 16 | address 17 | const 18 | outcome 19 | ) 20 | -------------------------------------------------------------------------------- /core/storage/keystore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(keystore 5 | keystore.cpp 6 | keystore_error.cpp 7 | impl/filesystem/filesystem_keystore.cpp 8 | impl/in_memory/in_memory_keystore.cpp 9 | ) 10 | target_link_libraries(keystore 11 | address 12 | bls_provider 13 | filestore 14 | outcome 15 | secp256k1_provider 16 | signature 17 | ) 18 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(miner_actor_v0 7 | miner_actor.cpp 8 | miner_actor_utils.cpp 9 | ) 10 | target_link_libraries(miner_actor_v0 11 | miner_actor_state 12 | actor 13 | address 14 | array 15 | cbor 16 | exit_code 17 | map 18 | rle_bitset 19 | sector 20 | uvarint_key 21 | ) 22 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/init/init_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v0/init/init_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v2::init { 11 | 12 | using Construct = v0::init::Construct; 13 | using Exec = v0::init::Exec; 14 | 15 | extern const ActorExports exports; 16 | } // namespace fc::vm::actor::builtin::v2::init 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/init/init_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v2/init/init_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::init { 11 | 12 | using Construct = v2::init::Construct; 13 | using Exec = v2::init::Exec; 14 | 15 | extern const ActorExports exports; 16 | } // namespace fc::vm::actor::builtin::v3::init 17 | -------------------------------------------------------------------------------- /test/core/codec/cbor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(light_reader) 7 | 8 | addtest(cbor_test 9 | cbor_test.cpp 10 | ) 11 | target_link_libraries(cbor_test 12 | cbor 13 | hexutil 14 | ) 15 | 16 | addtest(cbor_buffering_test 17 | cbor_buffering_test.cpp 18 | ) 19 | target_link_libraries(cbor_buffering_test 20 | cbor_stream 21 | ) 22 | -------------------------------------------------------------------------------- /test/core/markets/retrieval/protocol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(retrieval_market_protocol_test 7 | retrieval_protocol_v0_0_1_test.cpp 8 | retrieval_protocol_v1_0_0_test.cpp 9 | query_protocol_v0_0_1_test.cpp 10 | query_protocol_v1_0_0_test.cpp 11 | ) 12 | target_link_libraries(retrieval_market_protocol_test 13 | address 14 | cbor 15 | ) 16 | -------------------------------------------------------------------------------- /core/markets/retrieval/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(retrieval_market_client 7 | impl/retrieval_client_impl.cpp 8 | impl/retrieval_client_error.cpp 9 | ) 10 | target_link_libraries(retrieval_market_client 11 | address 12 | logger 13 | cbor 14 | cbor_stream 15 | data_transfer 16 | filecoin_hasher 17 | ipld_traverser 18 | ) 19 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/system/system_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/actor_method.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v0::system { 11 | 12 | struct Construct : ActorMethodBase<1> { 13 | ACTOR_METHOD_DECL(); 14 | }; 15 | 16 | extern const ActorExports exports; 17 | 18 | } // namespace fc::vm::actor::builtin::v0::system 19 | -------------------------------------------------------------------------------- /core/codec/json/json_errors.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::codec::json { 11 | enum class JsonError { 12 | kWrongLength = 1, 13 | kWrongEnum, 14 | kWrongType, 15 | kOutOfRange, 16 | kWrongParams, 17 | }; 18 | } // namespace fc::api 19 | 20 | OUTCOME_HPP_DECLARE_ERROR(fc::codec::json , JsonError); 21 | -------------------------------------------------------------------------------- /core/api/rpc/web_socket_client_error.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "api/rpc/web_socket_client_error.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::api::rpc, WebSocketClientError, e) { 9 | using fc::api::rpc::WebSocketClientError; 10 | 11 | if (e == WebSocketClientError::kRpcErrorResponse) { 12 | return "RPC error: got error response"; 13 | } 14 | return "unknown error"; 15 | } 16 | -------------------------------------------------------------------------------- /core/common/git_commit_version/git_commit_version.cpp.in: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "common/git_commit_version/git_commit_version.hpp" 7 | 8 | namespace fc::common::git_commit_version { 9 | const std::string &getGitPrettyVersion() { 10 | static const std::string version{"@GIT_REPO_PRETTY_VERSION@"}; 11 | return version; 12 | } 13 | } // namespace fc::common::git_commit_version 14 | -------------------------------------------------------------------------------- /core/sector_storage/stores/storage_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::sector_storage::stores { 11 | 12 | enum class StorageError { 13 | kFileNotExist = 1, 14 | kFilesystemStatError, 15 | kConfigFileNotExist, 16 | }; 17 | 18 | } 19 | 20 | OUTCOME_HPP_DECLARE_ERROR(fc::sector_storage::stores, StorageError); 21 | -------------------------------------------------------------------------------- /core/cli/node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_executable(fuhon-node-cli 7 | main.cpp 8 | ) 9 | target_link_libraries(fuhon-node-cli 10 | cli 11 | rpc 12 | car 13 | memory_indexed_car 14 | unixfs 15 | api_ipfs_datastore 16 | file 17 | ) 18 | set_target_properties(fuhon-node-cli PROPERTIES 19 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin 20 | ) 21 | -------------------------------------------------------------------------------- /core/drand/impl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(drand_http 7 | http.cpp 8 | ) 9 | target_link_libraries(drand_http 10 | blob 11 | outcome 12 | json 13 | ) 14 | 15 | add_library(drand_beacon 16 | beaconizer.cpp 17 | ) 18 | target_link_libraries(drand_beacon 19 | bls_provider 20 | drand_http 21 | filecoin_sha 22 | p2p::p2p_byteutil 23 | ) 24 | -------------------------------------------------------------------------------- /core/markets/pieceio/pieceio_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::markets::pieceio { 11 | 12 | enum class PieceIOError { 13 | kCannotCreatePipe = 1, 14 | kCannotWritePipe, 15 | kCannotClosePipe, 16 | kFileNotExist, 17 | }; 18 | 19 | } 20 | 21 | OUTCOME_HPP_DECLARE_ERROR(fc::markets::pieceio, PieceIOError); 22 | -------------------------------------------------------------------------------- /core/sector_storage/zerocomm/zerocomm.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/cid/cid.hpp" 9 | #include "primitives/piece/piece.hpp" 10 | 11 | namespace fc::sector_storage::zerocomm { 12 | using primitives::piece::UnpaddedPieceSize; 13 | 14 | outcome::result getZeroPieceCommitment(const UnpaddedPieceSize &size); 15 | } // namespace fc::sector_storage::zerocomm 16 | -------------------------------------------------------------------------------- /core/storage/face/cow.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/bytes_cow.hpp" 9 | 10 | namespace fc::storage::face { 11 | template 12 | struct cow; 13 | 14 | template 15 | using cow_t = typename cow::type; 16 | 17 | template <> 18 | struct cow { 19 | using type = BytesCow; 20 | }; 21 | } // namespace fc::storage::face 22 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(account) 7 | add_subdirectory(cron) 8 | add_subdirectory(init) 9 | add_subdirectory(market) 10 | add_subdirectory(miner) 11 | add_subdirectory(multisig) 12 | add_subdirectory(payment_channel) 13 | add_subdirectory(reward) 14 | add_subdirectory(storage_power) 15 | add_subdirectory(system) 16 | add_subdirectory(verified_registry) 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(account) 7 | add_subdirectory(cron) 8 | add_subdirectory(init) 9 | add_subdirectory(market) 10 | add_subdirectory(miner) 11 | add_subdirectory(multisig) 12 | add_subdirectory(payment_channel) 13 | add_subdirectory(reward) 14 | add_subdirectory(storage_power) 15 | add_subdirectory(system) 16 | add_subdirectory(verified_registry) 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/payment_channel/payment_channel_actor_utils.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v2/payment_channel/payment_channel_actor_utils.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::payment_channel { 11 | using PaymentChannelUtils = v2::payment_channel::PaymentChannelUtils; 12 | } // namespace fc::vm::actor::builtin::v3::payment_channel 13 | -------------------------------------------------------------------------------- /test/core/primitives/address/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(address_codec_test 5 | address_codec_test.cpp 6 | ) 7 | target_link_libraries(address_codec_test 8 | address_key 9 | ) 10 | 11 | addtest(address_verifier_test 12 | address_verifier_test.cpp 13 | ) 14 | target_link_libraries(address_verifier_test 15 | address 16 | bls_provider 17 | secp256k1_provider 18 | ) 19 | -------------------------------------------------------------------------------- /test/testutil/mocks/primitives/stored_counter_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/stored_counter/stored_counter.hpp" 9 | 10 | #include 11 | 12 | namespace fc::primitives { 13 | 14 | class CounterMock : public Counter { 15 | public: 16 | MOCK_METHOD0(next, outcome::result()); 17 | }; 18 | 19 | } // namespace fc::primitives 20 | -------------------------------------------------------------------------------- /core/adt/address_key.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/bytes.hpp" 9 | #include "primitives/address/address.hpp" 10 | 11 | namespace fc::adt { 12 | struct AddressKeyer { 13 | using Key = primitives::address::Address; 14 | 15 | static Bytes encode(const Key &key); 16 | 17 | static outcome::result decode(BytesIn key); 18 | }; 19 | } // namespace fc::adt 20 | -------------------------------------------------------------------------------- /core/common/default_t.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | namespace fc::common { 9 | /** 10 | * Default value for codec value instantiation 11 | * In case of non default constructible type instantiate default value with 12 | * any constant 13 | * @tparam T - constructible type 14 | */ 15 | template 16 | inline T kDefaultT() { 17 | return {}; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/primitives/piece/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(piece 7 | impl/piece.cpp 8 | impl/piece_error.cpp 9 | ) 10 | 11 | target_link_libraries(piece 12 | cid 13 | outcome 14 | ) 15 | 16 | add_library(piece_data 17 | impl/piece_data.cpp 18 | ) 19 | 20 | target_link_libraries(piece_data 21 | Boost::filesystem 22 | ) 23 | -------------------------------------------------------------------------------- /core/storage/ipfs/impl/ipfs_datastore_error.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "storage/ipfs/ipfs_datastore_error.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::storage::ipfs, IpfsDatastoreError, e) { 9 | using fc::storage::ipfs::IpfsDatastoreError; 10 | 11 | if (e == IpfsDatastoreError::kNotFound) { 12 | return "IpfsDatastoreError: cid not found"; 13 | } 14 | return "unknown error"; 15 | } 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(account) 7 | add_subdirectory(cron) 8 | add_subdirectory(init) 9 | add_subdirectory(market) 10 | add_subdirectory(miner) 11 | add_subdirectory(multisig) 12 | add_subdirectory(payment_channel) 13 | add_subdirectory(reward) 14 | add_subdirectory(storage_power) 15 | add_subdirectory(system) 16 | add_subdirectory(verified_registry) 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/miner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(miner_actor_state 7 | miner_actor_state.cpp 8 | v0/miner_actor_state.cpp 9 | v2/miner_actor_state.cpp 10 | v3/miner_actor_state.cpp 11 | v4/miner_actor_state.cpp 12 | bind_states.cpp 13 | ) 14 | target_link_libraries(miner_actor_state 15 | cbor 16 | toolchain 17 | miner_types 18 | ) 19 | -------------------------------------------------------------------------------- /test/core/test_vectors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(test_vectors_test 7 | test.cpp 8 | fixed_randomness.cpp 9 | replaying_randomness.cpp 10 | ) 11 | target_link_libraries(test_vectors_test 12 | Boost::iostreams 13 | car 14 | interpreter 15 | ipfs_datastore_in_memory 16 | json 17 | proof_param_provider 18 | state_tree 19 | runtime 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /core/vm/state/state_tree_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::vm::state { 11 | 12 | /** 13 | * @brief Type of errors returned by StateTree 14 | */ 15 | enum class StateTreeError { 16 | kStateNotFound = 1, 17 | }; 18 | 19 | } // namespace fc::vm::state 20 | 21 | OUTCOME_HPP_DECLARE_ERROR(fc::vm::state, StateTreeError); 22 | -------------------------------------------------------------------------------- /test/core/paych/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(paych_maker_test 5 | maker_test.cpp 6 | ) 7 | target_link_libraries(paych_maker_test 8 | in_memory_storage 9 | paych_maker 10 | ) 11 | 12 | addtest(paych_vouchers_test 13 | vouchers_test.cpp 14 | ) 15 | target_link_libraries(paych_vouchers_test 16 | in_memory_storage 17 | ipfs_datastore_in_memory 18 | paych_vouchers 19 | ) 20 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/storage_power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_power_actor_state 7 | storage_power_actor_state.cpp 8 | v0/storage_power_actor_state.cpp 9 | v2/storage_power_actor_state.cpp 10 | bind_states.cpp 11 | ) 12 | target_link_libraries(storage_power_actor_state 13 | cbor 14 | address_key 15 | alpha_beta_filter 16 | storage_power_types 17 | ) 18 | -------------------------------------------------------------------------------- /core/vm/dvm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(dvm 7 | dvm.cpp 8 | ) 9 | target_link_libraries(dvm 10 | cbor 11 | exit_code 12 | logger 13 | ) 14 | 15 | add_executable(dvm_main 16 | main.cpp 17 | ) 18 | target_link_libraries(dvm_main 19 | car 20 | cids_index 21 | drand_beacon 22 | in_memory_storage 23 | interpreter 24 | ipfs_datastore_in_memory 25 | ) 26 | -------------------------------------------------------------------------------- /core/api/rpc/web_socket_client_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::api::rpc { 11 | 12 | /** 13 | * @brief Type of errors returned by StateTree 14 | */ 15 | enum class WebSocketClientError { 16 | kRpcErrorResponse = 1, 17 | }; 18 | 19 | } // namespace fc::api::rpc 20 | 21 | OUTCOME_HPP_DECLARE_ERROR(fc::api::rpc, WebSocketClientError); 22 | -------------------------------------------------------------------------------- /core/cli/validate/address.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "cli/validate/with.hpp" 9 | #include "primitives/address/address_codec.hpp" 10 | 11 | namespace fc::primitives::address { 12 | CLI_VALIDATE(Address) { 13 | return validateWith(out, values, [](const std::string &value) { 14 | return decodeFromString(value).value(); 15 | }); 16 | } 17 | } // namespace fc::primitives::address 18 | -------------------------------------------------------------------------------- /core/storage/piece/impl/piece_storage_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::storage::piece { 11 | 12 | /** 13 | * @enum Piece storage errors 14 | */ 15 | enum class PieceStorageError { kPieceNotFound = 1, kPayloadNotFound }; 16 | 17 | } // namespace fc::storage::piece 18 | 19 | OUTCOME_HPP_DECLARE_ERROR(fc::storage::piece, PieceStorageError); 20 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/cron/v0/cron_actor_state.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/states/cron/cron_actor_state.hpp" 9 | 10 | #include "codec/cbor/streams_annotation.hpp" 11 | 12 | namespace fc::vm::actor::builtin::v0::cron { 13 | struct CronActorState : states::CronActorState {}; 14 | CBOR_TUPLE(CronActorState, entries) 15 | } // namespace fc::vm::actor::builtin::v0::cron 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/miner/v3/miner_actor_state.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/states/miner/v3/miner_actor_state.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v3::miner { 9 | using namespace types::miner; 10 | 11 | outcome::result> MinerActorState::getInfo() const { 12 | return miner_info.get(); 13 | } 14 | 15 | } // namespace fc::vm::actor::builtin::v3::miner 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/miner/v4/miner_actor_state.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/states/miner/v4/miner_actor_state.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v4::miner { 9 | using namespace types::miner; 10 | 11 | outcome::result> MinerActorState::getInfo() const { 12 | return miner_info.get(); 13 | } 14 | 15 | } // namespace fc::vm::actor::builtin::v4::miner 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/storage_power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_power_actor_v0 7 | storage_power_actor.cpp 8 | storage_power_actor_utils.cpp 9 | ) 10 | target_link_libraries(storage_power_actor_v0 11 | storage_power_actor_state 12 | actor 13 | alpha_beta_filter 14 | block 15 | balance_table 16 | const 17 | hamt 18 | multimap 19 | uvarint_key 20 | ) 21 | -------------------------------------------------------------------------------- /test/core/adt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(balance_table_hamt_test 7 | balance_table_hamt_test.cpp 8 | ) 9 | target_link_libraries(balance_table_hamt_test 10 | balance_table 11 | ipfs_datastore_in_memory 12 | ) 13 | 14 | addtest(multimap_test 15 | multimap_test.cpp 16 | ) 17 | target_link_libraries(multimap_test 18 | hamt 19 | multimap 20 | ipfs_datastore_in_memory 21 | ) 22 | -------------------------------------------------------------------------------- /test/core/primitives/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(address) 7 | add_subdirectory(bitvec) 8 | add_subdirectory(cid) 9 | add_subdirectory(go) 10 | add_subdirectory(piece) 11 | add_subdirectory(rle_bitset) 12 | add_subdirectory(sector_file) 13 | add_subdirectory(tipset) 14 | 15 | addtest(big_int_test 16 | big_int_test.cpp 17 | ) 18 | target_link_libraries(big_int_test 19 | Boost::boost 20 | ) 21 | -------------------------------------------------------------------------------- /test/testutil/mocks/miner/precommit_policy_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "miner/storage_fsm/precommit_policy.hpp" 9 | 10 | #include 11 | 12 | namespace fc::mining { 13 | class PreCommitPolicyMock : public PreCommitPolicy { 14 | public: 15 | MOCK_METHOD1(expiration, outcome::result(gsl::span)); 16 | }; 17 | } // namespace fc::mining 18 | -------------------------------------------------------------------------------- /core/proofs/proof_param_provider.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/logger.hpp" 9 | #include "common/outcome.hpp" 10 | #include "gsl/span" 11 | #include "proofs/proof_param_provider_error.hpp" 12 | 13 | namespace fc::proofs { 14 | 15 | outcome::result getParams(const std::string ¶m_file, 16 | uint64_t storage_size); 17 | 18 | } // namespace fc::proofs 19 | -------------------------------------------------------------------------------- /core/storage/ipfs/ipfs_datastore_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::storage::ipfs { 11 | 12 | /** 13 | * @brief Type of errors returned by Keystore 14 | */ 15 | enum class IpfsDatastoreError { 16 | kNotFound = 1, 17 | }; 18 | 19 | } // namespace fc::storage::ipfs 20 | 21 | OUTCOME_HPP_DECLARE_ERROR(fc::storage::ipfs, IpfsDatastoreError); 22 | -------------------------------------------------------------------------------- /core/api/full_node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(api 7 | get_node.cpp 8 | make.cpp 9 | node_api_v1_wrapper.cpp 10 | ) 11 | target_link_libraries(api 12 | address 13 | block_producer 14 | cid 15 | const 16 | interpreter 17 | logger 18 | message 19 | miner_types 20 | msg_waiter 21 | node_version 22 | state_tree 23 | mpool 24 | sync 25 | jwt 26 | ) 27 | -------------------------------------------------------------------------------- /core/fslock/fslock_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::fslock { 11 | 12 | /** 13 | * @brief FSLock returns these types of errors 14 | */ 15 | enum class FSLockError { 16 | kFileLocked = 1, 17 | kIsDirectory, 18 | kUnknown = 1000, 19 | }; 20 | 21 | } // namespace fc::fslock 22 | 23 | OUTCOME_HPP_DECLARE_ERROR(fc::fslock, FSLockError); 24 | -------------------------------------------------------------------------------- /test/core/primitives/tipset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(tipset_test 5 | tipset_test.cpp 6 | file_test.cpp 7 | ) 8 | target_link_libraries(tipset_test 9 | base_fs_test 10 | ipfs_datastore_error 11 | tipset 12 | version 13 | ) 14 | 15 | addtest(load_test 16 | load_test.cpp 17 | ) 18 | target_link_libraries(load_test 19 | tipset 20 | ipfs_datastore_in_memory 21 | ) 22 | -------------------------------------------------------------------------------- /test/core/storage/leveldb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(leveldb_fs_test 5 | leveldb_fs_test.cpp 6 | ) 7 | target_link_libraries(leveldb_fs_test 8 | leveldb 9 | base_fs_test 10 | ) 11 | 12 | addtest(leveldb_integration_test 13 | leveldb_integration_test.cpp 14 | ) 15 | target_link_libraries(leveldb_integration_test 16 | leveldb 17 | hexutil 18 | base_leveldb_test 19 | Boost::filesystem 20 | ) 21 | -------------------------------------------------------------------------------- /cmake/clang-format.cmake: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE 2 | ALL_CXX_SOURCE_FILES 3 | src/*.[ch]pp 4 | src/*.[ch] 5 | test/*.[ch]pp 6 | test/*.[ch] 7 | ) 8 | 9 | # Adding clang-format target if executable is found 10 | if(NOT CLANG_FORMAT_BIN) 11 | find_program(CLANG_FORMAT_BIN "clang-format") 12 | endif() 13 | 14 | if(CLANG_FORMAT_BIN) 15 | message(STATUS "Target clang-format enabled") 16 | add_custom_target( 17 | clang-format 18 | COMMAND "${CLANG_FORMAT_BIN}" 19 | -i 20 | ${ALL_CXX_SOURCE_FILES} 21 | ) 22 | endif() 23 | -------------------------------------------------------------------------------- /core/storage/unixfs/unixfs.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package unixfs.pb; 4 | 5 | message Data { 6 | enum DataType { 7 | Raw = 0; 8 | Directory = 1; 9 | File = 2; 10 | Metadata = 3; 11 | Symlink = 4; 12 | HAMTShard = 5; 13 | } 14 | 15 | required DataType Type = 1; 16 | optional bytes Data = 2; 17 | optional uint64 filesize = 3; 18 | repeated uint64 blocksizes = 4; 19 | 20 | optional uint64 hashType = 5; 21 | optional uint64 fanout = 6; 22 | } 23 | 24 | message Metadata { 25 | optional string MimeType = 1; 26 | } 27 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/system/system_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v0/system/system_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v2::system { 11 | 12 | /** 13 | * System actor v2 is identical to System actor v0 14 | */ 15 | using Construct = v0::system::Construct; 16 | 17 | extern const ActorExports exports; 18 | 19 | } // namespace fc::vm::actor::builtin::v2::system 20 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/system/system_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v2/system/system_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::system { 11 | 12 | /** 13 | * System actor v3 is identical to System actor v2 14 | */ 15 | using Construct = v2::system::Construct; 16 | 17 | extern const ActorExports exports; 18 | 19 | } // namespace fc::vm::actor::builtin::v3::system 20 | -------------------------------------------------------------------------------- /test/core/markets/retrieval/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(protocol) 7 | 8 | addtest(retrieval_market_test 9 | retrieval_market_test.cpp 10 | ) 11 | target_link_libraries(retrieval_market_test 12 | retrieval_market_provider 13 | retrieval_market_client 14 | piece_storage 15 | in_memory_storage 16 | ipfs_datastore_in_memory 17 | map_prefix 18 | p2p::p2p 19 | p2p::p2p_literals 20 | ) 21 | -------------------------------------------------------------------------------- /test/testutil/mocks/clock/utc_clock_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #ifndef TEST_CORE_BLOCKCHAIN_MOCKS_UTC_CLOCK 7 | #define TEST_CORE_BLOCKCHAIN_MOCKS_UTC_CLOCK 8 | 9 | #include 10 | 11 | #include "clock/utc_clock.hpp" 12 | 13 | namespace fc::clock { 14 | class UTCClockMock : public UTCClock { 15 | public: 16 | MOCK_CONST_METHOD0(nowMicro, microseconds()); 17 | }; 18 | } // namespace fc::clock 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /core/common/git_commit_version/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_custom_target(git_commit_version_generated 7 | COMMAND ./git_commit_version.sh 8 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 9 | BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/git_commit_version.cpp 10 | ) 11 | add_library(git_commit_version 12 | git_commit_version.cpp 13 | ) 14 | add_dependencies(git_commit_version 15 | git_commit_version_generated 16 | ) 17 | -------------------------------------------------------------------------------- /core/markets/retrieval/provider/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(retrieval_market_provider 7 | impl/retrieval_provider_impl.cpp 8 | ) 9 | target_link_libraries(retrieval_market_provider 10 | address 11 | logger 12 | cbor 13 | cbor_stream 14 | tipset 15 | ipld_traverser 16 | map_prefix 17 | memory_indexed_car 18 | piece 19 | piece_data 20 | car 21 | miner 22 | manager 23 | ) 24 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/storage_power/v0/claim.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/types/storage_power/claim.hpp" 9 | 10 | #include "codec/cbor/streams_annotation.hpp" 11 | 12 | namespace fc::vm::actor::builtin::v0::storage_power { 13 | 14 | struct Claim : types::storage_power::Claim {}; 15 | CBOR_TUPLE(Claim, raw_power, qa_power) 16 | 17 | } // namespace fc::vm::actor::builtin::v0::storage_power 18 | -------------------------------------------------------------------------------- /core/api/wallet/ledger_wallet.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "api/wallet/wallet_api.hpp" 9 | #include "storage/map_prefix/prefix.hpp" 10 | 11 | namespace fc::api { 12 | using storage::MapPtr; 13 | 14 | class LedgerWallet { 15 | public: 16 | static void fillLedgerWalletApi(const std::shared_ptr &api, 17 | const MapPtr &store); 18 | }; 19 | 20 | } // namespace fc::api 21 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | 3 | [Docker BuildKit](https://docs.docker.com/develop/develop-images/build_enhancements/#to-enable-buildkit-builds) 4 | 5 | `DOCKER_BUILDKIT=1` environment variable must be set to enable BuildKit. 6 | 7 | ## Build 8 | 9 | To build docker image from the current context. It is advised to ignore binaries and large files from docker build context. 10 | 11 | docker build .. -f Dockerfile 12 | 13 | There are 2 targets `fuhon-node` and `fuhon-miner` declared in Dockerfile. To build a specific target use `-t` option. -------------------------------------------------------------------------------- /test/testutil/mocks/miner/events_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "miner/storage_fsm/events.hpp" 9 | 10 | #include 11 | 12 | namespace fc::mining { 13 | class EventsMock : public Events { 14 | public: 15 | MOCK_METHOD4(chainAt, 16 | outcome::result( 17 | HeightHandler, RevertHandler, EpochDuration, ChainEpoch)); 18 | }; 19 | } // namespace fc::mining 20 | -------------------------------------------------------------------------------- /core/storage/ipld/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | #Copyright Soramitsu Co., Ltd.All Rights Reserved. 3 | #SPDX - License - Identifier : Apache - 2.0 4 | # 5 | 6 | add_library(ipld_traverser 7 | traverser.cpp 8 | ) 9 | target_link_libraries(ipld_traverser 10 | cbor 11 | ) 12 | 13 | add_library(cids_ipld 14 | cids_ipld.cpp 15 | ) 16 | target_link_libraries(cids_ipld 17 | cid 18 | ) 19 | 20 | add_library(memory_indexed_car 21 | memory_indexed_car.cpp 22 | ) 23 | target_link_libraries(memory_indexed_car 24 | cbor 25 | ) 26 | -------------------------------------------------------------------------------- /cmake/modules/Findcppcodec.cmake: -------------------------------------------------------------------------------- 1 | #.rst: 2 | # Findcppcodec.cmake 3 | # ------------------ 4 | # Try to find cppcodec 5 | # 6 | # This will define the following variables: 7 | # 8 | # CPPCODEC_FOUND - system has cppcodec 9 | # CPPCODEC_INCLUDE_DIRS - cppcodec include directories 10 | # 11 | 12 | find_package(PkgConfig) 13 | if (PKG_CONFIG_FOUND) 14 | pkg_check_modules(PC_CPPCODEC cppcodec) 15 | endif() 16 | 17 | if (PC_CPPCODEC_FOUND) 18 | set(CPPCODEC_FOUND "${PC_CPPCODEC_FOUND}") 19 | set(CPPCODEC_INCLUDE_DIRS "${PC_CPPCODEC_INCLUDEDIR}") 20 | endif() 21 | -------------------------------------------------------------------------------- /core/common/git_commit_version/git_commit_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | GIT_REPO_PRETTY_VERSION=$(git describe --tags --always --dirty) || GIT_REPO_PRETTY_VERSION="git-unknown" 5 | FILE=$(sed -e "s/@GIT_REPO_PRETTY_VERSION@/$GIT_REPO_PRETTY_VERSION/g" git_commit_version.cpp.in) 6 | OLD_FILE=$(cat git_commit_version.cpp) || OLD_FILE="" 7 | HASH=$(echo "$FILE" | shasum) 8 | OLD_HASH=$(echo "$OLD_FILE" | shasum) 9 | 10 | if [ "$HASH" != "$OLD_HASH" ]; then 11 | echo "git_commit_version.sh: update" 12 | echo "$FILE" > git_commit_version.cpp 13 | fi 14 | -------------------------------------------------------------------------------- /core/common/std_function_signature.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc { 11 | template 12 | struct std_function_signature {}; 13 | 14 | template 15 | struct std_function_signature> { 16 | using type = T; 17 | }; 18 | 19 | template 20 | using std_function_signature_t = typename std_function_signature::type; 21 | } // namespace fc 22 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/system/system_actor_state.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/types/universal/universal.hpp" 9 | 10 | namespace fc::vm::actor::builtin::states { 11 | 12 | struct SystemActorState { 13 | virtual ~SystemActorState() = default; 14 | // empty state 15 | }; 16 | 17 | using SystemActorStatePtr = types::Universal; 18 | 19 | } // namespace fc::vm::actor::builtin::states 20 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/storage_power/v2/claim.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/types/storage_power/claim.hpp" 9 | 10 | #include "codec/cbor/streams_annotation.hpp" 11 | 12 | namespace fc::vm::actor::builtin::v2::storage_power { 13 | 14 | struct Claim : types::storage_power::Claim {}; 15 | CBOR_TUPLE(Claim, seal_proof_type, raw_power, qa_power) 16 | 17 | } // namespace fc::vm::actor::builtin::v2::storage_power 18 | -------------------------------------------------------------------------------- /core/clock/utc_clock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "clock/time.hpp" 9 | 10 | namespace fc::clock { 11 | /** 12 | * Provides current UTC time 13 | */ 14 | class UTCClock { 15 | public: 16 | inline auto nowUTC() const { 17 | return std::chrono::duration_cast(nowMicro()); 18 | } 19 | virtual microseconds nowMicro() const = 0; 20 | virtual ~UTCClock() = default; 21 | }; 22 | } // namespace fc::clock 23 | -------------------------------------------------------------------------------- /core/paych/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(paych_maker 7 | maker.cpp 8 | ) 9 | target_link_libraries(paych_maker 10 | map_prefix 11 | # TODO(turuslan): extract `getPaymentChannelCodeId` from toolchain 12 | toolchain 13 | ) 14 | 15 | add_library(paych_vouchers 16 | vouchers.cpp 17 | ) 18 | target_link_libraries(paych_vouchers 19 | map_prefix 20 | payment_channel_actor_state 21 | signature 22 | tipset 23 | ) 24 | -------------------------------------------------------------------------------- /core/fslock/fslock_error.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "fslock/fslock_error.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::fslock, FSLockError, e) { 9 | using fc::fslock::FSLockError; 10 | 11 | switch (e) { 12 | case (FSLockError::kFileLocked): 13 | return "FileLock: file is locked"; 14 | case (FSLockError::kIsDirectory): 15 | return "FileLock: cannot lock directory"; 16 | default: 17 | return "FileLock: unknown error"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/markets/storage/provider/storage_provider_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::markets::storage::provider { 11 | 12 | enum class StorageProviderError { 13 | kProviderStartError = 1, 14 | kStreamLookupError, 15 | kNotFoundSector, 16 | }; 17 | 18 | } // namespace fc::markets::storage::provider 19 | 20 | OUTCOME_HPP_DECLARE_ERROR(fc::markets::storage::provider, StorageProviderError); 21 | -------------------------------------------------------------------------------- /core/storage/ipfs/api_ipfs_datastore/api_ipfs_datastore_error.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "storage/ipfs/api_ipfs_datastore/api_ipfs_datastore_error.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::storage::ipfs, ApiIpfsDatastoreError, e) { 9 | using E = fc::storage::ipfs::ApiIpfsDatastoreError; 10 | if (e == E::kNotSupproted) { 11 | return "ApiIpfsDatastoreError: operation is not supported"; 12 | } 13 | return "ApiIpfsDatastoreError: unknown error"; 14 | } 15 | -------------------------------------------------------------------------------- /core/vm/actor/code.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include "common/cmp.hpp" 11 | 12 | namespace fc { 13 | struct ActorCodeCid : std::string_view {}; 14 | constexpr bool operator==(const ActorCodeCid &l, const ActorCodeCid &r) { 15 | return static_cast(l) 16 | == static_cast(r); 17 | } 18 | FC_OPERATOR_NOT_EQUAL(ActorCodeCid) 19 | } // namespace fc 20 | -------------------------------------------------------------------------------- /test/testutil/mocks/cpp-ledger/ledger_device_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include "cpp-ledger/ledger/ledger.hpp" 11 | 12 | namespace ledger { 13 | 14 | class MockLedgerDevice : public LedgerDevice { 15 | public: 16 | MOCK_CONST_METHOD1(Exchange, 17 | std::tuple(const Bytes &command)); 18 | MOCK_METHOD0(Close, void()); 19 | }; 20 | 21 | } // namespace ledger 22 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/system/v0/system_actor_state.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/states/system/system_actor_state.hpp" 9 | 10 | #include "codec/cbor/streams_annotation.hpp" 11 | 12 | namespace fc::vm::actor::builtin::v0::system { 13 | 14 | /// System actor state 15 | struct SystemActorState : states::SystemActorState {}; 16 | CBOR_TUPLE_0(SystemActorState) 17 | 18 | } // namespace fc::vm::actor::builtin::v0::system 19 | -------------------------------------------------------------------------------- /docker/docker-compose-mainnet.yml: -------------------------------------------------------------------------------- 1 | version: "3.0" 2 | 3 | services: 4 | fuhon-node: 5 | build: 6 | context: .. 7 | dockerfile: Dockerfile 8 | target: fuhon-node 9 | image: fuhon-node:develop-build 10 | ports: 11 | - "1234:1234" 12 | volumes: 13 | - ./mainnet:/tmp/fuhon 14 | fuhon-miner: 15 | build: 16 | context: .. 17 | dockerfile: Dockerfile 18 | target: fuhon-miner 19 | image: fuhon-miner:develop-build 20 | volumes: 21 | - ./mainnet:/tmp/fuhon 22 | depends_on: 23 | - fuhon-node 24 | -------------------------------------------------------------------------------- /core/adt/address_key.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "adt/address_key.hpp" 7 | #include "common/span.hpp" 8 | 9 | #include "primitives/address/address_codec.hpp" 10 | 11 | namespace fc::adt { 12 | Bytes AddressKeyer::encode(const Key &key) { 13 | return Bytes{primitives::address::encode(key)}; 14 | } 15 | 16 | outcome::result AddressKeyer::decode(BytesIn key) { 17 | return primitives::address::decode(key); 18 | } 19 | } // namespace fc::adt 20 | -------------------------------------------------------------------------------- /core/common/libp2p/multi/multiaddress_fmt.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | template <> 12 | struct fmt::formatter 13 | : formatter { 14 | template 15 | auto format(const libp2p::multi::Multiaddress &address, C &ctx) { 16 | return formatter::format(address.getStringAddress(), ctx); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /core/config/profile_config.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc::config { 11 | using boost::program_options::options_description; 12 | 13 | /** 14 | * Creates program option description for 'profile' and initialize parameters 15 | * according the profile. 16 | * 17 | * @return profile program option description 18 | */ 19 | options_description configProfile(); 20 | } // namespace fc::config 21 | -------------------------------------------------------------------------------- /core/primitives/chain_epoch/chain_epoch.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc::primitives { 11 | 12 | /** 13 | * @brief epoch index type represents a round of a blockchain protocol, which 14 | * acts as a proxy for time within the VM 15 | */ 16 | using ChainEpoch = int64_t; 17 | 18 | using EpochDuration = int64_t; 19 | 20 | constexpr ChainEpoch kChainEpochUndefined{-1}; 21 | 22 | } // namespace fc::primitives 23 | -------------------------------------------------------------------------------- /core/storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(amt) 7 | add_subdirectory(car) 8 | add_subdirectory(chain) 9 | add_subdirectory(compacter) 10 | add_subdirectory(filestore) 11 | add_subdirectory(hamt) 12 | add_subdirectory(in_memory) 13 | add_subdirectory(ipfs) 14 | add_subdirectory(ipld) 15 | add_subdirectory(keystore) 16 | add_subdirectory(leveldb) 17 | add_subdirectory(map_prefix) 18 | add_subdirectory(mpool) 19 | add_subdirectory(piece) 20 | add_subdirectory(unixfs) 21 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/methods/system.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/actor_method.hpp" 9 | 10 | namespace fc::vm::actor::builtin::system { 11 | 12 | // These methods must be actual with the last version of actors 13 | 14 | enum class SystemActor : MethodNumber { 15 | kConstruct = 1, 16 | }; 17 | 18 | struct Construct : ActorMethodBase {}; 19 | 20 | } // namespace fc::vm::actor::builtin::system 21 | -------------------------------------------------------------------------------- /docker/docker-compose-interopnet.yml: -------------------------------------------------------------------------------- 1 | version: "3.0" 2 | 3 | services: 4 | fuhon-node: 5 | build: 6 | context: .. 7 | dockerfile: Dockerfile 8 | target: fuhon-node 9 | image: fuhon-node:develop-build 10 | ports: 11 | - "1234:1234" 12 | volumes: 13 | - ./interopnet:/tmp/fuhon 14 | fuhon-miner: 15 | build: 16 | context: .. 17 | dockerfile: Dockerfile 18 | target: fuhon-miner 19 | image: fuhon-miner:develop-build 20 | volumes: 21 | - ./interopnet:/tmp/fuhon 22 | depends_on: 23 | - fuhon-node 24 | -------------------------------------------------------------------------------- /cmake/toolchain/flags/sanitize_undefined.cmake: -------------------------------------------------------------------------------- 1 | if (DEFINED POLLY_FLAGS_SANITIZE_UNDEFINED_CMAKE_) 2 | return() 3 | else () 4 | set(POLLY_FLAGS_SANITIZE_UNDEFINED_CMAKE_ 1) 5 | endif () 6 | 7 | include(${CMAKE_CURRENT_LIST_DIR}/../../toolchain-util.cmake) 8 | 9 | set(FLAGS 10 | -fsanitize=undefined 11 | -fno-omit-frame-pointer 12 | -ferror-limit=0 13 | -g 14 | ) 15 | foreach(FLAG IN LISTS FLAGS) 16 | add_cache_flag(CMAKE_CXX_FLAGS ${FLAG}) 17 | add_cache_flag(CMAKE_C_FLAGS ${FLAG}) 18 | endforeach() 19 | 20 | 21 | set(ENV{UBSAN_OPTIONS} print_stacktrace=1) 22 | -------------------------------------------------------------------------------- /core/codec/cbor/fwd.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/bytes.hpp" 9 | #include "common/outcome.hpp" 10 | 11 | namespace fc::codec::cbor { 12 | template 13 | // NOLINTNEXTLINE(readability-redundant-declaration) 14 | outcome::result encode(const T &arg); 15 | 16 | template 17 | // NOLINTNEXTLINE(readability-redundant-declaration) 18 | outcome::result decode(BytesIn input); 19 | } // namespace fc::codec::cbor 20 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/payment_channel/payment_channel_actor.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v3/payment_channel/payment_channel_actor.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v3::payment_channel { 9 | const ActorExports exports{ 10 | exportMethod(), 11 | exportMethod(), 12 | exportMethod(), 13 | exportMethod(), 14 | }; 15 | } // namespace fc::vm::actor::builtin::v3::payment_channel 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v0/storage_power/storage_power_actor_utils.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "vm/actor/builtin/v0/storage_power/storage_power_actor_utils.hpp" 7 | 8 | namespace fc::vm::actor::builtin::v0::storage_power { 9 | outcome::result PowerUtils::validateMinerHasClaim( 10 | PowerActorStatePtr &state, const Address &miner) const { 11 | // Do nothing for v0 12 | return outcome::success(); 13 | } 14 | } // namespace fc::vm::actor::builtin::v0::storage_power 15 | -------------------------------------------------------------------------------- /core/miner/storage_fsm/precommit_policy.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "miner/storage_fsm/types.hpp" 9 | #include "primitives/chain_epoch/chain_epoch.hpp" 10 | 11 | namespace fc::mining { 12 | using primitives::ChainEpoch; 13 | 14 | class PreCommitPolicy { 15 | public: 16 | virtual ~PreCommitPolicy() = default; 17 | 18 | virtual outcome::result expiration(gsl::span pieces) = 0; 19 | }; 20 | 21 | } // namespace fc::mining 22 | -------------------------------------------------------------------------------- /libs/cpp-ledger/ledger/ledger_admin_hid.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "cpp-ledger/ledger/ledger.hpp" 9 | 10 | namespace ledger { 11 | 12 | class LedgerAdminHid : public LedgerAdmin { 13 | public: 14 | int CountDevices() const override; 15 | std::tuple ListDevices() const override; 16 | std::tuple, Error> Connect( 17 | int deviceIndex) const override; 18 | }; 19 | 20 | } // namespace ledger 21 | -------------------------------------------------------------------------------- /cmake/toolchain/flags/sanitize_memory.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, Ruslan Baratov 2 | # All rights reserved. 3 | 4 | if (DEFINED POLLY_FLAGS_SANITIZE_MEMORY_CMAKE_) 5 | return() 6 | else () 7 | set(POLLY_FLAGS_SANITIZE_MEMORY_CMAKE_ 1) 8 | endif () 9 | 10 | include(${CMAKE_CURRENT_LIST_DIR}/../../toolchain-util.cmake) 11 | 12 | set(FLAGS 13 | -fsanitize=memory 14 | -fsanitize-memory-track-origins 15 | -ferror-limit=0 16 | -g 17 | ) 18 | foreach(FLAG IN LISTS FLAGS) 19 | add_cache_flag(CMAKE_CXX_FLAGS ${FLAG}) 20 | add_cache_flag(CMAKE_C_FLAGS ${FLAG}) 21 | endforeach() 22 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/account/v0/account_actor_state.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/states/account/account_actor_state.hpp" 9 | 10 | #include "codec/cbor/streams_annotation.hpp" 11 | #include "primitives/address/address_codec.hpp" 12 | 13 | namespace fc::vm::actor::builtin::v0::account { 14 | struct AccountActorState : states::AccountActorState {}; 15 | CBOR_TUPLE(AccountActorState, address) 16 | } // namespace fc::vm::actor::builtin::v0::account 17 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/account/account_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v0/account/account_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v2::account { 11 | 12 | /** 13 | * Account actor v2 is identical to Account actor v0 14 | */ 15 | using Construct = v0::account::Construct; 16 | using PubkeyAddress = v0::account::PubkeyAddress; 17 | 18 | extern const ActorExports exports; 19 | } // namespace fc::vm::actor::builtin::v2::account 20 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/account/account_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v2/account/account_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::account { 11 | 12 | /** 13 | * Account actor v3 is identical to Account actor v2 14 | */ 15 | using Construct = v2::account::Construct; 16 | using PubkeyAddress = v2::account::PubkeyAddress; 17 | 18 | extern const ActorExports exports; 19 | } // namespace fc::vm::actor::builtin::v3::account 20 | -------------------------------------------------------------------------------- /test/testutil/context_wait.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | inline void stopAfterSteps(boost::asio::io_context &io, size_t steps) { 11 | io.post([&io, steps] { 12 | if (steps == 0) { 13 | return io.stop(); 14 | } 15 | stopAfterSteps(io, steps - 1); 16 | }); 17 | } 18 | 19 | inline void runForSteps(boost::asio::io_context &io, size_t steps) { 20 | stopAfterSteps(io, steps); 21 | io.restart(); 22 | io.run(); 23 | } 24 | -------------------------------------------------------------------------------- /core/common/prometheus/since.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace fc { 11 | struct Since { 12 | using Clock = std::chrono::steady_clock; 13 | 14 | Clock::time_point start{Clock::now()}; 15 | 16 | template 17 | T ms() const { 18 | return std::chrono::duration_cast>( 19 | Clock::now() - start) 20 | .count(); 21 | } 22 | }; 23 | } // namespace fc 24 | -------------------------------------------------------------------------------- /core/storage/car/cids_index/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(cids_index 7 | cids_index.cpp 8 | ) 9 | target_link_libraries(cids_index 10 | cid 11 | cids_ipld 12 | car 13 | file 14 | ipfs_datastore_error 15 | ) 16 | 17 | add_executable(cids-index 18 | main.cpp 19 | ) 20 | target_link_libraries(cids-index 21 | cids_index 22 | ) 23 | 24 | set_target_properties(cids-index PROPERTIES 25 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin 26 | ) 27 | -------------------------------------------------------------------------------- /test/testutil/storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | add_library(base_fs_test 5 | base_fs_test.hpp 6 | base_fs_test.cpp 7 | ) 8 | target_link_libraries(base_fs_test 9 | Boost::filesystem 10 | Boost::boost 11 | logger 12 | ) 13 | 14 | add_library(base_leveldb_test 15 | base_leveldb_test.hpp 16 | base_leveldb_test.cpp 17 | ) 18 | target_link_libraries(base_leveldb_test 19 | base_fs_test 20 | Boost::filesystem 21 | Boost::boost 22 | logger 23 | leveldb 24 | ) 25 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v2/cron/cron_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/actor_method.hpp" 9 | #include "vm/actor/builtin/v0/cron/cron_actor.hpp" 10 | 11 | namespace fc::vm::actor::builtin::v2::cron { 12 | 13 | /** 14 | * Cron actor v2 is identical to Cron actor v0 15 | */ 16 | using Construct = v0::cron::Construct; 17 | using EpochTick = v0::cron::EpochTick; 18 | 19 | extern const ActorExports exports; 20 | 21 | } // namespace fc::vm::actor::builtin::v2::cron 22 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/cron/cron_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/actor_method.hpp" 9 | #include "vm/actor/builtin/v2/cron/cron_actor.hpp" 10 | 11 | namespace fc::vm::actor::builtin::v3::cron { 12 | 13 | /** 14 | * Cron actor v3 is identical to Cron actor v2 15 | */ 16 | using Construct = v2::cron::Construct; 17 | using EpochTick = v2::cron::EpochTick; 18 | 19 | extern const ActorExports exports; 20 | 21 | } // namespace fc::vm::actor::builtin::v3::cron 22 | -------------------------------------------------------------------------------- /test/core/api/version_test.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include 7 | 8 | #include "api/version.hpp" 9 | 10 | namespace fc::api { 11 | /** 12 | * Test API version compatibility with Lotus. 13 | */ 14 | TEST(ApiVersionTest, Version) { 15 | EXPECT_EQ(0x000C00, makeApiVersion(0, 12, 0)); 16 | EXPECT_EQ(0x010000, makeApiVersion(1, 0, 0)); 17 | EXPECT_EQ(0x0000FF, makeApiVersion(0, 0, 255)); 18 | EXPECT_EQ(0x010203, makeApiVersion(1, 2, 3)); 19 | } 20 | } // namespace fc::api 21 | -------------------------------------------------------------------------------- /core/clock/impl/chain_epoch_clock_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "clock/chain_epoch_clock.hpp" 9 | 10 | namespace fc::clock { 11 | class ChainEpochClockImpl : public ChainEpochClock { 12 | public: 13 | explicit ChainEpochClockImpl(UnixTime genesis_time); 14 | UnixTime genesisTime() const override; 15 | outcome::result epochAtTime(UnixTime time) const override; 16 | 17 | private: 18 | UnixTime genesis_time_; 19 | }; 20 | } // namespace fc::clock 21 | -------------------------------------------------------------------------------- /core/crypto/secp256k1/secp256k1_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::crypto::secp256k1 { 11 | 12 | enum class Secp256k1Error { 13 | kKeyGenerationFailed = 1, 14 | kSignatureParseError, 15 | kSignatureSerializationError, 16 | kCannotSignError, 17 | kPubkeyParseError, 18 | kPubkeySerializationError, 19 | kRecoverError, 20 | }; 21 | 22 | } 23 | 24 | OUTCOME_HPP_DECLARE_ERROR(fc::crypto::secp256k1, Secp256k1Error); 25 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/payment_channel/policy.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/types.hpp" 9 | 10 | namespace fc::vm::actor::builtin::types::payment_channel { 11 | using primitives::EpochDuration; 12 | 13 | constexpr size_t kLaneLimit{INT64_MAX}; 14 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) 15 | extern EpochDuration kSettleDelay; 16 | constexpr size_t kMaxSecretSize{256}; 17 | } // namespace fc::vm::actor::builtin::types::payment_channel 18 | -------------------------------------------------------------------------------- /test/core/common/bitsutil_test.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "common/bitsutil.hpp" 7 | #include 8 | 9 | namespace fc::common { 10 | 11 | /** 12 | * Check trailing zeroes counting 13 | */ 14 | TEST(Bitsutil, countTrailingZeros) { 15 | EXPECT_EQ(64, countTrailingZeros(0)); 16 | uint64_t x = 1; 17 | for (int zeroes = 0; zeroes < 64; ++zeroes) { 18 | EXPECT_EQ(zeroes, countTrailingZeros(x)); 19 | x = x << 1; 20 | } 21 | } 22 | 23 | } // namespace fc::common 24 | -------------------------------------------------------------------------------- /test/testutil/mocks/markets/storage/chain_events/chain_events_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "markets/storage/chain_events/chain_events.hpp" 9 | 10 | #include 11 | 12 | namespace fc::markets::storage::chain_events { 13 | 14 | class ChainEventsMock : public ChainEvents { 15 | public: 16 | MOCK_METHOD3(onDealSectorCommitted, 17 | void(const Address &, const DealId &, CommitCb)); 18 | }; 19 | 20 | } // namespace fc::markets::storage::chain_events 21 | -------------------------------------------------------------------------------- /core/drand/impl/http.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/async.hpp" 9 | #include "drand/messages.hpp" 10 | #include "fwd.hpp" 11 | 12 | namespace fc::drand::http { 13 | using boost::asio::io_context; 14 | 15 | void getInfo(io_context &io, const std::string& host, CbT cb); 16 | 17 | void getEntry(io_context &io, 18 | const std::string &host, 19 | uint64_t round, 20 | CbT cb); 21 | } // namespace fc::drand::http 22 | -------------------------------------------------------------------------------- /core/primitives/piece/piece_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::primitives::piece { 11 | 12 | /** 13 | * @brief Pieces returns these types of errors 14 | */ 15 | enum class PieceError { 16 | kLessThatMinimumSize = 1, 17 | kLessThatMinimumPaddedSize, 18 | kInvalidUnpaddedSize, 19 | kInvalidPaddedSize, 20 | }; 21 | 22 | } // namespace fc::primitives::piece 23 | 24 | OUTCOME_HPP_DECLARE_ERROR(fc::primitives::piece, PieceError); 25 | -------------------------------------------------------------------------------- /core/storage/ipfs/graphsync/extension_dedup.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "codec/cbor/cbor_codec.hpp" 9 | #include "storage/ipfs/graphsync/extension.hpp" 10 | 11 | namespace fc::storage::ipfs::graphsync::extension::dedup { 12 | constexpr std::string_view kName{"graphsync/dedup-by-key"}; 13 | 14 | inline Extension make(const std::string_view &key) { 15 | return {std::string{kName}, codec::cbor::encode(key).value()}; 16 | } 17 | } // namespace fc::storage::ipfs::graphsync::extension::dedup 18 | -------------------------------------------------------------------------------- /core/vm/runtime/consensus_fault_types.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/types.hpp" 9 | 10 | namespace fc { 11 | using primitives::ActorId; 12 | using primitives::ChainEpoch; 13 | 14 | enum class ConsensusFaultType : int64_t { 15 | DoubleForkMining = 1, 16 | ParentGrinding = 2, 17 | TimeOffsetMining = 3, 18 | }; 19 | 20 | struct ConsensusFault { 21 | ActorId target{}; 22 | ChainEpoch epoch{}; 23 | ConsensusFaultType type{}; 24 | }; 25 | } // namespace fc 26 | -------------------------------------------------------------------------------- /test/core/storage/ipfs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | addtest(datastore_integration_test 5 | datastore_integration_test.cpp 6 | ) 7 | target_link_libraries(datastore_integration_test 8 | p2p::p2p_random_generator 9 | ipfs_datastore_leveldb 10 | ) 11 | 12 | addtest(in_memory_ipfs_datastore_test 13 | in_memory_ipfs_datastore_test.cpp 14 | ) 15 | target_link_libraries(in_memory_ipfs_datastore_test 16 | p2p::p2p_random_generator 17 | ipfs_datastore_in_memory 18 | ) 19 | 20 | add_subdirectory(graphsync) 21 | -------------------------------------------------------------------------------- /test/testutil/mocks/vm/interpreter/interpreter_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include "vm/interpreter/impl/interpreter_impl.hpp" 11 | 12 | namespace fc::vm::interpreter { 13 | class InterpreterMock : public Interpreter { 14 | public: 15 | MOCK_CONST_METHOD2(interpret, 16 | outcome::result(TsBranchPtr, 17 | const TipsetCPtr &tipset)); 18 | }; 19 | } // namespace fc::vm::interpreter 20 | -------------------------------------------------------------------------------- /core/markets/storage/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_subdirectory(import_manager) 7 | 8 | add_library(storage_market_client 9 | impl/storage_market_client_impl.cpp 10 | ) 11 | target_link_libraries(storage_market_client 12 | address 13 | blob 14 | data_transfer 15 | discovery 16 | outcome 17 | logger 18 | piece 19 | signature 20 | market_types 21 | message 22 | tipset 23 | memory_indexed_car 24 | storage_market_import_manager 25 | stream_open_queue 26 | ) 27 | -------------------------------------------------------------------------------- /test/core/crypto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | addtest(blake2_test 7 | blake2_test.cpp 8 | ) 9 | target_link_libraries(blake2_test 10 | blake2 11 | hexutil 12 | ) 13 | 14 | addtest(bls_provider_test 15 | bls_provider_test.cpp 16 | ) 17 | target_link_libraries(bls_provider_test 18 | bls_provider 19 | ) 20 | 21 | addtest(secp256k1_provider_test 22 | secp256k1_provider_test.cpp 23 | ) 24 | target_link_libraries(secp256k1_provider_test 25 | secp256k1_provider 26 | hexutil 27 | ) 28 | -------------------------------------------------------------------------------- /core/storage/ipfs/graphsync/impl/network/marshalling/message_parser.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "storage/ipfs/graphsync/impl/network/marshalling/message.hpp" 9 | 10 | namespace fc::storage::ipfs::graphsync { 11 | 12 | /// Parses protobuf message received from wire 13 | /// \param bytes Raw bytes of received message, without length prefix 14 | /// \return Message or error 15 | outcome::result parseMessage(gsl::span bytes); 16 | 17 | } // namespace fc::storage::ipfs::graphsync 18 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/miner/cron_event_payload.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "codec/cbor/streams_annotation.hpp" 9 | 10 | namespace fc::vm::actor::builtin::types::miner { 11 | 12 | enum class CronEventType { 13 | kWorkerKeyChange, 14 | kProvingDeadline, 15 | kProcessEarlyTerminations, 16 | }; 17 | 18 | struct CronEventPayload { 19 | CronEventType event_type; 20 | }; 21 | CBOR_TUPLE(CronEventPayload, event_type) 22 | 23 | } // namespace fc::vm::actor::builtin::types::miner 24 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/types/miner/dispute_info.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/types/miner/partition_sector_map.hpp" 9 | #include "vm/actor/builtin/types/miner/power_pair.hpp" 10 | 11 | namespace fc::vm::actor::builtin::types::miner { 12 | 13 | struct DisputeInfo { 14 | RleBitset all_sector_nos; 15 | RleBitset ignored_sector_nos; 16 | PartitionSectorMap disputed_sectors; 17 | PowerPair disputed_power; 18 | }; 19 | 20 | } // namespace fc::vm::actor::builtin::types::miner 21 | -------------------------------------------------------------------------------- /core/remote_worker/remote_worker_api.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "api/worker_api.hpp" 9 | #include "sector_storage/impl/local_worker.hpp" 10 | 11 | namespace fc::remote_worker { 12 | using fc::api::WorkerApi; 13 | using sector_storage::LocalWorker; 14 | using sector_storage::stores::LocalStore; 15 | 16 | std::shared_ptr makeWorkerApi( 17 | const std::shared_ptr &local_store, 18 | const std::shared_ptr &worker); 19 | 20 | } // namespace fc::remote_worker 21 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/v3/reward/reward_actor.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "vm/actor/builtin/v2/reward/reward_actor.hpp" 9 | 10 | namespace fc::vm::actor::builtin::v3::reward { 11 | 12 | // TODO (m.tagirov) implement v3 13 | using Constructor = v2::reward::Constructor; 14 | using AwardBlockReward = v2::reward::AwardBlockReward; 15 | using ThisEpochReward = v2::reward::ThisEpochReward; 16 | using UpdateNetworkKPI = v2::reward::UpdateNetworkKPI; 17 | 18 | } // namespace fc::vm::actor::builtin::v3::reward 19 | -------------------------------------------------------------------------------- /test/testutil/mocks/cbor_blake/cbor_blake_ipld_mock.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include "cbor_blake/ipld.hpp" 11 | 12 | namespace fc { 13 | 14 | class CborBlakeIpldMock : public CbIpld { 15 | public: 16 | MOCK_CONST_METHOD2(get, bool(const CbCid &key, Bytes *value)); 17 | MOCK_METHOD2(putMock, void(const CbCid &key, BytesIn value)); 18 | void put(const CbCid &key, BytesCow &&value) override { 19 | putMock(key, value); 20 | } 21 | }; 22 | } // namespace fc 23 | -------------------------------------------------------------------------------- /core/storage/keystore/keystore_error.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "common/outcome.hpp" 9 | 10 | namespace fc::storage::keystore { 11 | 12 | /** 13 | * @brief Type of errors returned by Keystore 14 | */ 15 | enum class KeyStoreError { 16 | kNotFound = 1, 17 | kAlreadyExists, 18 | kWrongAddress, 19 | kWrongSignature, 20 | kCannotStore, 21 | kCannotRead, 22 | }; 23 | 24 | } // namespace fc::storage::keystore 25 | 26 | OUTCOME_HPP_DECLARE_ERROR(fc::storage::keystore, KeyStoreError); 27 | -------------------------------------------------------------------------------- /core/markets/storage/provider/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | add_library(storage_market_provider 7 | impl/provider_impl.cpp 8 | impl/storage_provider_error.cpp 9 | ) 10 | target_link_libraries(storage_market_provider 11 | Boost::boost 12 | api 13 | fuhon_stored_ask 14 | outcome 15 | piece 16 | piece_storage 17 | sectorblocks 18 | ) 19 | 20 | add_library(fuhon_stored_ask 21 | impl/stored_ask.cpp 22 | ) 23 | target_link_libraries(fuhon_stored_ask 24 | p2p::p2p 25 | piece 26 | tipset 27 | ) 28 | -------------------------------------------------------------------------------- /core/storage/ipld/selector.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "codec/cbor/cbor_raw.hpp" 9 | 10 | namespace fc::storage::ipld { 11 | 12 | // TODO(turuslan): implement selectors 13 | using Selector = CborRaw; 14 | 15 | /** 16 | * Selector to walk through all nodes 17 | * {"R": {"l": {"none": {}}, ":>": {"a": {">": {"@": {}}}}}} 18 | */ 19 | static const Selector kAllSelector{ 20 | common::unhex("a16152a2616ca1646e6f6e65a0623a3ea16161a1613ea16140a0") 21 | .value()}; 22 | } // namespace fc::storage::ipld 23 | -------------------------------------------------------------------------------- /libs/cpp-ledger/ledger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | find_library(HIDAPI_LIB 7 | NAMES hidapi hidapi-libusb) 8 | 9 | find_path(HIDAPI_INCLUDE_DIR 10 | NAMES hidapi.h 11 | PATH_SUFFIXES 12 | hidapi) 13 | 14 | add_library(ledger_device 15 | apdu_wrapper.cpp 16 | device_hid_info.cpp 17 | device_hid.cpp 18 | ledger_device_hid.cpp 19 | ledger_admin_hid.cpp 20 | utils.cpp 21 | ) 22 | 23 | target_include_directories(ledger_device PRIVATE ${HIDAPI_INCLUDE_DIR}) 24 | target_link_libraries(ledger_device ${HIDAPI_LIB}) 25 | -------------------------------------------------------------------------------- /core/codec/cbor/README.md: -------------------------------------------------------------------------------- 1 | 2 | CBOR allows encoding and decoding of scalar types, as well as list and maps (with string keys). 3 | 4 | ```c++ 5 | CborEncodeStream e; 6 | CborDecodeStream d; 7 | int int1, int2, int3; 8 | 9 | // int, 1, 2 10 | e << 1 << 2; 11 | // decode 12 | d >> int1 >> int2; 13 | 14 | // list, [1, 2, 3] 15 | // encode 16 | e << (e.list() << 1 << 2 << 3); 17 | // decode 18 | d.list() >> int1 >> int2 >> int3; 19 | 20 | // map, {"a": 1, "b": [2]} 21 | // encode 22 | auto em = e.map(); 23 | em["a"] << 1; 24 | em["b"] << (em["b"].list << 2); 25 | // decode 26 | auto dm = d.map(); 27 | dm.at("a") >> int1; 28 | dm.at("b").list() >> int2; 29 | ``` 30 | -------------------------------------------------------------------------------- /core/storage/piece/impl/piece_storage_error.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "storage/piece/impl/piece_storage_error.hpp" 7 | 8 | OUTCOME_CPP_DEFINE_CATEGORY(fc::storage::piece, PieceStorageError, e) { 9 | using fc::storage::piece::PieceStorageError; 10 | 11 | switch (e) { 12 | case PieceStorageError::kPieceNotFound: 13 | return "PieceStorageError: piece not found"; 14 | case PieceStorageError::kPayloadNotFound: 15 | return "PieceStorageError: payload not found"; 16 | } 17 | 18 | return "PieceStorageError: unknown error"; 19 | } 20 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | NamespaceIndentation: All 3 | BreakBeforeBinaryOperators: NonAssignment 4 | AlignOperands: true 5 | DerivePointerAlignment: false 6 | PointerAlignment: Right 7 | BinPackArguments: false 8 | BinPackParameters: false 9 | AllowShortFunctionsOnASingleLine: Empty 10 | IncludeBlocks: Preserve 11 | 12 | # Comment pragma for Filecoin System Test Matrix (https://github.com/filecoin-project/system-test-matrix) 13 | # Comment format is '//stm:tags=...;ignore=...' with no whitespace. This is a go convention for comments that are not 14 | # meant to be read by humans and must not be changed by clang-format 15 | CommentPragmas: '^stm:.*' 16 | -------------------------------------------------------------------------------- /core/vm/actor/builtin/states/account/account_actor_state.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "primitives/address/address.hpp" 9 | #include "vm/actor/builtin/types/universal/universal.hpp" 10 | 11 | namespace fc::vm::actor::builtin::states { 12 | using primitives::address::Address; 13 | 14 | struct AccountActorState { 15 | virtual ~AccountActorState() = default; 16 | 17 | Address address; 18 | }; 19 | 20 | using AccountActorStatePtr = types::Universal; 21 | 22 | } // namespace fc::vm::actor::builtin::states 23 | -------------------------------------------------------------------------------- /test/testutil/storage/base_leveldb_test.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "testutil/storage/base_fs_test.hpp" 9 | 10 | #include "storage/leveldb/leveldb.hpp" 11 | 12 | namespace test { 13 | 14 | struct BaseLevelDB_Test : public BaseFS_Test { 15 | using LevelDB = fc::storage::LevelDB; 16 | 17 | explicit BaseLevelDB_Test(const fs::path &path); 18 | 19 | void open(); 20 | 21 | void SetUp() override; 22 | 23 | void TearDown() override; 24 | 25 | std::shared_ptr db_; 26 | }; 27 | 28 | } // namespace test 29 | -------------------------------------------------------------------------------- /cmake/toolchain/flags/sanitize_leak.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, Ruslan Baratov 2 | # All rights reserved. 3 | 4 | if (DEFINED POLLY_FLAGS_SANITIZE_LEAK_CMAKE_) 5 | return() 6 | else () 7 | set(POLLY_FLAGS_SANITIZE_LEAK_CMAKE_ 1) 8 | endif () 9 | 10 | include(${CMAKE_CURRENT_LIST_DIR}/../../toolchain-util.cmake) 11 | 12 | set(FLAGS 13 | -fsanitize=leak 14 | -ferror-limit=0 15 | -g 16 | ) 17 | foreach(FLAG IN LISTS FLAGS) 18 | add_cache_flag(CMAKE_CXX_FLAGS ${FLAG}) 19 | add_cache_flag(CMAKE_C_FLAGS ${FLAG}) 20 | endforeach() 21 | 22 | set(ENV{LSAN_OPTIONS} detect_leaks=1) 23 | 24 | list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "sanitize-leak") 25 | -------------------------------------------------------------------------------- /core/common/logger.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | namespace fc::common { 12 | using Logger = std::shared_ptr; 13 | 14 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) 15 | extern spdlog::sink_ptr file_sink; 16 | 17 | /** 18 | * Provide logger object 19 | * @param tag - tagging name for identifying logger 20 | * @return logger object 21 | */ 22 | Logger createLogger(const std::string &tag); 23 | } // namespace fc::common 24 | -------------------------------------------------------------------------------- /core/blockchain/production/block_producer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "fwd.hpp" 7 | #include "primitives/block/block.hpp" 8 | 9 | namespace fc::blockchain::production { 10 | using primitives::block::BlockTemplate; 11 | using primitives::block::BlockWithMessages; 12 | using vm::interpreter::InterpreterCache; 13 | 14 | outcome::result generate( 15 | InterpreterCache &interpreter_cache, 16 | const TsLoadPtr &ts_load, 17 | std::shared_ptr ipld, 18 | BlockTemplate t); 19 | } // namespace fc::blockchain::production 20 | -------------------------------------------------------------------------------- /test/testutil/peer_id.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Soramitsu Co., Ltd. All Rights Reserved. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include "common/bytes.hpp" 11 | #include "common/outcome.hpp" 12 | 13 | using fc::Bytes; 14 | using libp2p::multi::Multihash; 15 | using libp2p::peer::PeerId; 16 | 17 | /** 18 | * Creates dummy PeerId 19 | */ 20 | inline PeerId generatePeerId(int value) { 21 | Bytes kBuffer = Bytes(43, value); 22 | auto hash = Multihash::create(libp2p::multi::sha256, kBuffer).value(); 23 | return PeerId::fromHash(hash).value(); 24 | } 25 | --------------------------------------------------------------------------------