gor-deploy/deploy/publish-pricing.md
shreerang 452c4db5f8 Add steps to publish PricingRecord and use it for determining cost of deployments (#4)
Part of https://www.notion.so/Laconic-Mainnet-Plan-1eca6b22d47280569cd0d1e6d711d949

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Reviewed-on: #4
Co-authored-by: shreerang <shreerang@noreply.git.vdb.to>
Co-committed-by: shreerang <shreerang@noreply.git.vdb.to>
2025-07-25 13:36:35 +00:00

3.6 KiB

publish-pricing

Setup

  • Clone the repo:

    git clone git@git.vdb.to:LaconicNetwork/gor-deploy.git
    cd gor-deploy/deploy
    
  • Build the Docker container:

    docker build -t cerc/laconic-registry-cli .
    
    # Builds image cerc/laconic-registry-cli:latest
    
  • Configure userKey in the registry CLI config:

    NOTE: The laconic authority is required to set the published record names so the user key should be of the account that owns the laconic authority (owner account address: laconic13maulvmjxnyx3g855vk0lsv5aptf3rpxskynef). If you don't have an authority check steps to reserve a new authority

    nano config.yml
    

Publish Record and Set Record Name

Publishing record requires a bond with enough funds as rent is taken for each record from the bond every year

The rent amount taken is 1000000alnt so maintaining a bond with about 10x the rent amount i.e 10000000alnt is recommended

Make sure, the record names are under laconic authority

Publish Record for Cost of alnt

  • alnt price calculation (reference: https://store.laconic.com):

    • Cost of 1 deployment is 12960 in terms of alnt or 5 in terms of USD
    • Hence, cost of 1 alnt comes out be 0.000386 USD rounded off to 6 decimals
  • Publish the record:

    ./laconic-cli.sh record publish --filename records/alnt-pricing.yml --bond-id <bond-id>
    
  • Get record info:

    ./laconic-cli.sh record get --id <record-id>
    
  • Set record name for cost of alnt record:

    ./laconic-cli.sh name set lrn://laconic/pricing/alnt <record-id>
    

Publish Record for Cost of Deployment

  • Publish the record:

    ./laconic-cli.sh record publish --filename records/webapp-deployment-pricing.yml --bond-id <bond-id>
    
  • Get record info:

    ./laconic-cli.sh record get --id <record-id>
    
  • Set record name for cost of deployment record

    ./laconic-cli.sh name set lrn://laconic/pricing/webapp-deployment <record-id>
    
  • Now you should be able to use these records in the app

  • You can now continue with steps to deploy the app

Create Bond (optional)

  • Create bond:

    ./laconic-cli.sh bond create --type alnt --quantity 10000000
    
  • Get bond info:

    ./laconic-cli.sh bond get --id <bond-id>
    

Reserve a New Authority (optional)

Below steps are used to reserve laconic authority

  • Reserve authority:

    ./laconic-cli.sh authority reserve laconic
    
  • After reserving authority, commit phase begins which lasts for 1 minute so please commit the bid following below steps within that time period

  • Check authority info:

    ./laconic-cli.sh authority whois laconic
    
    • Note down auction ID from authority info as it is required in next steps
  • Get auction info:

    ./laconic-cli.sh auction get <auction-id>
    
  • Commit an auction bid:

    # 5000000 alnt is the minimum bid amount for authority auction
    
    ./laconic-cli.sh auction bid commit <auction-id> 5000000 alnt
    
    # Example file path inside container
    Reveal file: /app/deploy/out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.json
    
  • The reveal phase starts as soon as commit phase ends and lasts for 1 minute so please reveal the bid within this time period

  • Reveal bid:

    ./laconic-cli.sh auction bid reveal <auction-id> /app/deploy/out/<reaveal-file>.json
    
  • Set authority bond after winning auction as it is required to use the published authority:

    ./laconic-cli.sh authority bond set laconic <bond-id>