Building Aeon on mipsel Ci20

Aeon is one of the lighter versions of CryptoNight based crypto currencies.

AEON uses the CryptoNight-Lite POW. CryptoNight(popularized by Monero) and CryptoNight-lite are identical except for the size of the scratchpad needed (1mb vs 2mb). The original CryptoNight proof of work calls for a 2mb scratchpad, which means for every CryptoNight(Monero) mining thread there needs to be 2mb of CPU cache available. AEON reduces this requirement to 1mb of cache per thread thus increasing the amount of work a processor can do when hitting a CPU cache constraint.

During this exercise we will see how to port the source-code to be able to run the Aeon simplewallet and simpleminer programs.

The source-code is available via git here


GCC 4.7.3 or later, CMake 2.8.6 or later, and Boost 1.53 or later. I have built all the needed things via pkgsrc-current on the Ci20 (GCC you can use the native one ) I have compiled all the pkgsrc packages for the Debian8 Ci20 NAND image here :

Building :

On the Ci20 device

# git clone
# cd aeon 
# mkdir dist 
# cd dist 
# cmake ..

This should create the Makefiles in the dist project directory. Also we need to decide what exactly we will be building.

root@ci20:~/aeon/dist# make help
The following are some of the valid targets for this Makefile:
... all (the default if no target is provided)
... clean
... depend
... install/local
... install
... rebuild_cache
... install/strip
... edit_cache
... test
... list_install_components
... version
... libminiupnpc-static
... cryptonote_core
... wallet
... common
... crypto
... ringct
... daemon
... simpleminer
... connectivity_tool
... rpc
... simplewallet
... tests
... net_load_tests_srv
... functional_tests
... performance_tests
... crypto-tests
... hash-tests
... unit_tests
... difficulty-tests
... hash-target-tests
... net_load_tests_clt
... coretests
... core_proxy
... gtest_main
... gtest

Please note that building the daemon will make absolutely no sense on the Ci20 board, since the aeond (used to sync the blockchain) stores the blockchain in RAM and you would need something like 16 Gb ram + 12 Gb ssd swap.  We will be building only the simplewallet and simpleminer (you can also build the test modules)


Now we need to touch the original code a little since we are building this on mips architecture. Here is a first error we will get when running make

root@ci20:~/aeon/dist# make simplewallet
[ 0%] Built target version
Scanning dependencies of target libminiupnpc-static
[ 1%] Building C object external/miniupnpc/CMakeFiles/libminiupnpc-static.dir/igd_desc_parse.c.o
cc: error: unrecognized command line option ‘-maes’
external/miniupnpc/CMakeFiles/libminiupnpc-static.dir/build.make:62: recipe for target 'external/miniupnpc/CMakeFiles/libminiupnpc-static.dir/igd_desc_parse.c.o' failed

We can fix the above quite easily (the Ci20 mips CPU does not support the -maes option since it is only for x86 )   and ppc64 , but definitely not for 32 bit dev boards (mips,arm) so we change it via sed

root@ci20:~/aeon/dist# grep -lRZ '\-maes' . | xargs -0 -l sed -i -e 's/\-maes//g'

Once we get rid of all the -maes options in the Makefiles we move on and end up after a long time with another error

root@ci20:~/aeon/dist# make simplewallet 

[52%] Linking CXX executable simplewallet
libwallet.a(wallet2.cpp.o): In function `std::__atomic_base<unsigned long long>::operator++()':
/usr/include/c++/4.9/bits/atomic_base.h:408: undefined reference to `__atomic_fetch_add_8'

Now the above can be simply fixed by adding the -latomic to the link file for simplewallet link.txt

root@ci20:~/aeon/dist# vi ./src/CMakeFiles/simplewallet.dir/link.txt
add -latomic to the end of the file so it looks like this 

/usr/bin/c++ -std=c++11 -D_GNU_SOURCE -Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wlogical-op -Wno-error=maybe-uninitialized -Wno-reorder -Wno-missing-field-initializers -march=native -g -DNDEBUG -rdynamic CMakeFiles/simplewallet.dir/simplewallet/password_container.cpp.o CMakeFiles/simplewallet.dir/simplewallet/simplewallet.cpp.o -o simplewallet -Wl,-rpath,/usr/pkg/lib libwallet.a librpc.a libcryptonote_core.a libcrypto.a libcommon.a libringct.a ../external/miniupnpc/libminiupnpc.a -lpthread /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ /usr/pkg/lib/ -lrt -lpthread -latomic

Continue with the build

root@ci20:~/aeon/dist# make simplewallet
[100%] Built target simplewallet 

root@ci20:~/aeon/dist# make simpleminer
[ 11%] Built target ringct
[ 35%] Built target cryptonote_core
[ 44%] Built target common
[ 94%] Built target crypto
Scanning dependencies of target simpleminer
[ 97%] Building CXX object src/CMakeFiles/simpleminer.dir/miner/simpleminer.cpp.o
[100%] Linking CXX executable simpleminer
[100%] Built target simpleminer

If you wish to build the test suites you will need to add the -atomic to their corresponding linker files

root@ci20:~/aeon/dist# vi ./tests/CMakeFiles/performance_tests.dir/link.txt
add -latomic to the end
root@ci20:~/aeon/dist# vi ./tests/CMakeFiles/unit_tests.dir/link.txt
add -latomic to the end
root@ci20:~/aeon/dist# vi ./tests/CMakeFiles/coretests.dir/link.txt
add -latomic to the end 
root@ci20:~/aeon/dist# vi ./tests/CMakeFiles/core_proxy.dir/link.txt
add -latomic to the end

The binaries are located here

root@ci20:~/aeon/dist/src# ls -alstr
total 178376
 4 -rw-r--r-- 1 root root 1118 Mar 15 06:09 cmake_install.cmake
 56 -rw-r--r-- 1 root root 56618 Mar 15 06:09 Makefile
 4 -rw-r--r-- 1 root root 246 Mar 15 06:09 CTestTestfile.cmake
 0 drwxr-xr-x 12 root root 1056 Mar 15 06:09 CMakeFiles
 0 drwxr-xr-x 8 root root 872 Mar 15 06:13 ..
20776 -rw-r--r-- 1 root root 21272790 Mar 15 06:24 librpc.a
54616 -rw-r--r-- 1 root root 55925862 Mar 15 06:51 libcryptonote_core.a
44616 -rw-r--r-- 1 root root 45685940 Mar 15 07:13 libwallet.a
 2888 -rw-r--r-- 1 root root 2953342 Mar 15 07:18 libcommon.a
 1884 -rw-r--r-- 1 root root 1929188 Mar 15 07:20 libcrypto.a
 5084 -rw-r--r-- 1 root root 5205088 Mar 15 07:25 libringct.a
36352 -rwxr-xr-x 1 root root 37221816 Mar 15 07:37 simplewallet
12096 -rwxr-xr-x 1 root root 12385100 Mar 15 18:37 simpleminer
 0 drwxr-xr-x 3 root root 1048 Mar 15 21:54 .

We can copy the two binaries somewhere else, here are the shared libraries used by the programs

root@ci20:~/bin# ldd simpleminer => /lib/mipsel-linux-gnu/ (0x7722f000) => /usr/pkg/lib/ (0x7721b000) => /usr/pkg/lib/ (0x771ef000) => /usr/pkg/lib/ (0x771bc000) => /usr/pkg/lib/ (0x7719b000) => /usr/pkg/lib/ (0x77184000) => /usr/pkg/lib/ (0x77047000) => /usr/pkg/lib/ (0x77004000) => /usr/pkg/lib/ (0x76f78000) => /usr/pkg/lib/ (0x76f66000) => /lib/mipsel-linux-gnu/ (0x76f4e000) => /usr/lib/mipsel-linux-gnu/ (0x76e3c000) => /lib/mipsel-linux-gnu/ (0x76dac000) => /lib/mipsel-linux-gnu/ (0x76d73000) => /lib/mipsel-linux-gnu/ (0x76bf0000)
 /lib/ (0x7727b000) => /usr/pkg/lib/ (0x75238000) => /usr/pkg/lib/ (0x74f43000) => /usr/pkg/lib/ (0x74d68000) => /lib/mipsel-linux-gnu/ (0x74d55000)

root@ci20:~/bin# ldd simplewallet => /lib/mipsel-linux-gnu/ (0x77f88000) => /usr/pkg/lib/ (0x77f74000) => /usr/pkg/lib/ (0x77f48000) => /usr/pkg/lib/ (0x77f15000) => /usr/pkg/lib/ (0x77ef4000) => /usr/pkg/lib/ (0x77edd000) => /usr/pkg/lib/ (0x77da0000) => /usr/pkg/lib/ (0x77d5d000) => /usr/pkg/lib/ (0x77cd1000) => /usr/pkg/lib/ (0x77cbf000) => /lib/mipsel-linux-gnu/ (0x77ca7000) => /usr/lib/mipsel-linux-gnu/ (0x77c92000) => /usr/lib/mipsel-linux-gnu/ (0x77b7f000) => /lib/mipsel-linux-gnu/ (0x77af0000) => /lib/mipsel-linux-gnu/ (0x77ab7000) => /lib/mipsel-linux-gnu/ (0x77934000)
 /lib/ (0x77fd4000) => /usr/pkg/lib/ (0x75f7b000) => /usr/pkg/lib/ (0x75c87000) => /usr/pkg/lib/ (0x75aac000) => /lib/mipsel-linux-gnu/ (0x75a98000)

I have uploaded the binaries here if needed

OK, now we have compiled the two, we can test is it works, first the simplewallet

root@ci20:~/bin# ./simplewallet 
aeon wallet v0.9.14.0()
Specify wallet file name (e.g., wallet.bin). If the wallet doesn't exist, it will be created.
Wallet file name: ci20wallet
The wallet doesn't exist, generating new one
password: ******************
[wallet XXX111]:

OK, so this works, but we have no access to the Aeon blockchain, so we should use some public Aeon node and connect to it (via a following shell script for example)

root@ci20:~/bin# cat 
./simplewallet --wallet-file=./ci20wallet --daemon-address

The initial sync with all the transactions will take some time, so be patient.  Do not forget to save the sync data once done. There are multiple online Aeon nodes listed here :

It took approximately 3 hours to sync the simplewallet

Refresh done, blocks received: 257191 
balance: 0.000000000000, unlocked balance: 0.000000000000
Use "help" command to see the list of available commands.
[wallet XXX111]: [wallet XXX111]:

Next we can try the simpleminer

root@ci20:~/bin# ./simpleminer --pool-addr --login walletaddress --pass x
2018-Mar-15 22:16:15.252403 Connecting
2018-Mar-15 22:16:15.285706 Connected OK
2018-Mar-15 22:16:15.302291 READ ENDS: Success. bytes_tr: 79
2018-Mar-15 22:16:15.303819 READ ENDS: Connection err_code 2
2018-Mar-15 22:16:15.304637 Connection err_code eof.
2018-Mar-15 22:16:15.305173 Returning false because of wrong state machine. state: 5
2018-Mar-15 22:16:15.305650 Failed to invoke http request to /
2018-Mar-15 22:16:15.306115 Failed to invoke login, disconnect and sleep....

Hmm so it looks like the simple miner does not work, It would make no sense anyway on the Ci20 device,  maybe its possible to use it from the simplewallet ? But for that you need to wait till your device synces the blokchain transactions via the public Aeon Nodes.





About astr0baby

Please run Adblock or similar... we have been told to do so since Carl Sagan wrote the Contact .
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.