Drizzle Quickstart

Install Drizzle via npm:

npm install --save drizzle

Using React?: The easiest way to get started with Drizzle is to use our official drizzle-react package and (optionally) its companion drizzle-react-components.

Note: Since Drizzle uses web3 1.0 and web sockets, be sure your development environment can support these. As a development blockchain, you'll need ganache-cli v6.1.0+, geth or parity.

  1. Import the provider.

    import { Drizzle, generateStore } from 'drizzle'
    
  2. Create an options object and pass in the desired contract artifacts for Drizzle to instantiate. Other options are available, see the Options section below.

    // Import contracts
    import SimpleStorage from './../build/contracts/SimpleStorage.json'
    import TutorialToken from './../build/contracts/TutorialToken.json'
    
    const options = {
      contracts: [
        SimpleStorage
      ]
    }
    
    const drizzleStore = generateStore(this.props.options)
    const drizzle = new Drizzle(this.props.options, drizzleStore)
    

Note: The above assumes you have no existing redux store and generates a new one. To use your existing redux store, see Using an Existing Redux Store.