Skip to content

Building the Fetch.AI components

Currently, the Fetch.AI ledger and the open economic framework (OEF) are built and deployed invidually. This will change with the main net deployment towards the end of the year.

Supported platforms

  • MacOS Darwin 10.13x and higher (64bit)

Initial setup

Get homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install dependencies:

brew install cmake openssl git python

Or with MacPorts:

port install cmake openssl git python

If you use homebrew, edit your ~/.bash_profile :

export OPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/`ls /usr/local/Cellar/openssl/ | sort | tail -1`"

Add the git alias:

git config --global alias.pullall '!f(){ git pull "[email protected]" && git submodule sync --recursive && git submodule update --init --recursive; }; f'

Download the ledger code

If you need them, here are the Git SSH key generation instructions.

Clone the repository:

cd [working_directory]
git clone https://github.com/fetchai/ledger.git
git checkout release/v0.5.x

Update and initialise submodules from the repository root directory:

cd ledger
git pull
git submodule update --init --recursive

Make sure you have all the submodules:

git submodule status

If any submodules are missing, please check your installation.

Build the ledger

From the ledger directory, follow the steps to build the library:

mkdir build
cd build
cmake ..
make -j constellation

You may have memory issues on make, so limit the number of cores (we chose 4):

make -j 4 constellation

If you want, you can build all the libraries:

make -j 4

For the etch simulator, build the vm-lang library:

make vm-lang

Possible gotchas

To avoid issues with OpenSSL, run the following:

cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib

Run a local node

Go to the constellation app folder:

cd apps/constellation

Start a standalone test node:

./constellation -port 8100 -block-interval 3000 -standalone
You should see output like this:
F E ╱     Constellation v0.4.1-rc1
   T C     Copyright 2018-2019 (c) Fetch AI Ltd.
     H

[ 2019-06-03 16:55:20.215, # 1 INFO  :                                main ] Configuration:

port......................: 8100
network mode..............: Standalone
num executors.............: 1
num lanes.................: 1
num slices................: 500
bootstrap.................: 0
discoverable..............: 0
host name.................:
external address..........: 127.0.0.1
db-prefix.................: node_storage
interface.................: 127.0.0.1
mining....................: Yes
tx processor threads......: 12
shard verification threads: 12
block interval............: 3000ms
max peers.................: 3
peers update cycle........: 0ms
peers.....................:
manifest.......:
 - HTTP/0: tcp://127.0.0.1:8100 (8100)
 - CORE/0: tcp://127.0.0.1:8101 (8101)
 - Lane/0: tcp://127.0.0.1:8110 (8110)

When you see the following message...

[ 2019-06-15 15:24:39.383, # 1 INFO  :                          P2PService ] CORE URI: tcp://127.0.0.1:8101
[ 2019-06-15 15:24:39.383, # 1 INFO  :                          P2PService ] Num Initial Peers: 0
[ 2019-06-15 15:24:39.383, # 1 INFO  :                          P2PService ] Starting P2PService...
[ 2019-06-15 15:24:39.484, # 5 INFO  :                          HTTPServer ] Starting HTTPServer on http://127.0.0.1:8100
[ 2019-06-15 15:24:39.524, # 6 WARN  :       NewVersionedRandomAccessStack ] Attempted to find if hash exists, but history is empty!
[ 2019-06-15 15:24:39.524, # 6 WARN  :       NewVersionedRandomAccessStack ] Attempted to find if hash exists, but history is empty!
[ 2019-06-15 15:24:39.525, # 7 INFO  :                    BlockCoordinator ] Chain Sync complete on 0x780bbb1c050cd3d5c20fce89fa6f4e61c884315efeb44c54ceb956a50563683a (block: 0 prev: 0xd3efbefbefbefbefbefbefbefbe19e9deb22b3efbefbefbefbefbefbefbefbed)
[ 2019-06-15 15:24:40.487, # 1 INFO  :                       constellation ] Startup complete
...your node is running and you will be able to test smart contracts and autonomous agents.

Navigate through to the OEF, etch language, or smart contracts links above and you will find instructions and tutorials.