Open olizilla opened 9 months ago
I want to streamline this process now so I can package it up as the new version of the add-to-web3 github action. With this the action would just be a single call to w3cli (or the go version) and some good docs and defaults.
This could be simpler and just show you the signing key, but the proposal uses the w3 space create
flow as the template. note: that flow uses mnemonic words, but we dont yet support those as the value for the W3_PRINCIPAL
env var, so we dont do that here
...which is intersesting, and maybe we shoud be consistent about that and support setting the principle from a mnemonic.
...but also it seems like the space recovery command that would import from mnemonic is missing in w3cli today! w3 can space recover
is listed in the readme but it's not exposed as a command.
As discussed:
w3 delegation create
to have --base64
option to output as (multibase encoded) base64w3 up
to have a --proof
option that can take a base64 encoded proof or file path (which would nicely echo go-w3up
CLI)--ci
option to w3 delegation create
) since the output is very different when passed@Gozala plz may i have your thoughts on this too?
There are a few [too many steps]() to setting up a delegation for an ephemeral environment.
What if we wrap it up as single command to create a key and delegation, and upload the delegation to w3s.
then in an ephemeral environment like CI we let folks pass in all the state to the command
w3cli already lets us set the signing key via the
W3_PRINCIPAL
env var, the proposal is to allow users to provide a --proof flag with a url to a delegation to use for this operation.This is how the new golang cli works today, and we could use that in the ephemeral env, which would make it easier for folks in environments where they dont want to or cant install the latest version of nodejs
note: passing it as a url implies it the command should fetch the delegation, and use the space DID that is specified in the delegation for the current operation.
how this works today
you have to pick out the did from the key generation, and create a delegation for it with the right capabilities, and then basee64 the car bytes so they survive being passed around as an string env var...
on the ci side, you have to write custom code (!?) or do something like this (untested conjecture, ymmv)
other options considered
What's not being proposed?
coupons
w3cli allows a user to create a coupon for another user. This allows the recipient to provision a space and have the coupon creator be pay the bill for that space.
In the case of a CI environment you want to define the space for the robot to add things to rather than have it create a new space each time.
support base64 encoded proofs
Explored in https://github.com/web3-storage/w3cli/pull/122 but i don't love it.
the string should probably be multibase encoded rather than raw base64. working with an ipfs url for the delegation seems nicer than a long base encoded string.