Questions tagged with Linux
Content language: English
Sort by most recent
Browse through the questions and answers listed below or filter and sort to narrow down your results.
I followed the tutorial
<https://docs.aws.amazon.com/ja_jp/managed-blockchain/latest/hyperledger-fabric-dev/managed-blockchain-get-started-tutorial.html>
and completed Step 1 to Step 7, and successfully deployed the chaincode to the network.
Here is the query result:
```log
$ peer lifecycle chaincode queryinstalled
Installed chaincodes on peer:
Package ID: abctest_1.0:957504a77be8fdbcaf6fac1707822f1620442d7a93f8c5d96f8b788ddda79022, Label: abctest_1.0
```
fabric-ca-client tools enroll the admin and got the admin_msp like this:
```
$ tree
.
├── admin-msp
│ ├── IssuerPublicKey
│ ├── IssuerRevocationPublicKey
│ ├── admincerts
│ │ └── cert.pem
│ ├── cacerts
│ │ └── ca-m-bz5qr6rhcveqxfjyjfrtaioe5e-n-j2ib55zmyree5fieloktt3ttim-managedblockchain-ap-northeast-1-amazonaws-com-30002.pem
│ ├── keystore
│ │ ├── 3e7e4b7f840f8a209b178afefb63e207f336cfd7101c612d8a8acefda8a59504_sk
│ │ ├── c8be8052c5888e713b82317296f0a636a07c6375fcb922cb06833f8ebffa6139_sk
│ │ └── e12f734b4044befcce7fae67c394fff9416123414814c3553dab1036b99361b9_sk
│ ├── signcerts
│ │ └── cert.pem
│ └── user
└── fabric-ca-client-config.yaml
```
i try to write a client application to connect the network.
```ts
import FabricCAServices from "fabric-ca-client";
import * as config from "./config";
import { Gateway, GatewayOptions, Wallets, Wallet } from "fabric-network";
import * as path from "path";
const createWallet = async (): Promise<Wallet> => {
const walletPath = path.resolve(process.cwd(), "wallet");
const wallet = await buildWallet(walletPath);
return wallet;
};
const buildWallet = async (walletPath: string): Promise<Wallet> => {
let wallet: Wallet;
if (walletPath) {
wallet = await Wallets.newFileSystemWallet(walletPath);
} else {
wallet = await Wallets.newInMemoryWallet();
}
return wallet;
};
const buildCAClient = (
ccp: Record<string, any>,
caHostName: string
): FabricCAServices => {
// Create a new CA client for interacting with the CA.
const caInfo = ccp.certificateAuthorities[caHostName]; // lookup CA details from config
const caTLSCACerts = caInfo.tlsCACerts.pem;
const caClient = new FabricCAServices(
caInfo.url,
{ trustedRoots: caTLSCACerts, verify: false },
caInfo.caName
);
return caClient;
};
const enrollAdmin = async (
caClient: FabricCAServices,
wallet: Wallet,
orgMspId: string
): Promise<void> => {
try {
// Check to see if we've already enrolled the admin user.
const identity = await wallet.get(config.adminUserId);
if (identity) {
return;
}
// Enroll the admin user, and import the new identity into the wallet.
const enrollment = await caClient.enroll({
enrollmentID: config.adminUserId,
enrollmentSecret: config.adminUserPasswd,
});
const x509Identity = {
credentials: {
certificate: enrollment.certificate,
privateKey: enrollment.key.toBytes(),
},
mspId: orgMspId,
type: "X.509",
};
await wallet.put(config.adminUserId, x509Identity);
console.log(
"Successfully enrolled admin user and imported it into the wallet"
);
} catch (error) {
console.error(`Failed to enroll admin user : ${error}`);
}
};
const createGateway = async (
connectionProfile: Record<string, any>,
identity: string,
wallet: Wallet
): Promise<Gateway> => {
const gateway = new Gateway();
const options: GatewayOptions = {
wallet,
identity,
discovery: { enabled: false, asLocalhost: true },
};
await gateway.connect(connectionProfile, options);
return gateway;
};
async function main() {
const wallet = await createWallet();
const ccp = config.connectionProfile;
const caClient = buildCAClient(ccp, config.caHostName); // ca.org.SDL.aws.com
await enrollAdmin(caClient, wallet, config.adminUserId);
const gatewayOrg1 = await createGateway(
config.connectionProfile,
config.adminUserId,
wallet
);
}
main();
```
Also I use this template to generate connect profile.
```json
{
"name": "${NETWORKNAME}-${MEMBERNAME}",
"version": "1.0.0",
"client": {
"organization": "${MEMBERNAME}",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"organizations": {
"${MEMBERNAME}": {
"mspid": "${MEMBERID}",
"peers": ["peer0.org.${MEMBERNAME}.aws.com"],
"certificateAuthorities": ["ca.org.${MEMBERNAME}.aws.com"]
}
},
"peers": {
"peer0.org.${MEMBERNAME}.aws.com": {
"url": "grpcs://${PEERSERVICEENDPOINT}",
"tlsCACerts": {
"pem": "${PEERPEM}"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org.${MEMBERNAME}.aws.com",
"hostnameOverride": "peer0.org.${MEMBERNAME}.aws.com"
}
}
},
"certificateAuthorities": {
"ca.org.${MEMBERNAME}.aws.com": {
"url": "https://${CASERVICEENDPOINT}",
"caName": "${MEMBERID}",
"tlsCACerts": {
"pem": ["${CAPEM}"]
},
"httpOptions": {
"verify": false
}
}
}
}
```
the $PEERPEM = `admin_msp/signcerts/cert.pem` and $CAPEM= `admin_msp/signcerts/cert.pem`
the finnal connect profile:
```json
{
"name": "LocalCoinNetwork-SDL",
"version": "1.0.0",
"client": {
"organization": "SDL",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"organizations": {
"SDL": {
"mspid": "m-BZ5QR6RHCVEQXFJYJFRTAIOE5E",
"peers": ["peer0.org.SDL.aws.com"],
"certificateAuthorities": ["ca.org.SDL.aws.com"]
}
},
"peers": {
"peer0.org.SDL.aws.com": {
"url": "grpcs://nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIIC8zCCApmgAwIBAgIUE37UHZ+ceYFu28QAwGXteREOfWEwCgYIKoZIzj0EAwIw\ngawxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdT\nZWF0dGxlMSIwIAYDVQQKExlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMSIwIAYD\nVQQLExlBbWF6b24gTWFuYWdlZCBCbG9ja2NoYWluMS4wLAYDVQQDEyVTREwgQW1h\nem9uIE1hbmFnZWQgQmxvY2tjaGFpbiBSb290IENBMB4XDTIzMDMyNzE2MzAwMFoX\nDTMzMDMyNDE2MzUwMFowaTELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENh\ncm9saW5hMRQwEgYDVQQKEwtIeXBlcmxlZGdlcjEbMAoGA1UECxMDU0RMMA0GA1UE\nCxMGY2xpZW50MQ4wDAYDVQQDEwVhZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABOR5XwEVuPWPFm1v9sgEtFRs847Vj4ArM7olxLBNh32DUG/ZLYETec2WJwS9\nYIXYXw8ovl+GrGbpn4rFCSDDZyyjgdowgdcwDgYDVR0PAQH/BAQDAgeAMAwGA1Ud\nEwEB/wQCMAAwHQYDVR0OBBYEFFVmufxkUSshWeZKubaR99QdMu6hMB8GA1UdIwQY\nMBaAFIeBsKCQ8SWeJS6JPxVpSm5Zwg5ZMBoGA1UdEQQTMBGCD2lwLTEwLTAtMTY4\nLTI0NzBbBggqAwQFBgcIAQRPeyJhdHRycyI6eyJoZi5BZmZpbGlhdGlvbiI6IlNE\nTCIsImhmLkVucm9sbG1lbnRJRCI6ImFkbWluIiwiaGYuVHlwZSI6ImNsaWVudCJ9\nfTAKBggqhkjOPQQDAgNIADBFAiEAvf+z1GDS9roj1XcH4yMwyJKaYpxeQK/4YTul\nu7CVX2ECIFfQvMj5lBQZUH6/C1B0T1p+5IYtukpcKf9rS4n6k1hE\n-----END CERTIFICATE-----\n"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org.SDL.aws.com",
"hostnameOverride": "peer0.org.SDL.aws.com"
}
}
},
"certificateAuthorities": {
"ca.org.SDL.aws.com": {
"url": "https://ca.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30002",
"caName": "m-BZ5QR6RHCVEQXFJYJFRTAIOE5E",
"tlsCACerts": {
"pem": [
"-----BEGIN CERTIFICATE-----\nMIIC8zCCApmgAwIBAgIUE37UHZ+ceYFu28QAwGXteREOfWEwCgYIKoZIzj0EAwIw\ngawxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdT\nZWF0dGxlMSIwIAYDVQQKExlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMSIwIAYD\nVQQLExlBbWF6b24gTWFuYWdlZCBCbG9ja2NoYWluMS4wLAYDVQQDEyVTREwgQW1h\nem9uIE1hbmFnZWQgQmxvY2tjaGFpbiBSb290IENBMB4XDTIzMDMyNzE2MzAwMFoX\nDTMzMDMyNDE2MzUwMFowaTELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENh\ncm9saW5hMRQwEgYDVQQKEwtIeXBlcmxlZGdlcjEbMAoGA1UECxMDU0RMMA0GA1UE\nCxMGY2xpZW50MQ4wDAYDVQQDEwVhZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABOR5XwEVuPWPFm1v9sgEtFRs847Vj4ArM7olxLBNh32DUG/ZLYETec2WJwS9\nYIXYXw8ovl+GrGbpn4rFCSDDZyyjgdowgdcwDgYDVR0PAQH/BAQDAgeAMAwGA1Ud\nEwEB/wQCMAAwHQYDVR0OBBYEFFVmufxkUSshWeZKubaR99QdMu6hMB8GA1UdIwQY\nMBaAFIeBsKCQ8SWeJS6JPxVpSm5Zwg5ZMBoGA1UdEQQTMBGCD2lwLTEwLTAtMTY4\nLTI0NzBbBggqAwQFBgcIAQRPeyJhdHRycyI6eyJoZi5BZmZpbGlhdGlvbiI6IlNE\nTCIsImhmLkVucm9sbG1lbnRJRCI6ImFkbWluIiwiaGYuVHlwZSI6ImNsaWVudCJ9\nfTAKBggqhkjOPQQDAgNIADBFAiEAvf+z1GDS9roj1XcH4yMwyJKaYpxeQK/4YTul\nu7CVX2ECIFfQvMj5lBQZUH6/C1B0T1p+5IYtukpcKf9rS4n6k1hE\n-----END CERTIFICATE-----\n"
]
},
"httpOptions": {
"verify": false
}
}
}
}
```
The client application runing result:
```log
D 2023-03-27T19:33:27.851Z | subchannel | (2) 10.0.138.232:30003 creating HTTP/2 session
D 2023-03-27T19:33:27.857Z | subchannel | (2) 10.0.138.232:30003 connection closed with error unable to verify the first certificate
D 2023-03-27T19:33:27.857Z | subchannel | (2) 10.0.138.232:30003 connection closed
D 2023-03-27T19:33:27.857Z | subchannel | (2) 10.0.138.232:30003 CONNECTING -> TRANSIENT_FAILURE
D 2023-03-27T19:33:27.858Z | pick_first | CONNECTING -> TRANSIENT_FAILURE
D 2023-03-27T19:33:27.858Z | resolving_load_balancer | dns:nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003 CONNECTING -> TRANSIENT_FAILURE
D 2023-03-27T19:33:27.858Z | connectivity_state | (1) dns:nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003 CONNECTING -> TRANSIENT_FAILURE
2023-03-27T19:33:29.830Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer0.org.SDL.aws.com, url:grpcs://nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003, connected:false, connectAttempted:true
2023-03-27T19:33:29.831Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer0.org.SDL.aws.com url:grpcs://nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003 timeout:3000
2023-03-27T19:33:29.832Z - info: [NetworkConfig]: buildPeer - Unable to connect to the endorser peer0.org.SDL.aws.com due to Error: Failed to connect before the deadline on Endorser- name: peer0.org.SDL.aws.com, url:grpcs://nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003, connected:false, connectAttempted:true
at checkState (/home/ubuntu/AMBS/cli-typescript/node_modules/@grpc/grpc-js/build/src/client.js:77:26)
at Timeout._onTimeout (/home/ubuntu/AMBS/cli-typescript/node_modules/@grpc/grpc-js/build/src/channel.js:525:17)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
connectFailed: true
}
D 2023-03-27T19:33:31.029Z | subchannel | (2) 10.0.138.232:30003 TRANSIENT_FAILURE -> CONNECTING
D 2023-03-27T19:33:31.030Z | pick_first | TRANSIENT_FAILURE -> CONNECTING
D 2023-03-27T19:33:31.030Z | resolving_load_balancer | dns:nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003 TRANSIENT_FAILURE -> CONNECTING
D 2023-03-27T19:33:31.030Z | connectivity_state | (1) dns:nd-wup4jgvqsvhwharbvdpg6yvr3y.m-bz5qr6rhcveqxfjyjfrtaioe5e.n-j2ib55zmyree5fieloktt3ttim.managedblockchain.ap-northeast-1.amazonaws.com:30003 TRANSIENT_FAILURE -> CONNECTING
```
It seams that `10.0.138.232:30003 connection closed with error unable to verify the first certificate` cause the error.
Maybe I use the wrong certificate files for `peer` and `peer ca`,
Please tell me what's wrong I made and Where are the correct certificate files location?
Thanks.
when I try to log in to FileZilla by using credentials that I created in FTP in an EC2/Lightsail (Ubuntu) instance, it was not connected. otherwise, I use a keypair, it will work.
Please give a reason and give a proper procedure for creating FTP Server by using an EC2/Lightsail.
Thank You in Advance
Hi there,
I have some linux instances running on AWS but sometimes when we try to connect to the instance its say "Network connection failure" and same when I check on AWS EC2 console its says 1/2 status check failed.
and after rebooting the instance sometimes its works perfectly and sometimes it got completely disconnected and after this we have to recover the data from EBS volumes and required to create new instance. But the previous instance was not in work.
Please provide me a solution, why it is happening?
Hi folks,
I'm strugling to get rid of nginx proxy in front of our application (which is a YARP proxy in itself, thus doesn't need another reverse proxy).
I've set the aws:elasticbeanstalk:environment:proxy ProxyServer option to "none" and I can see from the eb-engine log that the nignx indeed gets disabled. In it's place, eb-engine adds two routes to nat iptable for redirecting port 80 to 5000 (default .NET core http port).
I've ssh'd to the instance and confirmed that I can call the app both via localhost(:80) and localhost:5000. Unfortunately, the app doesn't seem to get exposed outside of the instance - ELB healthchecks fail, I can't call it using the instance IP directly (Failed to connect to 10.0.x.y port 80: Connection refused).
It works fine with nginx enabled so I would rule out any vpc networking issues. Any ideas what required linux configuration might be missing that prevents the app from getting exposed on the instance?
Thanks,
Piotr
I have study https://docs.aws.amazon.com/greengrass/v2/developerguide/idt-programmatic-download.html
and the result is that all the link and script only provide idt for x86
I have done connecting my host device to aws with greengrass while following the guide
now im trying to install idt on host but stuck on cannot find a idt download link for aarch64
requesting idt plat: aarch64 linux
Hello, I am a user who is working on the practice of migrating a shopping mall company to aws. Could you recommend a cost-effective EC2 instance type to build a server that 40 million customers can access at the same time?
I am thinking about the infrastructure of a shopping mall web server that uses four available areas in Seoul Region by utilizing Application Load Balancer and Auto Scaling.
Additionally, I am considering whether to use Application load balancer or Network load balancer when configuring the web server, so please recommend which load balancer is good.
Thank you.