Skip to content

Commit

Permalink
Feature/follow node (paritytech#155)
Browse files Browse the repository at this point in the history
* refactor for multisig

remove doublemap for multisig

* Feature/linked node (paritytech#79)

provide linked node data struct for runtime module storage
this linked node support option data or no option data

* provide linkednode struct in cxsupport
* refactor linked node
* add option for LinkedNode
* refactor linkednode
      remove template mode, use associate type to replace it

* Fix static net address (paritytech#80)

* Feature/linked_node provide multinodexindex (paritytech#82)

provide multinodexindex

* fix bug for linked_node

when add same index node, do nothing for this node

* refactor financialrecords to support withdraw cache

refactor financialrecords to support withdraw cache and remove deposit fee

* btc bridge

* rename num/hash relationship data (NumberForHash/HashsForNumber)
* let HashsForNumber map to a vec to get all forked block
* add blocknumber in BlockHeaderFor

* tokenbalances

refactor tokenbalances to support issue token in genesis

* reject issue chainx token and provide u32, usize as for tokenbalance

* Perfect deposit  (paritytech#83)

* Add deposit cache

* Perfect deposit

* Perfect withdraw (paritytech#84)

* Perfect withdraw

* add network check in btc bridge

* when meet testnet, jump header bit check
* check the bit change block in genesis

* Fix test build

* Feature/refactor match (paritytech#86)

*  matchorder and pendingorders

* Fix op_return account id parse

* tokenbalances: provide reserved type for reservedtoken

* Fix merge error

* update genesis_config

* Update genesis_config

* x-btc

* provide  codec for btreemap

due to orphan for mod, use local struct named `CodecBTreeMap`

* Update latest bitcoin-rust dependeces

* Implement initial vote weight via coin age (paritytech#87)

* Use struct instead of map as much as possible

* Unchecked initial version

* All intentions except these validators are candidates

* Add harsh test

* Put candidates into stats

* Rename unstake to deactive

* Revert StakeWeight

* Remove useless code

* Remove MAX_INTENTIONS

* Refactor with btreemap (paritytech#88)

* Refactor NominationRecordsOf to NominationRecords using BTreeMap

* Remove candidate_count

* Rename deactive to deactivate

* optimization match (paritytech#89)

* remove ensureaccountliquid in tokenbalances and support

for ensureaccountliquied has changed in staking module

* Hotfix/fix stakeweight type (paritytech#90)

* Revert StakeWeight type

* Change Balance to u64

* Fix total_minted and remove valid_cands_weight

* Fix insert registration information failure (paritytech#91)

* Change receive_address type

* Update exterbn

* update secp256k1 dependency (paritytech#94)

* Fix receive_address bug

* Support new substrate in cxrml

* update rust-secp256k1 dependeces

* Runtime build ok

* Build ok

* New runtime interface

* Update all runtime module

* Runtime build ok

* All build ok

* Add node runtime to support chainx runtime

* Update new runtime
  • Loading branch information
gguoss authored Dec 17, 2018
1 parent 25b3c71 commit f2d7c5f
Show file tree
Hide file tree
Showing 69 changed files with 5,311 additions and 5,879 deletions.
3,591 changes: 1,930 additions & 1,661 deletions Cargo.lock

Large diffs are not rendered by default.

70 changes: 10 additions & 60 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,10 @@ version = "0.3.0"
authors = ["Chainpool <https://www.chainx.org>"]

[dependencies]
jsonrpc-macros = { git="https://github.com/paritytech/jsonrpc.git" }
substrate-network = { git = "https://github.com/paritytech/substrate" }
substrate-network-libp2p = { git = "https://github.com/paritytech/substrate" }
sr-primitives = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
substrate-client = { git = "https://github.com/paritytech/substrate" }
substrate-client-db = { git = "https://github.com/paritytech/substrate" }
substrate-keyring = { git = "https://github.com/paritytech/substrate" }
substrate-state-db = { git = "https://github.com/paritytech/substrate" }
substrate-state-machine = { git = "https://github.com/paritytech/substrate" }
substrate-telemetry = { git = "https://github.com/paritytech/substrate" }
substrate-bft = { git = "https://github.com/paritytech/substrate", default_features = false }
substrate-rpc-servers = { git = "https://github.com/paritytech/substrate" }
srml-balances = { git = "https://github.com/paritytech/substrate" }
jsonrpc-http-server = { git = "https://github.com/paritytech/jsonrpc" }
jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc" }
chainx-cli = { path = "./cli" }
ctrlc = { version = "3.0", features = ["termination"] }
serde = { version = "1.0", default_features = false }
serde_derive = { version = "1.0", optional = true }
parity-codec = { version = "2.0" }
chainx-primitives = { path = "./primitives" }
chainx-consensus = { path = "./consensus" }
chainx-executor = { path = "./executor" }
chainx-runtime = { path = "./runtime" }
chainx-network = { path = "./network" }
chainx-pool = { path = "./pool" }
chainx-rpc = { path = "./rpc" }
chainx-api = { path = "./api" }
cxrml-exchange-pendingorders = { path = "./cxrml/exchange/pendingorders" }
cxrml-tokenbalances = { path = "./cxrml/tokenbalances" }

env_logger = "0.5.13"
rhododendron = "0.3"
hex-literal = "0.1"
exit-future = "0.1"
error-chain = "0.12"
futures = "0.1.17"
ansi_term = "0.10"
sysinfo = "0.5.7"
tokio = "0.1.7"
names = '0.11.0'
clap = "2.30.0"
base58 = "0.1"
slog = "^2"
log = "0.3"

# bitcoin-rust
primitives = { git = "https://github.com/chainx-org/bitcoin-rust" }
Expand All @@ -57,24 +17,14 @@ keys = { git = "https://github.com/chainx-org/bitcoin-rust" }
[workspace]
members = [
"primitives",
"consensus",
"executor",
"runtime",
"network",
"pool",
"rpc",
"api",
"cxrml/system",
"cxrml/support",
"cxrml/tokenbalances",
"cxrml/multisig",
"cxrml/associations",
"cxrml/bridge/btc",
"cxrml/mining/staking",
"cxrml/mining/tokenstaking",
"cxrml/funds/financialrecords",
"cxrml/funds/withdrawal",
"cxrml/exchange/pendingorders",
"cxrml/exchange/matchorder",
"cxrml/example",
"cli",
# "cxrml/support",
# "cxrml/tokenbalances",
# "cxrml/mining/staking",
# "cxrml/funds/financialrecords",
# "cxrml/multisig",
# "cxrml/bridge/btc",
# "cxrml/example",
]
18 changes: 0 additions & 18 deletions api/Cargo.toml

This file was deleted.

84 changes: 0 additions & 84 deletions api/src/implement.rs

This file was deleted.

102 changes: 0 additions & 102 deletions api/src/lib.rs

This file was deleted.

35 changes: 35 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "chainx-cli"
version = "0.1.0"
description = "ChainX node implementation in Rust."

[dependencies]
log = "0.4"
tokio = "0.1.7"
exit-future = "0.1"
substrate-cli = { git = "https://github.com/chainpool/substrate" }
parity-codec = { version = "2.1" }
base58 = "0.1"
slog = "^2"
sr-io = { git = "https://github.com/chainpool/substrate" }
substrate-client = { git = "https://github.com/chainpool/substrate" }
substrate-primitives = { git = "https://github.com/chainpool/substrate" }
chainx-runtime = { path = "../runtime" }
chainx-primitives = { path = "../primitives" }
hex-literal = "0.1"
substrate-service = { git = "https://github.com/chainpool/substrate" }
substrate-transaction-pool = { git = "https://github.com/chainpool/substrate" }
substrate-network = { git = "https://github.com/chainpool/substrate" }
substrate-consensus-aura = { git = "https://github.com/chainpool/substrate" }
substrate-finality-grandpa = { git = "https://github.com/chainpool/substrate" }
substrate-keyring = { git = "https://github.com/chainpool/substrate" }
#cxrml-tokenbalances = { path = "../cxrml/tokenbalances" }
sr-primitives = { git = "https://github.com/chainpool/substrate" }
chainx-executor = { path = "../executor" }
primitives = { git = "https://github.com/chainx-org/bitcoin-rust" }
chain = { git = "https://github.com/chainx-org/bitcoin-rust" }
keys = { git = "https://github.com/chainx-org/bitcoin-rust" }
structopt = "0.2.13"

[dev-dependencies]
substrate-service-test = { git = "https://github.com/chainpool/substrate" }
47 changes: 47 additions & 0 deletions cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
use chainx_runtime::GenesisConfig;
use substrate_service;
use genesis_config::{testnet_genesis, GenesisSpec};

const STAGING_TELEMETRY_URL: &str = "ws://stats.chainx.org/submit/";

/// Specialised `ChainSpec`.
pub type ChainSpec = substrate_service::ChainSpec<GenesisConfig>;

/// Staging testnet config.
pub fn staging_testnet_config() -> ChainSpec {
let boot_nodes = vec![
];
ChainSpec::from_genesis(
"Staging Testnet",
"staging_testnet",
staging_testnet_config_genesis,
boot_nodes,
Some(STAGING_TELEMETRY_URL.into()),
None,
None,
None,
)
}

fn staging_testnet_config_genesis() -> GenesisConfig {
testnet_genesis(GenesisSpec::Multi)
}

fn development_config_genesis() -> GenesisConfig {
testnet_genesis(GenesisSpec::Dev)
}

/// Development config (single validator Alice)
pub fn development_config() -> ChainSpec {
ChainSpec::from_genesis("Development", "development", development_config_genesis, vec![], None, None, None, None)
}

fn local_testnet_genesis() -> GenesisConfig {
testnet_genesis(GenesisSpec::Local)
}

/// Local testnet config (multivalidator Alice + Bob)
pub fn local_testnet_config() -> ChainSpec {
ChainSpec::from_genesis("Local Testnet", "local_testnet", local_testnet_genesis, vec![], None, None, None, None)
}

12 changes: 12 additions & 0 deletions cli/src/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: substrate-node
author: "Parity Team <[email protected]>"
about: Substrate Node Rust Implementation
args:
- log:
short: l
value_name: LOG_PATTERN
help: Sets a custom logging
takes_value: true
subcommands:
- validator:
about: Run validator node
Loading

0 comments on commit f2d7c5f

Please sign in to comment.