Skip to content

terra-money/alliance-protocol

Repository files navigation

Benchmark

The smart contract has been deployed to pisco-1 testnet and it has been benchmarked with the following data:

Size Chains Alliances Data Size (kB) Tx Cost (Luna) Gas Used
XSmall 8 16 5,5 0.406522 354,576
Small 16 32 11 0.667318 574,760
Medium 32 64 21,9 1.188321 1,008,969
Large 64 124 43,7 2.230764 1,877,682
XLarge 124 248 87,4 4.319313 3,615,282

Take in consideration that the XLarge dataset almost reach the limit of data we can submit on chain since the maximum gas for queries is 3 000 000 and the size of the data is quiet large.

Deployment Matix

Network CodeID Contract Address
Oracle testnet (pisco-1) 11271 terra1w8ta7vhpzwe0y99tvvtp7k0k8uex2jq8jts8k2hsyg009ya06qts5fwftt
Hub testnet (pisco-1) 11272 terra1eaxcahzxp0x8wqejqjlqaey53tp06l728qad6z395lyzgl026qkq20xj43
Oracle mainnet (phoenix-1) 1782 terra1mdpvgjc8jmv60a4x68nggsh9w8uyv69sqls04a76m9med5hsqmwsse8sxa
Hub mainnet (phoenix-1) 1778 terra1jwyzzsaag4t0evnuukc35ysyrx9arzdde2kg9cld28alhjurtthq0prs2s

Development

Considering the Rust is installed in your system you have to use the wasm32 compiler and install cargo-make.

$ rustup default stable
$ rustup target add wasm32-unknown-unknown
$ cargo install --force cargo-make

There are few available commands to run on development:

Validate the code has been formatted correctly:

$ cargo make fmt

Run the tests written for the smart contracts

$ cargo make test

Lint the code

$ cargo make lint

Generate json Schemas for each smart contract

$ cargo make schema

Build the code

$ cargo make build

Optimize the built code

$ cargo make optimize

Deployment

Before executing the following scripts, navigate to the scripts folder and execute yarn command to install the dependencies for the set of scripts. Also remember to set the following environment variables:

# Mnemonic of the account to deploy the contract with
MNEMONIC=
# Chain id where to deploy the contract
CHAIN_ID=
# Prefix of the acccounts where to deploy the smart contract 
ACC_PREFIX=

To deploy oracle and alliance hub smart contract:

$ cargo make deploy-oracle
$ cargo make deploy-hub

Releases

No releases published

Packages

No packages published