AttachBlockchainIdentity
Attaches the given block chain public key identity to the current profile.
Service | Operation |
---|---|
identity | ATTACH_BLOCKCHAIN_IDENTITY |
Method Parameters
Parameter | Description |
---|---|
blockchainConfig | Identifies the block chain. |
publicKey | Block chain public key. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string blockchainConfig = "config";
string publicKey = "xxx";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.IdentityService.AttachBlockchainIdentity(blockchainConfig, publicKey, successCallback, failureCallback);
const char *blockchainConfig = "config";
const char *publicKey = "xxx";
_bc->getIdentityService()->attachBlockchainIdentity(blockchainConfig, publicKey, this);
NSString *blockchainConfig = @"config";
NSString *publicKey = @"xxx";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc identityService] attachBlockchainIdentity:blockchainConfig
publicKey:publicKey
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String blockchainConfig = "config";
String publicKey = "xxx";
this; // implements IServerCallback
_bc.getIdentityService().attachBlockchainIdentity(blockchainConfig, publicKey, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var blockchainConfig = "config";
var publicKey = "xxx";
_bc.identity.attachBlockchainIdentity(blockchainConfig, publicKey, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var blockchainConfig = "config";
var publicKey = "xxx";
ServerResponse result = await _bc.identityService.attachBlockchainIdentity(blockchainConfig:blockchainConfig, publicKey:publicKey);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var blockchainConfig = "config";
var publicKey = "xxx";
var identityProxy = bridge.getIdentityServiceProxy();
var postResult = identityProxy.attachBlockchainIdentity(blockchainConfig, publicKey);
if (postResult.status == 200) {
// Success!
}
{
"service": "identity",
"operation": "ATTACH_BLOCKCHAIN_IDENTITY",
"data": {
"blockchainConfig": "config",
"publicKey": "xxx"
}
}