Giter Site home page Giter Site logo

truffle-box / tezos-tzip-12-box Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 2.0 54 KB

A TZIP-12 Token example box for Tezos development with Truffle

License: MIT License

JavaScript 96.35% Shell 3.65%
truffle tezos blockchain javascript smart-contracts smartcontracts ligo ligolang nodejs tzip-12

tezos-tzip-12-box's Introduction

Tezos TZIP-12 Token Box

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.

Prerequisites

  • Docker
    • Used for LIGO compilations and running a local sandbox Tezos node.
  • NodeJS
    • v8.9.4 to v12.2.0

Installation

  1. Install Truffle globally. Make sure you install truffle@tezos.
npm install -g truffle@tezos
  1. Download the box. This also takes care of installing the necessary dependencies.
truffle unbox tezos-tzip-12

Usage

  • 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

Sandbox Management

An archive mode sandbox Tezos node is provided in this box with RPC exposed at port 8732 and two accounts generously funded.

Commands

npm run start-sandbox
npm run kill-sandbox
npm run restart-sandbox

Available Accounts

alias pkh pk sk
alice tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb edpkvGfYw3LyB1UcCahKQk4rF2tvbMUk8GFiTuMjL75uGXrpvKXhjn edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
bob tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6 edpkurPsQ8eUApnLUJ9ZPDvu98E8VNj4KtJa1aZr16Cr5ow5VHKnz4 edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt

Interacting with Live Networks

  • 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

tezos-tzip-12-box's People

Contributors

cruzmolina avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.