Spawn separate process for wakunode2 from Go

Hack to get librln dynamic lib
This commit is contained in:
Oskar Thoren 2021-06-07 16:47:37 +08:00
parent 78968abe1a
commit 454073a978
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
2 changed files with 14 additions and 0 deletions

14
main.go
View File

@ -3,8 +3,11 @@ package main
import (
"fmt"
"io"
"log"
"encoding/json"
"bytes"
"os"
"os/exec"
"net/http"
)
@ -28,6 +31,17 @@ type DebugResult struct {
}
func main() {
cmd := exec.Command("./wakunode2")
// TODO Redirect to file
cmd.Stdout = os.Stdout
err := cmd.Start()
if err != nil {
log.Fatal(err)
}
log.Printf("Just ran subprocess %d, exiting\n", cmd.Process.Pid)
// TODO This should wait a bit
// Run this in background
fmt.Println("JSON RPC request: get_waku_v2_debug_v1_info")
data := Payload{

BIN
vendor/rln/target/debug/librln.so vendored Executable file

Binary file not shown.