diff --git a/sidebars.js b/sidebars.js index e34d58da..79408549 100644 --- a/sidebars.js +++ b/sidebars.js @@ -67,43 +67,32 @@ const sidebars = { }, { type: 'category', - label: 'NEW Create Wraps', + label: 'Create Wraps', items: [ - 'tutorials/new-create-wraps/introduction', + 'tutorials/create-wraps/introduction', { type: 'category', label: 'Part One', items: [ - 'tutorials/new-create-wraps/part-one/project-setup', - 'tutorials/new-create-wraps/part-one/project-manifest', - 'tutorials/new-create-wraps/part-one/schema-and-codegen', - 'tutorials/new-create-wraps/part-one/first-method', - 'tutorials/new-create-wraps/part-one/import-and-subinvoke', - 'tutorials/new-create-wraps/part-one/interfaces-and-plugins', - 'tutorials/new-create-wraps/part-one/integration-testing', - 'tutorials/new-create-wraps/part-one/deployment' + 'tutorials/create-wraps/part-one/project-setup', + 'tutorials/create-wraps/part-one/project-manifest', + 'tutorials/create-wraps/part-one/schema-and-codegen', + 'tutorials/create-wraps/part-one/first-method', + 'tutorials/create-wraps/part-one/import-and-subinvoke', + 'tutorials/create-wraps/part-one/interfaces-and-plugins', + 'tutorials/create-wraps/part-one/integration-testing', + 'tutorials/create-wraps/part-one/deployment' ] - } - ], - }, - { - type: 'category', - label: 'Create Wraps', - items: [ + }, { type: 'category', - label: 'Tutorial', + label: 'Part Two', items: [ - 'tutorials/create-wraps/tutorial/project-setup', - 'tutorials/create-wraps/tutorial/project-folder', - 'tutorials/create-wraps/tutorial/build-deploy-test', - 'tutorials/create-wraps/tutorial/adding-new-methods', - 'tutorials/create-wraps/tutorial/writing-tests-with-workflows', - 'tutorials/create-wraps/tutorial/deploy-locally-and-test', + 'tutorials/create-wraps/part-two/polywrap-manifest', + 'tutorials/create-wraps/part-two/default-plugins', + 'tutorials/create-wraps/part-two/writing-tests-with-workflows' ] - }, - 'tutorials/create-wraps/polywrap-manifest', - 'tutorials/create-wraps/default-plugins' + } ], }, { diff --git a/src/docs/tutorials/advanced/interfaces/define-implement-interfaces.md b/src/docs/tutorials/advanced/interfaces/define-implement-interfaces.md index d192d7ef..afcbae88 100644 --- a/src/docs/tutorials/advanced/interfaces/define-implement-interfaces.md +++ b/src/docs/tutorials/advanced/interfaces/define-implement-interfaces.md @@ -16,7 +16,7 @@ It is implemented by multiple plugin wraps to help the Polywrap client query dif ## Declaring an interface project -Interface projects are declared using a [Polywrap Manifest](/tutorials/create-wraps/polywrap-manifest). +Interface projects are declared using a [Polywrap Manifest](/tutorials/create-wraps/part-two/polywrap-manifest). To indicate that a project is an abstract interface, set the project type to `interface`. Interface projects do not have a module. Only a [schema](/concepts/wrap-schema) path is declared. diff --git a/src/docs/tutorials/build-and-deploy-wraps/build-pipeline.md b/src/docs/tutorials/build-and-deploy-wraps/build-pipeline.md index 4e378194..df7c68c7 100644 --- a/src/docs/tutorials/build-and-deploy-wraps/build-pipeline.md +++ b/src/docs/tutorials/build-and-deploy-wraps/build-pipeline.md @@ -16,7 +16,7 @@ This article will help you understand the follow concepts: ## Build pipeline The build process begins by running the [`build`](https://github.com/polywrap/cli/tree/origin-dev/packages/cli#build--b) command from the [`polywrap`](https://github.com/polywrap/cli/tree/origin-dev/packages/cli) CLI. -The command will first search for the [Polywrap Manifest](../create-wraps/polywrap-manifest), find the wrap schema and implementation, and move these files into a Docker image. +The command will first search for the [Polywrap Manifest](../create-wraps/part-two/polywrap-manifest), find the wrap schema and implementation, and move these files into a Docker image. Within the docker image, the wrap schema is parsed and its contents are extracted into an ABI. The ABI is used to generate binding code for the wrap. @@ -31,7 +31,7 @@ The Build Manifest `polywrap.build.yaml` file is the entry point to build pipeli ### Declaration -The location of the Build Manifest must be declared in your [Polywrap Manifest](../create-wraps/polywrap-manifest) with a field labeled *build*. +The location of the Build Manifest must be declared in your [Polywrap Manifest](../create-wraps/part-two/polywrap-manifest) with a field labeled *build*. If a custom build manifest is not declared, the default build configuration will be used. ```yml diff --git a/src/docs/tutorials/new-create-wraps/introduction.mdx b/src/docs/tutorials/create-wraps/introduction.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/introduction.mdx rename to src/docs/tutorials/create-wraps/introduction.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/deployment.mdx b/src/docs/tutorials/create-wraps/part-one/deployment.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/deployment.mdx rename to src/docs/tutorials/create-wraps/part-one/deployment.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/first-method.mdx b/src/docs/tutorials/create-wraps/part-one/first-method.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/first-method.mdx rename to src/docs/tutorials/create-wraps/part-one/first-method.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/import-and-subinvoke.mdx b/src/docs/tutorials/create-wraps/part-one/import-and-subinvoke.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/import-and-subinvoke.mdx rename to src/docs/tutorials/create-wraps/part-one/import-and-subinvoke.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/integration-testing.mdx b/src/docs/tutorials/create-wraps/part-one/integration-testing.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/integration-testing.mdx rename to src/docs/tutorials/create-wraps/part-one/integration-testing.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/interfaces-and-plugins.mdx b/src/docs/tutorials/create-wraps/part-one/interfaces-and-plugins.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/interfaces-and-plugins.mdx rename to src/docs/tutorials/create-wraps/part-one/interfaces-and-plugins.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/project-manifest.mdx b/src/docs/tutorials/create-wraps/part-one/project-manifest.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/project-manifest.mdx rename to src/docs/tutorials/create-wraps/part-one/project-manifest.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/project-setup.mdx b/src/docs/tutorials/create-wraps/part-one/project-setup.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/project-setup.mdx rename to src/docs/tutorials/create-wraps/part-one/project-setup.mdx diff --git a/src/docs/tutorials/new-create-wraps/part-one/schema-and-codegen.mdx b/src/docs/tutorials/create-wraps/part-one/schema-and-codegen.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/part-one/schema-and-codegen.mdx rename to src/docs/tutorials/create-wraps/part-one/schema-and-codegen.mdx diff --git a/src/docs/tutorials/create-wraps/add-metadata.md b/src/docs/tutorials/create-wraps/part-two/add-metadata.md similarity index 100% rename from src/docs/tutorials/create-wraps/add-metadata.md rename to src/docs/tutorials/create-wraps/part-two/add-metadata.md diff --git a/src/docs/tutorials/create-wraps/default-plugins.md b/src/docs/tutorials/create-wraps/part-two/default-plugins.md similarity index 100% rename from src/docs/tutorials/create-wraps/default-plugins.md rename to src/docs/tutorials/create-wraps/part-two/default-plugins.md diff --git a/src/docs/tutorials/create-wraps/polylwrap-manifest.md b/src/docs/tutorials/create-wraps/part-two/polylwrap-manifest.md similarity index 100% rename from src/docs/tutorials/create-wraps/polylwrap-manifest.md rename to src/docs/tutorials/create-wraps/part-two/polylwrap-manifest.md diff --git a/src/docs/tutorials/create-wraps/tutorial/writing-tests-with-workflows.md b/src/docs/tutorials/create-wraps/part-two/writing-tests-with-workflows.md similarity index 100% rename from src/docs/tutorials/create-wraps/tutorial/writing-tests-with-workflows.md rename to src/docs/tutorials/create-wraps/part-two/writing-tests-with-workflows.md diff --git a/src/docs/tutorials/new-create-wraps/partials/_codegen-dir.mdx b/src/docs/tutorials/create-wraps/partials/_codegen-dir.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_codegen-dir.mdx rename to src/docs/tutorials/create-wraps/partials/_codegen-dir.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_complete_code.mdx b/src/docs/tutorials/create-wraps/partials/_complete_code.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_complete_code.mdx rename to src/docs/tutorials/create-wraps/partials/_complete_code.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_first_method_empty.mdx b/src/docs/tutorials/create-wraps/partials/_first_method_empty.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_first_method_empty.mdx rename to src/docs/tutorials/create-wraps/partials/_first_method_empty.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_first_method_sha3.mdx b/src/docs/tutorials/create-wraps/partials/_first_method_sha3.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_first_method_sha3.mdx rename to src/docs/tutorials/create-wraps/partials/_first_method_sha3.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_first_method_simple.mdx b/src/docs/tutorials/create-wraps/partials/_first_method_simple.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_first_method_simple.mdx rename to src/docs/tutorials/create-wraps/partials/_first_method_simple.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_integration_tests.mdx b/src/docs/tutorials/create-wraps/partials/_integration_tests.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_integration_tests.mdx rename to src/docs/tutorials/create-wraps/partials/_integration_tests.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_project-dir-common.mdx b/src/docs/tutorials/create-wraps/partials/_project-dir-common.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_project-dir-common.mdx rename to src/docs/tutorials/create-wraps/partials/_project-dir-common.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_template-module.mdx b/src/docs/tutorials/create-wraps/partials/_template-module.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_template-module.mdx rename to src/docs/tutorials/create-wraps/partials/_template-module.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_wrap-args.mdx b/src/docs/tutorials/create-wraps/partials/_wrap-args.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_wrap-args.mdx rename to src/docs/tutorials/create-wraps/partials/_wrap-args.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_wrap-custom-types.mdx b/src/docs/tutorials/create-wraps/partials/_wrap-custom-types.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_wrap-custom-types.mdx rename to src/docs/tutorials/create-wraps/partials/_wrap-custom-types.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_wrap-dir.mdx b/src/docs/tutorials/create-wraps/partials/_wrap-dir.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_wrap-dir.mdx rename to src/docs/tutorials/create-wraps/partials/_wrap-dir.mdx diff --git a/src/docs/tutorials/new-create-wraps/partials/_wrap-module-base.mdx b/src/docs/tutorials/create-wraps/partials/_wrap-module-base.mdx similarity index 100% rename from src/docs/tutorials/new-create-wraps/partials/_wrap-module-base.mdx rename to src/docs/tutorials/create-wraps/partials/_wrap-module-base.mdx diff --git a/src/docs/tutorials/create-wraps/tutorial/adding-new-methods.md b/src/docs/tutorials/create-wraps/tutorial/adding-new-methods.md deleted file mode 100644 index 9602b61b..00000000 --- a/src/docs/tutorials/create-wraps/tutorial/adding-new-methods.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -id: 'adding-new-methods' -title: 'Adding new Methods' ---- - -## **Custom functionality: IPFS SimpleStorage** - -It's time to build and customize your own Polywrap wrap! We'll be adding IPFS support to the SimpleStorage API. - -### **Update the schema** - -The first step to adding new wrap functionality is defining the method we want our users to invoke. Add the following method & custom data types to your `./src/schema.graphql` schema file: - -```graphql title="./src/schema.graphql" -type Module { -... -$snippet: gql-simple-storage-setIpfs-schema -``` - -### **Implement the `setIpfsData` method** - -In the `./src/index.ts` file, import the new types we've defined: - -```typescript title="./src/index.ts" -$snippet: as-simple-storage-index-imports -``` - -These new types will not exist yet, but don't worry, they'll be generated in the `./src/wrap/*` folder once the `yarn build` command is run. - -Next, we'll implement the `setIpfsData` method. Add this function to the bottom of your `./src/index.ts` file: - -```typescript title="./src/index.ts" -$snippet: as-simple-storage-setIpfs-method -``` - -As you can see, the `SimpleStorage.sol` smart contract already exposes a `setHash()` method. - -In steps `1` and `2`, our SimpleStorage wrap is sending a "sub-invocation" to the IPFS and Ethereum plugin wraps we imported in our schema. Wraps can be implemented as a WebAssembly-based wrap, or a plugin wrap in the client's language (ex: JavaScript). For more information on plugins, see the ["Plugin an Existing JS SDK"](/tutorials/advanced/create-plugins/create-js-plugin) documentation. - -The `Ethereum_Module.callContractMethodAndWait` function also accepts an optional argument, `connection`. This option allows you to select the network which you're transacting with, by specifying a node's endpoint, or a network (name or chain ID) (e.g. `"rinkeby"`). - -To verify everything is implemented correctly, try running `yarn build` and see if the Polywrap build succeeds. - -### **Adding more methods** - -With our first method implementation complete, it's now time to add more. The steps are the same as above. - -Update the `./src/schema.graphql` file like so: - -```graphql title="./src/schema.graphql" -type Module { -... -$snippet: gql-simple-storage-getIpfs-schema -... -} -``` - -Implement the `getIpfsData(...)` method like so in `./src/index.ts`: - -```typescript title="./src/index.ts" -$snippet: as-simple-storage-getIpfs-method -``` - -To verify everything is implemented correctly, try running `yarn build` and see if the Polywrap build succeeds. diff --git a/src/docs/tutorials/create-wraps/tutorial/build-deploy-test.md b/src/docs/tutorials/create-wraps/tutorial/build-deploy-test.md deleted file mode 100644 index cc6bf9f6..00000000 --- a/src/docs/tutorials/create-wraps/tutorial/build-deploy-test.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: 'build-deploy-test' -title: 'Build, deploy and test' ---- - -### **Build** - -Let's start building our project! Simply run: - -```bash -yarn build -``` - -In the output window, you'll see that our smart contract was compiled, and our Polywrap wrap was built and output to the `./build/*` folder. It contains the following files: - -``` -build/ - |── wrap.wasm # Wrap Logic - └── wrap.info # Wrap Manifest -``` - -This directory's contents will be uploaded to decentralized storage, and enable any Polywrap Client to download, and execute your wrap's functionality within the application. - -The `wrap.wasm` file is the WebAssembly file that was compiled from AssemblyScript. - -Lastly, the `wrap.info` file describes the layout of the package, as well as its methods and custom types. - -### **Deploy** - -To deploy our Polywrap wrap and associated smart contracts for testing, let's first setup a test environment. Simply run: - -```bash -yarn test:env:up -``` - -This will stand-up an Ethereum node, as well as an IPFS node. - -:::tip -In the future, test environments will be easily configurable to include any nodes your Polywrap wrap requires. -::: - -Next, let's deploy the `SimpleStorage.sol` smart contract, and the `simplestorage.eth` wrap URI by running: - -```bash -yarn deploy -``` - -### **Test** - -With our Polywrap wrap live at `simplestorage.eth` on our test network, it's now time to test it out! - -This is where our workflows come in handy. Run `yarn test` to see this in action. - -In the output window, you'll see a combination of jobs and returned results from the Polywrap wrap. In this workflow, we send a combination of `setData` and `getData` queries which modify the `SimpleStorage.sol` contract's stored value. - -Now that we've built the SimpleStorage wrap, let's add custom functionality to it in the next section! diff --git a/src/docs/tutorials/create-wraps/tutorial/deploy-locally-and-test.md b/src/docs/tutorials/create-wraps/tutorial/deploy-locally-and-test.md deleted file mode 100644 index d8b18fa2..00000000 --- a/src/docs/tutorials/create-wraps/tutorial/deploy-locally-and-test.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: 'deploy-locally-and-test' -title: 'Deploy locally & run tests' ---- - -### **Deploy** - -With our workflow complete, let's test the wrap on our local environment! First, let's set up our test environment with the following command in your terminal: - -```bash -yarn test:env:up -``` - -:::tip -This command starts up a test environment with a local Ethereum network using [Ganache](https://www.trufflesuite.com/ganache), an ENS smart contract, and a local IPFS node. - -To close the test environment, simply run: - -```bash -yarn test:env:down -``` -::: - -Next, we will deploy our both our `SimpleStorage.sol` smart contract as well as our wrap with the following command: - -```bash -yarn deploy -``` - -:::tip -Behind the scenes, `yarn deploy` will run the following commands: - -```bash -yarn deploy:api && yarn deploy:contract -``` - -Let's break down each of these commands, starting with `yarn deploy:api`, which itself runs this command: - -```bash -npx polywrap deploy -``` - -The polywrap CLI's deploy command executes a deployment pipeline defined in a `polywrap.deploy.yaml` manifest. -Our deployment pipeline builds and deploys our wrap to our local test environment. -The wrap 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: - -```bash -node ./scripts/deploy-contract.js -``` - -We'll be interacting with this deployed smart contract using our wrap. -::: - -### **Test** - -Now, we'll use the following command to check whether our wrap and smart contract are working properly: - -```bash -yarn test:workflow -``` - -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 wrap!** - -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](https://discord.com/invite/Z5m88a5qWu). diff --git a/src/docs/tutorials/create-wraps/tutorial/project-folder.md b/src/docs/tutorials/create-wraps/tutorial/project-folder.md deleted file mode 100644 index 59dc00cf..00000000 --- a/src/docs/tutorials/create-wraps/tutorial/project-folder.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -id: 'project-folder' -title: 'The Polywrap project folder' ---- - -Once you have your project set up, the folder tree should look something like this: - -``` -polywrap.yaml # Manifest File -src/ -│ ├── index.ts # Entry point, exports methods defined in schema -│ |── schema.graphql/ # Schema -| └── contracts/ # Smart Contracts -| -workflows/ # Job definitions (described below) -| -scripts/ # Smart Contract Build/Deploy -``` - -### **`polywrap.yaml`** -The `polywrap.yaml` is a manifest file describing the layout of a Polywrap wrap. - -### **`schema.graphql`** -Each wrap project has a [Wrap Schema](/concepts/wrap-schema). -The schema defines the wrap's dependencies, methods, and custom types. -In short, it's an interface describing how to use the wrap. - -### **`src/index.ts`** -The `index.ts` file exports the wrap's method's implementations, which contain the wrap's logic. - -### **`src/contracts/*`** -The `src/contracts` directory contains our protocol's Ethereum-based smart contracts. - -### **`workflows/*`** -[Workflows](/tutorials/advanced/workflows/running-workflows) provide a simple way to test your Polywrap without having to write custom testing logic (with JavaScript and Jest, for example). - -We'll be using this functionality further down in this guide with the `polywrap run` command, allowing us to easily send test queries against our API. - -### **`scripts/*`** -We've defined some simple build & deployment scripts for our Solidity smart contracts. These are basic utilities, and can be replaced entirely by a [Truffle](https://www.trufflesuite.com/) or [Hardhat](https://hardhat.org/) project. - -In the next section, we'll build this example wrap and see what gets outputted in the build folder! diff --git a/src/docs/tutorials/create-wraps/tutorial/project-setup.md b/src/docs/tutorials/create-wraps/tutorial/project-setup.md deleted file mode 100644 index 326acb34..00000000 --- a/src/docs/tutorials/create-wraps/tutorial/project-setup.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: 'project-setup' -title: 'Project setup' ---- - -If you're looking to find out what it takes to build a Polywrap wrap, you've come to the right place! This guide will help you understand Polywrap's core concepts. If you haven't checked out our [Quick Start](/quick-start/javascript) section yet, we recommend visiting that section first. - -In this guide, we'll download a simple but complete project to help us get started. We'll look at the different folders and files that make up a Polywrap wrap, such as the GraphQL schema and WebAssembly implementations. Then, we'll dive in and add more code to these existing files to expand the functionality of our wrap. Finally, we'll learn about the different ways you can build and deploy your wrap so that other devs can integrate your wrap into their own apps! - -:::tip -This guide will make use of a simple smart contract written in Solidity. We'll be adding a few functions to it and then use a script to deploy the contract to a test environment where we'll interact with it using our Polywrap wrap. - -NB: No Solidity or smart contract knowledge is required to use the guide! - -If you want to skip ahead to see the resulting code of this guide, visit our [Demos repository](https://github.com/polywrap/demos/tree/main/simple-storage/wrap/assemblyscript). -::: - -If at any time in this process you get stuck or have questions, please reach out to us on [Discord](https://discord.com/invite/Z5m88a5qWu). - -## **Prerequisites** - -You'll need the following installed before building your wrap: - -- `nvm` -- `yarn` -- `docker` -- `docker-compose` - -You'll be using [AssemblyScript](https://www.assemblyscript.org/) to implement your wrap's logic. AssemblyScript compiles to [WebAssembly](https://webassembly.org/). - -:::tip -For now, AssemblyScript and Rust are the only languages with which you can implement your wrap. In the future, we will support additional languages that compile to WebAssembly, such as Go. - -If you have experience programming in TypeScript, you'll feel at home with AssemblyScript since the language's syntax is very similar. - -👋 This guide is meant for those who want to build and deploy their own wraps. If you're interested in integrating deployed wraps into your own app, see our [Integrate into a JS App](../../use-wraps/install-client) guide. -::: - -## **Create your project** - -Let's begin by downloading the Polywrap demos repository, which contains the SimpleStorage wrap we will be using in this guide: - -```bash -git clone https://github.com/polywrap/demos.git -``` -From the root of this new directory, navigate to `simple-storage/wrap/assemblyscript`. - -:::tip -The best way to start a new wrap project is with a project template generated using our CLI. - -```bash -npx polywrap create wasm assemblyscript -``` - -Where `` is replaced with a custom name of your choice. For example `my-wrap`. - -After running this command, you'll see a new folder appear with the custom name you've chosen. The folder will contain everything you need to get started! -::: - - -## **Installation** - -Let's ensure all of your project's dependencies are installed. From inside the project's directory, simply run: - -- `nvm install && nvm use` -- `yarn` - -The Polywrap CLI is now installed locally to your project's directory. Going forward we'll use this local installation by running `npx polywrap`. - -We recommend not installing the `polywrap` package globally to avoid future version conflicts, and maximize reproducibility for the other developers you're working with. - -Let's head over to the next section to see what's in this new directory!