Folgendes habe ich ausgeführt:
➜ voting_truffle truffle migrate
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/Voting.sol...
Compilation warnings encountered:
/Users/glaksmono/Documents/Blockchain Projects/voting_truffle/contracts/Migrations.sol:11:3: Warning: No visibility specified. Defaulting to "public".
function Migrations() {
^
Spanning multiple lines.
,/Users/glaksmono/Documents/Blockchain Projects/voting_truffle/contracts/Migrations.sol:15:3: Warning: No visibility specified. Defaulting to "public".
function setCompleted(uint completed) restricted {
^
Spanning multiple lines.
,/Users/glaksmono/Documents/Blockchain Projects/voting_truffle/contracts/Migrations.sol:19:3: Warning: No visibility specified. Defaulting to "public".
function upgrade(address new_address) restricted {
^
Spanning multiple lines.
Writing artifacts to ./build/contracts
Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock
at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:43303:16)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:331156:36
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:175492:11
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:314196:9
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:315621:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70159:18)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70449:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70604:12)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70564:24)
at emitNone (events.js:111:20)
➜ voting_truffle
Ich habe 2 Migrationsdateien: 1. migrations/1_initial_migration.js
2.migrations/2_deploy_contracts.js
Der Inhalt von migrations/2_deploy_contracts.js
ist folgender:
var Voting = artifacts.require("./Voting.sol");
module.exports = function(deployer) {
deployer.deploy(Voting, ['Rama', 'Nick', 'Jose'], {gas: 6700000});
};
/* As you can see above, the deployer expects the first argument to be the name of the contract followed by constructor arguments. In our case, there is only one argument which is an array of
candidates. The third argument is a hash where we specify the gas required to deploy our code. The gas amount varies depending on the size of your contract.
*/
Hier ist der Status meiner Blockchain-Synchronisation von geth attach
:
> eth.syncing
{
currentBlock: 2179367,
highestBlock: 2179534,
knownStates: 5799770,
pulledStates: 5764000,
startingBlock: 0
}
>
Ich versuche seit Tagen, das herauszufinden, und ich stecke fest. Irgendwelche Ideen?
Ich versuche, diesem Tutorial zu folgen, und stecke im Migrationsabschnitt fest.
Diese Zeile ist dein Problem -Error: authentication needed: password or unlock
Sie müssen die Geth-Konsole öffnen und eingeben, personal.unlockAccount("address", "password", 0)
um die Verträge auf ropsten bereitzustellen.
Er sagt es im Tutorial in Abschnitt 4 hier:
mahesh@projectblockchain:~/voting$ truffle console
truffle(default)> web3.personal.newAccount('verystrongpassword')
'0x95a94979d86d9c32d1d2ab5ace2dcc8d1b446fa1'
truffle(default)> web3.eth.getBalance('0x95a94979d86d9c32d1d2ab5ace2dcc8d1b446fa1')
{ [String: '0'] s: 1, e: 0, c: [ 0 ] }
truffle(default)> web3.personal.unlockAccount('0x95a94979d86d9c32d1d2ab5ace2dcc8d1b446fa1', 'verystrongpassword', 15000)
// Replace 'verystrongpassword' with a good strong password.
// The account is locked by default, make sure to unlock it before using the account for deploying and interacting with the blockchain.
Er hat 1500, ich habe 0 als dritte Variable eingegeben. Das gibt an, wie lange das Konto entsperrt werden soll. Wenn Sie 0 eingeben, wird es für die gesamte Sitzung entsperrt.
0xgoku
truffle console
? Scheint bei mir nicht zu funktionieren: gist.github.com/glaksmono/a260ca02cd741ad5d1e9f107c663e4ccMichael O'Rourke
INFO [08-06|08:06:14] IPC endpoint opened: <path>
. Sobald Sie diesen Pfad erhalten haben, geben Siegeth attach ipc:<path>
. Das sollte die Konsole öffnen. Geben Sie in dieser Konsolepersonal.unlockAccount('0x60a9e63750adfafc77bd0ba692a20e4dbe330c24', 'pass', 0
.0xgoku
truffle migration
? Ich glaube nicht, dass Sie das in diegeth console
.Michael O'Rourke
truffle migrate --network ropsten
im Projektordner wie gewohnt. Sie sollten 3 Registerkarten geöffnet haben. Eines, auf dem Geth ausgeführt wird, eine, auf der die Geth-Konsole ausgeführt wird, und eine zum Migrieren der Verträge0xgoku
truffle.js
: gist.github.com/glaksmono/f97543cf6da57fa4234f3445df977836 und ich erhalte jetzt diesen Fehler: gist.github.com/glaksmono/e7dbbff3a31faae27f0eaefe587ac0e4Michael O'Rourke
0xgoku
0xgoku
truffle.js
: gist.github.com/glaksmono/40434ca612d9c9237676e82c561d0971 Ideen? Ich kann auch sehen, dass sich etwas in meinem Konto geändert hat: ropsten.etherscan.io/address/…Michael O'Rourke
0xgoku
Michael O'Rourke
0xgoku
Michael O'Rourke
$ truffle console truffle(development)> web3.eth.getBlock("pending").gasLimit
Ändern Sie die Gasmenge in Ihrer truffle.js-Datei auf das, was Sie erhalten.0xgoku
Michael O'Rourke
0xgoku
Michael O'Rourke
testrpc
oder ein,ganache-cli
je nachdem, welches Sie installiert haben. Wenn Sie beides nicht haben, laden Sie es herunterganache-cli
0xgoku
testrpc
- nicht wirklich sicher, ob es nicht funktioniertropsten
Michael O'Rourke
0xgoku