i have an asynchronous task that i need to execute but it appears that substrate node already has a runtime for doing that, if i simply make main function in node/main.rs
asynchronous like this:
#[tokio::main]
async fn main() -> Result<(),sc_cli::Error>{
tokio::spawn(myasyncFunction);
command::run()
}
it gives me this error:
Thread 'main' panicked at 'Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks
can someone explain to me the error and what is the right place to add my async tasks in node?