rosetta-deso
provides an implementation of the Rosetta API for DeSo in Golang.
If you haven't heard of the Rosetta API, you can find more
information here.
As specified in the Rosetta API Principles,
all Rosetta implementations must be deployable via Docker and support running via either an
online
or offline
mode.
You must install docker. You can download Docker here.
Running the following commands will create a Docker image called rosetta-deso:latest
.
Checkout rosetta-deso
and core
in the same directory
In the rosetta-deso
repo, run the following (you may need sudo):
docker build -t rosetta-deso -f Dockerfile ..
You may need sudo:
docker run -p 17005:17005 -it rosetta-deso /deso/bin/rosetta-deso run
Specify --network=TESTNET --miner-public-keys=publickey
to get free testnet money. You
can easily generate a key on deso.com and copy it from your wallet page (starts with
BC).
Scripts in the scripts/testnet
folder demonstrate how to run an online node, offline node, and construct transactions.
cd scripts/testnet
./online.sh
./offline.sh
./send.sh
To run checks with rosetta-cli
, first install the rosetta-cli:
curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/master/scripts/install.sh | sh -s
To run the data checks, execute:
bin/rosetta-cli check:data --configuration-file rosetta-cli-conf/testnet/deso.conf
To run the construction checks, execute:
bin/rosetta-cli check:construction --configuration-file rosetta-cli-conf/testnet/deso.conf
There are some issues with running the rosetta cli w/ M1 Macs. To fix this, you can run the following command to build the rosetta cli docker image:
docker build github.com/coinbase/mesh-cli --platform linux/amd64 -t rosetta-cli
Then update the configuration file to use http://host.docker.internal:17005
instead of http://localhost:17005
-
basically replacing all usages of localhost
with host.docker.internal
.
Then to run the rosetta cli check:data tests, you can run the following command:
docker run -v "$(pwd):/data" --rm -it --platform linux/amd64 rosetta-cli check:data --configuration-file /data/rosetta-cli-conf/testnet/deso.conf