- Notifications
You must be signed in to change notification settings - Fork38
Elixir full node implementation of the aeternity specification
License
aeternity/elixir-node
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This implementation aims to be a aims to be a full node that complies with the aeternity specification, in the current state this is not ready yet and should never be used to join the aeternity network.
This is an elixir full node implementation of the aeternity specification.
Compatibility to the erlang aeternity implementation is documented indocs/aeternity-erlang-compatibility.md.
Elixir 1.6 with Erlang/OTP20 is the basis of the project
Rust is needed for persistent storage dependency
libsodium 1.0.16 is needed for elliptic curve support
sudo apt-get install autoconf autogen libtool libgmp3-dev lsofwget -O libsodium-src.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gzmkdir libsodium-src&& tar -zxf libsodium-src.tar.gz -C libsodium-src --strip-components=1cd libsodium-src&& ./configure&& make&& make check&& sudo make install&&cd ..
mix deps.get
Start the application in interactive Elixir
- Development config:
make iex-0
- Production config:
MIX_ENV=prod make iex-0
The default sync port is 3015, this can be adjusted usingSYNC_PORT=some_port iex -S mix phx.server
.The node will run an http api atlocalhost:4000
, this can be adjusted usingPORT=some_port iex -S mix phx.server
.
Miner.resume()
to start the minerMiner.suspend()
to stop the minerMiner.mine_sync_block_to_chain()
mine the next blockChain.top_block()
to get the top block of the current chainChain.top_block_chain_state()
to get the top block chainstateChain.chain_state(block_hash)
to get the chainstate of certain blockPool.get_pool()
to get all transactions from the poolPeers.all_peers()
to get all connected peersPeers.try_connect(%{host: host, port: port, pubkey: pubkey})
to manually connect a new peerPeers.get_info_try_connect(uri)
to connect to another elixir node, providing a get connection info interface
Run the testsuite withmix test
Debug, error, warning and info logs is found inapps/aecore/logs
ADockerfile
anddocker-compose.yml
are found in the base directory, prebuilt images are not yet published.
Build container
docker build . -t elixir-node
Run node in container
docker run --name elixir-node -it -p 4000:4000 -p 3015:3015 elixir-node
Run multiple nodes network with docker compose
docker-compose up
runs 3 connected nodes, with 2 mining
About
Elixir full node implementation of the aeternity specification