From 1d7e14dc1b35e70093427f6c0a1e46d3db7bd329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Wed, 31 Jul 2019 13:54:48 +0200 Subject: [PATCH 1/4] refactor the C and Go wrapper build system - moved "nimbus/api" to "wrappers" - renamed files - replaced the build scripts with Makefile targets - set the rpath relative to the test binary's location so it can look for libnimbus.so there at runtime - libnimbus.so.0 required on Linux, apparently - compiled all the Nimbus code with `--app:lib`, not just one file (this required skipping a proc in "nimbus/config.nim" because it uses an API that's unavailable in libraries) - removed static linking from the Go wrapper. It doesn't make sense at a global level, when using a shared Nimbus library. To selectively link static libraries, we should probably be specifying them as *.a. I did build a static libnimbus.a, as a test, but it insisted on dlopen-ing a shared version of itself which looked too ugly to continue. --- .gitignore | 2 +- Makefile | 16 ++- nim.cfg | 4 + nimbus/api/.gitignore | 2 - nimbus/api/README.md | 7 -- nimbus/api/build_go.sh | 2 - nimbus/api/build_status_api.sh | 12 -- nimbus/api/status_api.nim.cfg | 4 - nimbus/config.nim | 103 +++++++++--------- wrappers/README.md | 21 ++++ nimbus/api/status_api.c => wrappers/wrapper.c | 2 +- nimbus/api/main.go => wrappers/wrapper.go | 4 +- nimbus/api/status_api.h => wrappers/wrapper.h | 0 .../status_api.nim => wrappers/wrapper.nim | 2 +- 14 files changed, 96 insertions(+), 85 deletions(-) delete mode 100644 nimbus/api/.gitignore delete mode 100644 nimbus/api/README.md delete mode 100755 nimbus/api/build_go.sh delete mode 100755 nimbus/api/build_status_api.sh delete mode 100644 nimbus/api/status_api.nim.cfg create mode 100644 wrappers/README.md rename nimbus/api/status_api.c => wrappers/wrapper.c (97%) rename nimbus/api/main.go => wrappers/wrapper.go (95%) rename nimbus/api/status_api.h => wrappers/wrapper.h (100%) rename nimbus/api/status_api.nim => wrappers/wrapper.nim (99%) diff --git a/.gitignore b/.gitignore index 65d68dedb..263f358b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -nimcache +/nimcache # Executables shall be put in an ignored build/ directory /build diff --git a/Makefile b/Makefile index d042eb3aa..48d8f6767 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ TOOLS_DIRS := premix tests # comma-separated values for the "clean" target TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(TOOLS)) -.PHONY: all $(TOOLS) deps sanity-checks github-ssh build-nim update status ntags ctags nimbus testsuite test clean mrproper fetch-dlls test-libp2p-daemon nat-libs libminiupnpc.a libnatpmp.a go-checks +.PHONY: all $(TOOLS) deps sanity-checks github-ssh build-nim update status ntags ctags nimbus testsuite test clean mrproper fetch-dlls test-libp2p-daemon nat-libs libminiupnpc.a libnatpmp.a go-checks libnimbus.so wrappers # default target, because it's the first one that doesn't start with '.' all: $(TOOLS) nimbus @@ -128,7 +128,7 @@ test-reproducibility: # usual cleaning clean: - rm -rf build/{nimbus,$(TOOLS_CSV),all_tests,test_rpc,*.exe} vendor/go/bin \ + rm -rf build/{nimbus,$(TOOLS_CSV),all_tests,test_rpc,*.exe,*.so,*.so.0,*_wrapper_test} vendor/go/bin \ $(NIMBLE_DIR) $(NIM_BINARY) $(NIM_DIR)/nimcache nimcache + $(MAKE) -C vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc clean $(HANDLE_OUTPUT) + $(MAKE) -C vendor/nim-nat-traversal/vendor/libnatpmp clean $(HANDLE_OUTPUT) @@ -197,6 +197,18 @@ test-libp2p-daemon: | vendor/go/bin/p2pd deps $(ENV_SCRIPT) nim c -r $(NIM_PARAMS) tests/testdaemon.nim && \ rm -f tests/testdaemon +libnimbus.so: | build deps nat-libs + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) nim c --app:lib --noMain -d:"chronicles_sinks=textlines" --debuginfo --opt:speed --lineTrace:off $(NIM_PARAMS) -o:build/$@.0 wrappers/wrapper.nim && \ + rm -f build/$@ && \ + ln -s $@.0 build/$@ + +wrappers: | build deps nat-libs libnimbus.so go-checks + echo -e $(BUILD_MSG) "build/C_wrapper_test" && \ + $(CC) wrappers/wrapper.c -Wl,-rpath,'$$ORIGIN' -Lbuild -lnimbus -lm -g -o build/C_wrapper_test + echo -e $(BUILD_MSG) "build/go_wrapper_test" && \ + go build -o build/go_wrapper_test wrappers/wrapper.go + # https://bitbucket.org/nimcontrib/ntags/ - currently fails with "out of memory" ntags: ntags -R . diff --git a/nim.cfg b/nim.cfg index 8b04f4b94..52b2c9fdf 100644 --- a/nim.cfg +++ b/nim.cfg @@ -17,3 +17,7 @@ --excessiveStackTrace:on -d:metrics # enable metric collection +# Required to make up for the compiler's inability to invalidate the C file +# (and object) cache on different command line arguments. +--forceBuild + diff --git a/nimbus/api/.gitignore b/nimbus/api/.gitignore deleted file mode 100644 index 0561c87e4..000000000 --- a/nimbus/api/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -status_api_test -libnimbus_api.so diff --git a/nimbus/api/README.md b/nimbus/api/README.md deleted file mode 100644 index d55cdfd5e..000000000 --- a/nimbus/api/README.md +++ /dev/null @@ -1,7 +0,0 @@ -This folder contains an experimental C API for using parts of the nimbus -code from C/go in the status console client: - -https://github.com/status-im/status-console-client/ - -It serves mainly as a proof-of-concept for now - there are several unresolved -issues surrounding threading, inter-language communication, callbacks etc. diff --git a/nimbus/api/build_go.sh b/nimbus/api/build_go.sh deleted file mode 100755 index b3d40fc9d..000000000 --- a/nimbus/api/build_go.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -go build --ldflags '-extldflags "-static"' -o test main.go diff --git a/nimbus/api/build_status_api.sh b/nimbus/api/build_status_api.sh deleted file mode 100755 index 662c78186..000000000 --- a/nimbus/api/build_status_api.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -echo "[Cleaning up caches...]" -rm -rf nimcache/ -rm -f libnimbus_api.so - -# ../env.sh nim c --opt:speed --lineTrace:off --verbosity:2 status_api -# gcc status_api.c ./libnimbus_api.so -lm -o xx - -# debug info -../../env.sh nim c --debuginfo --opt:speed --lineTrace:off --verbosity:2 status_api -gcc status_api.c ./libnimbus_api.so -lm -g -o status_api_test diff --git a/nimbus/api/status_api.nim.cfg b/nimbus/api/status_api.nim.cfg deleted file mode 100644 index 8bf3bb1da..000000000 --- a/nimbus/api/status_api.nim.cfg +++ /dev/null @@ -1,4 +0,0 @@ --app:lib -o:"libnimbus_api.so" -noMain --d:"chronicles_sinks=textlines" diff --git a/nimbus/config.nim b/nimbus/config.nim index 83f342064..9c593f78b 100644 --- a/nimbus/config.nim +++ b/nimbus/config.nim @@ -752,60 +752,61 @@ LOGGING AND DEBUGGING OPTIONS: $ord(defaultNetwork) ] -proc processArguments*(msg: var string): ConfigStatus = - ## Process command line argument and update `NimbusConfiguration`. - let config = getConfiguration() +when declared(os.paramCount): # not available with `--app:lib` + proc processArguments*(msg: var string): ConfigStatus = + ## Process command line argument and update `NimbusConfiguration`. + let config = getConfiguration() - # At this point `config.net.bootnodes` is likely populated with network default - # bootnodes. We want to override those if at least one custom bootnode is - # specified on the command line. We temporarily set `config.net.bootNodes` - # to empty seq, and in the end restore it if no bootnodes were spricified on - # the command line. - # TODO: This is pretty hacky and it's better to refactor it to make a clear - # distinction between default and custom bootnodes. - var tempBootNodes: seq[ENode] - swap(tempBootNodes, config.net.bootNodes) - - # The same trick is done to discPort - config.net.discPort = 0 - - var opt = initOptParser() - var length = 0 - for kind, key, value in opt.getopt(): - result = Error - case kind - of cmdArgument: - discard - of cmdLongOption, cmdShortOption: - inc(length) - case key.toLowerAscii() - of "help", "h": - msg = getHelpString() - result = Success - break - of "version", "ver", "v": - msg = NimbusVersion - result = Success - break - else: - processArgument processEthArguments, key, value, msg - processArgument processRpcArguments, key, value, msg - processArgument processNetArguments, key, value, msg - processArgument processShhArguments, key, value, msg - processArgument processDebugArguments, key, value, msg - if result != Success: - msg = "Unknown option: '" & key & "'." - break - of cmdEnd: - doAssert(false) # we're never getting this kind here - - if config.net.bootNodes.len == 0: - # No custom bootnodes were specified on the command line, restore to - # previous values + # At this point `config.net.bootnodes` is likely populated with network default + # bootnodes. We want to override those if at least one custom bootnode is + # specified on the command line. We temporarily set `config.net.bootNodes` + # to empty seq, and in the end restore it if no bootnodes were spricified on + # the command line. + # TODO: This is pretty hacky and it's better to refactor it to make a clear + # distinction between default and custom bootnodes. + var tempBootNodes: seq[ENode] swap(tempBootNodes, config.net.bootNodes) - if config.net.discPort == 0: - config.net.discPort = config.net.bindPort + # The same trick is done to discPort + config.net.discPort = 0 + + var opt = initOptParser() + var length = 0 + for kind, key, value in opt.getopt(): + result = Error + case kind + of cmdArgument: + discard + of cmdLongOption, cmdShortOption: + inc(length) + case key.toLowerAscii() + of "help", "h": + msg = getHelpString() + result = Success + break + of "version", "ver", "v": + msg = NimbusVersion + result = Success + break + else: + processArgument processEthArguments, key, value, msg + processArgument processRpcArguments, key, value, msg + processArgument processNetArguments, key, value, msg + processArgument processShhArguments, key, value, msg + processArgument processDebugArguments, key, value, msg + if result != Success: + msg = "Unknown option: '" & key & "'." + break + of cmdEnd: + doAssert(false) # we're never getting this kind here + + if config.net.bootNodes.len == 0: + # No custom bootnodes were specified on the command line, restore to + # previous values + swap(tempBootNodes, config.net.bootNodes) + + if config.net.discPort == 0: + config.net.discPort = config.net.bindPort proc processConfiguration*(pathname: string): ConfigStatus = ## Process configuration file `pathname` and update `NimbusConfiguration`. diff --git a/wrappers/README.md b/wrappers/README.md new file mode 100644 index 000000000..f61116262 --- /dev/null +++ b/wrappers/README.md @@ -0,0 +1,21 @@ +This folder contains an experimental C wrapper for using parts of the Nimbus +code from C/Go in the Status console client: + +https://github.com/status-im/status-console-client/ + +It serves mainly as a proof-of-concept for now - there are several unresolved +issues surrounding threading, inter-language communication, callbacks etc. + +To build the wrappers and the test programs, run from the top level directory: + +```bash +make wrappers +``` + +Now you can run the test programs: + +```bash +build/C_wrapper_test +build/go_wrapper_test +``` + diff --git a/nimbus/api/status_api.c b/wrappers/wrapper.c similarity index 97% rename from nimbus/api/status_api.c rename to wrappers/wrapper.c index 56cbc9f82..5d3f0cf6f 100644 --- a/nimbus/api/status_api.c +++ b/wrappers/wrapper.c @@ -4,7 +4,7 @@ #include #include -#include "status_api.h" +#include "wrapper.h" void NimMain(); diff --git a/nimbus/api/main.go b/wrappers/wrapper.go similarity index 95% rename from nimbus/api/main.go rename to wrappers/wrapper.go index 22d36a981..0c5b363d5 100644 --- a/nimbus/api/main.go +++ b/wrappers/wrapper.go @@ -6,8 +6,8 @@ import ( "time" ) -// #cgo LDFLAGS: /home/oskarth/git/nimbus/nimbus/libnimbus_api.so -lm -// #include "libnim.h" +// #cgo LDFLAGS: -Wl,-rpath,'$ORIGIN' -L${SRCDIR}/../build -lnimbus -lm +// #include "wrapper.h" import "C" // Arrange that main.main runs on main thread. diff --git a/nimbus/api/status_api.h b/wrappers/wrapper.h similarity index 100% rename from nimbus/api/status_api.h rename to wrappers/wrapper.h diff --git a/nimbus/api/status_api.nim b/wrappers/wrapper.nim similarity index 99% rename from nimbus/api/status_api.nim rename to wrappers/wrapper.nim index 73077c929..6b7c83df7 100644 --- a/nimbus/api/status_api.nim +++ b/wrappers/wrapper.nim @@ -12,7 +12,7 @@ import nimcrypto/[bcmode, hmac, rijndael, pbkdf2, sha2, sysrand, utils, keccak, hash], eth/[keys, rlp, p2p], eth/p2p/rlpx_protocols/[whisper_protocol], eth/p2p/[discovery, enode, peer_pool], chronicles, - ../config + ../nimbus/config type CReceivedMessage* = object From c75e491d7661456835ff5d5c088da525343f8c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 1 Aug 2019 02:44:27 +0200 Subject: [PATCH 2/4] more renaming --- Makefile | 8 ++++---- wrappers/README.md | 8 ++++---- wrappers/{wrapper.c => wrapper_example.c} | 0 wrappers/{wrapper.go => wrapper_example.go} | 0 4 files changed, 8 insertions(+), 8 deletions(-) rename wrappers/{wrapper.c => wrapper_example.c} (100%) rename wrappers/{wrapper.go => wrapper_example.go} (100%) diff --git a/Makefile b/Makefile index 48d8f6767..96bbd95bd 100644 --- a/Makefile +++ b/Makefile @@ -204,10 +204,10 @@ libnimbus.so: | build deps nat-libs ln -s $@.0 build/$@ wrappers: | build deps nat-libs libnimbus.so go-checks - echo -e $(BUILD_MSG) "build/C_wrapper_test" && \ - $(CC) wrappers/wrapper.c -Wl,-rpath,'$$ORIGIN' -Lbuild -lnimbus -lm -g -o build/C_wrapper_test - echo -e $(BUILD_MSG) "build/go_wrapper_test" && \ - go build -o build/go_wrapper_test wrappers/wrapper.go + echo -e $(BUILD_MSG) "build/C_wrapper_example" && \ + $(CC) wrappers/wrapper_example.c -Wl,-rpath,'$$ORIGIN' -Lbuild -lnimbus -lm -g -o build/C_wrapper_example + echo -e $(BUILD_MSG) "build/go_wrapper_example" && \ + go build -o build/go_wrapper_example wrappers/wrapper_example.go # https://bitbucket.org/nimcontrib/ntags/ - currently fails with "out of memory" ntags: diff --git a/wrappers/README.md b/wrappers/README.md index f61116262..807a79987 100644 --- a/wrappers/README.md +++ b/wrappers/README.md @@ -6,16 +6,16 @@ https://github.com/status-im/status-console-client/ It serves mainly as a proof-of-concept for now - there are several unresolved issues surrounding threading, inter-language communication, callbacks etc. -To build the wrappers and the test programs, run from the top level directory: +To build the wrappers and the example programs, run from the top level directory: ```bash make wrappers ``` -Now you can run the test programs: +Now you can run the example programs: ```bash -build/C_wrapper_test -build/go_wrapper_test +build/C_wrapper_example +build/go_wrapper_example ``` diff --git a/wrappers/wrapper.c b/wrappers/wrapper_example.c similarity index 100% rename from wrappers/wrapper.c rename to wrappers/wrapper_example.c diff --git a/wrappers/wrapper.go b/wrappers/wrapper_example.go similarity index 100% rename from wrappers/wrapper.go rename to wrappers/wrapper_example.go From f63014bddbc09c2f49f89bbef42c385f88b7e1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 1 Aug 2019 13:14:00 +0200 Subject: [PATCH 3/4] libnimbus.a and statically linked wrapper examples --- Makefile | 12 +++++++++++- wrappers/README.md | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 96bbd95bd..40c1d7e99 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ TOOLS_DIRS := premix tests # comma-separated values for the "clean" target TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(TOOLS)) -.PHONY: all $(TOOLS) deps sanity-checks github-ssh build-nim update status ntags ctags nimbus testsuite test clean mrproper fetch-dlls test-libp2p-daemon nat-libs libminiupnpc.a libnatpmp.a go-checks libnimbus.so wrappers +.PHONY: all $(TOOLS) deps sanity-checks github-ssh build-nim update status ntags ctags nimbus testsuite test clean mrproper fetch-dlls test-libp2p-daemon nat-libs libminiupnpc.a libnatpmp.a go-checks libnimbus.so libnimbus.a wrappers # default target, because it's the first one that doesn't start with '.' all: $(TOOLS) nimbus @@ -209,6 +209,16 @@ wrappers: | build deps nat-libs libnimbus.so go-checks echo -e $(BUILD_MSG) "build/go_wrapper_example" && \ go build -o build/go_wrapper_example wrappers/wrapper_example.go +libnimbus.a: | build deps nat-libs + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) nim c --app:staticlib --noMain $(NIM_PARAMS) -o:build/$@ wrappers/wrapper.nim + +wrappers-static: | build deps nat-libs libnimbus.a go-checks + echo -e $(BUILD_MSG) "build/C_wrapper_example_static" && \ + $(CC) wrappers/wrapper_example.c -static -pthread -Lbuild -lnimbus -lm -ldl -g -o build/C_wrapper_example_static + echo -e $(BUILD_MSG) "build/go_wrapper_example_static" && \ + go build -ldflags "-linkmode external -extldflags '-static -ldl'" -o build/go_wrapper_example_static wrappers/wrapper_example.go + # https://bitbucket.org/nimcontrib/ntags/ - currently fails with "out of memory" ntags: ntags -R . diff --git a/wrappers/README.md b/wrappers/README.md index 807a79987..2558e0b9d 100644 --- a/wrappers/README.md +++ b/wrappers/README.md @@ -19,3 +19,9 @@ build/C_wrapper_example build/go_wrapper_example ``` +To build statically linked versions: + +```bash +make wrappers-static +``` + From f6121c10f0e9cd137c6cff4bcc725f80f0d4b6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Fri, 2 Aug 2019 18:59:47 +0200 Subject: [PATCH 4/4] various changes: - re-enable Nim's cache globally - add a new "nimcache" subdir for the libraries - make sure Go doesn't try to link libnimbus.a in the dynamically linked wrapper example - always delete the static archive before recreating it - rename wrapper.nim/.h to libnimbus.nim/.h - better hygiene in libnimbus.h (include guards and C++ support) - remove MainnetBootnodes copy, since we do include "config.nim" after all --- Makefile | 7 ++++--- nim.cfg | 4 ---- wrappers/{wrapper.h => libnimbus.h} | 14 ++++++++++++++ wrappers/{wrapper.nim => libnimbus.nim} | 16 ---------------- wrappers/wrapper_example.c | 2 +- wrappers/wrapper_example.go | 2 +- 6 files changed, 20 insertions(+), 25 deletions(-) rename wrappers/{wrapper.h => libnimbus.h} (84%) rename wrappers/{wrapper.nim => libnimbus.nim} (82%) diff --git a/Makefile b/Makefile index 40c1d7e99..792774dbc 100644 --- a/Makefile +++ b/Makefile @@ -199,7 +199,7 @@ test-libp2p-daemon: | vendor/go/bin/p2pd deps libnimbus.so: | build deps nat-libs echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim c --app:lib --noMain -d:"chronicles_sinks=textlines" --debuginfo --opt:speed --lineTrace:off $(NIM_PARAMS) -o:build/$@.0 wrappers/wrapper.nim && \ + $(ENV_SCRIPT) nim c --app:lib --noMain --nimcache:nimcache/libnimbus $(NIM_PARAMS) -o:build/$@.0 wrappers/libnimbus.nim && \ rm -f build/$@ && \ ln -s $@.0 build/$@ @@ -207,11 +207,12 @@ wrappers: | build deps nat-libs libnimbus.so go-checks echo -e $(BUILD_MSG) "build/C_wrapper_example" && \ $(CC) wrappers/wrapper_example.c -Wl,-rpath,'$$ORIGIN' -Lbuild -lnimbus -lm -g -o build/C_wrapper_example echo -e $(BUILD_MSG) "build/go_wrapper_example" && \ - go build -o build/go_wrapper_example wrappers/wrapper_example.go + go build -linkshared -o build/go_wrapper_example wrappers/wrapper_example.go libnimbus.a: | build deps nat-libs echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim c --app:staticlib --noMain $(NIM_PARAMS) -o:build/$@ wrappers/wrapper.nim + rm -f build/$@ && \ + $(ENV_SCRIPT) nim c --app:staticlib --noMain --nimcache:nimcache/libnimbus $(NIM_PARAMS) -o:build/$@ wrappers/libnimbus.nim wrappers-static: | build deps nat-libs libnimbus.a go-checks echo -e $(BUILD_MSG) "build/C_wrapper_example_static" && \ diff --git a/nim.cfg b/nim.cfg index 52b2c9fdf..8b04f4b94 100644 --- a/nim.cfg +++ b/nim.cfg @@ -17,7 +17,3 @@ --excessiveStackTrace:on -d:metrics # enable metric collection -# Required to make up for the compiler's inability to invalidate the C file -# (and object) cache on different command line arguments. ---forceBuild - diff --git a/wrappers/wrapper.h b/wrappers/libnimbus.h similarity index 84% rename from wrappers/wrapper.h rename to wrappers/libnimbus.h index 4f84bfffb..94840f6f7 100644 --- a/wrappers/wrapper.h +++ b/wrappers/libnimbus.h @@ -1,6 +1,13 @@ +#ifndef __LIBNIMBUS_H__ +#define __LIBNIMBUS_H__ + #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { uint8_t* decoded; size_t decodedLen; @@ -30,3 +37,10 @@ void nimbus_poll(); void nimbus_post(const char* channel, const char* payload); void nimbus_subscribe(const char* channel, received_msg_handler msg); + +#ifdef __cplusplus +} +#endif + +#endif //__LIBNIMBUS_H__ + diff --git a/wrappers/wrapper.nim b/wrappers/libnimbus.nim similarity index 82% rename from wrappers/wrapper.nim rename to wrappers/libnimbus.nim index 6b7c83df7..e5c157e7a 100644 --- a/wrappers/wrapper.nim +++ b/wrappers/libnimbus.nim @@ -28,22 +28,6 @@ proc `$`*(digest: SymKey): string = for c in digest: result &= hexChar(c.byte) const - # Can't import config.nim from here.. - # TODO: refactor in nimbus, then move this. - MainnetBootnodes = [ - # Ethereum Foundation Go Bootnodes - "enode://d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666@18.138.108.67:30303", # bootnode-aws-ap-southeast-1-001 - "enode://22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de@3.209.45.79:30303", # bootnode-aws-us-east-1-001 - "enode://ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758@34.255.23.113:30303", # bootnode-aws-eu-west-1-001 - "enode://279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8@35.158.244.151:30303", # bootnode-aws-eu-central-1-001 - "enode://8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a@52.187.207.27:30303", # bootnode-azure-australiaeast-001 - "enode://103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1@191.234.162.198:30303", # bootnode-azure-brazilsouth-001 - "enode://715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8@52.231.165.108:30303", # bootnode-azure-koreasouth-001 - "enode://5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f@104.42.217.25:30303", # bootnode-azure-westus-001 - # Ethereum Foundation C++ Bootnodes - "enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303" # DE - ] - # Whisper nodes taken from: # curl -s https://raw.githubusercontent.com/status-im/status-react/develop/resources/config/fleets.json | jq '"\"" + .fleets["eth.beta"].whisper[] + "\","' -r WhisperNodes* = [ diff --git a/wrappers/wrapper_example.c b/wrappers/wrapper_example.c index 5d3f0cf6f..728005bb2 100644 --- a/wrappers/wrapper_example.c +++ b/wrappers/wrapper_example.c @@ -4,7 +4,7 @@ #include #include -#include "wrapper.h" +#include "libnimbus.h" void NimMain(); diff --git a/wrappers/wrapper_example.go b/wrappers/wrapper_example.go index 0c5b363d5..9b392cee7 100644 --- a/wrappers/wrapper_example.go +++ b/wrappers/wrapper_example.go @@ -7,7 +7,7 @@ import ( ) // #cgo LDFLAGS: -Wl,-rpath,'$ORIGIN' -L${SRCDIR}/../build -lnimbus -lm -// #include "wrapper.h" +// #include "libnimbus.h" import "C" // Arrange that main.main runs on main thread.