For setting up your environment to develop seda-chain
. Shows how to build, run,
format, and clean the code base. To learn how to contribute please read
here.
Note
Windows is not supported at this time.
If you are using VSCode and docker you can open the project in a dev-container where all deps will be installed already. Otherwise please see the dev dependencies.
We use clang format to format our protobuf generated code.
- Linux
- Please see your distro specific installation tool(i.e
apt
) and use that to install it.
- Please see your distro specific installation tool(i.e
- Macos:
Docker is used to help make release and static builds locally.
- Linux
- Please see your distro specific installation tool(i.e
apt
) and use that to install it.
- Please see your distro specific installation tool(i.e
- Macos:
We use Golang as the language to develop sedad
as it has the CosmosSDK.
- Golang: you can download it from the linked page or:
- Linux: Use your distribution's package manager.
- Mac: Use
macports
orbrew
.
- Ensure that
$GOPATH
and$PATH
have been set properly. On a Mac that uses the Z shell, you may have to run the following:
mkdir -p $HOME/go/bin
echo "export GOPATH=$HOME/go" >> ~/.zprofile
echo "export PATH=\$PATH:\$GOPATH/bin" >> ~/.zprofile
echo "export GO111MODULE=on" >> ~/.zprofile
source ~/.zprofile
We use GNU Make to help us built, lint, fmt, and etc for our project.
- Linux:
- Your distro likely already comes with this. You can check by running
which make
. - Otherwise please see your distro specific installation tool(i.e
apt
) and use that to install it.
- Your distro likely already comes with this. You can check by running
- Macos:
A necessary tool for generating protobuf code.
- Linux:
- Please see your distro specific installation tool(i.e
apt
) and use that to install it.
- Please see your distro specific installation tool(i.e
- Macos:
We also need some dependencies to make protobuf work for cosmos.
The buf
tool.
- Linux:
curl -sSL https://github.com/bufbuild/buf/releases/download/v1.28.1/buf-Linux-x86_64 -o buf && chmod +x buf && sudo mv buf /usr/local/bin
- Macos:
WasmVM is the library that makes CosmWASM possible.
You can install that by running:
sudo ./scripts/install_wasmvm.sh
To build the protobuf (only necessary if you made changes in the proto files) you will need to run:
make prot-dep-install
make proto-update-deps
make proto-gen
To build, run:
make build
To install (builds and moves the executable to $GOPATH/bin
, which should be in $PATH
), run:
make install
To run a single-node testnet locally:
make build
BIN=./build/sedad
$BIN tendermint unsafe-reset-all
rm -rf ~/.sedad
$BIN init node0 --default-denom aseda --chain-id seda-1-local
$BIN keys add satoshi --keyring-backend test
$BIN add-genesis-account $($BIN keys show satoshi --keyring-backend test -a) 10000000000000000seda
$BIN gentx satoshi 10000000000000000seda --keyring-backend test --chain-id seda-1-local
$BIN collect-gentxs
$BIN start
To lint and format the protobuf(only necessary if you mess with protobuf):
make proto-fmt
make proto-lint
If you have not install a Go linters runner, install it first:
make lint-install
Run format and run linter for go sided:
make fmt
make lint
After running the make install
command you should be able to use sedad --help
.
To run all unit tests:
make test-unit
To see test coverage:
make cover-html
To run end-to-end tests:
make test-e2e