Deployment
The deploment process of contracts is straightforward and free. There are no gas-costs for deployments. All you need is a machine that runs it and from there distribute.
Last updated
The deploment process of contracts is straightforward and free. There are no gas-costs for deployments. All you need is a machine that runs it and from there distribute.
Last updated
Please read the code comments in the files below. Examples are taken from our Github repo. We assume the example contract will be executed and the below helps you to get a better understanding.
Below is a typical configuration file that goes wit your app package. In the example below, there is no need to setup a custom Main Settlement Bus as we provided one already as a kind of testnet (gasless).
The configurable part consists of the Peer and Feature options.
While the Trac apps support native node-js, it is encouraged to use Pear:
Deploy Bootstrap (admin):
Start your app the first time and choose option 1)
Copy and backup the seedphrase
Copy the "Peer Writer" key from the Peer section (basically the contract address)
With a text editor, open the file index.js in document root
Replace the bootstrap address in the example section (not the MSB) with the copied writer address
Choose a channel name (exactly 32 characters)
Type /exit and hit enter, then run again: pear run . store1
After the options appear, type "/add_admin --address YourPeerWriterKey" and hit enter
Your instance is now the Bootstrap and admin peer of your contract network.
Keep your bootstrap node running
For production contracts, it is strongly recommended to add a couple of indexers. See below.
Running indexers (admin)
Install on different machines than the Bootstrap's (ideally different data centers) with the exact setup in index.js
Upon start ("pear run . store1") copy the "Peer Writer" key
In the Bootstrap node screen, add the indexer: "/add_indexer --key TheIndexerWriterKey."
You should see a success confirmation
Usually 2 indexers on different locations are enough, we recommend 2 to max. 4 in addition to the Bootstrap
Enable others to join and to transact:
By default, people cannot auto-join the contract network. The network admin (the Bootstrap in this case) can enable auto-join
To enable auto-join, in the screen of the Bootstrap enter "/set_auto_add_writers --enabled 1"
Any other Peer joining with the exact same setup can join the network and execute contract functions and transactions.
Users may join using the exact same setup in index.js and start using "pear run . store1"
For more features, play around with the available system and chat options.