Open truffle-config.js and uncomment the development section in networks:
Copy
development:{host:"127.0.0.1",// Localhost (default: none)port:8545,// Standard Ethereum port (default: none)network_id:"*",// Any network (default: none)},
This will allow your contract to connect to your Evmos local node.
In the Truffle terminal, migrate the contract using:
Copy
truffle migrate --network development
You should see incoming deployment logs in the Evmos daemon Terminal tab for each transaction
(one to deploy Migrations.sol and the other to deploy Counter.sol).
Copy
$ I[2020-07-15|17:35:59.934] Added good transaction module=mempool tx=22245B935689918D332F58E82690F02073F0453D54D5944B6D64AAF1F21974E2 res="&{CheckTx:log:\"[]\" gas_wanted:6721975 }"height=3total=1
I[2020-07-15|17:36:02.065] Executed block module=state height=4validTxs=1invalidTxs=0
I[2020-07-15|17:36:02.068] Committed state module=state height=4txs=1appHash=76BA85365F10A59FE24ADCA87544191C2D72B9FB5630466C5B71E878F9C0A111
I[2020-07-15|17:36:02.981] Added good transaction module=mempool tx=84516B4588CBB21E6D562A6A295F1F8876076A0CFF2EF1B0EC670AD8D8BB5425 res="&{CheckTx:log:\"[]\" gas_wanted:6721975 }"height=4total=1
Now, you can run the Truffle tests using the Evmos node using the test command:
Copy
$ truffle test--network development
Using network 'development'.
Compiling your contracts...
===========================> Everything is up to date, there is nothing to compile.
Contract: Counter
✓ should add(5036ms)1 passing (10s)