How to Set Up the Aeternity Elixir Full Node

Jun 30, 2022 | Blockchain

The Aeternity Elixir Full Node is an innovative implementation that aims to align with the Aeternity specification. However, bear in mind that it is currently not compatible with the Aeternity network. In this guide, we will walk you through the installation process, initial setup, and some usage patterns of this Elixir full node.

Getting Started

Before you dive into the installation process, ensure you have the following software and packages installed on your system:

  • Elixir 1.6 with Erlang OTP20 (the foundation of this project).
  • Rust for persistent storage dependency.
  • libsodium 1.0.16 for elliptic curve support.

Installing Required Packages

Run the following commands in your terminal to install the necessary dependencies:

sudo apt-get install autoconf autogen libtool libgmp3-dev
wget -O libsodium-src.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz
mkdir libsodium-src
tar -zxf libsodium-src.tar.gz -C libsodium-src --strip-components=1
cd libsodium-src
./configure
make
make check
sudo make install
cd ..

Fetching Dependencies

Once the packages are installed, fetch the dependencies by running:

mix deps.get

Starting the Application

To start the application in an interactive Elixir console, use the following command:

make iex

For production configuration, use:

MIX_ENV=prod make iex

You can adjust the default sync port (3015) and running the HTTP API (on port 4000) using variables:

SYNC_PORT=some_port iex -S mix phx.server
PORT=some_port iex -S mix phx.server

Usage Instructions

Now that your node is running, you can use the following API calls in the Elixir interactive console:

  • Miner.resume() to start the miner.
  • Miner.suspend() to stop the miner.
  • Miner.mine_sync_block_to_chain() to mine the next block.
  • Chain.top_block() to view the top block of the current chain.
  • Chain.chain_state(block_hash) to get the state of a particular block.
  • Pool.get_pool() to fetch all transactions from the pool.
  • Peers.try_connect(%{host: host, port: port, pubkey: pubkey}) to connect to a new peer.

Running Tests

To ensure everything is working as expected, you can run the test suite using:

mix test

Using Docker Containers

If you prefer using Docker, here’s how you can proceed:

  • To build the container, run: docker build . -t elixir-node
  • To run the node in the container, use: docker run --name elixir-node -it -p 4000:4000 -p 3015:3015 elixir-node
  • To run a network of multiple nodes with Docker Compose, you can use: docker-compose up (this will run 3 connected nodes with 2 mining).

Troubleshooting

In the unlikely event that you encounter issues while setting up or running the Aeternity Elixir Full Node, here are some troubleshooting steps to consider:

  • Double-check the versions of Elixir and Erlang you’re using, as the incompatibility might stem from version mismatches.
  • If dependencies are failing to load, ensure that all prerequisites were installed correctly.
  • For network-related issues, validate that the ports used are not blocked or utilized by other applications on your machine.
  • Consult the logs that can be found in apps/aecore/logs for more specific error messages.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

Setting up an Aeternity Elixir Full Node is akin to building a creative puzzle; every piece must fit just right for a complete picture. By following the steps outlined above, you’ll be on your way to developing a strong foundation for your Aeternity development projects.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox