├── .dockerignore
├── .editorconfig
├── .github
└── workflows
│ ├── build.yml
│ └── cargo-test.yml
├── .gitignore
├── .mergify.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── build.rs
├── clippy.toml
├── config.tendermint-solo.ini
├── coordinator
├── Cargo.toml
└── src
│ ├── app_desc.rs
│ ├── app_desc
│ ├── deserialize.rs
│ ├── engine.rs
│ ├── genesis.rs
│ ├── params.rs
│ ├── tendermint.rs
│ └── validator.rs
│ ├── context.rs
│ ├── context
│ ├── chain_history_access.rs
│ ├── mem_pool_access.rs
│ ├── storage_access.rs
│ └── sub_storage_access.rs
│ ├── desc_common.rs
│ ├── desc_common
│ └── params.rs
│ ├── engine.rs
│ ├── header.rs
│ ├── lib.rs
│ ├── link_desc.rs
│ ├── link_desc
│ ├── params.rs
│ └── validator.rs
│ ├── linkable.rs
│ ├── module.rs
│ ├── test_coordinator.rs
│ ├── transaction.rs
│ ├── types.rs
│ ├── types
│ └── event.rs
│ ├── values.rs
│ ├── weaver.rs
│ └── weaver
│ └── test.rs
├── core
├── Cargo.toml
├── res
│ ├── null.json
│ ├── solo.json
│ └── tendermint.json
└── src
│ ├── account_provider.rs
│ ├── block.rs
│ ├── blockchain
│ ├── block_info.rs
│ ├── blockchain.rs
│ ├── body_db.rs
│ ├── event_db.rs
│ ├── extras.rs
│ ├── headerchain.rs
│ ├── mod.rs
│ ├── route.rs
│ └── update_result.rs
│ ├── blockchain_info.rs
│ ├── client
│ ├── chain_notify.rs
│ ├── client.rs
│ ├── config.rs
│ ├── importer.rs
│ ├── mod.rs
│ ├── snapshot_notify.rs
│ └── test_client.rs
│ ├── consensus
│ ├── bit_set.rs
│ ├── mod.rs
│ ├── null_engine
│ │ └── mod.rs
│ ├── signer.rs
│ ├── solo
│ │ └── mod.rs
│ ├── tendermint
│ │ ├── DESIGN.md
│ │ ├── backup.rs
│ │ ├── chain_notify.rs
│ │ ├── engine.rs
│ │ ├── evidence_collector.rs
│ │ ├── message.rs
│ │ ├── mod.rs
│ │ ├── network.rs
│ │ ├── params.rs
│ │ ├── types.rs
│ │ ├── vote_collector.rs
│ │ ├── vote_regression_checker.rs
│ │ └── worker.rs
│ └── validator_set
│ │ ├── dynamic_validator.rs
│ │ └── mod.rs
│ ├── db.rs
│ ├── db_version.rs
│ ├── encoded.rs
│ ├── error.rs
│ ├── event.rs
│ ├── genesis.rs
│ ├── lib.rs
│ ├── miner
│ ├── backup.rs
│ ├── mem_pool.rs
│ ├── mem_pool_types.rs
│ ├── miner.rs
│ └── mod.rs
│ ├── peer_db.rs
│ ├── service.rs
│ ├── tests
│ ├── helpers.rs
│ └── mod.rs
│ ├── transaction.rs
│ ├── types
│ ├── block_status.rs
│ ├── mod.rs
│ ├── transaction_id.rs
│ └── verification_queue_info.rs
│ ├── verification
│ ├── mod.rs
│ ├── queue
│ │ ├── kind.rs
│ │ └── mod.rs
│ ├── verification.rs
│ └── verifier.rs
│ └── views
│ ├── block.rs
│ ├── body.rs
│ ├── header.rs
│ └── mod.rs
├── demo
├── README.md
├── app-desc.toml
├── config0.ini
├── config1.ini
├── config2.ini
├── config3.ini
├── keys
│ ├── UTC--2020-03-05T06-22-17Z--15737bb2-a003-24dd-4f38-9a42b2f1a5c1
│ ├── UTC--2020-03-05T06-23-41Z--84597567-cca7-15c1-1e67-ba4d7d74c9cf
│ ├── UTC--2020-03-05T06-24-42Z--8a4d1282-551c-30f4-4e51-4f7d1836b482
│ └── UTC--2020-03-05T06-25-04Z--3a427683-d4d6-7a73-e776-fd15df5b1396
├── link-desc.toml
└── password.json
├── discovery
├── Cargo.toml
└── src
│ ├── config.rs
│ ├── extension.rs
│ ├── lib.rs
│ ├── message.rs
│ └── node_id.rs
├── docker
├── README.md
└── ubuntu
│ └── Dockerfile
├── docker_push.sh
├── foundry
├── config
│ ├── mod.rs
│ └── presets
│ │ ├── config.dev.ini
│ │ └── config.prod.ini
├── constants.rs
├── dummy_network_service.rs
├── json
│ ├── mod.rs
│ ├── password_entry.rs
│ └── password_file.rs
├── lib.rs
├── main.rs
├── run_node.rs
└── subcommand.rs
├── graphql-engine
├── Cargo.toml
└── src
│ ├── block.rs
│ ├── header.rs
│ └── lib.rs
├── graphql-types
├── Cargo.toml
└── src
│ └── lib.rs
├── graphql
├── Cargo.toml
├── src
│ ├── graphiql.rs
│ ├── handler.rs
│ └── lib.rs
└── tests
│ ├── common
│ └── mod.rs
│ └── integration_test.rs
├── informer
├── Cargo.toml
└── src
│ ├── handler
│ ├── mod.rs
│ ├── rpc_ws_handler.rs
│ └── subscription.rs
│ ├── informer_service
│ ├── informer_service_handler.rs
│ ├── mod.rs
│ └── rate_limiter.rs
│ ├── lib.rs
│ └── rpc_server.rs
├── informer_courier
├── Cargo.toml
└── src
│ ├── event_types.rs
│ ├── informer_notify.rs
│ └── lib.rs
├── integration-test
├── Cargo.toml
├── README.md
├── config.tendermint-solo.ini
├── keys
│ ├── UTC--2020-03-05T06-22-17Z--15737bb2-a003-24dd-4f38-9a42b2f1a5c1
│ ├── UTC--2020-03-05T06-23-41Z--84597567-cca7-15c1-1e67-ba4d7d74c9cf
│ ├── UTC--2020-03-05T06-24-42Z--8a4d1282-551c-30f4-4e51-4f7d1836b482
│ └── UTC--2020-03-05T06-25-04Z--3a427683-d4d6-7a73-e776-fd15df5b1396
├── password.json
├── src
│ └── lib.rs
└── tests
│ ├── integration_test.rs
│ └── multi.rs
├── json
├── Cargo.toml
└── src
│ ├── bytes.rs
│ ├── hash.rs
│ ├── lib.rs
│ └── uint.rs
├── key
├── Cargo.toml
├── benches
│ ├── ed25519.rs
│ ├── pay_and_transfer.rs
│ └── tendermint.rs
└── src
│ ├── ed25519
│ ├── keypair.rs
│ ├── mod.rs
│ ├── private.rs
│ ├── public.rs
│ └── signature.rs
│ ├── encryption.rs
│ ├── encryption
│ ├── keypair.rs
│ ├── private.rs
│ └── public.rs
│ ├── error.rs
│ ├── keypair.rs
│ ├── lib.rs
│ ├── network.rs
│ ├── password.rs
│ ├── platform_address.rs
│ ├── platform_address
│ ├── checksum.rs
│ └── version.rs
│ ├── random.rs
│ └── x25519
│ ├── exchange.rs
│ ├── keypair.rs
│ ├── mod.rs
│ ├── private.rs
│ └── public.rs
├── keystore
├── Cargo.toml
├── src
│ ├── account
│ │ ├── cipher.rs
│ │ ├── crypto.rs
│ │ ├── decrypted_account.rs
│ │ ├── kdf.rs
│ │ ├── mod.rs
│ │ ├── safe_account.rs
│ │ └── version.rs
│ ├── accounts_dir
│ │ ├── disk.rs
│ │ ├── memory.rs
│ │ └── mod.rs
│ ├── bin
│ │ └── sign.rs
│ ├── error.rs
│ ├── import.rs
│ ├── json
│ │ ├── bytes.rs
│ │ ├── cipher.rs
│ │ ├── crypto.rs
│ │ ├── error.rs
│ │ ├── hash.rs
│ │ ├── id.rs
│ │ ├── kdf.rs
│ │ ├── key_file.rs
│ │ ├── mod.rs
│ │ └── version.rs
│ ├── keystore.rs
│ ├── lib.rs
│ ├── random.rs
│ └── secret_store.rs
└── tests
│ ├── api.rs
│ ├── res
│ ├── ciphertext
│ │ ├── 30.json
│ │ └── 31.json
│ └── pat
│ │ ├── p1.json
│ │ └── p2.json
│ └── util
│ ├── mod.rs
│ └── transient_dir.rs
├── logstash.conf
├── module
├── Cargo.toml
├── src
│ ├── impls.rs
│ ├── impls
│ │ └── process.rs
│ ├── lib.rs
│ ├── link.rs
│ ├── link
│ │ └── base.rs
│ └── sandbox.rs
└── tests
│ └── intergration_test.rs
├── network
├── Cargo.toml
└── src
│ ├── addr.rs
│ ├── client.rs
│ ├── config.rs
│ ├── control.rs
│ ├── extension.rs
│ ├── filters
│ ├── control.rs
│ ├── filter.rs
│ ├── filters.rs
│ └── mod.rs
│ ├── lib.rs
│ ├── node_id.rs
│ ├── p2p
│ ├── connection
│ │ ├── established.rs
│ │ ├── incoming.rs
│ │ ├── message.rs
│ │ ├── mod.rs
│ │ └── outgoing.rs
│ ├── handler.rs
│ ├── listener.rs
│ ├── message
│ │ ├── extension.rs
│ │ ├── message.rs
│ │ ├── mod.rs
│ │ ├── negotiation.rs
│ │ └── signed_message.rs
│ ├── mod.rs
│ └── stream.rs
│ ├── routing_table.rs
│ ├── service.rs
│ ├── session
│ ├── mod.rs
│ └── session.rs
│ └── stream.rs
├── rpc
├── Cargo.toml
└── src
│ ├── lib.rs
│ ├── rpc_server.rs
│ └── v1
│ ├── errors.rs
│ ├── impls
│ ├── chain.rs
│ ├── devel.rs
│ ├── mempool.rs
│ ├── mod.rs
│ ├── net.rs
│ └── snapshot.rs
│ ├── mod.rs
│ ├── traits
│ ├── chain.rs
│ ├── devel.rs
│ ├── mempool.rs
│ ├── mod.rs
│ ├── net.rs
│ └── snapshot.rs
│ └── types
│ ├── action.rs
│ ├── asset_output.rs
│ ├── asset_scheme.rs
│ ├── block.rs
│ ├── mod.rs
│ ├── transaction.rs
│ ├── unsigned_transaction.rs
│ └── work.rs
├── rust-toolchain
├── rustfmt.toml
├── spec
├── Block-Synchronization-Extension.md
├── Digital-Signature.md
├── Discovery-Extension.md
├── Foundry-Address.md
├── GraphQL.md
├── Hash-Function.md
├── JSON-RPC.md
├── Merkle-Trie.md
├── Network-Extension-Protocol.md
├── Node-Discovery-Protocol.md
├── Operate-Extension.md
├── P2P-Protocol.md
├── README.md
├── Stratum.md
├── System-Extension.md
├── Tag-encoding.md
├── Transaction-Propagation-Extension.md
├── Transaction.md
└── Wire-Protocol.md
├── state
├── Cargo.toml
└── src
│ ├── cache
│ ├── global_cache.rs
│ ├── lru_cache.rs
│ ├── mod.rs
│ ├── module_cache.rs
│ ├── top_cache.rs
│ └── write_back.rs
│ ├── checkpoint.rs
│ ├── db
│ ├── mod.rs
│ └── state_db.rs
│ ├── error.rs
│ ├── impls
│ ├── mod.rs
│ ├── module_level.rs
│ ├── test_helper.rs
│ └── top_level.rs
│ ├── item
│ ├── action_data.rs
│ ├── address.rs
│ ├── metadata.rs
│ ├── mod.rs
│ ├── module.rs
│ ├── module_datum.rs
│ ├── stake.rs
│ └── validator_set.rs
│ ├── lib.rs
│ ├── stake
│ └── mod.rs
│ ├── tests.rs
│ └── traits.rs
├── sync
├── Cargo.toml
└── src
│ ├── block
│ ├── downloader
│ │ ├── body.rs
│ │ ├── header.rs
│ │ └── mod.rs
│ ├── extension.rs
│ ├── message
│ │ ├── mod.rs
│ │ ├── request.rs
│ │ └── response.rs
│ └── mod.rs
│ ├── lib.rs
│ ├── snapshot
│ ├── error.rs
│ └── mod.rs
│ └── transaction
│ ├── extension.rs
│ ├── message.rs
│ └── mod.rs
├── test
├── .editorconfig
├── .gitignore
├── README.md
├── custom.minfee
│ └── tccq9td7gtgjhu08ud9hs7uml0pj4lt36mdwyft72tl
│ │ ├── keys
│ │ └── key
│ │ └── password.json
├── package.json
├── src
│ ├── e2e.long
│ │ ├── account.test.ts
│ │ ├── accountUnlock.test.ts
│ │ ├── bootstrap.test.ts
│ │ ├── discovery2.test.ts
│ │ ├── discovery5.test.ts
│ │ ├── futureTransaction.test.ts
│ │ ├── invalidBlockPropagation.helper.ts
│ │ ├── invalidBlockPropagation0.test.ts
│ │ ├── invalidBlockPropagation1.test.ts
│ │ ├── invalidBlockPropagation2.test.ts
│ │ ├── invalidBlockPropagation3.test.ts
│ │ ├── invalidBlockPropagation4.test.ts
│ │ ├── invalidBlockPropagation5.test.ts
│ │ ├── invalidBlockPropagation6.test.ts
│ │ ├── invalidBlockPropagation9.test.ts
│ │ ├── mempool.test.ts
│ │ ├── onChainBlockValid.test.ts
│ │ ├── onChainHeaderValid.test.ts
│ │ ├── onChainTx.test.ts
│ │ ├── reward2.test.ts
│ │ ├── sync2.test.ts
│ │ ├── sync3.test.ts
│ │ ├── sync5.test.ts
│ │ └── tendermint.test.ts
│ ├── e2e
│ │ ├── account.test.ts
│ │ ├── basic.test.ts
│ │ ├── chain.test.ts
│ │ ├── informer.test.ts
│ │ ├── informer2.test.ts
│ │ ├── ipc.test.ts
│ │ ├── mempool.test.ts
│ │ ├── network1.test.ts
│ │ ├── network2.test.ts
│ │ ├── pay.test.ts
│ │ ├── reward.test.ts
│ │ ├── snapshot.test.ts
│ │ ├── syncEmptyBlock.test.ts
│ │ └── verification.test.ts
│ ├── helper
│ │ ├── chai-similar.test.ts
│ │ ├── chai-similar.ts
│ │ ├── constants.ts
│ │ ├── error.ts
│ │ ├── mock
│ │ │ ├── blockSyncMessage.ts
│ │ │ ├── cHeader.ts
│ │ │ ├── example
│ │ │ │ ├── send-block.ts
│ │ │ │ └── send-tx.ts
│ │ │ ├── index.ts
│ │ │ ├── message.ts
│ │ │ ├── p2pLayer.ts
│ │ │ ├── tendermintMessage.ts
│ │ │ ├── test
│ │ │ │ ├── blockSyncMessage.test.ts
│ │ │ │ ├── header.test.ts
│ │ │ │ ├── message.test.ts
│ │ │ │ └── txSyncMessage.test.ts
│ │ │ └── transactionSyncMessage.ts
│ │ ├── promise.ts
│ │ ├── random.ts
│ │ ├── rlp.ts
│ │ └── spawn.ts
│ ├── primitives
│ │ ├── README.md
│ │ ├── src
│ │ │ ├── address
│ │ │ │ ├── address.ts
│ │ │ │ └── checksum.ts
│ │ │ ├── hash.ts
│ │ │ ├── index.ts
│ │ │ ├── key
│ │ │ │ ├── ed25519.ts
│ │ │ │ ├── key.ts
│ │ │ │ └── keyExchange.ts
│ │ │ ├── utility.ts
│ │ │ └── value
│ │ │ │ ├── H128.ts
│ │ │ │ ├── H256.ts
│ │ │ │ ├── H512.ts
│ │ │ │ ├── U128.ts
│ │ │ │ ├── U256.ts
│ │ │ │ └── U64.ts
│ │ └── test
│ │ │ ├── Hxxx.test.ts
│ │ │ ├── Uxxx.test.ts
│ │ │ ├── address.test.ts
│ │ │ ├── hash.test.ts
│ │ │ ├── key.test.ts
│ │ │ ├── keyExchange.test.ts
│ │ │ └── utility.test.ts
│ ├── scheme
│ │ ├── mempool.json
│ │ ├── solo.json
│ │ ├── tendermint-int.json
│ │ └── tendermint-tps.json
│ ├── sdk
│ │ ├── __test__
│ │ │ ├── SignatureTag.spec.ts
│ │ │ └── blake.spec.ts
│ │ ├── core
│ │ │ ├── Block.ts
│ │ │ ├── SignedTransaction.ts
│ │ │ ├── Text.ts
│ │ │ ├── Transaction.ts
│ │ │ ├── __test__
│ │ │ │ ├── Block.spec.ts
│ │ │ │ └── SignedTransaction.spec.ts
│ │ │ ├── classes.ts
│ │ │ ├── index.ts
│ │ │ ├── transaction
│ │ │ │ ├── ChangeParams.ts
│ │ │ │ ├── DelegateCCS.ts
│ │ │ │ ├── Pay.ts
│ │ │ │ ├── Redelegate.ts
│ │ │ │ ├── ReportDoubleVote.ts
│ │ │ │ ├── Revoke.ts
│ │ │ │ ├── SelfNominate.ts
│ │ │ │ ├── TransferCCS.ts
│ │ │ │ ├── __test__
│ │ │ │ │ └── Pay.spec.ts
│ │ │ │ └── json.ts
│ │ │ └── types.ts
│ │ ├── index.ts
│ │ ├── key
│ │ │ ├── KeyStore.ts
│ │ │ ├── LocalKeyStore.ts
│ │ │ ├── MemoryKeyStore.ts
│ │ │ ├── RemoteKeyStore.ts
│ │ │ ├── __test__
│ │ │ │ ├── LocalKeyStore.spec.ts
│ │ │ │ └── MemoryKeyStore.spec.ts
│ │ │ ├── classes.ts
│ │ │ └── index.ts
│ │ └── utils.ts
│ └── tendermint.test
│ │ ├── local.ts
│ │ └── remote.ts
├── tendermint.dynval
│ ├── 74ft6vs4-6hnNHtCB4Drxl25ZZEi0i0pDf-daeZMq-Ys3kgqKOUtc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── 7zfgtdtf43Cq3OiFal90JIQBg2MbmaJMqrfQpQ98qOCjyR-BsWctc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── 8y5y8f2cmHGhSPvEdPgq0ckxQLmiS3wuiUQViBa6tvgoxfRQJGEtc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── 9w0t888bwJQ6KiY1g16erHoJXsZYBRkMDf6t2q0g8By_DykEV9Itc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── be408xc5EctYW80ArkfkEEdJh9TYEp3hMF1I1Yhr5itP9Q8oSvMtc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── brnv7hjvbOFhgKognQNJ-OtnAs9dBh6Bhe9upHKNhu4rIKhQZA0tc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── constants.ts
│ ├── ejr942sfGmscSzhJgY2GDHm7B6dIJo_oa67IisBx2dxZLCG6Wr8tc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── rn3rnhr3s9Q_CLfiEx3HrRuSnXTDsteFheb2XqKG2Me44sESOxYtc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ ├── snapshot-config.yml
│ ├── tcqfztsg3H1ZitrqRhvzyFrnJ66dZT0xXwcJmiANX770mz_9XSUtc0
│ │ ├── keys
│ │ │ └── key
│ │ └── password.json
│ └── xek9jzmhvHcp-RxX9XXJVV23kKl574FD6ilIjzteSY48LACx05Etc0
│ │ ├── keys
│ │ └── key
│ │ └── password.json
├── tendermint
│ ├── keys
│ │ ├── UTC--2020-03-05T06-22-17Z--15737bb2-a003-24dd-4f38-9a42b2f1a5c1
│ │ ├── UTC--2020-03-05T06-23-41Z--84597567-cca7-15c1-1e67-ba4d7d74c9cf
│ │ ├── UTC--2020-03-05T06-24-42Z--8a4d1282-551c-30f4-4e51-4f7d1836b482
│ │ └── UTC--2020-03-05T06-25-04Z--3a427683-d4d6-7a73-e776-fd15df5b1396
│ └── password.json
├── tsconfig.json
├── tslint.json
├── upload_logs.sh
└── yarn.lock
├── timestamp
├── Cargo.toml
├── README.md
├── app-desc.toml
├── link-desc.toml
├── src
│ ├── account
│ │ ├── graphql.rs
│ │ ├── mod.rs
│ │ ├── module.rs
│ │ ├── services.rs
│ │ ├── state_machine.rs
│ │ └── types.rs
│ ├── bin
│ │ ├── account.rs
│ │ ├── sorting.rs
│ │ ├── staking.rs
│ │ ├── stamp.rs
│ │ └── token.rs
│ ├── common.rs
│ ├── common
│ │ ├── state_machine.rs
│ │ └── state_manager.rs
│ ├── lib.rs
│ ├── sorting
│ │ ├── mod.rs
│ │ ├── module.rs
│ │ └── services.rs
│ ├── staking
│ │ ├── mod.rs
│ │ ├── module.rs
│ │ └── services.rs
│ ├── stamp
│ │ ├── mod.rs
│ │ ├── module.rs
│ │ ├── services.rs
│ │ └── types.rs
│ ├── token
│ │ ├── graphql.rs
│ │ ├── mod.rs
│ │ ├── module.rs
│ │ ├── services.rs
│ │ ├── state_machine.rs
│ │ └── types.rs
│ └── util
│ │ └── mod.rs
└── tests
│ ├── common
│ ├── mod.rs
│ └── query.graphql
│ └── integration_test.rs
├── types
├── Cargo.toml
└── src
│ ├── block_hash.rs
│ ├── block_id.rs
│ ├── chain_params.rs
│ ├── errors
│ ├── history_error.rs
│ ├── mod.rs
│ ├── runtime_error.rs
│ └── syntax_error.rs
│ ├── header.rs
│ ├── lib.rs
│ ├── sync_header.rs
│ ├── transaction
│ ├── approval.rs
│ ├── mod.rs
│ ├── partial_hashing.rs
│ └── validator.rs
│ ├── tx_hash.rs
│ ├── util
│ ├── mod.rs
│ ├── tag.rs
│ └── unexpected.rs
│ └── validator_set.rs
└── util
├── io
├── Cargo.toml
└── src
│ ├── lib.rs
│ ├── service.rs
│ └── worker.rs
├── logger
├── Cargo.toml
└── src
│ ├── email.rs
│ ├── lib.rs
│ ├── logger.rs
│ ├── macros.rs
│ └── structured_logger.rs
├── panic_hook
├── Cargo.toml
└── src
│ └── lib.rs
├── table
├── Cargo.toml
└── src
│ └── lib.rs
└── timer
├── Cargo.toml
└── src
├── lib.rs
└── timer.rs
/.dockerignore:
--------------------------------------------------------------------------------
1 | /.idea/
2 | /target/
3 | /keys/
4 | /db/
5 | /docker/
6 | /keystore.db
7 | /test/
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 | [*.rs]
3 | indent_style=space
4 | indent_size=4
5 | tab_width=8
6 | end_of_line=lf
7 | charset=utf-8
8 | trim_trailing_whitespace=true
9 | max_line_length=120
10 | insert_final_newline=true
11 |
12 | [*.yml]
13 | indent_style=space
14 | indent_size=2
15 | tab_width=8
16 | end_of_line=lf
17 | charset=utf-8
18 | trim_trailing_whitespace=true
19 | insert_final_newline=true
20 |
21 | [.github/**/*.yml]
22 | indent_style=space
23 | indent_size=2
24 | tab_width=8
25 | end_of_line=lf
26 | charset=utf-8
27 | trim_trailing_whitespace=true
28 | insert_final_newline=true
29 |
30 | [.travis.yml]
31 | indent_style=space
32 | indent_size=2
33 | tab_width=8
34 | end_of_line=lf
35 | charset=utf-8
36 |
37 | [*.json]
38 | indent_style=space
39 | indent_size=2
40 | tab_width=4
41 | end_of_line=lf
42 | charset=utf-8
43 | trim_trailing_whitespace=true
44 | insert_final_newline=true
45 |
46 |
47 | [*.toml]
48 | indent_style=space
49 | indent_size=4
50 | tab_width=8
51 | end_of_line=lf
52 | charset=utf-8
53 | trim_trailing_whitespace=true
54 | insert_final_newline=true
55 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | on: [push, pull_request]
2 |
3 | name: build
4 |
5 | jobs:
6 | build:
7 | name: Actions - build
8 | runs-on: ${{ matrix.os }}
9 | strategy:
10 | matrix:
11 | os: [macOS-10.14, ubuntu-18.04]
12 | fail-fast: false
13 | steps:
14 | - uses: actions/checkout@v1
15 | with:
16 | fetch-depth: 1
17 | - uses: actions-rs/toolchain@v1
18 | with:
19 | toolchain: 1.47.0
20 | profile: minimal
21 | override: true
22 | - run: cargo fetch --verbose
23 | - run: cargo build --release
24 | - name: Archive
25 | working-directory: target/release
26 | run: |
27 | mkdir artifacts
28 | echo ${{github.sha}} ${{github.ref}} | tee artifacts/git-ref
29 | shasum -a 256 foundry | tee artifacts/sha256sums
30 | FOUNDRY_VERSION="$(./foundry --version | cut -d ' ' -f 2)"
31 | tar cvfz artifacts/foundry-${FOUNDRY_VERSION}-$(uname -m)-$(echo $(uname) | tr '[:upper:]' '[:lower:]').tar.gz foundry
32 | - uses: actions/upload-artifact@v1
33 | with:
34 | name: foundry-${{ matrix.os }}
35 | path: target/release/artifacts
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Cargo lock in subs
2 | **/Cargo.lock
3 |
4 | # Generated by Cargo
5 | **/target/
6 |
7 | **/*.rs.bk
8 | **/*.iml
9 | .idea/
10 | .vscode/
11 | /db/
12 | /snapshot/
13 | /log/
14 | /keys/
15 | /test/log/
16 |
17 | # macOS
18 | .DS_store
19 |
20 | # integration test
21 | /integration-test/db/
22 | /integration-test/logs/
23 |
24 | # demo
25 | /demo/db*
26 | /demo/foundry
--------------------------------------------------------------------------------
/.mergify.yml:
--------------------------------------------------------------------------------
1 | pull_request_rules:
2 | - name: Merge when CI passes and resolves all requested reviews
3 | conditions:
4 | - "#approved-reviews-by>=1"
5 | - "#review-requested=0"
6 | - "#changes-requested-reviews-by=0"
7 | - "status-success~=^Actions - "
8 | - base=master
9 | - label!=do-not-merge
10 | - "- title~=\\b(wip|WIP)\\b"
11 | actions:
12 | merge:
13 | method: rebase
14 | rebase_fallback: null
15 | strict: smart
16 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | If you would like to contribute to CodeChain, please fork it, fix bugs or implement features, and [propose a pull request](https://github.com/CodeChain-io/codechain/compare).
2 |
3 | # Report bugs
4 |
5 | Create a [new issue](https://github.com/CodeChain-io/codechain/issues/new) in our repository and state:
6 |
7 | * What's your CodeChain version?
8 | * What's your operating system and version?
9 | * How did you install CodeChain?
10 | * Is your node fully synchronized?
11 | * Did you try turning it off and on again?
12 | * Also, try to include steps to reproduce the issue and expand on the **actual** versus **expected** behavior.
13 |
14 | # License
15 |
16 | By contributing to CodeChain, you agree that your contributions will be licensed under the GPLv3 License.
17 |
18 | Each contributor has to [sign our Contributor License Agreement](https://www.clahub.com/agreements/CodeChain-io/codechain). The purpose of the CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen license. You can read and sign our full Contributor License Agreement before submitting a pull request.
19 |
--------------------------------------------------------------------------------
/build.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use vergen::{generate_cargo_keys, ConstantsFlags};
18 |
19 | fn main() {
20 | generate_cargo_keys(ConstantsFlags::all()).expect("Unable to generate vergen constants!");
21 | }
22 |
--------------------------------------------------------------------------------
/clippy.toml:
--------------------------------------------------------------------------------
1 | too-many-arguments-threshold = 10
2 |
--------------------------------------------------------------------------------
/config.tendermint-solo.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeChain-io/foundry/58cd0832f9db09ace91035344db7168063ecfa7a/config.tendermint-solo.ini
--------------------------------------------------------------------------------
/coordinator/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "coordinator"
3 | version = "0.1.0"
4 | authors = ["CodeChain Team "]
5 | edition = "2018"
6 |
7 | [dependencies]
8 | ccrypto = { package = "codechain-crypto", git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.3", tag = "v0.3.0" }
9 | ckey = { package = "codechain-key", path = "../key" }
10 | cmodule = { package = "codechain-module", path = "../module" }
11 | codechain-logger = { path = "../util/logger" }
12 | ctypes = { package = "codechain-types", path = "../types" }
13 | remote-trait-object = "0.4.0"
14 | foundry-process-sandbox = { version = "0.2.1", git = "https://github.com/CodeChain-io/foundry-sandbox.git", tag = "v0.2.1" }
15 | foundry-module-rt = { version = "0.2.2", git = "https://github.com/CodeChain-io/module-rt.git", tag = "v0.2.2" }
16 | primitives = { git = "https://github.com/CodeChain-io/rust-codechain-primitives.git", version = "0.5", tag = "v0.5.1" }
17 | rlp = { git = "https://github.com/CodeChain-io/rlp.git", version = "0.5", tag = "v0.5.0"}
18 | parking_lot = "0.11.0"
19 | serde = { version = "1.0", features = ["derive"] }
20 | serde_yaml = "0.8"
21 | toml = "0.4"
22 | erased-serde = "0.3"
23 | rustc-hex = "2"
24 | hex = { version = "0.4.2", features = ["serde"] }
25 | regex = "1"
26 | once_cell = "1"
27 | linkme = "0.2.2"
28 | log = "0.4.6"
29 | thiserror = "1"
30 | handlebars = "3.3"
31 | anyhow = "1"
32 | serde_cbor = "0.11.1"
33 | intertrait = "0.2.0"
34 |
35 | [dev-dependencies]
36 | unindent = "0.1.6"
37 |
--------------------------------------------------------------------------------
/coordinator/src/context.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | mod chain_history_access;
18 | mod mem_pool_access;
19 | mod storage_access;
20 | mod sub_storage_access;
21 |
22 | pub use chain_history_access::ChainHistoryAccess;
23 | pub use mem_pool_access::MemPoolAccess;
24 | pub use storage_access::StorageAccess;
25 | pub use sub_storage_access::SubStorageAccess;
26 |
27 | /// A `Context` provides the interface against the system services such as moulde substorage access,
28 | /// mempool access
29 | pub trait Context: SubStorageAccess + MemPoolAccess {}
30 |
--------------------------------------------------------------------------------
/coordinator/src/context/chain_history_access.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use crate::header::Header;
18 | use ctypes::BlockId;
19 |
20 | pub trait ChainHistoryAccess {
21 | fn get_block_header(&self, block_id: BlockId) -> Option;
22 | }
23 |
--------------------------------------------------------------------------------
/coordinator/src/context/mem_pool_access.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use crate::transaction::Transaction;
18 | use ctypes::TxHash;
19 |
20 | pub trait MemPoolAccess {
21 | fn inject_transactions(&self, txs: Vec) -> Vec>;
22 | }
23 |
--------------------------------------------------------------------------------
/coordinator/src/context/storage_access.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use crate::context::SubStorageAccess;
18 | pub use ctypes::StorageId;
19 |
20 | // Interface between host and the coordinator
21 | pub trait StorageAccess: Send {
22 | /// Returns a subspace of the given `storage_id` in the underlying storage.
23 | fn sub_storage(&mut self, storage_id: StorageId) -> Box;
24 |
25 | fn max_body_size(&self) -> u64;
26 |
27 | /// Create a recoverable checkpoint of this state
28 | fn create_checkpoint(&mut self);
29 | /// Revert to the last checkpoint and discard it
30 | fn revert_to_the_checkpoint(&mut self);
31 | /// Merge last checkpoint with the previous
32 | fn discard_checkpoint(&mut self);
33 | }
34 |
--------------------------------------------------------------------------------
/coordinator/src/context/sub_storage_access.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use remote_trait_object::{service, Service};
18 |
19 | // Interface between each module and the coordinator
20 | #[service]
21 | pub trait SubStorageAccess: Service {
22 | fn get(&self, key: &[u8]) -> Option>;
23 | fn set(&mut self, key: &[u8], value: Vec);
24 | fn has(&self, key: &[u8]) -> bool;
25 | fn remove(&mut self, key: &[u8]);
26 | }
27 |
--------------------------------------------------------------------------------
/core/res/null.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Null",
3 | "genesis": {
4 | "seal": {
5 | "generic": "0x0"
6 | },
7 | "author": "fjjh0000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtc0",
8 | "timestamp": "0x00",
9 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
10 | "extraData": "0x"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/core/res/solo.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Solo",
3 | "genesis": {
4 | "seal": {
5 | "generic": "0x0"
6 | },
7 | "author": "fjjh0000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtc0",
8 | "timestamp": "0x00",
9 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
10 | "extraData": "0x"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/core/res/tendermint.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Tendermint",
3 | "genesis": {
4 | "seal": {
5 | "tendermint": {
6 | "prev_view": "0x0",
7 | "cur_view": "0x0",
8 | "precommits": [
9 | "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
10 | ]
11 | }
12 | },
13 | "author": "rjmxg19kCmkCxROEoV0QYsrDpOYsjQwusCtN5_oKMEzk-I6kgtAtc0",
14 | "timestamp": "0x00",
15 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
16 | "extraData": "0x"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/blockchain/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | mod block_info;
18 | #[cfg_attr(feature = "cargo-clippy", allow(clippy::module_inception))]
19 | mod blockchain;
20 | mod body_db;
21 | mod event_db;
22 | mod extras;
23 | mod headerchain;
24 | mod route;
25 | mod update_result;
26 |
27 | pub use self::blockchain::{BlockChain, BlockProvider};
28 | pub use self::body_db::BodyProvider;
29 | pub use self::event_db::EventProvider;
30 | pub use self::extras::{BlockDetails, TransactionAddress};
31 | pub use self::headerchain::HeaderProvider;
32 | pub use self::update_result::ChainUpdateResult;
33 |
--------------------------------------------------------------------------------
/core/src/blockchain_info.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2018 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use ctypes::{BlockHash, BlockNumber};
18 |
19 | /// Information about the blockchain gathered together.
20 | #[derive(Clone, Debug)]
21 | pub struct BlockChainInfo {
22 | /// Genesis block hash.
23 | pub genesis_hash: BlockHash,
24 | /// Best blockchain block hash.
25 | pub best_block_hash: BlockHash,
26 | /// Best blockchain proposal block hash.
27 | pub best_proposal_block_hash: BlockHash,
28 | /// Best blockchain block number.
29 | pub best_block_number: BlockNumber,
30 | /// Best blockchain block timestamp.
31 | pub best_block_timestamp: u64,
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/client/chain_notify.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use ctypes::BlockHash;
18 |
19 | /// Represents what has to be handled by actor listening to chain events
20 | pub trait ChainNotify: Send + Sync {
21 | /// fires when chain has new headers.
22 | fn new_headers(&self, _imported: Vec, _enacted: Vec, _new_best_proposal: Option) {
23 | // does nothing by default
24 | }
25 |
26 | /// fires when chain has new blocks.
27 | fn new_blocks(&self, _imported: Vec, _invalid: Vec, _enacted: Vec) {
28 | // does nothing by default
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/consensus/null_engine/mod.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2020 Kodebox, Inc.
2 | // This file is part of CodeChain.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as
6 | // published by the Free Software Foundation, either version 3 of the
7 | // License, or (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | use super::ConsensusEngine;
18 | use crate::consensus::{EngineError, EngineType};
19 | use ckey::Ed25519Public as Public;
20 |
21 | /// An engine which does not provide any consensus mechanism and does not seal blocks.
22 | #[derive(Default)]
23 | pub struct NullEngine;
24 |
25 | impl ConsensusEngine for NullEngine {
26 | fn seals_internally(&self) -> bool {
27 | true
28 | }
29 |
30 | fn engine_type(&self) -> EngineType {
31 | EngineType::Solo
32 | }
33 |
34 | fn possible_authors(&self, _block_number: Option) -> Result