alastria / alastria-node

How to install a node in Alastria Red-T (Quorum technology) and tips to deploy and use it
https://alastria.io/
Apache License 2.0
81 stars 299 forks source link

Error al generar transacciones privadas 'privateFor' #60

Closed marcosio closed 6 years ago

marcosio commented 6 years ago

Se realiza un test desde el nodo SantanderGW a IndraGW con el código:

a = eth.accounts[0]
web3.eth.defaultAccount = a;

// abi and bytecode generated from simplestorage.sol:
// > solcjs --bin --abi simplestorage.sol
var abi = [{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initVal","type":"uint256"}],"payable":false,"type":"constructor"}];

var bytecode = "0x6060604052341561000f57600080fd5b604051602080610149833981016040528080519060200190919050505b806000819055505b505b610104806100456000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632a1afcd914605157806360fe47b11460775780636d4ce63c146097575b600080fd5b3415605b57600080fd5b606160bd565b6040518082815260200191505060405180910390f35b3415608157600080fd5b6095600480803590602001909190505060c3565b005b341560a157600080fd5b60a760ce565b6040518082815260200191505060405180910390f35b60005481565b806000819055505b50565b6000805490505b905600a165627a7a72305820d5851baab720bba574474de3d09dbeaabc674a15f4dd93b974908476542c23f00029";

var simpleContract = web3.eth.contract(abi);
var simple = simpleContract.new(42, {from:a, data: bytecode, gas: 0x47b760, privateFor: ["K7H2ULb9cq648JoGXH12UQ/Dj7Poe2GiDYHE+Glrz04="]}, function(e, contract) {
    if (e) {
        console.log("err creating contract", e);
    } else {
        if (!contract.address) {
            console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");
        } else {
            console.log("Contract mined! Address: " + contract.address);
            console.log(contract);
        }
    }
});

Cuando se ejecuta desde la consola se genera la excepción 'EOF' y en la traza del nodo:

INFO [12-27|10:49:00|internal/ethapi/api.go:1154]      sending private tx                       data=6060604052341561000f57600080fd5b6040516020806101
49833981016040528080519060200190919050505b806000819055505b505b610104806100456000396000f30060606040526000357c01000000000000000000000000000000000000000
00000000000000000900463ffffffff1680632a1afcd914605157806360fe47b11460775780636d4ce63c146097575b600080fd5b3415605b57600080fd5b606160bd565b604051808281
5260200191505060405180910390f35b3415608157600080fd5b6095600480803590602001909190505060c3565b005b341560a157600080fd5b60a760ce565b604051808281526020019
1505060405180910390f35b60005481565b806000819055505b50565b6000805490505b905600a165627a7a72305820d5851baab720bba574474de3d09dbeaabc674a15f4dd93b9749084
76542c23f00029000000000000000000000000000000000000000000000000000000000000002a privatefrom= privatefor="[K7H2ULb9cq648JoGXH12UQ/Dj7Poe2GiDYHE+Glrz04=
]"
ERROR[12-27|10:49:00|rpc/server.go:136]                goroutine 3134 [running]:
github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest.func1(0xc446749440, 0x1933620, 0xc44ee687d0)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:135 +0x12d
panic(0xef9460, 0xc420012090)
    /usr/local/go/src/runtime/panic.go:458 +0x243
github.com/ethereum/go-ethereum/internal/ethapi.(*PublicTransactionPoolAPI).SendTransaction(0xc44679d200, 0x192e960, 0xc448aa1e40, 0x1694b5d0bb570d05
, 0x8091000d827d9849, 0xfe9077bc, 0x0, 0xc4408e5a60, 0x0, 0x0, ...)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:1155 +0x8ef
reflect.Value.call(0xc440ddde00, 0xc44f0161c8, 0x13, 0x103617e, 0x4, 0xc44390c060, 0x3, 0x4, 0x1, 0xf5dd40, ...)
    /usr/local/go/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xc440ddde00, 0xc44f0161c8, 0x13, 0xc44390c060, 0x3, 0x4, 0x1, 0x1, 0x11e1a05)
    /usr/local/go/src/reflect/value.go:302 +0xa4
github.com/ethereum/go-ethereum/rpc.(*Server).handle(0xc446749440, 0x192e960, 0xc448aa1e40, 0x1933620, 0xc44ee687d0, 0xc44390c000, 0xc44ee68840, 0x0,
 0xebb6c0)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:311 +0x8ea
github.com/ethereum/go-ethereum/rpc.(*Server).exec(0xc446749440, 0x192e960, 0xc448aa1e40, 0x1933620, 0xc44ee687d0, 0xc44390c000)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:333 +0x1d9
github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest(0xc446749440, 0x1933620, 0xc44ee687d0, 0xc4632efc01, 0x1, 0x0, 0x0)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:194 +0x414
github.com/ethereum/go-ethereum/rpc.(*Server).ServeSingleRequest(0xc446749440, 0x1933620, 0xc44ee687d0, 0x1)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:225 +0x4e
github.com/ethereum/go-ethereum/rpc.(*Server).ServeHTTP(0xc446749440, 0x192d3a0, 0xc4501cf930, 0xc4494682d0)
    /home/ubuntu/alastria-node/scripts/quorum/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/http.go:161 +0x4f4
net/http.serverHandler.ServeHTTP(0xc440bf2080, 0x192d3a0, 0xc4501cf930, 0xc4494682d0)
    /usr/local/go/src/net/http/server.go:2202 +0x7d
net/http.(*conn).serve(0xc431424980, 0x192e960, 0xc449053900)
    /usr/local/go/src/net/http/server.go:1579 +0x4b7
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2293 +0x44d
marcosio commented 6 years ago

CORREGIDO!

El proceso geth (quorum) no detectaba correctamente el proceso constellation.

Se ha cambiado start.sh para que se solucione.