Hyperledger Sawtooth Supply Chain transaction example in python - ubuntu-16.04

I successfully built and ran the transaction processor for supply chain on ubuntu 16.04. Now I would like to create a client transaction using the python sdk. I referred to
https://sawtooth.hyperledger.org/docs/core/nightly/1-2/_autogen/sdk_submit_tutorial_python.html
and
https://sawtooth.hyperledger.org/docs/supply-chain/nightly/master/family_specification.html#transactions
as reference.
But so far the validator always rejects my transaction and calls it invalid. My TP is running correctly and is receiving the transaction but is unable to deserialize the payload.
Does anyone have an example script in python for creating a transaction? For example creating a new agent or fish?

Now it works. I was able to generate the .proto files from https://github.com/hyperledger/sawtooth-supply-chain/tree/master/protos for python. After installing the supply-rest-api the validator accepts my payload.

Related

Getting error when trying to use starttls() in PySpark application in Azure Synapse Notebook

I've got a two part question. I've been asked to have an email sent whenever an error occurs when running a Notebook in Azure Synapse. The Notebook is going to be run in a pipeline, so I asked them why they didn't just have the email sent from the pipeline, since they know how to do it from there. They gave me a long answer which I didn't understand, so I guess it has to be done inside Synapse.
So anyway, do you have any suggestions as to how to do this? I thought of maybe doing a Logic App or Function and having the Logic App or Function called via the PySpark application.
Another way I am trying and do it is inside the PySpark application itself. Anyway I have the following code:
smtp = smtplib.SMTP("smtp-mail.outlook.com", port=587)
smtp.ehlo()
smtp.starttls()
So anyway, when it gets to smtp.starttls(), I get an error message
SMTPNotSupportedError: STARTTLS extension not supported by server.
I only get this error when trying to do it in PySpark in Synapse. When I do it in Python in Visual Studio on my other machine and run it there, I don't get the error, and I can send the email. Do you have any suggestions? Thanks.

is there a way to mint from metaplex candymachine CLI to another wallet? or how to send multiple NFT's

i have an NFT project, we have a promo ending soon which will involve me sending large amounts of NFT's to about 50 different holders wallets.
Is there a way i can mint multiple tokens from CLI using metaplex directly to another wallet??
or
Is there a way i can send a selection of NFT's (using a json Array) from the default solana wallet using my own custom RPC in CLI??
Example
I Mint 10 Tokens using metaplex and then send those 10 to another wallet.
Ive used a website to send multiple NFT's before but after a while i get timeout error as the default RPC has been over used.
If you know javascript you can use the Metaplex js-sdk. This SDK has a function inside the candyMachines() module that allow you to mint from an existing Candy machine and specify a newOwner of the mint (you will mint an NFT and the NFT will appear on the newOwner wallet). This method is not documented yet, but it has a test that you can follow here

Using Charles Proxy to debug Azure function locally

I'm creating an azure function to generate audio files from ssml. It worked great until a couple days back when I started getting empty file back from the API. If I use an app I created to request the conversion it work great, but when I use my azure function running locally on my mac, after a few files I start to get empty files (for the same file that work great with the app).
To debug the issue, i'd like to use Charles on my machine to see what the network request are and what is different between those two.
Unfortunately, when I try to run the function in VS code with Charles on, I get:
Core Tools Version: 3.0.3331 Commit hash: 0b57b1647c5a385beb8f7d64fa0e534ad4c7555d
Function Runtime Version: 3.0.15371.0
[2021-03-08T05:24:12.902Z] A host error has occurred during startup operation 'd98e6aea-950a-4d9a-84db-afe74e83cabb'.
[2021-03-08T05:24:12.903Z] System.Net.Http: The SSL connection could not be established, see inner exception. System.Private.CoreLib: The remote certificate is invalid according to the validation procedure.
Value cannot be null. (Parameter 'provider')
How can I configure the azure function tooling to work with Charles in VS Code?

Pact:Verify not picking up kafka config file. Same file gets picked up fine during consumer test run

We have implemented contract testing using message pact and directly accessing Kafka Topics for retrieving the messages from queues. Kafka topics can be accessed using authentication PLAINTEXT. So we have a separate LoginModule defined in a config file with username and password. When I do the test from consumer end it is picking up the correct config file and the scripts are running. But when I run pact:verify using the same setting in the script, LoginModule is not getting recognized and I get an error "unable to find LoginModule class". From pact side I am getting an error "Failed to invoke provider method". Have anyone faced such issues with using pact with kafka before please ?
Are you talking about this one? github.com/reevoo/pact-messages If so, we are not currently supporting pact-messages as we have yet to finalize the base level tech with http/json.
This has been brought up in the past and is known within the Foundation, but we'd rather lock down the core technology before trying to tackle other message protocols/formats.

PHP Slow to process soap request via browser but fine on the command line

I am trying to connect to an external SOAP service using PHP and have written a small php test script that just connects to the service and performs a simple request to check everything is working.
This all works correctly but when I run via a browser request, it is very slow taking somewhere in the region of 40s to establish the initial connection. When I do the same request using the exact same script on the command line, it goes through straight away.
Does anyone have any ideas as to why this might be?
Cheers
PHP caches the wsdl in /tmp. If you run from the command line first, the cache file will be owned by whatever user you're running the script as, and apache won't be able to read the cache. The wsdl will have to be downloaded and parsed every time which will be slow.
Check the permissions of /tmp/wsdl*.
Maybe external SOAP service trying to check your IP, and your server has ICMP allowed, when your local network - not.
Anyway, this question might be answered more clearly by administrator of external SOAP service :)
Is there a difference between the php.inis that are being used?
On a standard ubuntu server installation:
diff /etc/php5/apache2/php.ini /etc/php5/cli/php.ini
//edit:
Another difference might be in the include paths. Had this trouble myself on a local test server, it didn't actually use the soap class that was included (it didn't include anything, because the search paths weren't valid), but it included the built-in soap_client class.