Ich versuche, Metacoin zu trüffeln, um zu debuggen, warum die Tuffle-Migration nicht zu testRPC/ganache-cli funktioniert. Es hängt sich bei der Bereitstellung für testRPC/Ganache auf, aber wenn ich es von Truffle Development aus mache und Ganache nicht angebe, wird der interne TestRPC von Truffle gut migriert.
Aktuelle Versionen
Truffle v4.0.4 - ein Entwicklungsframework für Ethereum
Ganache CLI v6.0.3 (Ganache-Core: 2.0.2)
Ich fahre folgende Sequenz:
mkdir metacoin
cd metacoin
truffle unbox metacoin
Neue Registerkarte öffnen
ganache-cli -u 0
Gehen Sie zurück zum Metacoin-Tab
truffle compile
truffle migrate --reset --network development --verbose-rpc
Die Ausgabe ohne --verbose-rpc sieht so aus:
Verwenden von Netzwerk-'Entwicklung'.
Migration wird ausgeführt: 1_initial_migration.js Bereitstellung von Migrationen...
Mit --verbose-rpc
> {
> "jsonrpc": "2.0",
> "id": 1,
> "method": "net_version",
> "params": []
> }
< {
< "jsonrpc": "2.0",
< "result": "1",
< "id": 1
< }
Using network 'development'.
Running migration: 1_initial_migration.js
> {
> "jsonrpc": "2.0",
> "id": 2,
> "method": "eth_accounts",
> "params": []
> }
< {
< "jsonrpc": "2.0",
< "result": [
< "0x006faef83e11473a09e59d2d2150209f11e216f9"
< ],
< "id": 2
< }
> {
> "jsonrpc": "2.0",
> "id": 3,
> "method": "net_version",
> "params": []
> }
< {
< "jsonrpc": "2.0",
< "result": "1",
< "id": 3
< }
Deploying Migrations...
> {
> "jsonrpc": "2.0",
> "id": 4,
> "method": "net_version",
> "params": []
> }
< {
< "jsonrpc": "2.0",
< "result": "1",
< "id": 4
< }
> {
> "jsonrpc": "2.0",
> "id": 5,
> "method": "eth_sendTransaction",
> "params": [
> {
> "from": "0xdcb731f4cc8349df9ef206f3c0e46ae532239917",
> "gas": "0x6691b7",
> "gasPrice": "0x174876e800",
> "data": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a723058206d0ad850ad766994ac09fceb3b7aa1ad7e80fd8536774114e97875055355ed660029"
> }
> ]
> }
Antwort von ganache-cli (mit -v)
eth_getBalance
> {
> "id": 6578289014410835,
> "jsonrpc": "2.0",
> "params": [
> "0x58ba5d062e2c2b14dc8b8458872afef70a9b25eb",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410836,
> "jsonrpc": "2.0",
> "params": [
> "0x58ba5d062e2c2b14dc8b8458872afef70a9b25eb",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
< {
< "id": 6578289014410835,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410836,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getBalance
> {
> "id": 6578289014410844,
> "jsonrpc": "2.0",
> "params": [
> "0x15528fc3cff56b4667f988c699ec5983030ce841",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getBalance
> {
> "id": 6578289014410838,
> "jsonrpc": "2.0",
> "params": [
> "0xf45ae1668bf2a6f7175a0795384b2059789e84a5",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410839,
> "jsonrpc": "2.0",
> "params": [
> "0xf45ae1668bf2a6f7175a0795384b2059789e84a5",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
eth_getBalance
> {
> "id": 6578289014410841,
> "jsonrpc": "2.0",
> "params": [
> "0xe4753e4dff52c272ac3f8037bc1f218e768ac66d",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
< {
< "id": 6578289014410844,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410838,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410841,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410839,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getTransactionCount
> {
> "id": 6578289014410848,
> "jsonrpc": "2.0",
> "params": [
> "0x11f2915576dc51dffb246959258e8fe5a1913161",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
eth_getBalance
> {
> "id": 6578289014410850,
> "jsonrpc": "2.0",
> "params": [
> "0xc69e35474199292ab39d047490963bd5b01fb73e",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410845,
> "jsonrpc": "2.0",
> "params": [
> "0x15528fc3cff56b4667f988c699ec5983030ce841",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
< {
< "id": 6578289014410848,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410850,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410845,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getBalance
> {
> "id": 6578289014410853,
> "jsonrpc": "2.0",
> "params": [
> "0x0327ff417aa111b61bed5f39e77946b38d6592b3",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410854,
> "jsonrpc": "2.0",
> "params": [
> "0x0327ff417aa111b61bed5f39e77946b38d6592b3",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
< {
< "id": 6578289014410853,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410854,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getBalance
> {
> "id": 6578289014410858,
> "jsonrpc": "2.0",
> "params": [
> "0x58ba5d062e2c2b14dc8b8458872afef70a9b25eb",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410859,
> "jsonrpc": "2.0",
> "params": [
> "0x58ba5d062e2c2b14dc8b8458872afef70a9b25eb",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
< {
< "id": 6578289014410858,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410859,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getBalance
> {
> "id": 6578289014410861,
> "jsonrpc": "2.0",
> "params": [
> "0xf45ae1668bf2a6f7175a0795384b2059789e84a5",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410865,
> "jsonrpc": "2.0",
> "params": [
> "0xe4753e4dff52c272ac3f8037bc1f218e768ac66d",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
eth_getBalance
> {
> "id": 6578289014410864,
> "jsonrpc": "2.0",
> "params": [
> "0xe4753e4dff52c272ac3f8037bc1f218e768ac66d",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
< {
< "id": 6578289014410861,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410865,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410864,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getTransactionCount
> {
> "id": 6578289014410871,
> "jsonrpc": "2.0",
> "params": [
> "0x11f2915576dc51dffb246959258e8fe5a1913161",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
eth_getBalance
> {
> "id": 6578289014410867,
> "jsonrpc": "2.0",
> "params": [
> "0x15528fc3cff56b4667f988c699ec5983030ce841",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410868,
> "jsonrpc": "2.0",
> "params": [
> "0x15528fc3cff56b4667f988c699ec5983030ce841",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
< {
< "id": 6578289014410871,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410867,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410868,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
eth_getTransactionCount
> {
> "id": 6578289014410874,
> "jsonrpc": "2.0",
> "params": [
> "0xc69e35474199292ab39d047490963bd5b01fb73e",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
eth_getBalance
> {
> "id": 6578289014410876,
> "jsonrpc": "2.0",
> "params": [
> "0x0327ff417aa111b61bed5f39e77946b38d6592b3",
> "latest"
> ],
> "method": "eth_getBalance",
> "external": true
> }
eth_getTransactionCount
> {
> "id": 6578289014410877,
> "jsonrpc": "2.0",
> "params": [
> "0x0327ff417aa111b61bed5f39e77946b38d6592b3",
> "latest"
> ],
> "method": "eth_getTransactionCount",
> "external": true
> }
< {
< "id": 6578289014410874,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410876,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
< {
< "id": 6578289014410877,
< "jsonrpc": "2.0",
< "result": "0x0"
< }
Ich habe versucht, sowohl Truffle als auch testRPC/ganache-cli neu zu installieren. Ich habe auch festgestellt, dass die Truffle-Migrationsprotokolle zeigen, dass es ein eth_account erhält, das ich zuvor noch nicht gesehen habe und das nicht von Ganache-cli/testRPC getrennt ist.
Ich habe keine zusätzlichen Nodes am Laufen (Geth, Parity, Private Chain usw.). Nur zwei Wochen lang habe ich große Verträge zu Private Chains migriert und hatte kein Problem, also war dies nicht immer hier.
Irgendwelche Gedanken?
Am besten, Sam
Ich habe tatsächlich herausgefunden, dass der Grund, warum es nicht migriert wurde, darin bestand, dass Parity ein paar super gut versteckte Prozesse hat, die nicht auftauchten, als ich es tat ps -a
; Nachdem ich diesen Paritätsprozess gefunden und beendet hatte, funktionierte es wie ein Zauber.
Ich hatte das gleiche Problem. Ich habe es gelöst, indem ich das Gaslimit in der truffle-config.js auf das zulässige Limit in ganache reduziert habe
Für mich war es das HDWalletProvider
Set mit der falschen Mnemonik
provider: () => new HDWalletProvider(mnemonic, "http://localhost:7545"),
Das Aktualisieren auf die richtige Mnemonik mit Guthaben in der Brieftasche, wie z. B. die mit geladenen Adressen generierte Ganache, oder das Entfernen der HDWalletProvider-Zeile, um einfach auf das Standardkonto zurückzugreifen, hat funktioniert.
Ismael
ganache-cli
ohne Parameter zu starten?