First Steps in Development

Setting Up Your First Project

  1. Create a new project directory:

bashCopymkdir my-aepp
cd my-aepp
aeproject init
  1. Project structure:

Copymy-aepp/
├── contracts/       # Sophia smart contracts
├── deployment/      # Deployment scripts
├── test/           # Test files
└── docker/         # Docker configuration
  1. Write your first contract:

sophiaCopy// contracts/HelloWorld.aes
contract HelloWorld =
  entrypoint sayHello(name : string) : string =
    String.concat("Hello, ", name)
  1. Test your contract:

javascriptCopy// test/helloWorldTest.js
const { assert } = require('chai')
const { utils } = require('@aeternity/aeproject')

describe('HelloWorld', () => {
  let contract
  
  before(async () => {
    contract = await utils.deployContract('HelloWorld')
  })
  
  it('should say hello', async () => {
    const result = await contract.sayHello('æternity')
    assert.equal(result, 'Hello, æternity')
  })
})

Wallet Setup and Test Tokens

Setting Up a Wallet

  1. Base æpp (Mobile Wallet)

  • Download from App Store or Google Play

  • Create a new account

  • Secure your seed phrase

  1. SuperHero Wallet (Browser Extension)

  • Install from Chrome Web Store

  • Create or import account

  • Connect to testnet

Getting Test Tokens

  1. Testnet Faucet

  1. Using the Faucet via CLI

bashCopycurl -X POST -H "Content-Type: application/json" \
-d '{"address": "YOUR_PUBLIC_KEY"}' \
https://faucet.aeternity.io/account/balance

Environment Configuration

javascriptCopy// config/network.js
module.exports = {
  networks: {
    testnet: {
      node: "https://testnet.aeternity.io",
      compilerUrl: "https://compiler.aeternity.io"
    },
    local: {
      node: "http://localhost:3001",
      compilerUrl: "http://localhost:3080"
    }
  }
}

Next Steps

Remember to always start development on testnet before deploying to mainnet. The æternity community is here to help - don't hesitate to reach out on the forum or Discord for support!

Last updated