Skip to main content

Local development

Створення середовища локальної розробки

Ви завжди можете налаштувати локальну мережу, щоб протестувати та розгорнути свій смарт-контракт!

Щоб створити повну локальну мережу, вам потрібно запустити локальний вузол, домен Core-EVM і фармер.

First, visit the Autonomys releases page and download the most up-to-date stable versions of the node and farmer.

tip

For each release, there are two versions:

  1. skylake: для новіших процесорів приблизно з 2015 року і далі
  2. x86-64-v2: для старих процесорів приблизно з 2009 року та деяких старих віртуальних машин

Older processors/VMs are no longer supported by official releases, but they can still be compiled manually if desired.

Після завантаження обох файлів, які відповідають вашій системі, запустіть вузол, використовуючи бажаний термінал. Якщо ви хочете запустити домен EVM на локальній машині, вам потрібно вказати:

  • Your local RPC server port
  • Your local web-socket RPC port You can do this with the following command:
./your_subspace_node_path run --dev --rpc-listen-on 127.0.0.1:9944 -- --domain-id 3 --dev --rpc-listen-on 127.0.0.1:8545

This will create a local RPC on port 8545.

Secondly, you need to start a farmer by running the following command:

 ./your_subspace_farmer_path farm --reward-address [YOUR REWARD ADDRESS] path=tmp-farm,size=100M

You can specify the desired plot size, but 100M should be sufficient.

And that’s it! By starting your local node and a farmer, you have your local RPC ready for testing and deploying your smart contracts! You can easily connect your MetaMask account to the local development network, as well as use Remix or Foundry in order to test and deploy smart contracts on a local network!