Note: Experimental. Currently designed for demo purposes only.
This box contains an example TZIP-12 Token contract along with a readymade sandbox node configuration for quickstart Tezos smart contract development.
- Install Truffle globally. Make sure you install
truffle@tezos
.
npm install -g truffle@tezos
- Download the box. This also takes care of installing the necessary dependencies.
truffle unbox tezos-tzip-12
-
Compiling the example smart contracts
truffle compile
-
Starting the local sandbox Tezos node
npm run start-sandbox
-
Migrating contracts
truffle migrate
-
Running contract tests
truffle test
An archive mode sandbox Tezos node is provided in this box with RPC exposed at port 8732
and two accounts generously funded.
npm run start-sandbox
npm run kill-sandbox
npm run restart-sandbox
alias | pkh | pk | sk |
---|---|---|---|
alice | tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb | edpkvGfYw3LyB1UcCahKQk4rF2tvbMUk8GFiTuMjL75uGXrpvKXhjn | edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq |
bob | tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6 | edpkurPsQ8eUApnLUJ9ZPDvu98E8VNj4KtJa1aZr16Cr5ow5VHKnz4 | edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt |
-
A test faucet key can be obtained from https://faucet.tzalpha.net/. Once saved, it can be imported inside
truffle-config.js
:const { mnemonic, secret, password, email } = require("./faucet.json"); module.exports = { networks: { carthagenet: { host: "https://carthagenet.smartpy.io", port: 443, network_id: "*", secret, mnemonic, password, email, type: "tezos" } } };
-
truffle@tezos
also supports importing an activated account's secret key:module.exports = { networks: { carthagenet: { host: "https://carthagenet.smartpy.io", port: 443, network_id: "*", secretKey: "edsk...", // private key type: "tezos" } } };
truffle migrate --network carthagenet truffle test --network carthagenet