-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
The following items are required to build and run the services associated with the project.
The minimum supported version of Go is 1.18
. To upgrade your installation of Go, see the documentation.
This project runs a version of Ethereum locally. It also uses the Solidity programming language for smart contract development. To install geth
and solidity
use Homebrew. The makefile
has a command called dev.setup
to help.
This project uses staticcheck
as the linter for code correctness and Go idioms. Running tests will require the use of staticcheck
. Information on installing staticcheck
can be found here.
This project uses govulncheck
for vulnerability management. Running tests will require the use of govulncheck
.
Information on installing govulncheck
can be found here.
The recommended option is to use the git clone command and clone the project anywhere on disk.
$ cd $HOME
$ mkdir code
$ cd code
$ git clone https://github.com/ardanlabs/liarsdice
$ cd blockchain
To install Ethereum (geth) and the Solidity compiler, run this make command.
$ make dev.setup
Navigate to the root of the project and run the test suite. You need geth running first.
$ cd $HOME/code/blockchain
// In a separate terminal window.
$ make geth-up
// Deploy the smart contract.
$ make contract-deploy
// Run the export command that is provided.
$ export GAME_CONTRACT_ID=0x46D9cE545007E4E694016b3959D4dC11D96F3F2b
// Now run the tests.
$ make test