hyperledger-firefly / hyperledger-firefly/firefly

Documentation: Custom identity walkthrough

Open
#621 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
602
Forks
246
Avg merge
18h 47m
Merged PRs (30d)
6

Description

Here's a shell starting point:

```sh
> go install github.com/hyperledger/firefly-cli/ff@latest
> # Build FireFly from main
> make docker
...

> # Start FireFly with manifest to use the local docker build, rather than latest release
> ff init -m manifest.json ids 2
initializing new FireFly stack...
Stack 'ids' created!
...

> # Start up the stack
> ff start ids
reading stack config... done
this will take a few seconds longer since this is the first time you're running this stack...
...

> # Create a signing key for new identity
> ACCOUNT=$( curl -sH 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"1","method":"personal_newAccount","params":["myunlockpw"]}' http://localhost:5100 | jq -r '.result' )
> echo $ACCOUNT
{"jsonrpc":"2.0","id":"1","result":"0x1a57a77bf68df300fc5e7bf4f5e851596a222f66"}

> # Unlock the new signing key on the node - must be repeated after every node restart
> curl -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"1","method":"personal_unlockAccount","params":["'$ACCOUNT'","myunlockpw",0]}' http://localhost:5100
{"jsonrpc":"2.0","id":"1","result":true}

> # Query our parent org
> # Note there's a TODO to allow you to specify the DID as an input here, rather than needing the UUID
> ORG_UUID=$( curl -s 'http://localhost:5000/api/v1/status' | jq -r '.org.id' )
> echo $ORG_UUID

> # Register with FireFly - using convenience of confirm=true as doing from the cmdline
> curl -H 'Content-Type: application/json' -d '{"name":"myid1","key":"'$ACCOUNT'","parent":"'$ORG_UUID'"}' 'http://localhost:5000/api/v1/namespaces/default/identities?confirm=true'

> # Query the new identity
> curl -s 'http://localhost:5000/api/v1/namespaces/default/identities' | jq
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.