diff --git a/README.md b/README.md index 952b262..2eb45ce 100644 --- a/README.md +++ b/README.md @@ -90,3 +90,11 @@ espflash board-info export CC=$PWD/.embuild/espressif/tools/riscv32-esp-elf/esp-2021r2-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc + +cargo +nightly build --release + +esptool.py --chip esp32c3 elf2image target/riscv32imc-esp-espidf/release/sphinx-key + +esptool.py --chip esp32c3 -p /dev/tty.usbserial-1420 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x10000 target/riscv32imc-esp-espidf/release/sphinx-key.bin + +espmonitor /dev/tty.usbserial-1420 diff --git a/signer/Cargo.toml b/signer/Cargo.toml index 3353ec3..ffbb385 100644 --- a/signer/Cargo.toml +++ b/signer/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] sphinx-key-parser = { path = "../parser" } -# vls-protocol-signer = { path = "../../../evanf/validating-lightning-signer/vls-protocol-signer", default-features = false, features = ["secp-lowmemory"] } +# vls-protocol-signer = { path = "../../../evanf/validating-lightning-signer/vls-protocol-signer", default-features = false, features = ["std", "secp-lowmemory"] } # vls-protocol-signer = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer", default-features = false, features = ["secp-lowmemory"] } -vls-protocol-signer = { git = "https://gitlab.com/Evanfeenstra/validating-lightning-signer", branch = "std-signer", default-features = false, features = ["secp-lowmemory"] } +vls-protocol-signer = { git = "https://gitlab.com/Evanfeenstra/validating-lightning-signer", branch = "std-signer", default-features = false, features = ["std", "secp-lowmemory"] } anyhow = {version = "1", features = ["backtrace"]} log = "0.4" diff --git a/signer/src/lib.rs b/signer/src/lib.rs index 2d3181a..1a06662 100644 --- a/signer/src/lib.rs +++ b/signer/src/lib.rs @@ -1,12 +1,13 @@ use lightning_signer::persist::{DummyPersister, Persist}; -use lightning_signer::Arc; +// use lightning_signer::Arc; use sphinx_key_parser::MsgDriver; +use std::sync::Arc; +use vls_protocol::model::PubKey; use vls_protocol::msgs::{self, read_serial_request_header, write_serial_response_header, Message}; use vls_protocol::serde_bolt::WireString; +use vls_protocol_signer::handler::{Handler, RootHandler}; pub use vls_protocol_signer::lightning_signer; pub use vls_protocol_signer::vls_protocol; -use vls_protocol::model::PubKey; -use vls_protocol_signer::handler::{Handler, RootHandler}; pub struct InitResponse { pub root_handler: RootHandler, @@ -28,7 +29,7 @@ pub fn init(bytes: Vec) -> anyhow::Result { .collect::>(); log::info!("allowlist {:?}", allowlist); let seed = init.dev_seed.as_ref().map(|s| s.0).expect("no seed"); - log::info!("seed {:?}", seed); + log::info!("create root handler now"); let root_handler = RootHandler::new(0, Some(seed), persister, allowlist); log::info!("root_handler created"); let init_reply = root_handler diff --git a/sphinx-key/sdkconfig.defaults b/sphinx-key/sdkconfig.defaults index 3ca3b5d..5259aff 100644 --- a/sphinx-key/sdkconfig.defaults +++ b/sphinx-key/sdkconfig.defaults @@ -1,5 +1,5 @@ # Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) -CONFIG_ESP_MAIN_TASK_STACK_SIZE=7000 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=13000 # Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). # This allows to use 1 ms granuality for thread sleeps (10 ms by default).