Hyperledger fabric token UTXO does not implement chaincode interface - token

I'm new to Hyperledger Fabric, and trying to get into smart contract developing in Golang. Until now, all tutorials and sources I read said that a smart contract must always implement the chaincode interface:
type Chaincode interface {
Init (stub ChaincodeStubInterface) pb.Response Invoke (stub ChaincodeStubInterface) pb.Response
}
But it seems that the Hyperledger Fabric functionality for implementing token-UTXO: https://github.com/hyperledger/fabric-samples/tree/main/token-utxo
Is a smart contract which doesn't implement the methods init or invoke from the chaincode interface. See https://github.com/hyperledger/fabric-samples/tree/main/token-utxo/chaincode-go/chaincode
Can anyone explain how is it possible that this chaincode works without implementing them?
Thank you.

The newer Fabric samples such as the UTXO contract leverage the newer contract API. The newer contract API layer implements the init and invoke functions, while allowing user contracts to be written with a higher-level abstraction where the application's chaincode functions can be directly implemented in the contract.
For more details, see the contract API documentation.

Related

Firebase cloud function dart kill all functions

I am searching for preventing attacks like Ddos, I am not sure I came across a solution.
Case 1
in which from every request putting a increment value in firestore database. After certain value such as 100000 a cloud function will trigger which will destroy / deactivate all my cloud functions.
Case 2
Is there any easy way using if else in cloud functions.
I am new to Firebase cloud functions
I am writing cloud functions in dart
Is there any way to write security rules for calling function
Is there any way to limit invocations
Can cdn or another service integration help in this situation. I dnt want surprise bill
First of, see this documentation on the guidelines you should follow to avoid security attacks in Firebase.
in which from every request putting a increment value in firestore database. After certain value such as 100000 a cloud function will trigger which will destroy / deactivate all my cloud functions.
Unfortunately, this is not how a managed service works. Cloud Functions can only be triggered when invoked or during a response to an event. If there's no traffic, then the function is not running. It's not possible to deactivate them.
You can however, list all you functions and delete them one-by-one by using Cloud Functions Client Library and method deleteFunction().
Is there any easy way using if else in cloud functions.
For this question, are you referring to conditional statements or on how a traffic is redirected?
I am new to Firebase cloud functions I am writing cloud functions in dart
Currently, there is no official way to deploy a function running in Dart Runtime, though there are community supported projects that allow you to run Dart functions on other environments.
Node is the only runtime being supported in Cloud Function for Firebase as of the moment. See documentation here.
Is there any way to write security rules for calling function
Firebase security rules are for Cloud Firestore, Realtime Database, and Cloud Storage. See this SO that shows how to protect HTTP functions using auth id tokens and database rules.
Additionally, in this documentation, you can find how to setup security rules in your Firebase project. Sample scripts can be found here.
Is there any way to limit invocations
You can find a similar SO question here on limiting invocations in Firebase Cloud Functions. Additional details regarding Quotas and Limits can be found here.
Can cdn or another service integration help in this situation. I dnt want surprise bill
CDNs can help you bring down costs due to caching behavior, however it is not the complete solution to avoid surprise bills. One way to avoid this is to setup budget alerts to send email notifications whenever your project exceeds (or about to exceed) the set spend threshold. See documentation on Avoiding surprise bills here.

Roles (read+write) in hyperledger

Is it possible to allow for someone in hyperledger rights only to read, and to others read+write?
So, can you specify different roles for users?
I'm going to answer the question based on Hyperledger Fabric v1.0.0.
The short answer is yes.
There are a couple of areas to discuss:
1) Ability to send (broadcast) and receive (deliver) transactions to/from the ordering service.
As you know, in order for transactions to make it to the ledger, they must go through an ordering service. An ordering service can be divided up into channels (in simplest terms think of channels as being unique ledgers). Each channel has policies which define who is able to read and write from/to the channel. The documentation on this topic is being updated, but basically there are channel reader and writer policies. If you cannot "write" to the channel, you cannot submit transactions to the ordering service. Additionally, if you don't have access to write to a channel, you cannot send endorsement proposals to peers for chaincode which is deployed on channel you don't have write permission for.
These policies are all part of channel configuration transactions (for which the documentation is currently being updated / created).
2) Chaincode
Beyond the channel-based policies mentioned above, it is also possible to restrict access to chaincode functions as well. This is actually typically handled from within chaincode itself and it is up to the deployer / developer of the chaincode to handle this (especially in the current 1.0.0-alpha release). There is some additional work underway to add some access control libraries which will make doing this a lot simpler

How to connect blockchains with Hyperledger Fabric?

How can we connect multiple blockchains in Hyperledger Fabric like sidechains?
The current implementation lacks clarity on this subject but it could be fairly easy implemented into a smart contract whose responsibility was to e.g. sign a document in another blockchain db. So one could simply use the REST API for the other network in Go Lang

wso2 APIManager: Add PingIdentity as new OAuth-Endpoint

We are planing to use PingFederate-Server as our central identity managment solution. What are the steps to integrate the ping server oauth-endpoint to our wso2 landscape.
Is there already a solution available?
I read the blog-post https://amilasnotes.wordpress.com/2015/05/19/integrating-with-a-third-party-oauth-provider-overview and it looks like that this task is possible.
Has someone experienced replacing the internal wso2 key-manager?
And is it possible to use both keymanagement solution (interal and ping), so that we don't need to migrate the current applications/access-tokens?
Thx, in advance
Marty
You have to write a custom keymanager implementation to connect to Ping identity server. Overall implementation steps can be found in https://amilasnotes.wordpress.com/2015/05/19/integrating-with-a-third-party-oauth-provider-overview/
There are two sample keymanager implementations you can look into. Surf Oauth and Mitre-ID Connect.
You can checkout the API manager default keymanager implementation as well. See AMDefaultKeyManagerImpl .
Regarding using both key managers, It won't be possible since default KM implementation is also written using the same keymanager interface. So only one keymanager implementation can be used.

How to configure WSO2 ESB SAP Adapter

I have already checked the information related to WSO2 ESB SAP Adapter from this link:
http://wso2.org/premium/summer-school-2011-session4-enterprise-integration-with-sap-and-wso2-esb
Is this the only information i can found about it?
I didn't find anything related to it in the official documentation of WSO2 ESB...
An example showing how to configure this adapter in the ESB will be very helpfull!
Thanks in advance,
Santiago.
You can refer following documentation for more info about WSO2 ESB integration with SAP.
http://docs.wso2.org/wiki/display/ESB460/Enterprise+Integration+with+SAP+and+WSO2+ESB
This documentation was added recently and I hope you will be able to find the information you are looking for.
WSO2 ESB comes with a variety of adapters to connect to all sorts of different systems. One of these adapters is the SAP adapter.
The WSO2 SAP adapter has full iDOC and experimental BAPI support. It used the SAP JCO library as underlying framework to communicate with SAP.
Installing the adapter couldn’t be easier. Its shipped with WSO2 ESB and the WSO2 ESB documentation website describes the installation procedure from the WSO2 perspective.
The installation procedure however does not guide you on how to find the settings you need in SAP.
That’s where this blogpost steps in. It is actually the first in a series of three. I’ll first take you through setting up the SAP connection. Then the next blogpost will introduce sending iDOCs and the last post will take you through invoking BAPIs at SAP.
So, let’s start off with some SAP adapter knowledge. I’ll refer to the WSO2 ESB SAP adapter as ‘SA’ in the following guide.
The SA is capable to be used as a Client as well as a Server. To setup the SA as client to a SAP system you’ll need to setup a client-side configuration fle. This file should be named [SAP-GWHOST].dest and must be placed in the [WSO2_HOME]/repository/conf/sap folder. This folder does not exist per default so make sure you create it and provide enough access rights for the WSO2 user to read the files within it.
To setup the WSO2 as an idoc server you must create a configuration file named [SAP-GWHOST].server.
Let’s first handle the client configuration file. There might be some differences based on your SAP system but the following settings should cover a lot of installations. The screenshots are based on SAP ECC version 6.0
In the examples here the SAP gateway is known as SAPSYS01.

Resources