Develop
Stackr Config
Develop
Stackr Config
Telling the Stackr SDK how to run your app
This is how the stackr.config.ts
file looks like
Everything is explained in the comments, please read through
import { KeyPurpose, SignatureScheme, StackrConfig } from "@stackr/stackr-js";
// this file is generated by the deployment script
import * as deployment from "./deployment.json";
const stackrConfig: StackrConfig = {
// your micro-rollup's identity
stackrApp: {
// the app id for your micro-rollup as returned by the deployment script
appId: deployment.app_id,
// the deployment script also deploys an app inbox for you where the rollup data is stored
appInbox: deployment.app_inbox,
},
// the builder is responsible for building the rollup blocks
builder: {
// the batchSize is the number of transactions that will be included in a rollup block
// this is the MAX but the actual number of transactions in a block can be lower
// in case some transactions are invalid
batchSize: 10,
// the batchTime is the time in milliseconds after which a rollup block will be built
batchTime: 1000,
},
// the syncer is responsible for syncing the rollup blocks to the L1 and Vulcan layer
syncer: {
// this is the time after which the syncer will send blocks to vulcan layer for verification
slotTime: 5000,
// self-explanatory :)
vulcanRPC: "http://vulcan.stf.xyz",
L1RPC: "http://rpc.stf.xyz",
},
// the operator is responsible for signing the rollup blocks
// and setting up onchain contracts
operator: {
accounts: [
{
// this is the private key of the operator
privateKey: "PUT_A_KEY",
// Dont worry about it, we kinda over-engineered this part :)
purpose: KeyPurpose.BATCH,
scheme: SignatureScheme.ECDSA,
},
],
},
// EIP-712 domain details used for signing and verifying transactions
domain: {
name: "Put something here",
version: "1",
chainId: 69420,
verifyingContract: deployment.app_inbox,
salt: "put something here",
},
// the datastore is used to store the rollup details
datastore: {
// changing this does nothing lol, it's hardcoded, we will update it later
filePath: "./datastore",
},
};
export { stackrConfig };