Skip to content

Commit

Permalink
Introducing datalog command
Browse files Browse the repository at this point in the history
* Upgrade to latest substrate
* Bump version
* Enable jemalloc allocator for native builds
* Fix browser wasm builds
* Added robonomics-sensors crate
  • Loading branch information
akru committed Apr 12, 2020
1 parent 408b99d commit 01137af
Show file tree
Hide file tree
Showing 13 changed files with 419 additions and 314 deletions.
640 changes: 350 additions & 290 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"robonomics/frame/datalog",
"robonomics/frame/liability",
"robonomics/protocol",
"robonomics/sensors",
"robonomics/ros-api",
"robonomics/ros-api/msgs",
"substrate-ros/api",
Expand Down
4 changes: 3 additions & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node-cli"
version = "0.17.0"
version = "0.17.1"
authors = ["Airalab <[email protected]>"]
description = "Robonomics node implementation in Rust & Substrate."
build = "build.rs"
Expand Down Expand Up @@ -86,6 +86,7 @@ sc-rpc = { git = "https://github.com/paritytech/substrate" }
# CLI-specific dependencies
sc-cli = { git = "https://github.com/paritytech/substrate", optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", optional = true }
parity-util-mem = { version = "*", default-features = false, optional = true }

# Browser bundle build support
wasm-bindgen = { version = "0.2.57", optional = true }
Expand Down Expand Up @@ -126,6 +127,7 @@ cli = [
"structopt",
"platforms",
"sc-service/rocksdb",
"parity-util-mem/jemalloc-global",
"robonomics-protocol/cli",
]

Expand Down
8 changes: 4 additions & 4 deletions bin/node/cli/src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Bo
let config = browser_configuration(chain_spec).await?;

info!("Robonomics browser node");
info!(" version {}", config.full_version());
info!(" version {}", config.impl_version);
info!(" by Airalab, 2018-2020");
info!("Chain specification: {}", config.expect_chain_spec().name());
info!("Node name: {}", config.name);
info!("Chain specification: {}", config.chain_spec.name());
info!("Node name: {}", config.network.node_name);
info!("Role: {:?}", config.role);

// Create the service. This is the most heavy initialization step.
if config.expect_chain_spec().is_ipci() {
if config.chain_spec.is_ipci() {
let service = crate::service::new_ipci_light(config)
.map_err(|e| format!("{:?}", e))?;
Ok(browser_utils::start_client(service))
Expand Down
13 changes: 1 addition & 12 deletions bin/node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use sc_cli::SubstrateCli;
use crate::{
Cli, Subcommand, chain_spec,
IsIpci, Cli, Subcommand, chain_spec,
service::{
new_robonomics_full, new_robonomics_light,
new_ipci_full, new_ipci_light,
Expand All @@ -27,17 +27,6 @@ use crate::{
},
};

/// Can be called for a `Configuration` to check if it is a configuration for IPCI network.
pub trait IsIpci {
fn is_ipci(&self) -> bool;
}

impl IsIpci for Box<dyn sc_chain_spec::ChainSpec> {
fn is_ipci(&self) -> bool {
self.id().starts_with("ipci")
}
}

impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
"airalab-robonomics"
Expand Down
11 changes: 11 additions & 0 deletions bin/node/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@ pub use browser::*;
pub use cli::*;
#[cfg(feature = "cli")]
pub use command::*;

/// Can be called for a `Configuration` to check if it is a configuration for IPCI network.
pub trait IsIpci {
fn is_ipci(&self) -> bool;
}

impl IsIpci for Box<dyn sc_chain_spec::ChainSpec> {
fn is_ipci(&self) -> bool {
self.id().starts_with("ipci")
}
}
2 changes: 1 addition & 1 deletion bin/node/ipci-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ipci-runtime"
version = "0.17.0"
version = "0.17.1"
authors = ["Airalab <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions bin/node/ipci-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 3,
impl_version: 3,
spec_version: 4,
impl_version: 4,
apis: RUNTIME_API_VERSIONS,
};

Expand Down
2 changes: 1 addition & 1 deletion bin/node/robonomics-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "robonomics-runtime"
version = "0.17.0"
version = "0.17.1"
authors = ["Airalab <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions bin/node/robonomics-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 82,
impl_version: 82,
spec_version: 83,
impl_version: 83,
apis: RUNTIME_API_VERSIONS,
};

Expand Down
2 changes: 1 addition & 1 deletion robonomics/protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sp-runtime = "2.0.0-alpha.5"
pallet-indices = "2.0.0-alpha.5"
derive_more = "0.99"
bincode = "1.2"
libp2p = "0.17"
libp2p = "0.18"
log = "0.4"
hex = "0.4"

Expand Down
24 changes: 24 additions & 0 deletions robonomics/sensors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "robonomics-sensors"
description = "Robonomics Network supported sensors."
version = "0.1.0"
authors = ["Airalab <[email protected]>"]
edition = "2018"

[dependencies]
robonomics-protocol = { path = "../protocol" }

# cli specified
sc-cli = { git = "https://github.com/paritytech/substrate", optional = true }
structopt = { version = "0.3.8", optional = true }
async-std = { version = "1.5", optional = true }

[features]
default = []

## Enables console interface components.
cli = [
"structopt",
"async-std",
"sc-cli",
]
18 changes: 18 additions & 0 deletions robonomics/sensors/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
///////////////////////////////////////////////////////////////////////////////
//
// Copyright 2018-2020 Airalab <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////////////
//! Robonomics Network supported sensors.

0 comments on commit 01137af

Please sign in to comment.