This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
#url = "https://substrate-rpc.parity.io/" | |
url = "http://127.0.0.1:9944/" | |
headers = {'content-type': 'application/json'} | |
payload = { | |
"method": "chain_getRuntimeVersion", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// send a transaction | |
let nonce = 0; | |
let tx = Transfer { | |
amount: 42, | |
nonce, | |
from: AccountKeyring::Alice.into(), | |
to: AccountKeyring::Bob.into(), | |
}; | |
let signature = AccountKeyring::from_public(&tx.from).unwrap().sign(&tx.encode()).into(); | |
let xt = Extrinsic::Transfer(tx, signature).encode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn state_getStorage(&mut self, module: &str, storage_key_name: &str, param: Vec<u8>) { | |
let mut key = module.as_bytes().to_vec(); | |
key.append(&mut vec!(' ' as u8)); | |
key.append(&mut storage_key_name.as_bytes().to_vec()); | |
key.append(&mut param.clone()); | |
println!("will query storage for: {:?}", key); | |
let mut keyhash = hex::encode(twox_128(&key)); | |
keyhash.insert_str(0, "0x"); | |
println!("with storage key: {}", keyhash); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println!("Got message: {}", msg); | |
let retstr = msg.as_text().unwrap(); | |
let value: serde_json::Value = serde_json::from_str(retstr).unwrap(); | |
match value["id"].as_str() { | |
Some(idstr) => { }, | |
_ => { | |
// subscriptions | |
println!("no id field found in response. must be subscription"); | |
println!("method: {:?}", value["method"].as_str()); | |
match value["method"].as_str() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub type SgxExternalities = HashMap<Vec<u8>, Vec<u8>>; | |
... | |
let mut ext = SgxExternalities::new(); | |
... | |
//custom struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use primitives::crypto::Pair; | |
use std::path::PathBuf; | |
use keystore::Store; | |
use app_crypto::{AppKey, AppPublic, AppPair, ed25519, sr25519}; | |
use primitives::crypto::{Ss58Codec}; | |
fn main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2020-02-23 17:44:12.053 tokio-runtime-worker-2 INFO substrate Imported #18954 (0x9763…7d63) | |
2020-02-23 17:44:12.053 tokio-runtime-worker-10 DEBUG txpool Pool Status: Status { ready: 0, ready_bytes: 0, future: 0, future_bytes: 0 } | |
2020-02-23 17:44:12.929 tokio-runtime-worker-3 DEBUG txpool [0x4ab1e17a55ae5c6ccbc9e6022a23d511ba0edec74edc87ab65b863ff34176af8] Importing to ready | |
2020-02-23 17:44:12.929 tokio-runtime-worker-3 DEBUG txpool Pool Status: Status { ready: 1, ready_bytes: 144, future: 0, future_bytes: 0 } | |
2020-02-23 17:44:13.158 tokio-runtime-worker-8 DEBUG txpool [0x2e29eb5810d1ddbb7c741709ebdb41de7530103ae64acbfe3a8af28ad4451c44] Importing to ready | |
2020-02-23 17:44:13.158 tokio-runtime-worker-8 DEBUG txpool Pool Status: Status { ready: 2, ready_bytes: 288, future: 0, future_bytes: 0 } | |
2020-02-23 17:44:13.349 tokio-runtime-worker-10 DEBUG txpool [0x9de73bd4d2d6aacb91fc4be5bc5694df97034fd0530d0c5a822c12a404719e88] Importing to ready | |
2020-02-23 17:44:13.349 tokio-runtime-worker-10 DEBUG txpool Po |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./target/release/substratee-node --dev -lexecutor=trace | |
2020-04-21 08:08:00.499 main WARN sc_cli::commands::runcmd Running in --dev mode, RPC CORS has been disabled. | |
2020-04-21 08:08:00.499 main INFO sc_cli::commands::runcmd SubstraTEE Node | |
2020-04-21 08:08:00.499 main INFO sc_cli::commands::runcmd version 0.6.0-f26ecb9-x86_64-linux-gnu | |
2020-04-21 08:08:00.499 main INFO sc_cli::commands::runcmd by Supercomputing Systems AG <info@scs.ch>, 2017-2020 | |
2020-04-21 08:08:00.499 main INFO sc_cli::commands::runcmd Chain specification: Development | |
2020-04-21 08:08:00.499 main INFO sc_cli::commands::runcmd Node name: lying-ghost-7137 | |
2020-04-21 08:08:00.499 main INFO sc_cli::commands::runcmd Roles: AUTHORITY | |
2020-04-21 08:08:02.340 main INFO sc_client::client Initializing Genesis block/state (state: 0x598b…9d8e, header-hash: 0xe7ef…3b8c) | |
2020-04-21 08:08:02.340 main INFO afg Loading GRANDPA authority set from genesis on what appears to be first startup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./target/release/substratee-node purge-chain --dev | |
Are you sure to remove "/home/abrenzikofer/.local/share/substratee-node/chains/dev/db"? [y/N]: y | |
"/home/abrenzikofer/.local/share/substratee-node/chains/dev/db" removed. | |
abrenzikofer@devsgx02:~/substrate-node-template-fork$ clear | |
abrenzikofer@devsgx02:~/substrate-node-template-fork$ ./target/release/substratee-node --dev -ltrace | |
2020-04-21 11:14:30.933 main WARN sc_cli::commands::runcmd Running in --dev mode, RPC CORS has been disabled. | |
2020-04-21 11:14:30.934 main INFO sc_cli::commands::runcmd SubstraTEE Node | |
2020-04-21 11:14:30.934 main INFO sc_cli::commands::runcmd version 0.6.0-f26ecb9-x86_64-linux-gnu | |
2020-04-21 11:14:30.934 main INFO sc_cli::commands::runcmd by Supercomputing Systems AG <info@scs.ch>, 2017-2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./target/release/substratee-node build-spec --dev | |
2020-04-21 11:43:36 Building chain spec | |
{ | |
"name": "Development", | |
"id": "dev", | |
"bootNodes": [ | |
"/ip4/127.0.0.1/tcp/30333/p2p/QmacT1i1phoNpXBQsFccy6ELok1tcuvNga1rakQH6KoSid" | |
], | |
"telemetryEndpoints": null, | |
"protocolId": null, |
OlderNewer