Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc/v0.2.0 #76

Merged
merged 72 commits into from
Dec 17, 2018
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ef65f8b
chore: delete CHANGELOG from develop
doitian Nov 27, 2018
781d5f5
feat: add get_current_cell rpc for fetching unspent cells
xxuejie Nov 27, 2018
b7d092c
feat: Print full config error instead of just description (#23)
xxuejie Nov 27, 2018
f4644b8
fix: Fix network unexpected connections to self (#21)
jjyr Nov 27, 2018
c7fbc92
fix: fix integration tests
xxuejie Nov 27, 2018
80faf9c
Merge pull request #24 from nervosnetwork/xxuejie/get-current-cell-rpc
xxuejie Nov 27, 2018
d126e51
chore: Update dependency bigint:0.2.3
ashchan Nov 27, 2018
682333d
fix typo
driftluo Nov 28, 2018
8d1daf1
chore: Depend `ckb-vm` via Cargo (#25)
doitian Nov 28, 2018
9962bac
doc: fix typo (#30)
u2 Nov 28, 2018
46e0219
Merge pull request #27 from nervosnetwork/fix-typo
TheWaWaR Nov 28, 2018
f59c030
doc: vm is no longer a submodule (#32)
doitian Nov 28, 2018
ab0649c
chore: move explorer to new repo
quake Nov 28, 2018
7c09312
Merge pull request #34 from nervosnetwork/quake/separate_explorer
Nov 28, 2018
2494aa7
chore: add `make stats` for counting lines of code (#37)
rainchen Nov 28, 2018
4c2c173
Merge pull request #28 from nervosnetwork/update-dep-bigint
zhangsoledad Nov 28, 2018
1ca3090
chore: add `make security-audit` to audit crates with security vulner…
rainchen Nov 28, 2018
d4ca022
feat: add new syscall to fetch current script hash (#42)
xxuejie Nov 30, 2018
2f8cd66
doc: change the RPC verify command in README (#43)
lgn21st Nov 30, 2018
51b1675
fix: fix missing output lock hash (#46)
xxuejie Nov 30, 2018
c314ecd
doc: better description of RPC verification command (#45)
Dec 1, 2018
a81b2b7
doc: add badges (#35)
doitian Dec 1, 2018
26f043a
chore: upgrade crate `jsonrpc-http-server`
doitian Nov 29, 2018
4c9b397
chore: remove dependency on YAML
doitian Nov 29, 2018
f93e1da
feat: dockerfile for hub (#48)
zhangsoledad Dec 4, 2018
5fa2d7f
chore: upgrade outdated deps
zhangsoledad Dec 4, 2018
af64b05
chore: module-level attributes to skip generated code rustfmt clippy
zhangsoledad Dec 4, 2018
be5ca52
Merge pull request #50 from zhangsoledad/zhangsoledad/upgrade_dep
zhangsoledad Dec 4, 2018
f036763
chore: allow CI on all branches (#49)
doitian Dec 4, 2018
62defc8
Merge pull request #51 from zhangsoledad/zhangsoledad/skip_attributes
zhangsoledad Dec 4, 2018
8c8382a
fix: fix IBD sync process
jjyr Dec 5, 2018
2585e0a
chore(typo): correct minor grammar issues in TODO comment (#66)
ashchan Dec 6, 2018
542860c
Merge pull request #64 from nervosnetwork/jjyr/fix-IBD-sync-headers-p…
zhangsoledad Dec 6, 2018
7fef14d
refactor: rpc and miner (#52)
quake Dec 10, 2018
0cd755c
chore: upgrade crossbeam-channel (#69)
quake Dec 10, 2018
2cb8aca
refactor: replace ethereum-types with numext
zhangsoledad Nov 27, 2018
1b55d0d
build: bump rust-toolchain
zhangsoledad Dec 3, 2018
9a02165
Merge pull request #67 from zhangsoledad/zhangsoledad/numext
jjyr Dec 10, 2018
b6ae37a
chore(deps): bump faster-hex from 0.1.0 to 0.1.1
dependabot-support Dec 10, 2018
cfb984c
chore(deps): bump serde_derive from 1.0.80 to 1.0.81
dependabot-support Dec 10, 2018
206edf4
Merge pull request #68 from nervosnetwork/dependabot/cargo/faster-hex…
zhangsoledad Dec 10, 2018
b2f8674
Merge pull request #72 from nervosnetwork/dependabot/cargo/serde_deri…
zhangsoledad Dec 10, 2018
2c9361c
chore(deps): bump serde from 1.0.80 to 1.0.81
dependabot-support Dec 10, 2018
1fa1086
chore(deps): bump indicatif from 0.10.2 to 0.10.3
dependabot-support Dec 10, 2018
2d71b79
Merge pull request #73 from nervosnetwork/dependabot/cargo/serde-1.0.81
zhangsoledad Dec 10, 2018
880d0c7
Merge pull request #65 from nervosnetwork/dependabot/cargo/indicatif-…
zhangsoledad Dec 11, 2018
313b2ea
refactor: embrace Rust 2018 (#75)
zhangsoledad Dec 11, 2018
9573905
refactor: VM syscall refactoring
xxuejie Dec 10, 2018
c9364f2
feat: add LOAD_INPUT_BY_FIELD syscall
xxuejie Dec 11, 2018
7727360
fix: rustfmt
xxuejie Dec 11, 2018
707d661
fix: in case of missing cell, return ITEM_MISSING error instead of ha…
xxuejie Dec 11, 2018
342fb48
fix: Rust 2018 fixes
xxuejie Dec 11, 2018
506410a
Merge pull request #74 from nervosnetwork/xxuejie/syscall-refactoring
xxuejie Dec 11, 2018
c21f5de
fix: fix syscall number
xxuejie Dec 11, 2018
f7ee06e
Merge pull request #77 from nervosnetwork/xxuejie/fix-syscall-number
zhangsoledad Dec 11, 2018
62e784f
fix: fix rpc_url
ashchan Dec 11, 2018
fba929c
Merge pull request #78 from nervosnetwork/fix-rpc-url
zhangsoledad Dec 11, 2018
722b505
fix(build): docker tag (#81)
zhangsoledad Dec 12, 2018
c07b493
fix(build): docker port
zhangsoledad Dec 12, 2018
6d80ea4
fix: fix syscall length calculation (#82)
xxuejie Dec 12, 2018
d248ed4
fix: remove hash caches to avoid JSON deserialization bug (#84)
xxuejie Dec 12, 2018
2c85cba
Merge pull request #85 from zhangsoledad/zhangsoledad/docker_port
zhangsoledad Dec 12, 2018
789f8ca
chore: add script to bump versions
doitian Dec 12, 2018
c4b0a21
chore: run cargo check after bumping version
doitian Dec 12, 2018
1eebf75
fix: remove unsound test
zhangsoledad Dec 12, 2018
edb2658
doc: add link to CHANGELOG in README
doitian Dec 12, 2018
01e02e2
fix: resolve mining old block issue (#87)
quake Dec 12, 2018
2b0976f
fix: uncheck subtract overflow (#88)
zhangsoledad Dec 13, 2018
0be27e4
chore: bump to v0.2.0
doitian Dec 13, 2018
1b49477
chore: CHANGELOG for v0.2.0
doitian Dec 13, 2018
ee446c8
Merge branch 'master' into rc/v0.2.0
doitian Dec 14, 2018
13a6634
chore: amend CHANGELOG for v0.2.0
doitian Dec 17, 2018
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
Prev Previous commit
Next Next commit
chore: remove dependency on YAML
doitian committed Dec 3, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 4c9b3975973a82a715a525ad9d6ff3ec7148e4a1
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ authors = ["Nervos Core Dev <[email protected]>"]
build = "build.rs"

[dependencies]
clap = { version = "2", features = ["yaml"] }
clap = { version = "2" }
serde = "1.0"
serde_derive = "1.0"
log = "0.4"
83 changes: 0 additions & 83 deletions src/cli/app.yml

This file was deleted.

106 changes: 106 additions & 0 deletions src/cli/args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// use build_info::Version;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};

use build_info::Version;

pub fn get_matches() -> ArgMatches<'static> {
let version = get_version!();

App::new("ckb")
.author("Nervos Core Dev <[email protected]>")
.about("Nervos CKB - The Common Knowledge Base")
.version(version.short().as_str())
.long_version(version.long().as_str())
.setting(AppSettings::ArgRequiredElseHelp)
.arg(
Arg::with_name("config")
.short("c")
.long("config")
.value_name("CONFIG")
.takes_value(true)
.help("Specify the configuration file PATH. Tries ckb.json, nodes/default.json in working directory when omitted.")
)
.subcommand(run())
.subcommand(export())
.subcommand(import())
.subcommand(cli())
.get_matches()
}

fn run() -> App<'static, 'static> {
SubCommand::with_name("run").about("Running ckb node")
}

fn arg_format() -> Arg<'static, 'static> {
Arg::with_name("format")
.short("f")
.long("format")
.value_name("FORMAT")
.required(true)
.takes_value(true)
.help("Specify the format.")
}

fn export() -> App<'static, 'static> {
SubCommand::with_name("export")
.about("Export ckb data")
.arg(arg_format())
.arg(
Arg::with_name("target")
.short("t")
.long("target")
.value_name("PATH")
.required(true)
.index(1)
.help("Specify the export target path."),
)
}

fn import() -> App<'static, 'static> {
SubCommand::with_name("import")
.about("Import ckb data")
.arg(arg_format())
.arg(
Arg::with_name("source")
.short("s")
.long("source")
.value_name("PATH")
.required(true)
.index(1)
.help("Specify the exported data path."),
)
}

fn arg_private_key() -> Arg<'static, 'static> {
Arg::with_name("private-key")
.short("p")
.long("private-key")
.value_name("H256")
.help("Specify the private key")
.takes_value(true)
.required(true)
}

fn cli() -> App<'static, 'static> {
SubCommand::with_name("cli")
.about("Running ckb cli")
.setting(AppSettings::ArgRequiredElseHelp)
.subcommand(
SubCommand::with_name("sign")
.about("Sign transaction using sha3-secp256k1 defined in system cell")
.arg(arg_private_key())
.arg(
Arg::with_name("unsigned-transaction")
.short("u")
.long("unsigned-transaction")
.value_name("JSON")
.help("Specify the unsigned transaction json string")
.takes_value(true)
.required(true),
),
).subcommand(
SubCommand::with_name("type_hash")
.about("Generate script type hash using sha3-secp256k1 defined in system cell")
.arg(arg_private_key()),
).subcommand(SubCommand::with_name("keygen").about("Generate new key"))
}
2 changes: 2 additions & 0 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
mod args;
mod export;
mod import;
mod run_impl;

pub use self::args::get_matches;
pub use self::export::export;
pub use self::import::import;
pub use self::run_impl::{keygen, run, sign, type_hash};
30 changes: 12 additions & 18 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
#[macro_use]
extern crate build_info;
#[macro_use]
extern crate clap;
extern crate ctrlc;
extern crate dir;
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_derive;

extern crate bigint;
extern crate ckb_chain;
extern crate ckb_chain_spec;
extern crate ckb_core;
extern crate ckb_db;
extern crate ckb_instrument;
extern crate ckb_miner;
extern crate ckb_network;
extern crate ckb_notify;
extern crate ckb_pool;
extern crate ckb_pow;
extern crate ckb_rpc;
extern crate ckb_shared;
extern crate ckb_sync;
extern crate ckb_util;
extern crate hash;
extern crate logger;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate build_info;
extern crate ckb_instrument;
extern crate ckb_pow;
extern crate config as config_tool;
extern crate crypto;
extern crate ctrlc;
extern crate dir;
extern crate faster_hex;
extern crate hash;
extern crate logger;
extern crate serde_json;
#[cfg(test)]
extern crate tempfile;
@@ -36,20 +37,13 @@ mod cli;
mod helper;
mod setup;

use build_info::Version;
use setup::{get_config_path, Setup};

fn main() {
// Always print backtrace on panic.
::std::env::set_var("RUST_BACKTRACE", "full");

let yaml = load_yaml!("cli/app.yml");
let version = get_version!();
let matches = clap::App::from_yaml(yaml)
.version(version.short().as_str())
.long_version(version.long().as_str())
.get_matches();

let matches = cli::get_matches();
let config_path = get_config_path(&matches);
let setup = match Setup::setup(&config_path) {
Ok(setup) => {