🚀Bootstrapping Your App

Bootstrap your app and connect to the blockchain.

In order to start interacting with contracts, you first need to bootstrap your app. After you grip an app, you need to "manually" bootstrap Griptape. This bootstrap process does the following:

  1. Initialize a client to make queries to the blockchain

  2. Initialize your Account Provider

  3. Initialize a client to execute messages to the blockchain

We are going to talk about Account Provider later in this guide, but for now think of it as the software piece in charge of getting a wallet address.

Also, it is important to mention that the bootstrap process should be run after you grip your application, and is commonly handled by a component in your UI.

App States

This diagram represents how the app goes from a not gripped app to a bootstrapped app:

  • Regular App: Cannot interact with contracts

  • Gripped: Can interact with contracts, but the account provider hasn't been initialized (queries that require an account address or viewing key and messages in general can't be called)

  • Bootstrapped: Messages and queries that require an account address or viewing key (for queries only) now can be called.

import { bootstrap } from '@stakeordie/griptape.js';

// This will bootstrap your app

Last updated