Command to add the details of a Peer Manually by providing PeerID, DID and DIDType. Updated Swagger to include the API for the same.
Adding of Peer details is done when a node is trying to connect the peer node for the first time. This is being done as the PeerID of a node can change. Additionally one node can have multiple peerIDs and multiple nodes can have the same peerID.
Using the command addpeerdetails as below will prompt for entering the PeerID, DID and DIDType. If we keep PeerID inside the DID directory , the DID value will change when a node switches peerID.
Example for CLI
$ ./rubixgoplatform addpeerdetails -port 20006Enter PeerID : 12D3KooWQ2as3FNtvL1MKTeo7XAuBZxSv8QqobxX4AmURxyNe5mXEnter DID : bafybmicro2m4kove5vsetej63xq4csobtlzchb2c34lp6dnakzkwtq2mmyEnter DID Type : 42024-05-22T16:41:02.681+0530 [INFO] Main: Peer added successfully
Example for API call
To trigger the API, we can use below :
curl -X POST http://localhost:20006/api/add-peer-details -H 'Content-Type: application/json' -d '{ "peerid": "12D3KooWJUJz2ipK78LAiwhc1QUVDvSMjZNBHt4vSAeVAq6FsneA", "did": "bafybmics43ef7ldgrogzurh7vukormpgscq4um44bss6mfuopsbjorbyaq", "didtype": 0 }'{"status":true,"message":"Peers added successfully","result":null}
Change the port number, PeerID, DID and DID Type to the required values.
Command to add the details of a Peer Manually by providing PeerID, DID and DIDType. Updated Swagger to include the API for the same. Adding of Peer details is done when a node is trying to connect the peer node for the first time. This is being done as the PeerID of a node can change. Additionally one node can have multiple peerIDs and multiple nodes can have the same peerID. Using the command addpeerdetails as below will prompt for entering the PeerID, DID and DIDType. If we keep PeerID inside the DID directory , the DID value will change when a node switches peerID.
Example for CLI
$ ./rubixgoplatform addpeerdetails -port 20006
Enter PeerID : 12D3KooWQ2as3FNtvL1MKTeo7XAuBZxSv8QqobxX4AmURxyNe5mX
Enter DID : bafybmicro2m4kove5vsetej63xq4csobtlzchb2c34lp6dnakzkwtq2mmy
Enter DID Type : 4
2024-05-22T16:41:02.681+0530 [INFO] Main: Peer added successfully
Example for API call To trigger the API, we can use below :
curl -X POST http://localhost:20006/api/add-peer-details -H 'Content-Type: application/json' -d '{ "peerid": "12D3KooWJUJz2ipK78LAiwhc1QUVDvSMjZNBHt4vSAeVAq6FsneA", "did": "bafybmics43ef7ldgrogzurh7vukormpgscq4um44bss6mfuopsbjorbyaq", "didtype": 0 }'
{"status":true,"message":"Peers added successfully","result":null}
Change the port number, PeerID, DID and DID Type to the required values.