Skip to content

Commit

Permalink
Merge pull request #174 from anandrgit/master
Browse files Browse the repository at this point in the history
Support contract Changes on Using Organization Id and Service Id
  • Loading branch information
raamb authored Dec 18, 2018
2 parents e9ff650 + 725d2ef commit 13abb5b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ metadata][service-configuration-metadata]
* **registry_address_key** (required) -
Ethereum address of the Registry contract instance.

* **organization_name** (required) -
name of the organization to search for [service configuration
* **organization_id** (required) -
Id of the organization to search for [service configuration
metadata][service-configuration-metadata].

* **service_name** (required) -
name of the service to search for [service configuration
* **service_id** (required) -
Id of the service to search for [service configuration
metadata][service-configuration-metadata].

* **passthrough_enabled** (optional; default: `false`) -
Expand Down
2 changes: 1 addition & 1 deletion blockchain/ethereum_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (env *SimulatedEthereumEnvironment) MpeDeposit(from *bind.TransactOpts, amo
}

func (env *SimulatedEthereumEnvironment) MpeOpenChannel(from *bind.TransactOpts, to *bind.TransactOpts, amount int64, expiration int64, groupId [32]byte) *SimulatedEthereumEnvironment {
_, err := env.MultiPartyEscrow.OpenChannel(EstimateGas(from), to.From, big.NewInt(amount), big.NewInt(expiration), groupId, from.From)
_, err := env.MultiPartyEscrow.OpenChannel(EstimateGas(from), from.From, to.From, groupId, big.NewInt(amount), big.NewInt(expiration))
if err != nil {
panic(fmt.Sprintf("Unable to open MPE payment channel: %v", err))
}
Expand Down
12 changes: 6 additions & 6 deletions blockchain/serviceMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ func getMetaDataUrifromRegistry() []byte {
log.WithError(err).WithField("registryContractAddress", registryContractAddress).
Panic("Error instantiating Registry contract for the given Contract Address")
}
orgName := StringToBytes32(config.GetString(config.OrganizationName))
serviceName := StringToBytes32(config.GetString(config.ServiceName))
orgId := StringToBytes32(config.GetString(config.OrganizationId))
serviceId := StringToBytes32(config.GetString(config.ServiceId))

serviceRegistration, err := reg.GetServiceRegistrationByName(nil, orgName, serviceName)
serviceRegistration, err := reg.GetServiceRegistrationById(nil, orgId, serviceId)
if err != nil {
log.WithError(err).WithField("OrganizationName", config.GetString(config.OrganizationName)).
WithField("ServiceName", config.GetString(config.ServiceName)).
Panic("Error Retrieving contract details for the Given Organization and Service Name ")
log.WithError(err).WithField("OrganizationId", config.GetString(config.OrganizationId)).
WithField("ServiceId", config.GetString(config.ServiceId)).
Panic("Error Retrieving contract details for the Given Organization and Service Ids ")
}

return serviceRegistration.MetadataURI[:]
Expand Down
9 changes: 4 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const (
HdwalletMnemonicKey = "hdwallet_mnemonic"
IpfsEndPoint = "ipfs_end_point"
LogKey = "log"
OrganizationName = "organization_name"
ServiceName = "service_name"
OrganizationId = "organization_id"
ServiceId = "service_id"
PassthroughEnabledKey = "passthrough_enabled"
PassthroughEndpointKey = "passthrough_endpoint"
PrivateKeyKey = "private_key"
Expand All @@ -52,11 +52,10 @@ const (
"hdwallet_index": 0,
"hdwallet_mnemonic": "",
"ipfs_end_point": "http://localhost:5002/",
"organization_name": "ExampleOrganization",
"organization_id": "ExampleOrganizationId",
"passthrough_enabled": false,
"registry_address_key": "0x4e74fefa82e83e0964f0d9f53c68e03f7298a8b2",
"service_name": "ExampleService",
"service_id": "ExampleServiceId",
"private_key": "",
"ssl_cert": "",
"ssl_key": "",
Expand Down
2 changes: 1 addition & 1 deletion resources/blockchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"bip39": "2.5.0",
"fs-extra": "5.0.0",
"ganache-cli": "6.1.6",
"singularitynet-platform-contracts": "https://github.com/singnet/platform-contracts/releases/download/v0.2.4/singularitynet-platform-contracts-0.2.4.tgz",
"singularitynet-platform-contracts": "https://github.com/singnet/platform-contracts/releases/download/v0.2.5/singularitynet-platform-contracts-0.2.5.tgz",
"singularitynet-token-contracts": "2.0.0",
"truffle": "4.1.13",
"truffle-contract": "3.0.6",
Expand Down

0 comments on commit 13abb5b

Please sign in to comment.