Steps to deploy & use a custom module in local testnet


What are the steps to deploy & execute a module ?

  1. start a local testnet
  2. set type = “Open”
  3. write a mvir contract
  4. compile it ( )
  5. ?



Seconded, it’s not obvious how to execute a custom transaction in a local test net node

1 Like

We are working on a repl so that we can test custom modules locally. The code is already in but it’s not yet published and it was pretty hacky. Will put out detailed instructions once we clean that up.


Basic idea is that you need to serialize the compiled code and craft a SignedTransaction whose program field contains your new module. We ware working on more helper functions to help you do that. Stay tuned.

1 Like

As a workaround, put your mvir contract under libra/language/functional_tests/tests/testsuite/ and run the tests. See this post for details.

(Note this does not actually spawn a node, but at least it allows you to test the semantics of your mvir code. As @runtianz mentioned we’re working on tools to support local nodes.)