Giter Site home page Giter Site logo

vidorge / internet-identity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dfinity/internet-identity

0.0 0.0 0.0 6.02 MB

Internet Identity, the Single Sign On service for the Internet Computer

License: Other

CSS 1.58% HTML 0.18% JavaScript 2.21% Rust 35.64% TypeScript 46.12% Shell 0.21% Haskell 13.10% WebAssembly 0.31% Dockerfile 0.65%

internet-identity's Introduction

Internet Identity Service

See ./docs/internet-identity-spec.adoc for a details specification and technical documentation.

Official build

The official build should ideally be reproducible, so that independent parties can validate that we really deploy what we claim to deploy.

We try to achieve some level of reproducibility using a Dockerized build environment. The following steps should build the official Wasm image

docker build -t internet-identity-service .
docker run --rm --entrypoint cat internet-identity-service /internet_identity.wasm > internet_identity.wasm
sha256sum internet_identity.wasm

The resulting internet_identity.wasm is ready for deployment as rdmx6-jaaaa-aaaaa-aaadq-cai, which is the reserved principal for this service.

Our CI also performs these steps; you can compare the SHA256 with the output there, or download the artifact there.

Software versions

  • dfx version 0.7.0

  • Rust version 1.51

  • NodeJS (with npm) version TBD

Running Locally

To run the internet_identity canisters, proceed as follows after cloning the repository

npm install
dfx start [--clean] [--background]
II_ENV=development dfx deploy --no-wallet --argument '(null)'

Then the canister can be used as

dfx canister call internet_identity register '(123, "test", vec {1; 2; 3}, null)'

To open the front-end, you can run the following and open the URL.

echo "http://localhost:8000?canisterId=$(dfx canister id internet_identity)"

Contributing to the frontend

The fastest workflow to get the development environment running is to deploy once with

npm ci
dfx start [--clean] [--background]
dfx deploy --no-wallet --argument '(null)'

Then, run CANISTER_ID=$(dfx canister id internet_identity) npm start to start webpack-dev-server.

To customize your canister ID for deployment or particular local development, create a .env file in the root of the project and add a CANISTER_ID attribute. It should look something like

CANISTER_ID=rrkah-fqaaa-aaaaa-aaaaq-cai

We have a set of Selenium tests that run through the various flows. To run them locally follow the steps in .github/workflows/selenium.yml.

We autoformat our code using prettier. Running npm run format formats all files in the frontend. If you open a PR that isn't formatted according to prettier, CI will automatically add a formatting commit to your PR.

We use eslint to check the frontend code. You can run it with npm run lint, or set up your editor to do it for you.

Contributing to the backend

The Internet Identity backend is a Wasm canister implemented in Rust and built from the internet_identity cargo package (src/internet_identity). Some canister functionality lives in separate libraries that can also be built to native code to simplify testing, e.g., src/certified_map, src/hashtree, src/cubehash, etc.

Run the following command in the root of the repository to execute the test suites of all the libraries:

cargo test

The backend canister is also used to serve the frontend assets. This creates a dependency between the frontend and the backend. So running the usual cargo build --target wasm32-unknown-unknown -p internet_identity might not work or include an outdated version of the frontend.

Use the following command to build the backend canister Wasm file instead:

dfx build internet_identity

The Wasm file will be located at target/wasm32-unknown-unknown/release/internet_identity.wasm.

internet-identity's People

Contributors

alin-at-dfinity avatar andrewwylde avatar dfinity-bjoern avatar drprofesq avatar dsarlis avatar eve832 avatar ggreif avatar hansl avatar hpeebles avatar ielashi avatar kritzcreek avatar krpeacock avatar lsgunnlsgunn avatar nomeata avatar roman-kashitsyn 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.