EndPoints
User communicates with the node thats running in the background via REST APIs and CLI. Below listed are the Endpoints with which user can able to view information, transfer tokens and so on.
Field | Sample Usage | Description | Flags |
---|---|---|---|
Run Rubix node | ./rubixgoplatform run -p node1 -n 0 -s -grpcPort 10500 | Creates a unique Decentralized IDentity | This following options are used to run the Rubix node-c string Configuration file for the core (default “api_config.json”) -k string Config file encryption key (default “TestKeyBasic#2022”) -n uint Node number -p string Working directory path (default “./") -s Start the core -testNet Run as test net -testNetKey string Test net key (default “testswarm.key”) |
Create DID | ./rubixgoplatform createdid | This command is used for creating a Decentralized IDentity (DID). | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -didType int DID type (0-Basic Mode, 1-Standard Mode, 2-Wallet Mode) (default 0) -didSecret string DID secret (default “My DID Secret”) -privPWD string Private key password (default “mypassword”) -quorumPWD string Quroum key password (default “mypassword”) -imgFile string Image file to create DID (Must be 256x256 PNG image) (default “image.png”) -didImgFile string DID image file name (default “did.png”) -privImgFile string DID private share image file name (default “pvtShare.png”) -pubImgFile string DID public share image file name (default “pubShare.png”) -privKeyFile string DID private key file name (default “pvtKey.pem”) -pubKeyFile string DID public key file name (default “pubKey.pem”) |
Add Bootstrap | ./rubixgoplatform addbootstrap -peers /ip4/103.60.213.76/tcp/4001/p2p/QmR1VH6SsEN1wf4EmstxXtNMvR35KEetbBetiGWWKWavJ6 | This command is used to add bootstrap peers. | -addr string Server/Host Address (default “localhost”) -peers string Bootstrap peers, multiple peers will be separated by a comma -port string Server/Host port (default “20000”) |
Remove Bootstrap | ./rubixgoplatform removebootstrap -peers /ip4/103.60.213.76/tcp/4001/p2p/QmR1VH6SsEN1wf4EmstxXtNMvR35KEetbBetiGWWKWavJ6 | This command is used for removing bootstrap peers. | -addr string Server/Host Address (default “localhost”) -peers string Bootstrap peers, multiple peers will be separated by a comma -port string Server/Host port (default “20000”) |
Remove All Bootstrap | ./rubixgoplatform removeallbootstrap | This command is used for removing all bootstrap peers. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) |
Get All Bootstrap | ./rubixgoplatform getallbootstrap | This command is used for retrieving all bootstrap peers. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) |
Get All DID | ./rubixgoplatform getalldid | This command is used for retrieving all Decentralized IDentities (DIDs). | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) |
Add Quorum | ./rubixgoplatform addquorum | This command is used for adding a quorum. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -quorumList string Quorum list file name (default “quorumlist.json”) |
Get All Quorum | ./rubixgoplatform getallquorum | This command is used for retrieving all quorum details. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) |
Remove All Quorum | ./rubixgoplatform removeallquorum | Use this command to remove all quorum lists. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) |
Setup Quorum | ./rubixgoplatform setupquorum | Use this command to set up a quorum, providing a quorum private key password. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -quorumPWD string Quorum key password (default “mypassword”) |
Get Account Info | ./rubixgoplatform getaccountinfo | Use this command to get account information on the node. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -did string DID address (default “") |
Dump Token Chain | ./rubixgoplatform dumptokenchain | Use this command to dump the token chain on the node. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -token string Token address (default “") |
Setup Service | ./rubixgoplatform setupservice | Use this command to set up a service. | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -srvName string Service name (default “explorer_service”) -dbAddress string Database address (default “localhost”) -dbName string Explorer database name (default “ExplorerDB”) -dbPassword string Database password (default “password”) -dbPort string Database port number (default “1433”) -dbType string DB Type (default “SQLServer”) -dbUsername string Database username (default “sa”) |
*Note: For nodes running in port other than 20000, you need to explicilty mention the port using the flag -port <port number>
to all the commands
Command | Sample Usage | Description | Options |
---|---|---|---|
Transfer RBT | ./rubixgoplatform transferrbt | Use this command to transfer RBT (Rubix Tokens). | -addr string Server/Host Address (default “localhost”) -port string Server/Host port (default “20000”) -senderAddr string Sender address (default “") -receiverAddr string Receiver address (default “") -rbtAmount float RBT amount to be transferred (default 0.0) -transComment string Transfer comment (default “Test transaction”) -transType int Transaction type (default 2) -fp Force password to be entered on the terminal -privPWD string Private key password (default “mypassword”) -privImgFile string DID private share image file name (default “pvtShare.png”) -privKeyFile string DID private key file name (default “pvtKey.pem”) |
Field | Endpoint | Description | Sample Request |
---|---|---|---|
Transfer Tokens | api/initiate-rbt-transfer | Transfers token(s) from one wallet address to another | curl -X 'POST' 'http://localhost:20000/api/initiate-rbt-transfer' -H 'accept: application/json' -H 'Content-Type: application/json' \-d '{"comment": "string","receiver": "string","sender": "string","tokenCOunt": 0,"type": 0}' |
Provide Signature | /api/signature-response | Supply the password for the node along with the ID generated when Initiate RBT transfer is called. | curl -X 'POST' 'http://localhost:20000/api/signature-response' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"id": "string","mode": 0,"password": "string"}' |
Field | Endpoint | Description | Sample Request |
---|---|---|---|
Account Information | /api/get-account-info | Retrieves the user account details | curl -X 'GET' 'http://localhost:20000/api/get-account-info?did=<did>' -H 'accept: application/json' |
Get Transaction Details with transcation ID | api/get-by-txnId | Retrieves the details of the transactions for the given ID | curl -X 'GET' 'http://localhost:20000/api/get-by-txnId?txnID=<Transaction ID' -H 'accept: application/json' |
Get Transaction Details with Comment | /api/get-by-comment | Retrieves the details of all the transactions committed with the specified comment. | curl -X 'GET' 'http://localhost:20000/api/get-by-comment?Comment=<Comment>' -H 'accept: application/json' |
Get Transaction Details with User’s DID | api/get-by-did | Retrieves all the transactions made with the input DID | curl -X 'GET' 'http://localhost:20000/api/get-by-did?DID=<DID>&Role=<Sender/Receiver>' -H 'accept: application/json' |