Skip to content

Commit

Permalink
fix: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Dec 2, 2024
1 parent 2267f1b commit 0d25ac8
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 24 deletions.
2 changes: 0 additions & 2 deletions examples/cbindings/waku_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ void handle_user_input() {
// End of UI program logic

int main(int argc, char** argv) {
waku_setup();

struct ConfigNode cfgNode;
// default values
snprintf(cfgNode.host, 128, "0.0.0.0");
Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/waku.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ auto cify(F&& f) {
}

int main(int argc, char** argv) {
waku_setup();

struct ConfigNode cfgNode;
// default values
snprintf(cfgNode.host, 128, "0.0.0.0");
Expand Down
6 changes: 0 additions & 6 deletions examples/golang/waku.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ type WakuNode struct {
ctx unsafe.Pointer
}

func WakuSetup() {
C.waku_setup()
}

func WakuNew(config WakuConfig) (*WakuNode, error) {
jsonConfig, err := json.Marshal(config)
if err != nil {
Expand Down Expand Up @@ -557,8 +553,6 @@ func (self *WakuNode) WakuGetMyENR() (string, error) {
}

func main() {
WakuSetup()

config := WakuConfig{
Host: "0.0.0.0",
Port: 30304,
Expand Down
1 change: 0 additions & 1 deletion examples/mobile/android/app/src/main/jni/waku_ffi.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ jclass loadClass(JNIEnv *env, const char *className) {
}

void Java_com_mobile_WakuModule_wakuSetup(JNIEnv *env, jobject thiz) {
waku_setup();
LOGD("log example for debugging purposes...")
}

Expand Down
3 changes: 0 additions & 3 deletions examples/python/waku.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ def call_waku(func):

callback_type = ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.c_char_p, ctypes.c_size_t)

# libwaku setup
libwaku.waku_setup()

# Node creation
libwaku.waku_new.restype = ctypes.c_void_p
libwaku.waku_new.argtypes = [ctypes.c_char_p,
Expand Down
4 changes: 0 additions & 4 deletions examples/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ pub type WakuCallback =
);

extern "C" {
pub fn waku_setup();

pub fn waku_new(
config_json: *const u8,
cb: WakuCallback,
Expand Down Expand Up @@ -70,8 +68,6 @@ fn main() {
}";

unsafe {
waku_setup();

// Create the waku node
let closure = |ret: i32, data: &str| {
println!("Ret {ret}. Error creating waku node {data}");
Expand Down
3 changes: 0 additions & 3 deletions library/libwaku.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ extern "C" {

typedef void (*WakuCallBack) (int callerRet, const char* msg, size_t len, void* userData);

// Initializes the library. Should be called before any other function
void waku_setup();

// Creates a new instance of the waku node.
// Sets up the waku node from the given configuration.
// Returns a pointer to the Context needed by the rest of the API functions.
Expand Down
3 changes: 0 additions & 3 deletions library/libwaku.nim
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ proc initializeLibrary() {.exported.} =

################################################################################
### Exported procs
proc waku_setup() {.dynlib, exportc.} =
NimMain()
initializeLibrary()

proc waku_new(
configJson: cstring, callback: WakuCallback, userData: pointer
Expand Down

0 comments on commit 0d25ac8

Please sign in to comment.