title | index | category | type | source |
---|---|---|---|---|
Private Chain Support |
5 |
guides |
content |
Olorun (Yoruba: Ọlọrun or Ọlọhun), literally the ruler of (or in) the Heavens, is the name given to one of the three manifestations of the Supreme God in the Yoruba pantheon. Olorun is the owner of the heavens and, in this manifestation, is associated with the Sun.
WARNING: This microservice is in an experimental alpha stage and is not thoroughly tested. Also we are doing some heavy changes. Use at your own risk. Pull requests are welcome!
lambda-olorun consists of a private chain onobarding service for the uPort platform. The purpose of the service is to allow uPort users to create an identity on a private chain. The identity contracts needs to be deployed on the private network and the service configured to use it.
The onboarding process for a uPort user using olorun is the following:
- Olorun create selective disclosure, requesting the
deviceKey
of the user - The selective disclosure request is sent to the user (normally a QR code is presented to the user)
- uPort user approves the disclosure of his
deviceKey
and it is sent to Olorun - Olorun creates am identity for the user on private network and returns the identity and the network parameters to the uPort user.
There are two ways to use Olorun. First one is to configure uPort-hosted service with a new private chain. The second one is to run your own instance of Olorun with your private network configured.
For either way, the uPort identity contracts needs to be deployed on the private network.
We are working on way for Olorun to deploy the contracts in case they are not deployed on the private network (see issue #4). Meanwhile to deploy the contracts you need to do the followin:
- Clone the uport-identity repo.
- Edit the
truffle.js
file to add your private chain rpc endpoint - Run
npm install
to install truffle and other project dependencies. - Run
npm run _deploy <network name>
to deploy the contracts on your private network - Check that the contracts are deployed in your private chain on the corresponding address. Write down the address of the contracts, you will need it later.
The uPort team runs an instance of the Olorun service at api.uport.me/olorun
(a test one at api.uport.space/olorun
), you can configure this service for your own private chain. To add your private chain you need the following information:
- JSON-RPC public endpoint for your private chain. Something like
http://private.chain:8545/
- NetworkId of your private chain. You can get it with:
curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":1}' http://private.chain:8545/
- Deploy address of the following contracts:
IdentityManager
,MetaIdentityManager
andTxRelay
To configure the service you need to create a Pull Request with the following files changed
src/lib/networks.js
: with a new network name, netowork id and JSON-RPC endpointsrc/lib/private-uport-contracts.js
: wiht the network name and contract addresses.
After your PR is reviewed the uPort users can onboard to your private chain using the hosted service.
To run your own version, you need to have the Serverless Framework installed. Then you need to configure your olorun with your network parameters (see above section). Finally to deploy your olorun you can do it with
sls deploy
The build leverages the serverless framework provided by AWS Lambda. AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running.)