Giter VIP home page Giter VIP logo

ocr-service's Introduction

OCR-Service

Getting Started

  1. Fork the Repository: Click the "Fork" button at the top-right corner of this repository to create your own copy.

  2. Or Clone the Repository: Clone this repository to your local machine using git clone https://github.com/mickymultani/OCR-Service.git.

  3. Install Dependencies: cd OCR-Service and then npm install to install the required dependencies.

  4. Testing:

    • Run npx hardhat test to run the tests
    • If all tests pass, follow the steps outlined below to test various functions of the OnchainID contract on the hardhat local network

//console #1 start the hardhat node

npx hardhat node

//console #2 deploy the contract to local hardhat network

npx hardhat run scripts/deploy.js --network localhost

//console #3 Launch Hardhat console

npx hardhat console --network localhost

Attach contract instance:

const [signer] = await ethers.getSigners();

const OnchainID = await ethers.getContractFactory("OnchainID");

const onchainID = await OnchainID.attach("deployed_contract_address_here");

Declare the variables:

let email; let userkyc;

Register new user:

await onchainID.registerUser();

Retrieve user info:

const userInfo = await onchainID.getUserInfo(signer.address); console.log(userInfo);

Adding a new email attribute:

await onchainID.addOrUpdateAttribute("email", "[email protected]");

Retrieve the email attribute and store it in the 'email' variable:

email = await onchainID.getAttribute("email"); console.log("Email attribute:", email);

Updating the email attribute:

await onchainID.addOrUpdateAttribute("email", "[email protected]");

Retrieve the updated email attribute using the same 'email' variable:

email = await onchainID.getAttribute("email"); console.log("Updated email attribute:", email);

Set KYC status:

await onchainID.updateKYCStatus("KYC Approved");

Retrieve and print the KYC status:

userkyc = await onchainID.getKYCStatus(signer.address); console.log("KYC Status:", userkyc);

Update KYC status:

await onchainID.updateKYCStatus("KYC Not Approved");

Retrieve and print the updated KYC status:

userkyc = await onchainID.getKYCStatus(signer.address); console.log("Updated KYC Status:", userkyc);

Contributing

If you'd like to contribute to this project, please fork the repository, make your changes, and submit a pull request. Contributions are welcome!

License

This project is licensed under the MIT License.

ocr-service's People

Contributors

mickymultani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.