Compiling XODE
Setting up your Github environment
Check Existing SSH Keys: Ensure that you have an existing SSH key. Run the following command to list your existing keys:
ls -al ~/.sshLook for files named id_rsa or id_rsa.pub.
Generate a New SSH Key (If Needed): If you don't have an SSH key or want to generate a new one, you can use the following command:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"Follow the prompts to generate a new key. Make sure to replace "your_email@example.com" with your actual email address.
Add SSH Key to SSH Agent: Start the SSH agent and add your private key:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsaCopy the SSH Key to Clipboard: Use the following command to copy your SSH key to the clipboard:
cat ~/.ssh/id_rsa.pubAdd SSH Key to GitHub:
Go to your GitHub account settings.
Navigate to "SSH and GPG keys" or "SSH keys."
Click on "New SSH key" or "Add SSH key."
Paste your key into the provided field and give it a title.
Clone Xode-Blockchain
git clone git@github.com:D2-Xode/xode-blockchain.git
cd xode-blockchainSetting up your Rust environment
Install the build-essential package.
sudo apt install build-essentialInstall support packages for Rust
sudo apt install --assume-yes git clang curl libssl-dev protobuf-compiler
sudo apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compilerDownload the rustup installation program and use it to install Rust by running the following command.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shUpdate your current shell to include Cargo by running the following command
source $HOME/.cargo/envConfigure the Rust toolchain to default to the latest stable version by running the following commands
rustup default stable
rustup updateAdd the nightly release and the nightly WebAssembly (wasm) targets to your development environment by running the following commands:
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup default nightly-x86_64-unknown-linux-gnuVerify the configuration of your development environment by running the following command.
rustup show
rustup +nightly showInstall WASM support for smart contracts
rustup target add wasm32-unknown-unknownCompile Xode and run the node
cargo buildCompiling for Raspberry Pi (aarch64) environment
Install cross crate
cargo install crossInstall Docker
sudo apt updateInstall a few prerequisite packages which let apt use packages
sudo apt install apt-transport-https ca-certificates curl software-properties-commonAdd the GPG key for the official Docker repository to your system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgAdd the Docker repository to APT sources
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullUpdate again the packes
sudo apt updateMake sure you are about to install from the Docker repo
apt-cache policy docker-ceInstall docker
sudo apt install docker-ceCheck docker status
sudo systemctl status dockerMake docker usable without having to use sudo
sudo usermod -aG docker ${USER}
su - ${USER}
groupsNow run cross compile
cross +nightly build --target aarch64-unknown-linux-gnu --releaseRunning XODE using Zombienet
Test of the xode-node binary is running and fully compiled
./target/release/xode-node --versionDownload the Polkadot binary (make sure you are in the zombienet directory with yout download the this binary)
wget https://github.com/paritytech/polkadot/releases/download/v1.0.0/polkadotDownload the Zombienet binary (make sure you are in the zombienet directory with yout download the this binary)
wget https://github.com/paritytech/zombienet/releases/download/v1.3.109/zombienet-linux-x64Make the two binaries executable
chmod +x polkadot
chmod +x zombienet-linux-x64Run XODE using Zombienet
./zombienet-launch.sh