c-tools | useful utils for c | Development Tools library
kandi X-RAY | c-tools Summary
kandi X-RAY | c-tools Summary
useful utils for c.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of c-tools
c-tools Key Features
c-tools Examples and Code Snippets
Community Discussions
Trending Discussions on c-tools
QUESTION
i need to use GRPC in nodejs an type script project , i have a problem with generate proto files in windows 10 and npm .
i want to ru this file transpile-proto-ts.sh
:
ANSWER
Answered 2022-Mar-22 at 06:47Make sure that your sh file is executable as
QUESTION
Hyperledger Fabric version: 2.2.4
Fabric Client: Fabric-Tools 2.2 Docker Image - https://hub.docker.com/layers/hyperledger/fabric-tools/2.2/images/sha256-a5f691808466e90942af3f5f72d697cdaa4e545acfc1f645a553986423ef7ea5?context=explore
Chaincode: Fabric-samples Javascript
Context on the issue:
I am currently creating a CI/CD pipeline for the deployment of chaincode using the 2.x chaincode lifecycle. I am facing unexpected behavior with Node.js chaincode deployment whereby the node_modules I install using npm install prior to running peer lifecycle chaincode package
(per the documentation) are not included in the resulting tar.gz package within code.tar.gz. Because my peer nodes are not able to access the internet to install dependencies, the missing modules result in errors when running the chaincode after installation. More specifically, I get errors related to missing modules like Fabric Shim which are defined in require()
statements in the chaincode sample.
When manually deconstructing unpacking the tar.gz structure, the code.tar.gz archive does not include node_modules that are present in the target chaincode directory that I defined the path to in the peer lifecycle chaincode package
command.
Expected Behavior: My understanding was that the new chaincode lifecycle packaging process included the dependencies in the tar.gz package before deploying and therefore there is no need to run npm install or otherwise download dependencies from externally at runtime. More specifically, based on the documentation and examples online, it seems the peer lifecycle chaincode package command would include installed dependencies from node_modules in the package for deployment.
Is this not the default behavior of the chaincode packaging mechanism, and if not, is there a best practice for bundling dependencies on Node.js chaincode where npm install
at the peer is not possible?
TIA for any help here
...ANSWER
Answered 2022-Jan-24 at 23:58The peer lifecycle chaincode package explicitly excludes the node_modules directory. Also as I assume you are currently using the inbuilt docker builder and launcher of the peer, even if you did send a package that contained the node_modules directory, it will still call npm install
on it even with the presence of the node_modules directory and may end up trying to interact with an external npm registry.
I would suggest that you look at either using a chaincode external builder and launcher, see https://hyperledger-fabric.readthedocs.io/en/release-2.2/cc_launcher.html and you could process a chaincode package that already has the node_modules included. A chaincode package is just a tar.gz file so is easy to package yourself as described in the link
or use chaincode as a service https://hyperledger-fabric.readthedocs.io/en/release-2.2/cc_service.html which doesn't require any code to be packaged and processed by the peer.
QUESTION
I have an java app (JDK13) running in a docker container. Recently I moved the app to JDK17 (OpenJDK17) and found a gradual increase of memory usage by docker container.
During investigation I found that the 'serviceability memory category' NMT grows constantly (15mb per an hour). I checked the page https://docs.oracle.com/en/java/javase/17/troubleshoot/diagnostic-tools.html#GUID-5EF7BB07-C903-4EBD-A9C2-EC0E44048D37 but this category is not mentioned there.
Could anyone explain what this serviceability category means and what can cause such gradual increase? Also there are some additional new memory categories comparing to JDK13. Maybe someone knows where I can read details about them.
Here is the result of command jcmd 1 VM.native_memory summary
ANSWER
Answered 2022-Jan-17 at 13:38Unfortunately (?), the easiest way to know for sure what those categories map to is to look at OpenJDK source code. The NMT tag you are looking for is mtServiceability. This would show that "serviceability" are basically diagnostic interfaces in JDK/JVM: JVMTI, heap dumps, etc.
But the same kind of thing is clear from observing that stack trace sample you are showing mentions ThreadStackTrace::dump_stack_at_safepoint
-- that is something that dumps the thread information, for example for jstack
, heap dump, etc. If you have a suspicion for the memory leak in that code, you might try to build a MCVE demonstrating it, and submitting the bug against OpenJDK, or showing it to a fellow OpenJDK developer. You probably know better what your application is doing to cause thread dumps, focus there.
That being said, I don't see any obvious memory leaks in StackFrameInfo
, neither can I reproduce any leak with stress tests, so maybe what you are seeing is "just" thread dumping over the larger and larger thread stacks. Or you capture it when thread dump is happening. Or... It is hard to say without the MCVE.
Update: After playing with MCVE, I realized that it reproduces with 17.0.1, but not with either mainline development JDK, or JDK 18 EA, or JDK 17.0.2 EA. I tested with 17.0.2 EA before, so was not seeing it, dang. Bisection between 17.0.1 and 17.0.2 EA shows it was fixed with JDK-8273902 backport. 17.0.2 releases this week, so the bug should disappear after you upgrade.
QUESTION
I've set up a sample network with three organizations:
- Org0 with two orderers;
- Org1 with one peer and one admin identity;
- Org2 with one peer, one admin identity and two user identities.
I've also set two CA, the second one gives certificates for TLS.
In the docker-compose.yaml, I've created two cli containers for Org1 and Org2 where I can act as admin joining a channel and installing the chaincode. In this way, I am able to deploy the chaincode without any problem. If I invoke the chaincode from the cli container of Org1 or Org2, it is always invoked with the role of admin of the organization (the certificate of the requestor is always the one of the admin of the org).
How can I invoke a smart contract with the role of a user that I've already registered on my CA (with the user certificate of one of the users of Org2) without implementing an application? This is useful for me only for testing purposes.
Currently I run this command:
...ANSWER
Answered 2021-Oct-25 at 06:50You can simply enroll your new user cryptographic material (MSP and TLS) from your CA and deploy a client container analog to the admin one, but pointing to the new material (with different volumes and env variables CORE_PEER_ID
, CORE_PEER_MSPCONFIGPATH
, etc.).
Anyone, at any point you are going to need to develop a client application with the SDK to implement more complex operations and execution flows.
You can also look for some higher level tool. IBM Blockchain Platform extension for VSCode is a good one.
QUESTION
When I specify the squashfs file system type in the wic
kickstart file (.wks file):
ANSWER
Answered 2021-Sep-02 at 18:06The dependency can be put in the machine configuration file with the WKS_FILE_DEPENDS
variable. For example:
QUESTION
1.I yarn add grpc-tools.
2.cmd command: protoc --js_out=import_style=commonjs,binary:./ --plugin=protoc-gen-grpc=./grpc_node_plugin.exe --grpc_out=./ UHDInterface.proto
3.Finally reported an error
UHDInterface.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-grpc hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--grpc_out
...ANSWER
Answered 2021-Mar-15 at 11:59proto3 doesn't support optional
and required
filed in message defination any more, just remove these field in UHDInterface.proto
You can reference why messge type remove 'required,optional'? for more detail.
QUESTION
I am trying to set up a Hyperledger Fabric Network with Hyperledger Explorer. I spin up a VM on the digital ocean cloud with ubuntu OS. From there, I spin up 3 orderers node, and 2 peers node. Which result in total of 5 nodes. (I am using RAFT setup).
However, I encounter the error as below when trying to start the hyperledger fabric explorer docker-container images.
Error: ...ANSWER
Answered 2021-Feb-20 at 23:54All configurations seems good, however you have to upgrade explorer version to be compatible with hyperledger fabric version.
So please use v1.1.4 instead of v1.1.1
Also make sure that you have mounted crypto config correctly, try to access this path inside the container /tmp/crypto/peerOrganizations/acme.com/tlsca/tlsca.acme.com-cert.pem
Try to change tlsCACerts
path to use peer tls ca.crt
/tmp/crypto/peerOrganizations/acme.com/peers/peer1.acme.com/tls/ca.crt
You have mentioned that the same configurations works with hyperledger fabric v2, if you have tried it locally not on the same server so I please disable the firewall on the server and give it a try
To check if you can reach domain and port please try this
cat > /dev/tcp/peer1.acme.com/7051
Check this https://support.bluemedora.com/s/article/Using-Bash-to-test-if-a-TCP-port-on-a-remote-system-is-open
QUESTION
Working on Webpack 5 and Storybook integration in our React apps' repository. Mainly upgrading from Webpack v4 to v5 because its support has been announced here in this blog post officially. Following the suggested full instructions.
With the below mentioned setup I get the following error message on the console:
...ANSWER
Answered 2021-May-28 at 08:12We had the same issue.
First, you will need to install @storybook/builder-webpack5@next
.
Then you have to upgrade every @storybook dependency to version ^6.3.0-alpha.6
using this command:
QUESTION
I'm wanting to create a script which can run k apply -Rf ./service-token-auth
for each of the logical groups here. Mainly all of the graphql-* and data-service-* folders.
Is this something that would be quite easy to implement?
...ANSWER
Answered 2021-Apr-28 at 21:21you can iterate over files in bash
first make sure that it only hits the folders that you want
QUESTION
I am trying to bundle on FreeBSD and it cannot find the grpc gem. I installed the grpc 1.30.2
version using a FreeBSD package but it cannot find the system gem.
I'm hoping there is a bundle config
setting to find and use the system gem which is already built and intalled.
The error I get is:
...ANSWER
Answered 2021-Apr-27 at 15:01Looks like this may be my fault. The gem packages purposefully remove the cache dir from the gem. This was originally added here:
https://cgit.freebsd.org/ports/commit/Mk/bsd.ruby.mk?id=8d77480356f58d6d8d1c69884d1ba9cc98ed383a
and lives on here:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install c-tools
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page