Skip to content

azimanuar5874/skale-ima-sdk

 
 

Repository files navigation

SKALE IMA SDK

Discord

This repo provides a SDK for running IMA on a single-node SKALE chain. This SDK operates without BLS signature verification.

Prerequisites

  • gcc/g++ 7
  • Docker
  • nodejs v10.X
  • yarn
  • truffle@5.0.12

On Ubuntu:

sudo apt-get update && add-apt-repository ppa:ubuntu-toolchain-r/test && \
    apt-get install -y apt-utils \
    build-essential \
    docker.io \
    g++-7 \
    gcc-7 \
    make  && \
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
        --slave /usr/bin/g++ g++ /usr/bin/g++-7 && \
    sudo update-alternatives --config gcc && \
    gcc --version && \
    g++ --version

# Install Nodejs, yarn

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \
    sudo apt-get install -y nodejs && \
    node --version && \
    npm --version && \
    sudo npm install -g yarn && \
    yarn --version

# Install Truffle

sudo npm install --unsafe-perm -g truffle@5.0.12
truffle --version

Clone this repo

git clone https://github.com/skalenetwork/skale-ima-sdk.git
cd skale-ima-sdk

Configuration

By default, basic provided configuration uses Rinkeby. This can be changed by editing .env file and providing alternative Ethereum URL pointing to other network like local ganache. Negative value -4 should be specified in the CHAIN_ID_MAIN_NET variable for local ganache network.

Setup

Modify environment variables in the .env file and load.

source .env

Install all required parts and source code:

./init.sh

Build the docker container:

./build.sh

Run

To run IMA with Rinkeby:

script /dev/null
screen -S IMA-SKALE-Chain-Box -d -m bash -c "./run.sh"

Access ABIs

The ABIs geenerated for the IMA smart contracts deployed to mainnet/testnet and the SKALE Chain can be found in the following folder:

cd skale-ima-sdk/dev_dir/IMA/proxy/data/

Mainnet ABI: proxyMainnet.json SKALE Chain ABI: proxySchain_Bob.json

Troubleshooting

tail -f data_dir/all_ima_deploy_mn.txt      # Monitor IMA Mainnet deployment
tail -f data_dir/all_ima_deploy_sc.txt      # Monitor IMA SKALE Chain deployment
tail -f data_dir/all_ima_registration.txt   # Monitor IMA registration
tail -f data_dir/all_ima_loop.txt           # Monitor IMA agent

./clean.sh                                  # Remove data files for rebuild
docker ps                                   # Show running containers
docker stop [NAMES]                         # Stop container before rebuilding

Reach out to the developer community on Discord: Discord

License

All contributions are made under the GNU Affero General Public License v3. See LICENSE.

Copyright (C) 2020-present SKALE Labs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 64.5%
  • Shell 22.5%
  • JavaScript 10.2%
  • Dockerfile 2.8%