I am following a tutorial on how to create a colabrative document. The github is below. It uses ipfs for the P2P aspect.
https://github.com/ipfs-shipyard/shared-editing-demo
I am getting the following error:
Uncaught Error: no protocol with name: libp2p-webrtc-star
I have searched and found possible solutions e.g. changing the config found in the link below but it has not worked:
https://github.com/ipfs/js-ipfs/issues/1029
config: { // overload the default config
Addresses: {
Swarm: [
"/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star"
],
API: '',
Gateway: ''
},
}
})
The above does not work as I still get the same error. There was a mention (on the github) of swarm having both the old and the new config together and that is why the error is being thrown. However, I am unsure how to resolve this.
i had that with 0.41.0 version. also try to use /dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star
switch back to 0.40.0 worked for me
Related
I tried to fork a simple pino transport "pino-loki" on github and wan't to add it as my dependency.
package.json seems to be fine and the library is pulled from github.
"pino-loki": "mygithub/pino-loki"
But for some reason pino can't initialise this transporter.
{
target: 'pino-loki',
level:"info",
options: {
host: 'http://localhost:3100',
batching: true,
interval: 5,
}
},
Error: unable to determine transport target for "pino-loki"
I can see it in my node_modules, are there any additional steps I'm missing?
I'm running a next.js react app in a docker container. It's being composed with several other contains: one running Ghost (I'm using the API), one running mysql, and one running NGINX. I've got everything running in development mode.
It works perfectly when run using next dev. But when I run it by doing next build and next start, I start seeing errors like Error: getaddrinfo ENOTFOUND ghost-api when I try to make server-side HTTP requests to my Ghost API container. I'm not entirely sure what the issue is but it seems like there's some issue with how Node is making requests after being built. I've been digging through a lot of Docker/Node questions trying to figure this one out but haven't had any luck.
The entire project can be found here: https://github.com/MichaelWashburnJr/react-cms
The problem may exist in the environment variable that you are using. In both getGhostApi and getGhostApiKey function, you are using the environment variable.
In NextJs you'll have to specify a next.config.js in which you define the variables that you need for
Ex. next.config.js
module.exports = {
serverRuntimeConfig: {
// Will only be available on the server side
mySecret: 'secret',
secondSecret: process.env.SECOND_SECRET, // Pass through env variables
},
publicRuntimeConfig: {
// Will be available on both server and client
staticFolder: '/static',
},
}
You can also refer to the next documentation for the same.
https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration
I'm not able to reproduce the error. How are you starting the frontend container in prod mode?
From the error it appears like you might be trying to start the frontend container or the frontend app as a separate process without starting it as part of the compose project. If that is the case, the name ghost-api won't be resolvable and you would get the Error: getaddrinfo ENOTFOUND ghost-api error.
I've changed the command key of frontend container as follows:
command: [ "yarn", "start-prod" ]
Changed the "start-prod" script in frontend/package.json as follows:
"start-prod": "next build && NODE_ENV='production' next start"
and everything worked as it worked in dev mode. I got some UNKNOWN_CONTENT_API_KEY error in both dev and prod mode but definitely there is no ghost-api name resolution error.
After cloning your repos:
$ grep -R ST_API *
frontend/.env.development:GHOST_API_URL=http://ghost-api:2368
frontend/.env.production:GHOST_API_URL=http://ghost-api:2368
frontend/src/constants/Config.js:export const getGhostApi = () => process.env.GHOST_API_URL || 'http://localhost:8000';
ghost-api is not a domain name: to make it work you need to edit your hosts file or (for a real production environment) to change http://ghost-api:2368 in frontend/.env.production file with the real deploy domain name.
If you are asking why you can't trust on docker compose networking, the answer is: you can, but only in the containers; while the front end will run in the browser of your application client, which is outside the containers.
Hope this helps.
It seems that Docker's hostname resolution does not work during build time. That is why ghost-api is not found.
Instead of referencing the other container by its name (ghost-api), on Mac you can try host.docker.internal. On Linux, using host networking during build worked for me:
nextjs-app:
build:
network: "host"
# ...
network_mode: "host"
This way, you can reference the other container using localhost.
I have been experimenting with truffle recently and followed the following tutorial: http://truffleframework.com/tutorials/pet-shop
Whenever I try to setup a transaction I keep getting the same error below
Error: Error: the tx doesn't have the correct nonce. account has nonce of: 14 tx has nonce of: 0
Checked online and read up on a lot of articles related to this but so far haven't found what might be causing this issue.
Truffle v3.4.7
Solidity v0.4.13
Npm v5.3.0
TestRPC v4.0.1 (also happen with Ganache)
Metamask v3.9.5
From what I understand it seems it is unable to find the previous transactions to hash the new transaction?
Using MetaMask v3.14.1 you can reset your account as follow:
Resetting an Account In the Settings menu, MetaMask has a "Reset
Account" button. This button wipes the current account's transaction
history, which is used to calculate the current account nonce.
Normal users should never have a reason to use this feature.
This is useful for developers who reset a test network but want to
continue using the same account, forcing MetaMask to believe this
network ID is a clean network in a fresh state.
Ref: http://metamask.helpscoutdocs.com/article/36-resetting-an-account
(Thanks to Tim Wu)
Old response:
Answer of yatskevich is correct.
However, for people how are using Truffle 4+ with "truffle develop", you need to remove and reinstall MetaMask to get it work again, every time you run Truffle Develop!
This issue is addressed here:
https://github.com/trufflesuite/truffle/issues/681, here:
https://github.com/trufflesuite/ganache/issues/112, and also here: https://github.com/MetaMask/metamask-extension/issues/1999
In short they are working on it and in the mean time you need to reinstall MetaMask every time!
Try to reconnect to your TestRPC network in MetaMask:
Select Main Ethereum Network (or any other than Localhost 8545)
Select Localhost 8545 again
I've stumbled upon this issue after stopping and starting a new TestRPC node.
Check your truffle.js or truffle-config.js
if you are using the HDWalletProvider like below, it seems that this is what causing the error
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = "your mnemonic";
module.exports = {
networks: {
development: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://127.0.0.1:8545/", 0, 50);
},
network_id: '*',
gas: 9999999
}
},
compilers: {
solc: {
version: "^0.4.25"
}
}
};
remove the HDWalletProvider like below, it solves mine
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost
port: 8545, // Standard Ganache UI port
network_id: "*",
gas: 4600000
}
},
compilers: {
solc: {
version: "0.5.2"
}
}
};
I am using gulp for my node.js project. I have an AWS ubuntu server where I want to copy some files using gulp.
I am using the following code in gulp
const sftp = require('gulp-sftp');
gulp.task('deploy', () => {
return gulp.src('deploy/bundle.zip')
.pipe(sftp({
host: 'ec2-x-x-x-x.us-x.compute.amazonaws.com',
key: {
location: '~/mykey.pem'
}
}));
});
However, I am getting the following error when I run gulp-deploy
[18:07:29] Using gulpfile ~/src/gulpfile.js
[18:07:29] Starting 'deploy'...
[18:07:29] Authenticating with private key.
[18:07:33] 'deploy' errored after 3.45 s
[18:07:33] Error in plugin 'gulp-sftp'
Message:
Authentication failure. Available authentication methods: publickey
Details:
level: authentication
partial: false
[18:07:33] gulp-sftp SFTP abrupt closure
[18:07:33] Connection :: close
I don't understand how to proceed further to troubleshoot. Please guide.
Looks like you're missing user as part of your options. It should either be root or ubuntu if you're linux or ubuntu, respectively.
Also for gulp-sftp, "Authentication failure. Available authentication methods: publickey" is a catch-all error even if your key location is invalid (in my case, it was). So make sure your path is correct as well.
My code:
.pipe(sftp({
host: 'serverurl.com',
user: 'ubuntu',
key: 'D:/path/to/key.pem'
}))
Edit: This has since been solved as an interesting network issue, see my comments and answer below.
Original Post:
My goal: Setup proof-of-concept tests on BrowserStack with Intern.
I went through the intern-tutorial, which all worked beutifully for me on Sauce Labs, and now I just want to learn what it takes to modify that configuration to test on BrowserStack, which keeps failing for me.
The terminal command, as per the tutorial:
./node_modules/.bin/intern-runner config=tests/intern
When running that, I get:
Listening on 0.0.0.0:9000
Starting tunnel...
BrowserStackLocal v2.2
Connecting to BrowserStack using WebSocket protocol...
Connected.
Ready
Error: connect ETIMEDOUT
at errnoException <net.js:904:11>
at Object.afterConnect [as oncomplete] <net.js:895:19>
TOTAL: tested 0 platforms, 0/0 tests failed; fatal error occurred
Environment:
OS: Mac OS X 10.9.4
Node: 0.10.29
NPM: 1.4.21
Intern: 2.0.1
Variables set in ~/.bash_profile as:
export BROWSERSTACK_USERNAME="<my_actual_username>"
export BROWSERSTACK_ACCESS_KEY="<my_actual_access_key>"
Intern configuration set in tests/intern as:
define({
proxyPort: 9000,
proxyUrl: 'http://localhost:9000/',
capabilities: {
'selenium-version': '2.41.0'
},
environments: [
{ os: "Windows", os_version: "8.1", browser: "chrome", browser_version: "34.0" }
],
maxConcurrency: 3,
tunnel: 'BrowserStackTunnel',
tunnelOptions: {
verbose: true
},
loader: {
packages: [ { name: 'app', location: 'app' } ]
},
suites: [ 'tests/hello' ],
functionalSuites: [ 'tests/functional/index' ],
excludeInstrumentation: /^(?:tests|node_modules)\//
});
As in, this is all that has been changed since the completed tutorial:
Removed all but one environment object (for simplicity), modified it to a format supported by BrowserStack.
Set the 'tunnel' property to the appropriate tunnel class.
Set tunnelOptions: { verbose: true } for debugging.
Things I've tried:
Setting BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY inline on the command line when executing the runner, just in case.
Used the configuration here (which I recognize is out of date): https://stackoverflow.com/questions/23304388/intern-js-and-browserstack
Stupidity checks, computer reboots, etc.
My environment object should be valid, as its based on one coming back from:
https://www.browserstack.com/automate/browsers.json
I feel like there's some basic thing here I'm missing about the configuration.
Can you have a look into the intern config file, which I use to run tests on browserstack. Hope it will help you solve your problem.
I have confirmed via A/B testing on different networks and with the same configuration, that this is due to the fact that Verizon Wireless blocks WebSocket connections, which has been reported elsewhere (see my comments on the original question).
This can be very tricky to diagnose. I hope it helps someone in the future!