Quickstart
Local Dev
Goal: connect trac-peer to an already-running MSB network, create/join a subnet, and execute one demo contract operation.
Prereqs
Node.js + npm
MSB network parameters:
MSB_BOOTSTRAP: 32-byte hex (64 hex chars)MSB_CHANNEL: string
An MSB “admin/funded” node that can transfer TNK to new addresses (so new peers can pay MSB fees).
1) Install
From the trac-peer repo folder:
npm install2) Start the first peer (creates a new subnet)
This starts an in-process MSB client node (joins your MSB network) + the subnet peer node.
npm run peer:run -- \
--msb-bootstrap=<MSB_BOOTSTRAP_HEX32> \
--msb-channel=<MSB_CHANNEL> \
--msb-store-name=peer-msb-1 \
--peer-store-name=peer1 \
--subnet-channel=tuxedex-v1On first run, the peer will generate a subnet bootstrap and persist it to:
stores/peer1/subnet-bootstrap.hex
Share that hex with joiners.
3) Fund the peer on MSB
In the peer logs you’ll see:
Peer MSB address: trac1...
On your MSB funded/admin node, transfer TNK to that address (any amount that covers fees for a few txs).
Why: MSB rejects txs from addresses that don’t exist in MSB state or can’t pay fees.
4) Deploy the subnet (one-time per subnet)
In the peer terminal:
This broadcasts an MSB operation that registers the subnet bootstrap + subnet channel.
5) Execute a demo contract operation
The default demo app is “Tuxemon”. It supports a single tx type:
catch
In the peer terminal:
Then query your local subnet state:
You can print your pubkey via:
6) Start a second peer (join the existing subnet)
Use the subnet bootstrap from stores/peer1/subnet-bootstrap.hex.
Fund peer2’s printed Peer MSB address the same way.
Notes
If you put flags on a new line without
\,zshwill treat them as a new shell command.confirmed=falsereads the local (unconfirmed) subnet view.confirmed=truereads the subnet’s signed view. These are subnet-specific, not “MSB finality”.
Last updated