Swaplace
  • About Swaplace
    • Manifesto
    • Overview
    • Roadmap
    • Tokenomics (🚧)
    • Start swaping with Swaplace
    • Marketplace
    • Call for contributors
      • ✧ How to start
      • ✧ Incentives
    • Community & Links
  • Developers
    • Guides
      • ✧ Overview
      • ✧ Setting up your local environment
      • ✧ Preparing
        • Encode config
        • Encode ERC1155 Asset
        • Make Swap
      • ✧ Creating
        • ERC20/ERC721
        • ERC1155
        • Native Ether
      • ✧ Accepting
      • ✧ Canceling
    • Technical Reference
      • ✧ Overview
      • ✧ Swaplace
      • ✧ SwapFactory
      • ✧ Interfaces
        • ✧ IERC165
        • ✧ IErrors
        • ✧ ISwap
        • ✧ ISwapFactory
        • ✧ ISwaplace
    • Deployments
Powered by GitBook
On this page
  • Pre-requisites
  • Setup
  • Contributing
  1. Developers
  2. Guides

✧ Setting up your local environment

Previous✧ OverviewNext✧ Preparing

Last updated 11 months ago

Pre-requisites

  • Have forked on your environment

  • Have or installed

  • RPC Node (or )

Setup

ATTENTION

After forking the repository, you must change the branch to the develop branch to get the latest version.

WARNING

main branch is not stable at the moment.

Clone the repository

git clone https://github.com/YourUsername/swaplace-dapp.git

then

git switch develop

Installing dependencies

NOTE When installing dependencies using YARN or NPM, stick to the selected package manager throughout your project. This consistency helps prevent conflicts and ensures smoother management of dependencies in the future.

Run the following commands to install all the dependencies

 npm i

OR

yarn i

After, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Environment Variables

Alchemy has two types of keys, one for the HTTP provider and another for the Alchemy SDK. You should use the HTTP key for the NEXT_PUBLIC_ALCHEMY_SEPOLIA_HTTP variable and the SDK key for the NEXT_PUBLIC_ALCHEMY_SEPOLIA_KEY variable.

The HTTP key is used to connect to the blockchain and the SDK key is used to connect to the Alchemy API, which allows us to get the user custody tokens easily.

NEXT_PUBLIC_ALCHEMY_SEPOLIA_HTTP=
NEXT_PUBLIC_ALCHEMY_SEPOLIA_KEY=

WARNING

The NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID= used in the .env file is public. They are not meant to be used in production.

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=

Contributing

The project comes with a .env.example file. You must rename it to .env and fill the variables with your values. Most RPC providers offer free testnet nodes. You can use or to get a free node. We currently use Sepolia for testing purposes but you can use any other provider and evm chains to test the application.

If you want to use your own please create your Project ID in the website (not mandatory).

To know more about how you can contribute .

this repository
NPM
YARN
Alchemy
Infura
Alchemy
Infura
WalletConnect
see our notion page