Skip to content

Commit

Permalink
Merge pull request #12 from uni-arts-chain/common
Browse files Browse the repository at this point in the history
v3.0.0
  • Loading branch information
tuminfei authored Jul 2, 2021
2 parents abb0680 + b35d854 commit 311a2c6
Show file tree
Hide file tree
Showing 123 changed files with 5,136 additions and 4,233 deletions.
3,536 changes: 1,912 additions & 1,624 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FROM phusion/baseimage:0.11 as builder

ENV DEBIAN_FRONTEND=noninteractive
ENV RUST_TOOLCHAIN=nightly-2020-10-06
ENV RUST_TOOLCHAIN=nightly-2021-06-01
ENV PATH="$PATH:/root/.cargo/bin"
ARG PROFILE=release

Expand All @@ -15,8 +15,8 @@ RUN apt-get update && \
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# && \
RUN rustup uninstall stable && \
rustup install 1.46.0 && \
rustup default 1.46.0-x86_64-unknown-linux-gnu && \
rustup install 1.53.0 && \
rustup default 1.53.0-x86_64-unknown-linux-gnu && \
rustup toolchain install $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN && \
rustup default $RUST_TOOLCHAIN
Expand All @@ -34,7 +34,7 @@ COPY primitives ./primitives/
COPY README.md README.md
COPY Cargo* ./

RUN cargo +nightly-2020-10-06 build "--$PROFILE"
RUN cargo +nightly-2021-06-01 build "--$PROFILE"


# ===== RUN ======
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uni-arts Network (https://uniarts.network)
![Image text](https://raw.githubusercontent.com/uni-arts-chain/uni-arts-network/master/docs/uniarts-network-new.png)
![Image text](https://raw.githubusercontent.com/uni-arts-chain/uni-arts-network/master/docs/UA-logo.png)


Unite of Uniqueness
Expand Down
6 changes: 3 additions & 3 deletions bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uart"
version = "1.0.0"
version = "3.0.0"
description = "Uni-Arts node implementation in Rust"
authors = ["Uniarts Developers"]
edition = "2018"
Expand All @@ -16,8 +16,8 @@ name = "uart"
path = "src/main.rs"

[dependencies]
futures = { version = "=0.3.8" }
parity-util-mem = { version = "*", default-features = false, features = ["jemalloc-global"] }
futures = { version = "0.3.13" }
parity-util-mem = { version = "0.9.0", default-features = false, features = ["jemalloc-global"] }

uniarts-cli = { path = "cli" }
uniarts-service = { path = "service" }
Expand Down
22 changes: 11 additions & 11 deletions bin/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uniarts-cli"
version = "1.0.0"
version = "3.0.0"
authors = ["terry.tu <[email protected]>"]
edition = "2018"

Expand All @@ -12,19 +12,19 @@ structopt = "0.3.8"
log = { version = "0.4.11" }

# uniarts
uniarts-service = { path = "../service", default-features = false, optional = true }
uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v2.0.1" }
uniarts-service = { path = "../service", default-features = false }
uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.0" }

# substratem
sp-core = { version = "2.0.1", optional = true }
sc-cli = { version = "0.8.0", optional = true }
sc-service = { version = "0.8.0", optional = true }
sc-executor = { version = "0.8.0", features = ["wasmtime"] }
frame-benchmarking-cli = { version = "2.0.1", optional = true }
sp-trie = { version = "2.0.1", default-features = false }
sp-core = { version = "3.0.0", optional = true }
sc-cli = { version = "0.9.0", optional = true }
sc-service = { version = "0.9.0", optional = true }
sc-executor = { version = "0.9.0", features = ["wasmtime"] }
frame-benchmarking-cli = { version = "3.0.0", optional = true }
sp-trie = { version = "3.0.0", default-features = false }

[build-dependencies]
substrate-build-script-utils = { version = "2.0.1", default-features = false }
substrate-build-script-utils = { version = "3.0.0", default-features = false }

[features]
default = ["wasmtime", "cli"]
Expand All @@ -36,7 +36,7 @@ wasmtime = [
]

cli = [
"uniarts-service",
"uniarts-service/full-node",
"sp-core",
"sc-cli",
"sc-service",
Expand Down
14 changes: 13 additions & 1 deletion bin/cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use structopt::StructOpt;
use sc_cli::RunCmd;
use sc_cli::{RunCmd, KeySubcommand, SignCmd, VanityCmd, VerifyCmd};

#[derive(Debug, StructOpt)]
pub struct Cli {
Expand All @@ -12,6 +12,18 @@ pub struct Cli {

#[derive(Debug, StructOpt)]
pub enum Subcommand {
/// Key management cli utilities
Key(KeySubcommand),

/// Verify a signature for a message, provided on STDIN, with a given (public or secret) key.
Verify(VerifyCmd),

/// Generate a seed that provides a vanity address.
Vanity(VanityCmd),

/// Sign a message, with a given (secret) key.
Sign(SignCmd),

/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),

Expand Down
28 changes: 20 additions & 8 deletions bin/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_core::crypto::Ss58AddressFormat;
use uniarts_service::{pangu_runtime, fuxi_runtime, IdentifyVariant};
use log::info;

const UNI_ARTS_ADDRESS_FORMAT_ID: u8 = 45;
const UNI_ARTS_ADDRESS_FORMAT_ID: u16 = 45;

impl SubstrateCli for Cli {
fn impl_name() -> String {
Expand Down Expand Up @@ -117,6 +117,10 @@ pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();

match &cli.subcommand {
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Some(Subcommand::Sign(cmd)) => cmd.run(),
Some(Subcommand::Verify(cmd)) => cmd.run(),
Some(Subcommand::Vanity(cmd)) => cmd.run(),
Some(Subcommand::BuildSpec(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
Expand Down Expand Up @@ -280,17 +284,25 @@ pub fn run() -> sc_cli::Result<()> {
info!(" \\____/|_| |_|_| /_/ \\_\\_| \\__|___/ \\_____|_| |_|\\__,_|_|_| |_|");
info!(" ");
info!(" ");
info!(" by UniArts Network, 2018-2020");
info!(" by UniArts Network, 2018-2021");

if chain_spec.is_pangu_network() {
runner.run_node_until_exit(|config| match config.role {
Role::Light => uniarts_service::pangu_new_light(config),
_ => uniarts_service::pangu_new_full(config).map(|(components, _)| components),
runner.run_node_until_exit(|config| async move {
match config.role {
Role::Light => {
uniarts_service::pangu_new_light(config)
},
_ => uniarts_service::pangu_new_full(config).map(|(task_manager, _)| task_manager),
}.map_err(sc_cli::Error::Service)
})
} else if chain_spec.is_fuxi_network() {
runner.run_node_until_exit(|config| match config.role {
Role::Light => uniarts_service::fuxi_new_light(config),
_ => uniarts_service::fuxi_new_full(config).map(|(components, _)| components),
runner.run_node_until_exit(|config| async move {
match config.role {
Role::Light => {
uniarts_service::fuxi_new_light(config)
},
_ => uniarts_service::fuxi_new_full(config).map(|(task_manager, _)| task_manager),
}.map_err(sc_cli::Error::Service)
})
} else {
unreachable!()
Expand Down
11 changes: 3 additions & 8 deletions bin/cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Uniarts CLI library.


#![warn(missing_docs)]
#![warn(unused_extern_crates)]

#[cfg(feature = "cli")]
Expand All @@ -9,10 +8,6 @@ mod cli;
mod command;

#[cfg(feature = "cli")]
pub use cli::*;

#[cfg(feature = "cli")]
pub use command::*;

pub use command::run;
#[cfg(feature = "cli")]
pub use sc_cli::{Error, Result};
pub use sc_cli::Result;
58 changes: 29 additions & 29 deletions bin/rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
[package]
name = "uniarts-rpc"
description = "Uniarts node rpc"
version = "1.0.0"
version = "3.0.0"
authors = ["terry.tu <[email protected]>"]
edition = "2018"

[dependencies]
# crates
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
jsonrpc-core = "15.1.0"

# uniarts
uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v2.0.1" }
uniarts-primitives = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.0" }

# rpc
substrate-frame-rpc-system = { version = "2.0.0" }
pallet-transaction-payment-rpc = { version = "2.0.0" }
substrate-frame-rpc-system = { version = "3.0.0" }
pallet-transaction-payment-rpc = { version = "3.0.0" }

pallet-staking-rpc = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v2.0.1" }
pallet-contracts-rpc = { version = "0.8.0" }
pallet-staking-rpc = { git = "https://github.com/uni-arts-chain/uni-arts-common.git", tag = "v3.0.0" }
pallet-contracts-rpc = { version = "3.0.0" }

# substrate client
sc-cli = { version = "0.8.0", features = ["wasmtime"] }
sc-executor = { version = "0.8.0", features = ["wasmtime"] }
sc-service = { version = "0.8.0", features = ["wasmtime"] }
sc-transaction-pool = { version = "2.0.0" }
sc-consensus-aura = { version = "0.8.0" }
sc-consensus = { version = "0.8.0" }
sc-finality-grandpa = { version = "0.8.0" }
sc-client-api = { version = "2.0.0" }
sc-rpc = { version = "2.0.0" }
sc-rpc-api = { version = "0.8.0" }
sc-telemetry = { version = "2.0.0" }
sc-basic-authorship = { version = "0.8.0" }
sc-cli = { version = "0.9.0", features = ["wasmtime"] }
sc-executor = { version = "0.9.0", features = ["wasmtime"] }
sc-service = { version = "0.9.0", features = ["wasmtime"] }
sc-transaction-pool = { version = "3.0.0" }
sc-consensus-aura = { version = "0.9.0" }
sc-consensus = { version = "0.9.0" }
sc-finality-grandpa = { version = "0.9.0" }
sc-client-api = { version = "3.0.0" }
sc-rpc = { version = "3.0.0" }
sc-rpc-api = { version = "0.9.0" }
sc-telemetry = { version = "3.0.0" }
sc-basic-authorship = { version = "0.9.0" }

# substrate primitives
sp-core = { version = "2.0.0" }
sp-inherents = { version = "2.0.0" }
sp-transaction-pool = { version = "2.0.0"}
sp-consensus-aura = { version = "0.8.0" }
sp-consensus = { version = "0.8.0" }
sp-finality-grandpa = { version = "2.0.0" }
sp-runtime = { version = "2.0.0" }
sp-api = { version = "2.0.0" }
sp-blockchain = { version = "2.0.0" }
sp-block-builder = { version = "2.0.0" }
sp-core = { version = "3.0.0" }
sp-inherents = { version = "3.0.0" }
sp-transaction-pool = { version = "3.0.0"}
sp-consensus-aura = { version = "0.9.0" }
sp-consensus = { version = "0.9.0" }
sp-finality-grandpa = { version = "3.0.0" }
sp-runtime = { version = "3.0.0" }
sp-api = { version = "3.0.0" }
sp-blockchain = { version = "3.0.0" }
sp-block-builder = { version = "3.0.0" }
4 changes: 2 additions & 2 deletions bin/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct LightDeps<C, F, P> {
/// Instantiate all full RPC extensions.
pub fn create_full<C, P>(
deps: FullDeps<C, P>,
) -> RpcExtension where
) -> jsonrpc_core::IoHandler<sc_rpc::Metadata> where
C: ProvideRuntimeApi<Block>,
C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError> + 'static,
C: Send + Sync + 'static,
Expand Down Expand Up @@ -88,7 +88,7 @@ pub fn create_full<C, P>(
}

/// Instantiate all RPC extensions for light node.
pub fn create_light<C, P, F>(deps: LightDeps<C, F, P>) -> RpcExtension
pub fn create_light<C, P, F>(deps: LightDeps<C, F, P>) -> jsonrpc_core::IoHandler<sc_rpc::Metadata>
where
C: 'static + Send + Sync,
C: ProvideRuntimeApi<Block>,
Expand Down
Loading

0 comments on commit 311a2c6

Please sign in to comment.