Deploy locally & run tests
#
DeployWith our workflow complete, let's test the Wasm wrapper on our local environment! First, let's set up our test environment with the following command in your terminal:
tip
This command starts up a test environment with a local Ethereum network using Ganache, an ENS smart contract, and a local IPFS node.
To close the test environment, simply run:
Next, we will deploy our both our SimpleStorage.sol
smart contract as well as our wrapper with the following command:
tip
Behind the scenes, yarn deploy
will run the following commands:
Let's break down each of these commands, starting with yarn deploy:api
, which itself runs this command:
The polywrap CLI's deploy command executes a deployment pipeline defined in a polywrap.deploy.yaml
manifest.
Our deployment pipeline builds and deploys our wrapper to our local test environment.
The wrapper is assigned to an Ethereum Name Service (ENS) domain registered in the test environment that is set to resolve to our local IPFS node.
We next deploy the SimpleStorage smart contract to the Ethereum test network using a script we've written for you:
We'll be interacting with this deployed smart contract using our Wasm wrapper.
#
TestNow, we'll use the following command to check whether our wrapper and smart contract are working properly:
This command uses the Polywrap CLI's run
command, which will execute a series of Polywrap invocations and return the result to you.
#
Conclusion๐ Congratulations! You've create a custom Wasm wrapper!
Hopefully this article has given you a clear understanding of the Polywrap toolchain's primary features. If at any time in this process you get stuck or have questions, please don't hesitate to reach out on Discord.