From e6eae9a3d63b96d31b5d114f470464f78e04b54c Mon Sep 17 00:00:00 2001 From: hoani Date: Mon, 4 Nov 2019 13:20:20 +1300 Subject: [PATCH] chore(node): Change RuntimeVersion impl_name to plug-node. According to https://crates.parity.io/sr_version/struct.RuntimeVersion.html, this will not affect functionality. chore(node): Replaced Substrate with Plug. Added Plug Developers to author information. Set version to 0.0.0 - to be updated to 1.0.0 when we release Plug chore(Dockerfile): Updated Dockerfile names and descriptions for Plug. Removed incorrect maintainer details. signing commit --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 8 ++++---- Dockerfile | 31 +++++++++++++++++-------------- node/runtime/src/lib.rs | 2 +- node/src/main.rs | 10 +++++----- 5 files changed, 37 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01f48544d5..55b2c6bd2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2995,6 +2995,16 @@ name = "pkg-config" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "plug" +version = "0.0.0" +dependencies = [ + "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "node-cli 2.0.0", + "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ppv-lite86" version = "0.2.5" @@ -4721,16 +4731,6 @@ dependencies = [ "tiny-bip39 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "substrate" -version = "2.0.0" -dependencies = [ - "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "node-cli 2.0.0", - "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "substrate-application-crypto" version = "2.0.0" diff --git a/Cargo.toml b/Cargo.toml index b2c49e11b2..e960528262 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [[bin]] -name = "substrate" +name = "plug" path = "node/src/main.rs" [package] -name = "substrate" -version = "2.0.0" -authors = ["Parity Technologies "] +name = "plug" +version = "0.0.0" +authors = ["Plug Developers ", "Parity Technologies "] build = "build.rs" edition = "2018" diff --git a/Dockerfile b/Dockerfile index 709e28cc8e..0dfd84b933 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,24 @@ # Note: We don't use Alpine and its packaged Rust/Cargo because they're too often out of date, -# preventing them from being used to build Substrate/Polkadot. +# preventing them from being used to build Substrate/Polkadot/Plug. FROM phusion/baseimage:0.10.2 as builder -LABEL maintainer="chevdor@gmail.com" -LABEL description="This is the build stage for Substrate. Here we create the binary." +LABEL description="Pl^g build image: The Pl^g binary is built here." ENV DEBIAN_FRONTEND=noninteractive ARG PROFILE=release -WORKDIR /substrate +WORKDIR /plug -COPY . /substrate +COPY . /plug RUN apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang + apt-get install -y \ + clang \ + cmake \ + git \ + libssl-dev \ + pkg-config RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ export PATH="$PATH:$HOME/.cargo/bin" && \ @@ -27,8 +31,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ # ===== SECOND STAGE ====== FROM phusion/baseimage:0.10.2 -LABEL maintainer="chevdor@gmail.com" -LABEL description="This is the 2nd stage: a very small image where we copy the Substrate binary." +LABEL description="Pl^g runner image: A minimal image for running Pl^g." ARG PROFILE=release RUN mv /usr/share/ca* /tmp && \ @@ -36,20 +39,20 @@ RUN mv /usr/share/ca* /tmp && \ mv /tmp/ca-certificates /usr/share/ && \ mkdir -p /root/.local/share/Polkadot && \ ln -s /root/.local/share/Polkadot /data && \ - useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate + useradd -m -u 1000 -U -s /bin/sh -d /plug plug -COPY --from=builder /substrate/target/$PROFILE/substrate /usr/local/bin +COPY --from=builder /plug/target/$PROFILE/plug /usr/local/bin # checks -RUN ldd /usr/local/bin/substrate && \ - /usr/local/bin/substrate --version +RUN ldd /usr/local/bin/plug && \ + /usr/local/bin/plug --version # Shrinking RUN rm -rf /usr/lib/python* && \ rm -rf /usr/bin /usr/sbin /usr/share/man -USER substrate +USER plug EXPOSE 30333 9933 9944 VOLUME ["/data"] -CMD ["/usr/local/bin/substrate"] +CMD ["/usr/local/bin/plug"] diff --git a/node/runtime/src/lib.rs b/node/runtime/src/lib.rs index b2994d36da..ef4b0d5671 100644 --- a/node/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -77,7 +77,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); /// Runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("node"), - impl_name: create_runtime_str!("substrate-node"), + impl_name: create_runtime_str!("plug-node"), authoring_version: 10, // Per convention: if the runtime behavior changes, increment spec_version // and set impl_version to equal spec_version. If only runtime diff --git a/node/src/main.rs b/node/src/main.rs index 9f76cf638c..5916139f0c 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -45,13 +45,13 @@ impl cli::IntoExit for Exit { fn main() -> Result<(), cli::error::Error> { let version = VersionInfo { - name: "Substrate Node", + name: "Plug Node", commit: env!("VERGEN_SHA_SHORT"), version: env!("CARGO_PKG_VERSION"), - executable_name: "substrate", - author: "Parity Technologies ", - description: "Generic substrate node", - support_url: "https://github.com/paritytech/substrate/issues/new", + executable_name: "plug", + author: "Plug Developers ", + description: "Generic plug node", + support_url: "https://github.com/plugblockchain/plug-blockchain/issues/new", }; cli::run(std::env::args(), Exit, version)