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

pRuntime: InitRuntime with secret keys for debug #48

Merged
merged 2 commits into from Sep 28, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions phost/src/main.rs
Expand Up @@ -48,6 +48,9 @@ struct Args {
#[structopt(long = "no-write-back", help = "Don't write pRuntime egress data back to Substarte.")]
no_write_back: bool,

#[structopt(long, help = "Inject dev key (0x1) to pRuntime. Cannot be used with remote attestation enabled.")]
use_dev_key: bool,

#[structopt(
short = "r", long = "remote-attestation",
help = "Should enable Remote Attestation")]
Expand Down Expand Up @@ -511,6 +514,10 @@ async fn bridge(args: Args) -> Result<(), Error> {
let runtime_info = pr.req_decode("init_runtime", InitRuntimeReq {
skip_ra: !args.ra,
bridge_genesis_info_b64: info_b64,
debug_set_key: match args.use_dev_key {
true => Some(String::from("0000000000000000000000000000000000000000000000000000000000000001")),
false => None
}
}).await?;

println!("runtime_info:{:?}", runtime_info);
Expand Down
3 changes: 2 additions & 1 deletion phost/src/types.rs
Expand Up @@ -133,7 +133,8 @@ impl Resp for QueryReq {
#[derive(Serialize, Deserialize, Debug)]
pub struct InitRuntimeReq {
pub skip_ra: bool,
pub bridge_genesis_info_b64: String
pub bridge_genesis_info_b64: String,
pub debug_set_key: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct InitRuntimeResp {
Expand Down