Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,062 changes: 4,393 additions & 669 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ members = [
"runtime-modules/versioned-store",
"runtime-modules/versioned-store-permissions",
"runtime-modules/working-group",
# "node",
# "utils/chain-spec-builder/"
"node",
"utils/chain-spec-builder/"
]

[profile.release]
Expand Down
231 changes: 93 additions & 138 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
authors = ['Joystream']
authors = ['Joystream contributors']
build = 'build.rs'
edition = '2018'
name = 'joystream-node'
version = '2.6.0'
version = '3.0.0'
default-run = "joystream-node"

[[bin]]
Expand All @@ -14,143 +14,98 @@ path = 'bin/main.rs'
crate-type = ["cdylib", "rlib"]

[dependencies]
hex-literal = '0.2.1'
derive_more = '0.14.0'
exit-future = '0.1.4'
futures = '0.1.29'
log = '0.4.8'
parking_lot = '0.9.0'
tokio = '0.1.22'
jsonrpc-core = '13.2.0'
rand = '0.7.2'
structopt = '=0.3.5'
# third-party dependencies
serde = { version = "1.0.102", features = ["derive"] }
futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-core = "14.2.0"
structopt = { version = "0.3.8", optional = true}
serde_json = '1.0'
serde = '1.0'
hex = '0.4'
# https://users.rust-lang.org/t/failure-derive-compilation-error/39062
# quote = '<=1.0.2'

[dependencies.node-runtime]
package = 'joystream-node-runtime'
path = '../runtime'

[dependencies.substrate-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-basic-authorship'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.babe]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-consensus-babe'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.babe-primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-consensus-babe-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.codec]
package = 'parity-scale-codec'
version = '1.0.0'

[dependencies.ctrlc]
features = ['termination']
version = '3.0'

[dependencies.inherents]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-inherents'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.network]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-network'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.sr-io]
git = 'https://github.com/paritytech/substrate.git'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.substrate-cli]
git = 'https://github.com/paritytech/substrate.git'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.substrate-client]
git = 'https://github.com/paritytech/substrate.git'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.substrate-executor]
git = 'https://github.com/paritytech/substrate.git'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.substrate-service]
git = 'https://github.com/paritytech/substrate.git'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-transaction-pool'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.substrate-telemetry]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-telemetry'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.grandpa]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-finality-grandpa'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.grandpa-primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-finality-grandpa-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.im-online]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'srml-im-online'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.substrate-rpc]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-rpc'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.authority-discovery]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-authority-discovery'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.client-db]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-client-db'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.runtime-primitives]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'sr-primitives'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.offchain]
default_features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-offchain'
rev = 'c37bb08535c49a12320af7facfd555ce05cce2e8'

[dependencies.libp2p]
version = '0.13.2'
default-features = false
# primitives
sp-authority-discovery = { package = 'sp-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-consensus-babe = { package = 'sp-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-finality-grandpa = { package = 'sp-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-core = { package = 'sp-core', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-runtime = { package = 'sp-runtime', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-finality-tracker = { package = 'sp-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-inherents = { package = 'sp-inherents', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-consensus = { package = 'sp-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-transaction-pool = { package = 'sp-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-api = { package = 'sp-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-blockchain = { package = 'sp-blockchain', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-block-builder = { package = 'sp-block-builder', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }

# client dependencies
sc-client-api = { package = 'sc-client-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-chain-spec = { package = 'sc-chain-spec', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-consensus = { package = 'sc-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-transaction-pool = { package = 'sc-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-network = { package = 'sc-network', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-consensus-babe = { package = 'sc-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
sc-finality-grandpa = { package = 'sc-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-basic-authorship = { package = 'sc-basic-authorship', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-service = { package = 'sc-service', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-authority-discovery = { package = 'sc-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-consensus-epochs = { package = 'sc-consensus-epochs', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-keystore = { package = 'sc-keystore', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-consensus-babe-rpc = { package = 'sc-consensus-babe-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-finality-grandpa-rpc = { package = 'sc-finality-grandpa-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-rpc-api = { package = 'sc-rpc-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-executor = { package = 'sc-executor', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }

# frame dependencies
pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
pallet-transaction-payment-rpc = { package = 'pallet-transaction-payment-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
substrate-frame-rpc-system = { package = 'substrate-frame-rpc-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
frame-benchmarking = { package = 'frame-benchmarking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }

# node-specific dependencies
node-runtime = { package= "joystream-node-runtime", path = "../runtime" }

# CLI-specific dependencies
sc-cli = { package = 'sc-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
frame-benchmarking-cli = { package = 'frame-benchmarking-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
node-inspect = { package = 'node-inspect', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }

# WASM-specific dependencies
wasm-bindgen = { version = "0.2.57", optional = true }
wasm-bindgen-futures = { version = "0.4.7", optional = true }
browser-utils = { package = 'substrate-browser-utils', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true}

[dev-dependencies]
tempfile = "3.1.0"
codec = { package = "parity-scale-codec", version = "1.3.1" }
sp-timestamp = { package = 'sp-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sp-keyring = { package = 'sp-keyring', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
sc-consensus-babe = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', features = ["test-helpers"]}
sc-service-test = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
frame-system = { package = 'frame-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
pallet-transaction-payment = { package = 'pallet-transaction-payment', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
pallet-grandpa = { package = 'pallet-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }

[build-dependencies]
vergen = '3'
structopt = { version = "0.3.8", optional = true }
node-inspect = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true}
sc-cli = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true}
frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }

[features]
default = [ "cli" ]
browser = [
"browser-utils",
"wasm-bindgen",
"wasm-bindgen-futures",
]
cli = [
"node-inspect",
"sc-cli",
"frame-benchmarking-cli",
"sc-service/db",
"structopt",
"substrate-build-script-utils",
]
runtime-benchmarks = [
"node-runtime/runtime-benchmarks",
"frame-benchmarking-cli",
]
23 changes: 3 additions & 20 deletions node/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Joystream node. If not, see <http://www.gnu.org/licenses/>.

//! Substrate Node Template CLI library.
//! Joystream Node.

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

use joystream_node::cli;
pub use substrate_cli::{error, IntoExit, VersionInfo};

fn main() {
let version = VersionInfo {
name: "Joystream Node",
commit: env!("VERGEN_SHA_SHORT"),
version: env!("CARGO_PKG_VERSION"),
executable_name: "joystream-node",
author: "Joystream",
description: "Joystream substrate node",
support_url: "https://www.joystream.org/",
};

if let Err(e) = cli::run(::std::env::args(), cli::Exit, version) {
eprintln!("Fatal error: {}\n\n{:?}", e, e);
std::process::exit(1)
}
fn main() -> sc_cli::Result<()> {
joystream_node::command::run()
}
83 changes: 64 additions & 19 deletions node/build.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,72 @@
use std::{env, path::PathBuf};
// This file is part of Substrate.

use vergen::{generate_cargo_keys, ConstantsFlags};
// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

const ERROR_MSG: &str = "Failed to generate metadata files";
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

fn main() {
generate_cargo_keys(ConstantsFlags::SHA_SHORT).expect(ERROR_MSG);

let mut manifest_dir = PathBuf::from(
env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."),
);

while manifest_dir.parent().is_some() {
if manifest_dir.join(".git/HEAD").exists() {
println!(
"cargo:rerun-if-changed={}",
manifest_dir.join(".git/HEAD").display()
);
return;
}
#[cfg(feature = "cli")]
cli::main();
}

#[cfg(feature = "cli")]
mod cli {
include!("src/cli.rs");

use sc_cli::structopt::clap::Shell;
use std::{env, fs, path::Path};
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};

pub fn main() {
build_shell_completion();
generate_cargo_keys();

manifest_dir.pop();
rerun_if_git_head_changed();
}

println!("cargo:warning=Could not find `.git/HEAD` from manifest dir!");
/// Build shell completion scripts for all known shells
/// Full list in https://github.com/kbknapp/clap-rs/blob/e9d0562a1dc5dfe731ed7c767e6cee0af08f0cf9/src/app/parser.rs#L123
fn build_shell_completion() {
for shell in &[
Shell::Bash,
Shell::Fish,
Shell::Zsh,
Shell::Elvish,
Shell::PowerShell,
] {
build_completion(shell);
}
}

/// Build the shell auto-completion for a given Shell
fn build_completion(shell: &Shell) {
let outdir = match env::var_os("OUT_DIR") {
None => return,
Some(dir) => dir,
};
let path = Path::new(&outdir)
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.join("completion-scripts");

fs::create_dir(&path).ok();

Cli::clap().gen_completions("joystream-node", *shell, &path);
}
}
Loading