Skip to content

Instantly share code, notes, and snippets.

@raffecat
Last active February 7, 2023 01:32
Show Gist options
  • Save raffecat/224e6fc95c7c0dbe62c5995e3df80661 to your computer and use it in GitHub Desktop.
Save raffecat/224e6fc95c7c0dbe62c5995e3df80661 to your computer and use it in GitHub Desktop.
Build Gigawallet on M1 Mac 7 Feb 2023
mkdir temp
cd temp
git clone git@github.com:dogecoinfoundation/libdogecoin.git
git clone git@github.com:dogeorg/go-libdogecoin.git
git clone git@github.com:dogecoinfoundation/gigawallet.git
cd libdogecoin
git checkout 0.1.1-dogeathon
./autogen.sh
./configure --disable-net --disable-tools
make
cd ..
cd go-libdogecoin
git checkout 0.1.1-dev
cp ../libdogecoin/include/dogecoin/libdogecoin.h include/libdogecoin.h
cp ../libdogecoin/.libs/libdogecoin.a build/darwin/arm64/libdogecoin.a
# CHANGE the line above to match your OS ^^^^^^^^^^^^ e.g. build/linux/amd64/libdogecoin.a
go build
cd ..
cd gigawallet
git checkout at-cleanup
echo "replace github.com/dogeorg/go-libdogecoin => `pwd`/../go-libdogecoin" >> go.mod
make
./build/gigawallet devconf.toml
----------------------- EXAMPLE -----------------------
Last login: Tue Feb 7 12:04:06 on ttys010
raffe@Raffes-MBP ~ % mkdir temp
raffe@Raffes-MBP ~ % cd temp
raffe@Raffes-MBP temp % git clone git@github.com:dogecoinfoundation/libdogecoin.git
Cloning into 'libdogecoin'...
remote: Enumerating objects: 3812, done.
remote: Counting objects: 100% (122/122), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 3812 (delta 61), reused 85 (delta 46), pack-reused 3690
Receiving objects: 100% (3812/3812), 9.73 MiB | 4.08 MiB/s, done.
Resolving deltas: 100% (2175/2175), done.
raffe@Raffes-MBP temp % git clone git@github.com:dogeorg/go-libdogecoin.git
Cloning into 'go-libdogecoin'...
remote: Enumerating objects: 325, done.
remote: Counting objects: 100% (62/62), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 325 (delta 56), reused 50 (delta 50), pack-reused 263
Receiving objects: 100% (325/325), 6.56 MiB | 3.69 MiB/s, done.
Resolving deltas: 100% (128/128), done.
raffe@Raffes-MBP temp % git clone git@github.com:dogecoinfoundation/gigawallet.git
Cloning into 'gigawallet'...
remote: Enumerating objects: 539, done.
remote: Counting objects: 100% (257/257), done.
remote: Compressing objects: 100% (163/163), done.
remote: Total 539 (delta 150), reused 173 (delta 81), pack-reused 282
Receiving objects: 100% (539/539), 387.74 KiB | 613.00 KiB/s, done.
Resolving deltas: 100% (302/302), done.
raffe@Raffes-MBP temp % cd libdogecoin
raffe@Raffes-MBP libdogecoin % git checkout 0.1.1-dogeathon
branch '0.1.1-dogeathon' set up to track 'origin/0.1.1-dogeathon'.
Switched to a new branch '0.1.1-dogeathon'
raffe@Raffes-MBP libdogecoin % ./autogen.sh
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:30: installing 'build-aux/compile'
configure.ac:24: installing 'build-aux/config.guess'
configure.ac:24: installing 'build-aux/config.sub'
configure.ac:28: installing 'build-aux/install-sh'
configure.ac:28: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
glibtoolize: copying file 'build-aux/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build-aux/m4'.
glibtoolize: copying file 'build-aux/m4/libtool.m4'
glibtoolize: copying file 'build-aux/m4/ltoptions.m4'
glibtoolize: copying file 'build-aux/m4/ltsugar.m4'
glibtoolize: copying file 'build-aux/m4/ltversion.m4'
glibtoolize: copying file 'build-aux/m4/lt~obsolete.m4'
configure.ac:43: installing 'build-aux/ar-lib'
configure.ac:37: installing 'build-aux/compile'
configure.ac:24: installing 'build-aux/config.guess'
configure.ac:24: installing 'build-aux/config.sub'
configure.ac:33: installing 'build-aux/install-sh'
configure.ac:33: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
raffe@Raffes-MBP libdogecoin % ./configure --disable-net --disable-tools
checking build system type... aarch64-apple-darwin21.6.0
checking host system type... aarch64-apple-darwin21.6.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for _Bool... yes
checking for stdbool.h that conforms to C99... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin21.6.0 file names to aarch64-apple-darwin21.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin21.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin21.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking if gcc supports -std=gnu99 -pedantic -Wall -Wextra -Wno-long-long -Wno-overlength-strings... yes
checking for __builtin_expect... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libdogecoin.pc
config.status: creating src/libdogecoin-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in src/secp256k1 (/Users/raffe/temp/libdogecoin/src/secp256k1)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local' '--disable-net' '--disable-tools' '--disable-shared' '--with-pic' '--with-bignum=no' '--enable-module-recovery' --cache-file=/dev/null --srcdir=.
checking build system type... aarch64-apple-darwin21.6.0
checking host system type... aarch64-apple-darwin21.6.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin21.6.0 file names to aarch64-apple-darwin21.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin21.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin21.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking dependency style of gcc... gcc3
checking for brew... brew
checking if gcc supports -Werror=unknown-warning-option... yes
checking if gcc supports -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef... yes
checking if gcc supports -Wno-overlength-strings... yes
checking if gcc supports -Wall... yes
checking if gcc supports -Wno-unused-function... yes
checking if gcc supports -Wextra... yes
checking if gcc supports -Wcast-align... yes
checking if gcc supports -Wcast-align=strict... no
checking if gcc supports -Wconditional-uninitialized... yes
checking if gcc supports -fvisibility=hidden... yes
checking for x86_64 assembly availability... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libsecp256k1.pc
config.status: creating src/libsecp256k1-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Build Options:
with external callbacks = no
with benchmarks = yes
with tests = yes
with coverage = no
module ecdh = no
module recovery = yes
module extrakeys = no
module schnorrsig = no
asm = no
ecmult window size = 15
ecmult gen prec. bits = 4
valgrind = no
CC = gcc
CPPFLAGS =
SECP_CFLAGS = -O2 -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-overlength-strings -Wall -Wno-unused-function -Wextra -Wcast-align -Wconditional-uninitialized -fvisibility=hidden
CFLAGS = -g -O2
LDFLAGS =
Options used to compile and link:
with tools = no
with net = no
target os = darwin
CC = gcc
CFLAGS = -g -O2 -W -std=gnu99 -pedantic -Wall -Wextra -Wno-long-long -Wno-overlength-strings
CXX =
CXXFLAGS =
LDFLAGS =
raffe@Raffes-MBP libdogecoin % make
CC test/tests-address_tests.o
CC test/tests-aes_tests.o
CC test/tests-base58_tests.o
CC test/tests-bip32_tests.o
CC test/tests-block_tests.o
CC test/tests-buffer_tests.o
CC test/tests-cstr_tests.o
CC test/tests-ecc_tests.o
CC test/tests-hash_tests.o
CC test/tests-key_tests.o
CC test/tests-koinu_tests.o
CC test/tests-mem_tests.o
CC test/tests-opreturn_tests.o
test/opreturn_tests.c:44:28: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
sprintf(decimal, "%x", length - 1);
~~ ^~~~~~~~~~
%lx
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
1 warning generated.
CC test/tests-random_tests.o
CC test/tests-rmd160_tests.o
CC test/tests-serialize_tests.o
CC test/tests-sha2_tests.o
CC test/tests-transaction_tests.o
CC test/tests-tx_tests.o
CC test/tests-unittester.o
CC test/tests-utils_tests.o
CC test/tests-vector_tests.o
test/vector_tests.c:75:32: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
sprintf(str, "TEST%d", i);
~~ ^
%zu
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
1 warning generated.
CC src/libdogecoin_la-address.lo
CC src/libdogecoin_la-aes.lo
CC src/libdogecoin_la-base58.lo
CC src/libdogecoin_la-bip32.lo
CC src/libdogecoin_la-block.lo
CC src/libdogecoin_la-buffer.lo
CC src/libdogecoin_la-chainparams.lo
CC src/libdogecoin_la-cstr.lo
CC src/libdogecoin_la-ctaes.lo
CC src/libdogecoin_la-ecc.lo
CC src/libdogecoin_la-key.lo
CC src/libdogecoin_la-koinu.lo
CC src/libdogecoin_la-mem.lo
src/mem.c:289:2: warning: no newline at end of file [-Wnewline-eof]
}
^
1 warning generated.
CC src/libdogecoin_la-random.lo
CC src/libdogecoin_la-rmd160.lo
CC src/libdogecoin_la-script.lo
CC src/libdogecoin_la-serialize.lo
CC src/libdogecoin_la-sha2.lo
CC src/cli/libdogecoin_la-tool.lo
CC src/libdogecoin_la-transaction.lo
CC src/libdogecoin_la-tx.lo
src/tx.c:272:28: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
for (; length < strlen(hexbytes) - 4; length++) {
^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t strlen(const char *__s);
^
1 warning generated.
CC src/libdogecoin_la-utils.lo
CC src/libdogecoin_la-vector.lo
CC src/libsecp256k1_la-secp256k1.lo
CC src/libsecp256k1_precomputed_la-precomputed_ecmult.lo
CC src/libsecp256k1_precomputed_la-precomputed_ecmult_gen.lo
CCLD libsecp256k1_precomputed.la
CCLD libsecp256k1.la
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
CCLD libdogecoin.la
CCLD tests
raffe@Raffes-MBP libdogecoin % cd ..
raffe@Raffes-MBP temp % cd go-libdogecoin
raffe@Raffes-MBP go-libdogecoin % git checkout 0.1.1-dev
branch '0.1.1-dev' set up to track 'origin/0.1.1-dev'.
Switched to a new branch '0.1.1-dev'
raffe@Raffes-MBP go-libdogecoin % cp ../libdogecoin/include/dogecoin/libdogecoin.h include/libdogecoin.h
raffe@Raffes-MBP go-libdogecoin % cp ../libdogecoin/.libs/libdogecoin.a build/darwin/arm64/libdogecoin.a
raffe@Raffes-MBP go-libdogecoin % go build
raffe@Raffes-MBP go-libdogecoin % cd ..
raffe@Raffes-MBP temp % cd gigawallet
raffe@Raffes-MBP gigawallet % git checkout at-cleanup
branch 'at-cleanup' set up to track 'origin/at-cleanup'.
Switched to a new branch 'at-cleanup'
raffe@Raffes-MBP gigawallet % echo "replace github.com/dogeorg/go-libdogecoin => `pwd`/../go-libdogecoin" >> go.mod
raffe@Raffes-MBP gigawallet % make
rm -rf ./build
mkdir -p build/
go build -o build/gigawallet ./cmd/gigawallet/main.go
raffe@Raffes-MBP gigawallet % ./build/gigawallet
usage: gigawallet <config-file> # e.g. devconf.toml
raffe@Raffes-MBP gigawallet % ./build/gigawallet devconf.toml
2023/02/07 12:14:53 Starting service: Confirmer
2023/02/07 12:14:53 Confirmer.. ok
2023/02/07 12:14:53 Starting service: Payment Broker
2023/02/07 12:14:53 GetPendingInvoices: not implemented
2023/02/07 12:14:53 Payment Broker.. ok
2023/02/07 12:14:53 Starting service: ZMQ Listener
2023/02/07 12:14:53 ZMQ: connecting to: tcp://localhost:28332
2023/02/07 12:14:53 ZMQ Listener.. ok
2023/02/07 12:14:53 Starting service: Payment API
2023/02/07 12:14:53 Payment API.. ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment