tron-us / ecommerce-hello-world Goto Github PK
View Code? Open in Web Editor NEWTRON dApp hello world tutorial
TRON dApp hello world tutorial
I was following the instructions on readme. Everything went well until i run
tronbox migrate --reset --network shasta
it prints:
UnhandledPromiseRejectionWarning: Error: Invalid URL provided to HttpProvider at new e (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\tronwrap\tronweb\dist\TronWeb.node.js:1:16497) at Object.create (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-provider\index.js:70:1) at Config.get [as provider] (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-config\index.js:278:1) at provision (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-provisioner\index.js:4:1) at Resolver.require (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-resolver\index.js:34:1) at Object.lastCompletedMigration (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-migrate\index.js:266:1) at Object.needsMigrating (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-migrate\index.js:295:1) at runMigrations (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-core\lib\commands\migrate.js:94:1) at C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-core\lib\commands\migrate.js:125:1 at C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\truffle-core\lib\environment.js:65:1 at cb (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\tronwrap\index.js:146:1) at axios.get.then.catch.err (C:\Users\User\AppData\Roaming\npm\node_modules\tronbox\build\webpack:\packages\tronwrap\index.js:174:1) at process._tickCallback (internal/process/next_tick.js:68:7) (node:13704) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:13704) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hello!
How i can update contract after production deploy for, for example, add new item or change price?
Thanks!
I am learning how to deploy me first smart contarct, this this error is preventing to continue
tronbox version
Tronbox v2.7.14
Solidity v0.5.14 (tron-solc)
tronbox migrate --reset --nexwork shasta
Using network 'development'.
(node:341) UnhandledPromiseRejectionWarning: Error: Invalid URL provided to HttpProvider
at new e (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/node_modules/tronweb/dist/webpack:/src/lib/providers/HttpProvider.js:7:19)
at Object.create (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/build/components/Provider/index.js:1:1403)
at Config.get [as provider] (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/build/components/Config.js:1:6101)
at /home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/node_modules/@truffle/expect/index.js:4:18
at Array.forEach ()
at Object.options (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/node_modules/@truffle/expect/index.js:3:19)
at Object.run (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/build/components/Migrate/index.js:1:3283)
at /home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/build/lib/commands/migrate.js:1:1229
at Object.needsMigrating (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/build/components/Migrate/index.js:1:6092)
at runMigrations (/home/ganiular/.nvm/versions/node/v14.14.0/lib/node_modules/tronbox/build/lib/commands/migrate.js:1:1096)
(Use node --trace-warnings ...
to show where the warning was created)
(node:341) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
(node:341) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
it can be updated to the latest version of tronbox so it can be compiled with solidity 0.5.4
>tronbox.cmd migrate
Using network 'development'.
Error: Invalid URL provided to HttpProvider
at new e (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\node_modules\tronweb\dist\webpack:\src\lib\providers\HttpProvider.js:7:19)
at Object.create (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Provider\index.js:1:1403)
at Config.get [as provider] (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Config.js:1:6101)
at provision (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Provisioner.js:1:79)
at Resolver.require (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\index.js:1:817)
at Object.lastCompletedMigration (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Migrate\index.js:1:5491)
at Object.needsMigrating (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Migrate\index.js:1:6117)
at runMigrations (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\lib\commands\migrate.js:1:1096)
at C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\lib\commands\migrate.js:1:1608
at C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\lib\environment.js:1:1546
Error: Invalid URL provided to HttpProvider
at new e (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\node_modules\tronweb\dist\webpack:\src\lib\providers\HttpProvider.js:7:19)
at Object.create (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Provider\index.js:1:1403)
at Config.get [as provider] (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Config.js:1:6101)
at provision (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Provisioner.js:1:79)
at Resolver.require (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\index.js:1:817)
at Object.lastCompletedMigration (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Migrate\index.js:1:5491)
at Object.needsMigrating (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\components\Migrate\index.js:1:6117)
at runMigrations (C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\lib\commands\migrate.js:1:1096)
at C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\lib\commands\migrate.js:1:1608
at C:\Users\m\AppData\Roaming\npm\node_modules\tronbox\build\lib\environment.js:1:1546
λ tronbox.cmd migrate --reset
Using network 'development'.
(node:7588) UnhandledPromiseRejectionWarning: Error: Invalid URL provided to HttpProvider
at new e (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\node_modules\tronweb\dist\webpack:\src\lib\providers\HttpProvider.js:7:19)
at Object.create (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\build\components\Provider\index.js:1:1403)
at Config.get [as provider] (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\build\components\Config.js:1:6101)
at expected_keys.forEach.key (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\node_modules@truffle\expect\index.js:4:18)
at Array.forEach ()
at Object.options (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\node_modules@truffle\expect\index.js:3:19)
at Object.run (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\build\components\Migrate\index.js:1:3283)
at C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\build\lib\commands\migrate.js:1:1229
at Object.needsMigrating (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\build\components\Migrate\index.js:1:6092)
at runMigrations (C:\Users\suraj\AppData\Roaming\npm\node_modules\tronbox\build\lib\commands\migrate.js:1:1096)
(node:7588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, o
r by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:7588) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js
process with a non-zero exit code.
For your reference code from tronbox.js
module.exports = {
networks: {
development: {
// For trontools/quickstart docker image
privateKey: 'Your_private_key',
consume_user_resource_percent: 30,
fee_limit: 100000000,
fullNode: "http://127.0.0.1:8090",
solidityNode: "http://127.0.0.1:8091",
eventServer: "http://127.0.0.1:8092",
network_id: ""
},
shasta: {
privateKey: 'Your_private_key',
consume_user_resource_percent: 30,
fee_limit: 100000000,
fullNode: "https://api.shasta.trongrid.io",
solidityNode: "https://api.shasta.trongrid.io",
eventServer: "https://api.shasta.trongrid.io",
network_id: ""
},
mainnet: {
// Don't put your private key here, pass it using an env variable, like:
// PK=da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0 tronbox migrate --network mainnet
privateKey: process.env.PK,
consume_user_resource_percent: 30,
fee_limit: 100000000,
fullNode: "https://api.trongrid.io",
solidityNode: "https://api.trongrid.io",
eventServer: "https://api.trongrid.io",
network_id: "*"
}
}
};
hi
according to part 1 of your walkthrough
I maked a .env file in root of project with this content:
PK="my private key extracted from TronLink";
but in part 3 when I enter tronbox migrate --reset --network shasta
in terminal get me this error:
ERROR: Invalid private key provided
now how can I solve this problem ?
I was following the instructions on readme. Everything went well until i run
tronbox migrate --reset --network shasta
It prints
Using network 'shasta'.
Running migration: 1_initial_migration.js
Replacing Migrations...
Migrations:
(base58) TLszpcG8kXjW6yUtKWJLUn7djttCXqvyq4
(hex) 4177ad22e56dece4268f647ba015f5c0d385f1e67c
Saving successful migration to network...
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying ECommerce...
ERROR: Contract ECommerce has not been deployed on the network.
For more details, check the transaction at:
https://api.shasta.trongrid.io/wallet/gettransactionbyid?value=635c20efee548376b67901165e4b08afc24802581c65f93f0a9d1a6c2bc858db
If the transaction above is empty, most likely, your address had no bandwidth/energy to deploy the contract.
I made a change to tronbox.js file. I commented fullNode, solidityNode, eventServer, and I uncommented fullHost variable.
I also checked the printed link. The link said my testnet account does not have enough energy.
For this issue, I found there should be no energy issue about shasta testnet. Can anybody help me with this error? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.