0

I was trying to configure Business network Operator services in my solution by adding the toolkit provided by r3 as corrdapp dependancy in my application.I am able to build the application but when I runnodes i am getting error for Notary

UPDATE

I am adding the log

    [ERROR] 2020-09-04T14:21:15,399Z [main] internal.Node. - Unable to install Corda service com.r3.businessnetworks.membership.flows.bno.service.BNOConfigurationService -  [errorCode=dfc7g6, moreInformationAt=https://errors.corda.net/OS/4.5/dfc7g6]
java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_201]
    [...]
    at net.corda.node.Corda.main(Corda.kt:13) ~[corda-node-4.5.jar:?]
Caused by: java.lang.NullPointerException
    at com.r3.businessnetworks.membership.flows.ConfigUtils.loadConfig(ConfigUtils.kt:16) ~[?:?]
    at com.r3.businessnetworks.membership.flows.bno.service.BNOConfigurationService.<init>(BNOConfigurationService.kt:21) ~[?:?]
    ... 33 more
[ERROR] 2020-09-04T14:21:15,458Z [main] internal.NodeStartupLogging. - Exception during node startup -  [errorCode=dfc7g6, moreInformationAt=https://errors.corda.net/OS/4.5/dfc7g6]
java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_201]
    [...]
    at net.corda.cliutils.CordaCliWrapperKt.start(CordaCliWrapper.kt:89) ~[corda-tools-cliutils-4.5.jar:?]
    at net.corda.node.Corda.main(Corda.kt:13) ~[corda-node-4.5.jar:?]
Caused by: java.lang.NullPointerException
    at com.r3.businessnetworks.membership.flows.ConfigUtils.loadConfig(ConfigUtils.kt:16) ~[?:?]
    at com.r3.businessnetworks.membership.flows.bno.service.BNOConfigurationService.<init>(BNOConfigurationService.kt:21) ~[?:?]
    ... 33 more
Alessandro Baffa
  • 1,127
  • 3
  • 11
  • 25
Sil
  • 25
  • 5

1 Answers1

1

You are missing the configuration file of this CorDapp as explained here; you must:

  1. Create a config folder inside your node's cordapps folder (i.e. node-folder/cordapps/config).
  2. Inside that folder create a membership-service.conf file.
  3. Inside that file add:
    // Whitelist of accepted BNOs. Attempt to communicate to not whitelisted 
    // BNO would result into an exception
    bnoWhitelist = ["O=BNO,L=New York,C=US", "O=BNO,L=London,C=GB"]
    
    // Name of the notary to use for BNO transactions such as membership approval
    notaryName = "O=Notary,L=Longon,C=GB"
    

The CorDapp that you're using relies on a configuration file (the above 3 steps create that file) and it causes the NullPointerException when it's missing. To understand more about CorDapp configuration files, read my article.

On a side note, according to this; the CorDapp that you're using will be deprecated on 31 September 2020.

Adel Rustum
  • 2,518
  • 2
  • 7
  • 15
  • Yes.. `// Name of the Notary notaryName = "O=Notary,L=London,C=GB" bnoWhitelist = ["O=BNO,L=Tokyo,C=JP"] // Name of the contract to validate membership transactions with. // Defaults to "net.corda.businessnetworks.membership.states.MembershipContract" if not specified // membershipContractName = "com.app.MyMembershipContract" // Name of the class that implements MembershipAutoAcceptor interface. Optional parameter. // membershipAutoAcceptor = "com.app.MyMembershipAutoAcceptor" ` still the same – Sil Sep 04 '20 at 15:16
  • Did you place the `membership-service.conf` inside the `your-node-folder/cordapps/config` folder then **restart the node**? – Adel Rustum Sep 04 '20 at 15:20
  • I deployed the nodes,then ran a script file which copy a membership-service.conf to the required directory then i started the node. – Sil Sep 04 '20 at 15:37
  • Can you browse to the configs folder and confirm that the file was copied there? – Adel Rustum Sep 04 '20 at 15:38
  • Yes it is there – Sil Sep 04 '20 at 15:56
  • My build is in the project root rather than in workflows.Is that a problem? – Sil Sep 07 '20 at 05:16
  • No it's not a problem. – Adel Rustum Sep 07 '20 at 05:18