Code Monkey home page Code Monkey logo

lambda-unnu's Introduction

lambda-unnu

Creator of Identities

Jamaica and Belize: Second person plural pronoun; You plural.

CircleCI

codecov

Diagrams

Description

Unnu is a server part of the uport-framework. The main feature is to create the initial uPort contract structure for a device key.

API Description

Create uPort identity

Calls the IdentityFactory, IdentityManager, or MetaIdentityManager contract to create the initial controller and proxy contract(uPortId). The proxy contract is configured to be controlled by the deviceKey. The identity factory is called in the blockchain specified by blockchain body data. If unnu does not know how to access the blockchain it returns a 404 status.

The endpoint is private, only valid "fuel tokens" from nisaba are allowed.

Endpoint createIdentity

POST /createIdentity

This endpoint uses the (Meta)IdentityManager. It also allows you to make an arbitrary call from the newly created identity.

Header

Authorization: Bearer <jwt fuel token>

Body

{
  deviceKey: <device key>,
  recoveryKey: <recovery key>,
  payload: {
    destination: <address>,
    data: <calldata>
  },
  blockchain: <blockchain name>,
  managerType: < "IdentityManager" | "MetaIdentityManager" >
}

Note that payload here is optional. If not given, an identity will be created without a call.

Response

Status Message
200 Ok. uPort contracts created
400 Bad Request Parameter missing or invalid
403 Forbidden JWT token missing or invalid
404 Not found Blockchain not found
500 Internal Error Internal error

Response data

{
  managerType: < "IdentityManager" | "MetaIdentityManager" >,
  managerAddress: <address>,
  txHash: <tx hash>
}

Sequence Diagram

createIdentity seq diagram

Lookup uPort identity

Look for a uPort identity created by a deviceKey.

Endpoint lookup

POST /lookup

Body

{
  deviceKey: <device key>
}

Response

Status Message
200 Ok. uPort contracts created
400 Bad Request Parameter missing or invalid
404 Not found Record not found
404 Not found Null identity. Not mined?
500 Internal Error Internal error

Response data

{
  managerType: < "IdentityManager" | "MetaIdentityManager" >,
  managerAddress: <address>,
  identity: <identity address>
  blockchain: <blockchain name>
}

Sequence Diagram

lookup seq diagram

Fixes

To sync the database with the nonces on the blockchain just do:

on develop

sls invoke local -f fixNonces

and on master

sls invoke local -f fixNonces --stage master

lambda-unnu's People

Contributors

aldigjo avatar c-castillo avatar oed avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

lambda-unnu's Issues

Onboard query

We need to check on how many successful vs failed onboarding tx. by cicle (every 2 weeks)

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.