Adding participants

Adding participants

A participant can be added to a participant registry using either the API or the command line.

Before you start

Before you follow these steps, you must have modeled a participant in a Business Network Definition and deployed it as a Business Network.

The procedure below shows an example using the following model of a participant from the Digital Property sample Business Network Definition: digitalproperty-network

Please note: If you are adding the participant using the composer participant add command, ensure that the JSON representation of the participant is wrapped in single quotes.


participant Person identified by personId {
  o String personId
  o String firstName
  o String lastName


  1. Add the participant to a participant registry

    • JavaScript API
    const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
    let businessNetworkConnection = new BusinessNetworkConnection();
    return businessNetworkConnection.connect('admin@digitalPropertyNetwork')
        .then(() => {
            return businessNetworkConnection.getParticipantRegistry('');
        .then((participantRegistry) => {
            let factory = businessNetworkConnection.getFactory();
            let participant = factory.newResource('', 'Person', '');
            participant.firstName = 'Mae';
            participant.lastName = 'Smith';
            return participantRegistry.add(participant);
        .then(() => {
            return businessNetworkConnection.disconnect();
        .catch((error) => {
  • Command line

    composer participant add -c admin@network -d '{"$class":"","personId":"","firstName":"Mae","lastName":"Smith"}'