Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prekucki/id auto provisioning #1539

Merged
merged 11 commits into from
Aug 10, 2021
Merged

Prekucki/id auto provisioning #1539

merged 11 commits into from
Aug 10, 2021

Conversation

prekucki
Copy link
Member

@prekucki prekucki commented Jul 23, 2021

Yagna Server Configuration

Rationale

The purpose of the change is

  • it enables the activation of a new node based on an etherium key generated in an external one
    configurator.
  • api authorization key generation without the need to start the server

New environmental variables

  • YAGNA_AUTOCONF_ID_SECRET - private key which activates as a new identity during server startup.
  • YAGNA_AUTOCONF_APPKEY - api key for the application. the key is temporary and may be different each time you run it.

Example

Case 1

New instalation. Want to run requestor

$ YAGNA_AUTOCONF_APPKEY=smok1 yagna service run
$ YAGNA_AUTOCONF_APPKEY=smok1 my-requestor

Case 2

Paper backup identity key.

$ cargo install wagyu
...
...

$ wagyu ethereum hd


      Path                 m/44'/60'/0'/0
      Mnemonic             devote unit reflect material short load round easily combine gadget foot stem
      Private Key          0570e8bc593869fded69dea1ef527d6b63a2cf7f5f557c9996376421075643ad
      Public Key           e1f22f76a25741c9cd4c1e7033c36d8140...96ea35de3da598181554695453026b818dc4d3963
      Address              0x6403a93e6FD70D770Af7b77b97616B7A20Ed874a

$ export YAGNA_AUTOCONF_ID_SECRET=0570e8bc593869fded69dea1ef527d6b63a2cf7f5f557c9996376421075643ad
$ yagna service run

$ yagna id list
{
  "headers": [
    "default",
    "locked",
    "alias",
    "address"
  ],
  "values": [
    [
      "X",
      "",
      null,
      "0x6403a93e6fd70d770af7b77b97616b7a20ed874a"
    ]
  ]
}

@prekucki prekucki requested a review from tworec July 23, 2021 11:15
@tworec
Copy link
Contributor

tworec commented Jul 23, 2021

Great. We've been also considering such a mechanism.
It resolves #1353 and #1534

core/identity/src/autoconf.rs Outdated Show resolved Hide resolved
core/identity/src/autoconf.rs Outdated Show resolved Hide resolved
use std::sync::Arc;

use crate::cli::Command;
/// Identity service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be first line in the file

@tworec tworec merged commit 54c2683 into master Aug 10, 2021
@tworec tworec deleted the prekucki/id-auto-provisioning branch August 10, 2021 16:30
@etam etam mentioned this pull request Oct 4, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants