Skip to content

dung5ire/esg-integration

Repository files navigation

Build

cargo build --release

Single-Node Development Chain

This command will start the single-node development chain

./target/release/node-template --dev

API

Get ESG score seperately

  • company: Name of the company

  • Returns sustainable_score on-chain for specific company

How we get sustainable score on-chain

  1. Insert key for specific company ( Each company have own private key and private key)
//REQUEST:

curl http://localhost:9933 -H "Content-Type:application/json;charset=utf-8" -d   '{ "jsonrpc":"2.0", "id":1, "method":"author_insertKey", "params": ["esg!","//Alice","0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"] }'

//RESPONSE:

{"jsonrpc":"2.0","result":null,"id":1}
  1. Choose your company to get true endpoint
  • Step 1:
cd scripts
  • Step 2: Install dependencies
yarn install
  • Step 3: Config your company and endpoint in .env
  • Step 4:
node set_endpoint.js
  1. Get sustainable score
./scripts/get_esg.sh -c <company name>

Example company name

  • facebook
  • alphabet
  • microsoft
// RESPONSE:

Actual sustainable score: 0.047217380

We multiply actual score by 1_000_000_000 to store in onchain storage

{"jsonrpc":"2.0","result":47218380,"id":1}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published