πŸ‘€Overview

In which ways can HollowDB be used?

HollowDB can be used in many ways, with or without a backend and with different types of wallets. Although the interface of HollowDB is very simple, there are several things to consider when you are building an application with HollowDB:

Lazy Evaluation

SmartWeave uses lazy-evaluation to move the burden of contract execution from network nodes to smart contract users. Currently, SmartWeave supports JavaScript, using the client's unmodified execution engine.

What this means is that, when a new client wants to make a transaction on a contract, they must download all preceding transactions and evaluate them locally. By doing that, they effectively reach the present state of the contract, upon which they execute their transaction.

The immediate side-effect of this is that if a contract has many interactions, it will take a longer time to lazy-evaluate it. Since HollowDB is a key-value database operated by a SmartWeave smart contract, the more keys & interaction a contract has, the longer it will take for clients to lazy-evaluate it.

Depending on your key-count and the data-size, you might prefer different architectures for your application. Let’s take a look at these scenarios:

Examples

There are various examples to demonstrate the basic operations of the HollowDB. Check out example.js and exampleBundlr.js and configure the variables. Then, put your an Arweave wallet (JWK) inside examples/config/wallet.js.

To run the examples:

# go to examples folder
cd examples
# install dependencies
yarn
# run the example
node example

We also have a simple NextJS application to demonstrate wallet-connections and usage of HollowDB within the browser.

For bigger examples with frontend, check out:

If you haven't seen already, check the Quick Start section to see the most basic example usage of HollowDB:

Last updated