# Waves IDE
Waves IDE is an online environment for developing and testing Ride smart contracts.
Key features:
- Code completion (snippets).
- Syntax and error highlighting.
- Sharing files.
- Library of exapmles.
- Ride REPL interactive console.
- Ride script compilation and assigning to an account or asset.
- Signing and sending transactions.
- JavaScript console with built-in functions for interaction with the Waves blockchain.
- Running JavaScript tests.
Waves IDE address:
- https://waves-ide.com/ – the major environment.
- https://stagenet.waves-ide.com/ – the environment with support for new features of Waves protocol which are now available on Stagenet only.
# Configuration
Configure the settings for blockchain operation:
- Click or press Ctrl + Shift + , (Cmd ⌘ + Shift + , for macOS).
- If necessary, change the blockchain network and node URL.
# Creating Account
- Click the account avatar or the Add account button in the top right corner. Select Generate new account.
- Click Show seed and private key and backup the seed phrase to a secure location. You will need the seed phrase to restore access to the account.
- Change the account name to quickly find it in the list. To do this, hover over the account name in the list and click . The account name is displayed only in Waves IDE.
To import an existing account, click the account avatar or the Add account button, select Import account and paste your seed phrase.
💡 To top up account balance on Testnet or Stagenet, do the following:
Copy address: click the account avatar and then click .
Go to the page:
• https://wavesexplorer.com/faucet?network=testnet for Testnet;
• https://wavesexplorer.com/faucet?network=stagenet for Stagenet.
Paste the address, then click Request WAVES.
# Writing Ride Script
Click and select script type.
Waves IDE helps you to write a code:
- prompts for names of built-in functions, operators, variables, and structures: just start typing or press Ctrl + Space (Cmd ⌘ + Space for macOS);
- highlights errors;
- displays the current script size and complexity.
Script file is saved in Waves IDE automatically. To save the file on your computer, in the menu on the right, hover over the file name and click . To share the script, click Share File under the script code.
💡 Find script examples in the Library menu.
# Ride REPL: Interactive Console
Ride REPL is the easiest way to try out the Ride language and its execution semantic.
Switch to the Ride REPL tab at the bottom of the window. Type an expression and press Enter.
# Assigning Script to Account
- Open the dApp script or the account script and click Deploy.
- In the Sign and publish window, select the appropriate account and click Add sign to generate the signature for the set script transaction.
- Click Publish to send the transaction.
# Issuing Smart Asset
- Open the asset script and click Issue.
- In the Sign and publish window, edit the JSON representation of transaction: add the
name
,description
, andquantity
fields. See the fields description in the Issue Transaction article. - Select the issuer's account and click Add sign to generate the signature for the issue transaction.
- Click Publish to send the transaction.
# Signing and Sending Transactions
- Click .
- In the Sign and publish window, paste the JSON representation of the transaction.
- Select the sender's account and click Add sign.
- Click Publish to send the transaction.
# JavaScript Interactive Console
Switch to the Console tab at the bottom of the window. Type a command and press Enter.
The console provides built-in functions for interaction with the Waves blockchain: signing and sending transactions, reading blockchain data, working with account keys and others. See the list of functions of js-test-env.
# Running Tests
In JS tests, you can use describe
, before
, it
, expect
and other functions of mocha and chai libraries. You can find test examples in the Library menu on the right.
To run test:
- Click and select Test.
- Replace the automatically generated code with your test.
- Click Run full test.
Test result is displayed on the Tests tab at the bottom of the window.