getting-started.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Getting Started
  2. =============================================
  3. Zeppelin integrates with `Truffle <https://github.com/ConsenSys/truffle/>`_, an Ethereum development environment. Please install Truffle and initialize your project with ``truffle init``::
  4. npm install -g truffle
  5. mkdir myproject && cd myproject
  6. truffle init
  7. To install the Zeppelin library, run::
  8. npm init # follow instructions
  9. npm i zeppelin-solidity
  10. After that, you'll get all the library's contracts in the contracts/zeppelin folder. You can use the contracts in the library like so::
  11. import "zeppelin-solidity/contracts/Ownable.sol";
  12. contract MyContract is Ownable {
  13. ...
  14. }
  15. .. epigraph::
  16. NOTE: The current distribution channel is npm, which is not ideal. `We're looking into providing a better tool for code distribution <https://github.com/OpenZeppelin/zeppelin-solidity/issues/13/>`_ , and ideas are welcome.
  17. Truffle Beta Support
  18. """"""""""""""""""""""""
  19. We also support Truffle Beta npm integration. If you're using Truffle Beta, the contracts in ``node_modules`` will be enough, so feel free to delete the copies at your ``contracts`` folder. If you're using Truffle Beta, you can use Zeppelin contracts like so::
  20. import "zeppelin-solidity/contracts/Ownable.sol";
  21. contract MyContract is Ownable {
  22. ...
  23. }
  24. For more info see the `Truffle Beta package management tutorial <http://truffleframework.com/tutorials/package-management/>`_.