Datagram Node CLI Usage Guide
Download the Latest Version
To get the latest version of the Datagram CLI, download it from: Datagram CLI Releases
sh
wget https://github.com/Datagram-Group/datagram-cli-release/releases/latest/download/datagram-cli-<targer platform>
chmod +x ./datagram-cli-<targer platform>
Running a Full Core Node
- Purchase a License:
- Buy a license at: Datagram License Portal
- Run the Datagram CLI:
- Execute the following command:sh
./datagram-cli-<targer platform> run -- -key <fullcore license>
- Execute the following command:
Running a Partner Core Node
- Request a Partner License:
- Obtain a license at: Datagram License Portal
- A partner license key can be used for multiple nodes simultaneously, and rewards will be distributed to the license owner.
- Partner Key format:
- Partner key is a
Multikey
format (/key_1/value-1/key_2/value-2/...
). - Key parameters:
secret
: partner licenseid
: external id to track on your systemaddress
(optional): address to receive reward, default is owner license address
- Partner key is a
- Run the Datagram CLI: note:
- Execute the following command:sh
./datagram-cli-<targer platform> run -- -key /secret/<partner-license>/id/<external-id>/address/<reward-address>
- Execute the following command:
- Run using Docker:
- Use the provided
Dockerfile
,entrypoint.sh
, andrun.sh
scripts to run the node within a Docker container.
- Use the provided
Docker Configuration
Dockerfile
dockerfile
FROM ubuntu:20.04 AS base
RUN apt-get update && \
apt-get install -y wget
# Install DATAGRAM CLI
RUN wget https://github.com/Datagram-Group/datagram-cli-release/releases/latest/download/datagram-cli-x86_64-linux && \
chmod +x ./datagram-cli-x86_64-linux && \
mv datagram-cli-x86_64-linux /usr/bin/datagram
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
Entrypoint Script (entrypoint.sh
)
sh
#!/bin/bash
# Check if DATAGRAM_KEY is set
if [ -z "$DATAGRAM_KEY" ]; then
echo "Error: DATAGRAM_KEY environment variable is not set." >&2
exit 1
fi
# Run datagram with the provided key
datagram run -- -key "$DATAGRAM_KEY"
Run Script (run.sh
)
sh
#!/bin/sh
# example
# export DATAGRAM_KEY=fullcore-license-key
# export DATAGRAM_KEY=/secret/here-is-partner-license/id/here-is-external-id
export DATAGRAM_KEY=/secret/here-is-partner-license/id/here-is-external-id/address/0x00abc
docker build --platform linux/amd64 -t datagram .
docker run \
--platform linux/amd64 \
--env DATAGRAM_KEY=$DATAGRAM_KEY \
--rm -it \
datagram
- Execute the command:
sh
./run.sh