Skip to content

Commit

Permalink
Merge pull request #48 from Phala-Network/init-with-secretkeys
Browse files Browse the repository at this point in the history
pRuntime: InitRuntime with secret keys for debug
  • Loading branch information
h4x3rotab committed Sep 28, 2020
2 parents 949b1c8 + dc09d39 commit ce551d2
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 140 deletions.
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

0 comments on commit ce551d2

Please sign in to comment.