Skip to main content

Deploy Contracts

Initial States

Modify initial-state.json if necessary.

Setting secure false will let anyone write anything to your DB, which only makes sense for test purposes during development.

For production, leave secure true and set access control rules to each collection.

{
"canEvolve": true,
"evolve": null,
"secure": true,
"data": {},
"nonces": {},
"ids": {},
"indexes":{},
"auth":{
"name": "weavedb",
"version": "1",
"links": {}
}
}

Deploy Your Own WeaveDB Contracts

Warp has a way to deploy a new contract by duplicating already deployed contracts.

So you can deploy your own WeaveDB instance with one command, which copies from our official deployment (currently v.0.2).

Deploy on the Warp mainnet.

node scripts/generate-wallet.js mainnet
yarn deploy

or on the testnet

node scripts/generate-wallet.js testnet
node scripts/add-funds.js testnet
yarn deploy-testnet

Buffer Dependency

In the client app, you will need to install buffer package and expose it to window.Buffer to resolve the Buffer dependency for crypto authentications. This will be removed in future releases.

yarn add buffer

Do the following somehow according to the web framework of your choice.

import { Buffer } from "buffer"
window.Buffer = Buffer