Run a local Amadeus Protocol node and test contracts
You can run a blockchain network on your own computer and directly observe the process of sending coins or deploying smart contracts. This repository guides you through building the Amadeus Protocol node software and running a local testnet. If you want to understand how the protocol works in a local environment without cloud infrastructure, follow this documentation.
Building and Running the Local Testnet
To prepare the node binary, use podman or docker to create a build image and then run build.sh. Before running the local testnet, you must map nodes.amadeus.bot to 127.0.0.1 in /etc/hosts. Additionally, you need to launch a separate Chrome browser instance with certificate verification and CORS policies disabled to access the RPC API. Running amadeusd with the TESTNET=true environment variable starts the local network. In this state, you can perform coin transfers or contract deployments using the Testnet.call function via the REPL.
Contract Deployment and Invocation Examples
The README includes a process for deploying a counter contract written in AssemblyScript and incrementing its value. After deploying the .wasm file with the Testnet.deploy function, you can change and query the contract state by calling the get and increment methods with Testnet.call. This example helps you grasp the entire flow of smart contract development.
System Configuration and Service Registration
To run the node stably, you must adjust system kernel parameters and resource limits. Increase the UDP stack buffer for a 1Gbps network and apply settings to block spoofed UDP packets in /etc/sysctl.conf. Set file descriptor, process count, and memory lock limits to unlimited so the node can use sufficient resources. Creating the systemd service file amadeusd.service ensures the node starts automatically at boot and restarts if it stops. Setting the AUTOUPDATE=true environment variable allows the node to update automatically, and you can switch to a validator node using the COMPUTOR variable.
Execution Environment and Precautions
This guide was tested in a Linux Kernel 6.8 and Ubuntu 24.04 environment. Compatibility issues may arise on other distributions or operating systems, so it is recommended to run it in the specified environment. When running the local testnet, you must disable the browser's certificate verification and CORS policies, so it is safer to use a separate browser instance with these settings applied. Changing system settings requires sudo privileges, so it is best to use this only for experimenting on a personal development machine. Before deploying to a production environment, you must verify that network security settings and resource limit adjustments have been applied as intended.