Griptape.js
  • What is Griptape.js?
  • 🛹Getting Started
  • 🚀Bootstrapping Your App
  • 🗞️Interacting with Contracts
    • Contract Definitions
      • More on Definitions
    • Creating Contract Clients
    • Built-In Definitions
    • Extending Contract Definitions
    • Contract Registry
    • Instantiating Contracts
  • 🔑Using Viewing Keys and Permits
    • Using the viewing key manager
    • Using Keplr with Griptape
    • Managing Permits
  • 🕢Handling Events
  • ⚒️Using Utilities
  • 🔀API Reference
    • Bootstrap
    • Contracts
    • Viewing Keys
    • Permits
    • Events
    • Utilities
  • 🐝Tricks Tutorials
    • React Tutorials
      • Hello, Griptape
      • Hello, Contracts
      • Hello, Events
      • Hello, Viewing Keys
      • Hello, Permits
      • Hello, Transactions
      • Hello, Mint
    • Vue Tutorials
      • Hello, Griptape
      • Hello, Contracts
      • Hello, Events
      • Hello, Viewing Keys
      • Hello, Permits
      • Hello, Transactions
      • Hello, Mint
  • 💾Hackathon
    • Welcome Packet
    • Getting Set Up
    • Glossary
Powered by GitBook
On this page

Bootstrapping Your App

Bootstrap your app and connect to the blockchain.

PreviousGetting StartedNextInteracting with Contracts

Last updated 3 years ago

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
bootstrap();
🚀
bootstrap