Software | Version | Required for |
---|---|---|
Go | >=1.16.2 | client |
GNU Make | >=4.3.0 | client |
geth | >=1.10.2 | client |
The contracts are available in the repository credcontracts and its go-ethereum bindings are available in the go-credbindings repository.
Then compile the code
make all
$ ganache-cli --deterministic\
--host 127.0.0.1 --port 8545\
--networkId 5777 --gasLimit 6721975\
--gasPrice 20000000000 --verbose
If you prefer, you can use geth instead of ganache using the command below.
$ ./genesis-gen.sh
$ geth --networkid=5777 --nodiscover\
--rpc --rpcport=8545 --ws --wsport=8546\
--rpccorsdomain="*" --datadir ./dev_datadir --dev.period 0\
--miner.gasprice=20000000000 --miner.gastarget=6721975\
--miner.gaslimit=6721975 --verbosity 5 --mine\
--miner.etherbase $(jq -r '.alloc | keys_unsorted[0]' dev_datadir/genesis.json)\
--miner.noverify --maxpeers 0\
--password ./dev_datadir/password.txt\
--unlock $(jq -r '.alloc | keys_unsorted[0]' dev_datadir/genesis.json)\
--allow-insecure-unlock
See the available options by running the benchmark command-line tool:
./dist/ctbench
You can attach to the ganache-cli console using geth:
$ geth attach http://127.0.0.1:8545
- Import a testing ganache account that already have funds
./dist/ctbench --config dev-config.json account import <hex_private_key>
- Deploy libraries
./dist/ctbench --config dev-config.json deploy libs
- Deploy a course
./dist/ctbench --config dev-config.json deploy course --owners=<teacher_address>,<another_teacher_address> --quorum=2
- Adding a student
./dist/ctbench --config dev-config.json course addStudent <student_address> <course_address>
- Issuing a credential
./dist/ctbench --config dev-config.json course issue <student_address> <course_address> credential.json
To see all available commands, please type:
./dist/ctbench help
./dist/ctbench --config dev-config.json test generate
./dist/ctbench --config dev-config.json test run
Install boltbrowser
go get github.com/br0xen/boltbrowser
Run passing the db
boltbrowser dev_datadir/database/cteth.db