How to use Emergence with Lamina 1

Prerequisites

This is a tutorial for integrating the Lamina1 blockchain with Emergence. It assumes you've completed the getting started steps Unity Getting Started

The Emergence Chain Asset

To work with any chain in Emergence you need to use an Emergence chain asset. For Lamina 1 there is a chain asset in the resources folder by default.

However if you're on an older version you may need to add it manually, to do so create a new chain asset, then input the following details:

Default Node URL: https://rpc-betanet.lamina1.com/ext/bc/C/rpc

Chain ID: 7649

Network Name: LAMINA1 Betanet

Emergence Configuration

The Emergence prefab in your scene has a field called configuration, attached to that is a configuration asset:

The chain field here needs to be replaced with the Lamina 1 chain:

Once that is all set you are ready to go in terms of using Emergence with Lamina 1!

Smart Contract Example

Let's work through an example using the simple counter smart contract that is included in the sample.

Go to the resources folder in the demo and make a copy of DeployedCounterSmartContract, I've called mine L1-Smart Contract

The L1 smart contract object needs to have 2 fields changed:

Contract Address: 0xdEff415d7E3e983E93Adcb2Fb113745C0F787bc2

Chain: Lamina1Betanet (the L1 chain object)

Now lets use these by updating the demo stations in the scene, we need to update the Read and the Write demo stations:

The Deployed Contract field in the Read Method and Write Method scripts in the Demostation needs to be updated to use our new smart contract object:

Last updated