Near Cross Contract Calls In Workspaces-rs - nearprotocol

In near's workspaces-rs, how can I approach testing smart contracts that have cross contract calls between the 2 of them if I have the wasm for both contracts? Checking the source shows support for rpc, but Im not sure if that can be used for cross contract calls, or how.

Related

Jaeger distritubed tracing with application integrated with 3rd party APIs

Currently analysing a probable distributed tracing tool for our Event Driven Microservice architecture.
Which currently looks somewhat similar to the picture below.
As I understand all the application integrated with jaeger(spring boot application having the proper jaeger dependancies) would create a span based on the middleware in place in my case mostly kafka.
My question is if on the chain of calls somewhere there is an application that calls lets a 3rd party API which has no jaeger tracing integrated in it. Would it break the tracing the chain?
Or lets say if the main application chain uses kafka to communicate within the services how to make sure that the tracing is not interrupted?
Should one write custom code for this, unfortunately I couldn't find an answer to this in their docs. https://www.jaegertracing.io/docs/1.36/getting-started/
My question is if on the chain of calls somewhere there is an
application that calls lets a 3rd party API which has no jaeger
tracing integrated in it. Would it break the tracing the chain?
In the setup that you have described above the calls to third parties would potentially not appear on the traces. But they will not break the chain. For example the second "jaeger integrated" app on your list is making 2 outgoing calls here. To a third party and to another instrumented application. The call to the other instrumented apps (and downstream apps) should definitely appear on your jaeger graph.
The call to the third party is slightly more difficult. If you are calling via a proxy that you have access to it would be possible to add telemetry information relating to the call at that point.
The alternative, and probably easier approach, is to trace outgoing calls from the instrumented apps.

How do I integrate a Go binding with MetaMask?

I am still learning. I have built a web3/js based front end that deploys and interacts with a contract where others can contribute ETH (a kickstarter-type contract). Everything works fine, with MetaMask kicking in for any payable transaction. I then built a front/back end app using Go. I deployed the same Solidity contract and ran it through abigen to produce a Golang bindings file. I can interact with the contract bind file only by hard-coding my private key, or passing it through the front end.
What I can't find info on is how to integrate MetaMask with the bindings, so other folks can contribute to the contract. I'd very much appreciate knowing if this is even possible, and if so, could you point me in the right direction? I've got this far but I'm stumped!
Thanks very much.

is there any other way to interact with Ethereum's smart contracts via UI besides Etherscan?

I'm aware of Etherscan's capability for interactions with smart contracts on the Ethereum network, but I wonder if there is any other way to read and write from smart contracts.
I'd expect an improved UI/UX usability, allowing input validation, adding documentation on top of the contract etc, yet I couldn't find any other service providing it.
You could use https://remix.ethereum.org/
There is no service that I know that can provide documentation on top of the contract.
But, it's possible to develop one. Are you interested in how it can be done?
The only one I know of is Remix. This is a great tool for smart contract testing and interaction
And if you are planning to develop your own UI with an API. This is not the exact solution but check out drizzle. It has some good built in features which will get you started on the front-end parts and showing blockchain data
Both tools presented below load the ABI automatically from the contract address.
eth95.dev
There is one that looks like old Windows 95 app. Pretty cool.
https://eth95.dev/
mycrypto.com
https://app.mycrypto.com/interact-with-contracts

Hyperledger fabric - Can I call external system during validation or Endorsement Phase

We have a use case where a transaction validation logic is quite complex and requires data from different sources, in order to validate a transaction.
Query Can we call and external rest service to validate certain data from hyperledger fabric, using its pluggable validation feature ?
Making an external api call from hyperledger fabric smart contract is technically possible, it is a risky idea for several reasons:
1) chaincode must be deterministic, and the problem with 'enriching' a transaction using an external API is that it must return the same result running anywhere in a business network, which may very well be running globally, so you need to trust that the answers will all be the same within a time windows that is quite a bit wider than a few ms
2) running just one endorser in development and production gets you around that problem, but weakens consensus a bit, and makes it essentially impossible to prove determinism for any given transaction
3) designing to such a weakened system is not a good idea, since inevitably someone will realize that the endorsement policy should be stronger and you go right back to the issues in point 1
One way around this issue is to use a distributed external API with versioned data (and you might need to write an oracle to provide this facility on top of an API that is not versioning its data) such that all endorsers store the external data's current version in the asset repository in world state as well. This makes certain that the data read is identical and accounts for delays in propagation in the oracle network. The presence of the API data version in the final asset data in world state (more accurately in the read/write set for the transaction) ensures that different versions of data in different regions in the oracle (e.g. propagation delays) will fail any multi-endorsement policy. Of course, a client designed in such an environment is free to resubmit a transaction for endorsement to get consensus.

Unit testing 3dSecure

We have began working on our payment service and all was going well with the test nonces that Braintree supply
We've been using fake-valid-nonce all over the place for our transactions however, we now need to implement 3dsecure which has 0 test nonces meaning all of our tests fail with a Gateway Rejected: three_d_secure error.
Has anyone had any experience with heavy unit testing of Braintree?
Thanks
I must concur with Joe on this,
I am participating to develop the Braintree library for Golang:
https://github.com/lionelbarrow/braintree-go
We are having issues with the exact same problem. There is no pre-defined nonces that will work through 3ds secure validation.
If we create payment methods using the cards provided in the sentinel document:
https://developers.braintreepayments.com/files/Centinel.IntegrationGuide.ConsumerAuthentication_TestCases_v1_18_0_20160823.pdf
and create a nonce from the server for one of those cards, the nonce obviously does not contain any 3ds information.
During our automated integration tests we do not have access to a client-side SDK and cannot run the "required" threeDSecure.verifyCard() (this is only available through JS code)
We are thus stuck without any means to automatic tests.
This is a serious issue as the server should always verify those fields on a transaction by itself without relying on data coming from the client
I asked the Braintree support for help on this case. Their only answer at the moment is that we should do manual testing and go through the whole client side workflow of validating a 3ds card.
I reminded them we are in 2018 and that requiring developers to manually test all integration test cases each time they commit something is not a sane way to develop.
I also reminded them that we are talking about security features that are touching client payment methods and should be tested automatically and thoroughly for obvious reasons.
I also pointed out that at least in their own python SDK they have integration tests (that work only on their own infrastructure) that test 3d secure:
https://github.com/braintree/braintree_python/blob/bdc95168f46b4c3ad3904fd56e5f8e15e04e9935/tests/test_helper.py#L297
This means someone on their teams is thinking about tests and is trying to do something. This something is not enough for us out there unfortunately.

Resources