Application provides simple web service to generate Web3.storage HTTP Bridge tokens, based on derived proof
- Download the module to folder 'w3-hbtg'
# cd w3-hbtg
# npm install -g .
- to install globally# npm install
- to resolve dependencies
# npm uninstall -g w3-hbtg
w3-hbtg --help
- To get master key, on your machine install Web3 CLI:
# npm install -g @web3-storage/w3cli
- If you have not already logged in and created a space with the w3 CLI
# w3 login [email protected]
then follow onscreen instructions
- Initiate space creation for a new Space:
# w3 space create
then follow onscreen instructions
- Install the
w3-hbtg
module globally on the VPS (or you server where you can use for ex. nginx as proxy for HTTP Bridge Token generator service) - Run next command to get agent's DID:
# w3-hbtg whoami
- Use printed DID to get proofs from your master key.
Go to your machine where you installed w3
(i.e. you have master key) and execute the next command.
!!! Use DID from step #2 as audience-did
w3 delegation create -c "store/add" -c "upload/add" -n "w3-hbtg service" -t "service" -o <output file path> <audience-did>
where audience-did - DID you printed in the step #2
Please remember list of delegated abilities: store/add
and upload/add
and copy the delegation file (generated) to the VPS
- Return back to your VPS (where you installed
w3-hbtg
)
Here we have to add generated proof
to open access to the mentioned (in the step #3) abilities, and the same abilities will be included into HTTP Bridge token returned by w3-hbtg
# w3-hbtg space add <path to delegation (proof) file>
- Check that namespace is available now:
w3-hbtg space ls
command output should contain namespace's DID (from Preparing Master key
, step #3), and it should be marked by asterisk.
if not you should select it with command:
# w3-hbtg space use <did>
where - space you want to select