How to compile/publish modules using Diem CLI client connected to a local test validator network?

I’m trying to run some Move modules on a local test validator network/server by doing the following:

  1. completing the instructions here

  2. cloning my module code to the machine running the local test validator network

  3. following the instructions on this page and executing this:

diem% account create
diem% dev compile 543e98a2844490fee7d1291aae65a802 [code directory]/src/modules [code directory]/diem/language/move-stdlib/nursery [code directory]/diem/language/move-stdlib/modules
diem% dev publish 543e98a2844490fee7d1291aae65a802 /tmp/2adaf46403f81593a6e1ffebad04b7ca/modules/[.mv file name]

The sender_account_address is the account created by the “account create”. I got this error message:

Error { inner: Inner { kind: JsonRpcError, source: None, json_rpc_error: Some(JsonRpcError { code: -32001, message: “Server error: VM Validation error: INVALID_MODULE_PUBLISHER”, data: Some(StatusCode(INVALID_MODULE_PUBLISHER)) }) } }

Then I used the AssocRoot account address as the sender_account_address and got the following error:

Unable to find existing managing account by address: 0000000000000000000000000A550C18, to see all existing accounts, run: ‘account list’

So my question is: which sender_account_address should I use to compile and publish Move code to a local test validator network?

Are there any other gotchas along the way once I publish?

Hi Alftom!

Sorry this issue was indeed a bug IMO. During one of our previous refactor on cli we no longer can have 0000000000000000000000000A550C18 as an argument to the module publishing, as it is not in the regular “accounts” list managed by cli. This PR will fix this issue tho. You can either rebase onto the PR and see if works or simply wait for it lands on main soon. Hope it could resolve your issue.

Best
Runtian

1 Like

Looks like it’s merged already. Thanks! I’ll report back if there are any additional issues