V / vulcan documentation

Blockchain

Publish to a local chain

Generate a service, validate it, and publish it to a local development chain. Use disposable development state and identities for this walkthrough.

Before you start

Complete Setup. The chain commands also require the repository's localnet binary and its dependencies. The CLI can select a supplied binary through N1_DEVNET_BIN. These steps assume a provisioned development environment, not a public network.

Generate a service

Run from the checkout root:

VULC_CLI="$PWD/n1/vulcan/lang/bin/vulc.ts"
node "$VULC_CLI" new contract guestbook --dir /tmp/vulcan-guestbook
node "$VULC_CLI" check /tmp/vulcan-guestbook/guestbook.v
node "$VULC_CLI" test /tmp/vulcan-guestbook

Choose a new directory for the scaffold. The test command is scoped to that directory. The scaffold is a starting point; inspect the generated publisher, state, actions and views before publishing.

Start the chain and publish

node n1/vulcan/lang/bin/vulc.ts chain up

Keep that foreground process running. In a second terminal, from the checkout root:

node n1/vulcan/lang/bin/vulc.ts publish /tmp/vulcan-guestbook/guestbook.v

Stop the local chain with Ctrl-C when you finish. Without --home, the chain is disposable; --home selects a directory for persisted development state.

Retain the address and receipt returned by your own run. An example address from another environment will not identify your local deployment.

Review the service boundary

  • State defines what the service remembers.
  • Actions change state and must enforce the caller's authority.
  • Views expose reads; review what they disclose.
  • Tests should cover successful calls, denied callers and invalid input.

Beyond a local walkthrough

A production deployment needs its actual network configuration, identities, policy, persistence, upgrade process and recovery evidence. This guide makes no claim that those are supplied by chain up. Follow the deployment contract of the network you intend to use.