cargo build --release
This command will start the single-node development chain
./target/release/node-template --dev
-
company: Name of the company
-
Returns
sustainable_score
on-chain for specific company
- 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}
- 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
- Get sustainable score
./scripts/get_esg.sh -c <company name>
- 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}