-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.txt
42 lines (33 loc) · 11.9 KB
/
input.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
geth --identity "PICCetherum" --rpc --rpccorsdomain "*" --datadir data0 --port "30303" --rpcapi "db,eth,net,web3" console 2>>geth.log
personal.unlockAccount(eth.accounts[0],'123456')
eth.defaultAccount=eth.coinbase;
miner.start();admin.sleepBlocks(1);miner.stop();
var img = [0x11,0x22];
var managerContract = web3.eth.contract([{"constant":false,"inputs":[],"name":"attach","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getImage","outputs":[{"name":"res","type":"bytes1[500]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"head","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"img","type":"bytes1[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]);
var manager = managerContract.new(
img,
{
from: web3.eth.accounts[0],
data: '0x6060604052341561000f57600080fd5b604051610bc9380380610bc983398101604052808051820191905050806100346100e2565b8080602001828103825283818151815260200191508051906020019060200280838360005b83811015610074578082015181840152602081019050610059565b5050505090500192505050604051809103906000f080151561009557600080fd5b600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008081905550506100f2565b60405161068a8061053f83390190565b61043e806101016000396000f300606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631100482d1461005c5780632607aafa146100715780638f7dcfa3146100d1575b600080fd5b341561006757600080fd5b61006f610126565b005b341561007c57600080fd5b610092600480803590602001909190505061024b565b60405180826101f460200280838360005b838110156100be5780820151818401526020810190506100a3565b5050505090500191505060405180910390f35b34156100dc57600080fd5b6100e46103a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60003390508073ffffffffffffffffffffffffffffffffffffffff1663b2b2b44d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15156101e757600080fd5b5af115156101f457600080fd5b50505080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600080828254019250508190555050565b6102536103c6565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915083600054039350600090505b83811015610318578173ffffffffffffffffffffffffffffffffffffffff1663f3638f786040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156102f257600080fd5b5af115156102ff57600080fd5b5050506040518051905091508080600101915050610287565b8173ffffffffffffffffffffffffffffffffffffffff1663f3651cbb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401613e8060405180830381600087803b151561037c57600080fd5b5af1151561038957600080fd5b50505060405180613e800160405292505050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b613e80604051908101604052806101f4905b60007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001906001900390816103d857905050905600a165627a7a72305820c7bec15ea69d9a9ade240d30391105ed00dea242eadd856a18cbecb0857f4feb00296060604052341561000f57600080fd5b60405161068a38038061068a833981016040528080518201919050506100478161004d64010000000002610283176401000000009004565b506100d5565b60008090505b81518110156100d157818181518110151561006a57fe5b906020019060200201516000826101f48110151561008457fe5b602091828204019190066101000a81548160ff02191690837f0100000000000000000000000000000000000000000000000000000000000000900402179055508080600101915050610053565b5050565b6105a6806100e46000396000f300606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633f34a72b1461007d578063b2b2b44d146100d7578063c79178c614610110578063f28dee271461018b578063f3638f78146101dc578063f3651cbb14610231575b600080fd5b341561008857600080fd5b6100d5600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610283565b005b34156100e257600080fd5b61010e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061030b565b005b341561011b57600080fd5b610131600480803590602001909190505061034f565b60405180827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b341561019657600080fd5b6101c2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610398565b604051808215151515815260200191505060405180910390f35b34156101e757600080fd5b6101ef610453565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561023c57600080fd5b61024461047d565b60405180826101f460200280838360005b83811015610270578082015181840152602081019050610255565b5050505090500191505060405180910390f35b60008090505b81518110156103075781818151811015156102a057fe5b906020019060200201516000826101f4811015156102ba57fe5b602091828204019190066101000a81548160ff02191690837f0100000000000000000000000000000000000000000000000000000000000000900402179055508080600101915050610289565b5050565b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000816101f48110151561035f57fe5b60209182820401919006915054906101000a90047f01000000000000000000000000000000000000000000000000000000000000000281565b60008060405180807f61747461636828290000000000000000000000000000000000000000000000008152506008019050604051809103902090508273ffffffffffffffffffffffffffffffffffffffff16817c010000000000000000000000000000000000000000000000000000000090046040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303816000875af192505050915050919050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61048561052e565b60006101f48060200260405190810160405280929190826101f48015610524576020028201916000905b82829054906101000a90047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600101906020826000010492830192600103820291508084116104af5790505b5050505050905090565b613e80604051908101604052806101f4905b60007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060019003908161054057905050905600a165627a7a72305820efda46bfcdc2cd6e66f2bd6d0bb8dcd60bee44946a98456baab193a44ab1ba5d0029',
gas: '1700000'
}, function (e, contract){
console.log(e, contract);
if (typeof contract.address !== 'undefined') {
console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
}
})
manager : address: "0xc5ef74db84f27c4f71063e3eceacdc5ba59055fd"
var res = img ;
var nodeContract = web3.eth.contract([{"constant":false,"inputs":[{"name":"res","type":"bytes1[]"}],"name":"setImage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_next","type":"address"}],"name":"setNext","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"image","outputs":[{"name":"","type":"bytes1"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"attachToHead","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"getNext","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getImage","outputs":[{"name":"res","type":"bytes1[500]"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"res","type":"bytes1[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]);
var node = nodeContract.new(
res,
{
from: web3.eth.accounts[0],
data: '0x6060604052341561000f57600080fd5b60405161068a38038061068a833981016040528080518201919050506100478161004d64010000000002610283176401000000009004565b506100d5565b60008090505b81518110156100d157818181518110151561006a57fe5b906020019060200201516000826101f48110151561008457fe5b602091828204019190066101000a81548160ff02191690837f0100000000000000000000000000000000000000000000000000000000000000900402179055508080600101915050610053565b5050565b6105a6806100e46000396000f300606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633f34a72b1461007d578063b2b2b44d146100d7578063c79178c614610110578063f28dee271461018b578063f3638f78146101dc578063f3651cbb14610231575b600080fd5b341561008857600080fd5b6100d5600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610283565b005b34156100e257600080fd5b61010e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061030b565b005b341561011b57600080fd5b610131600480803590602001909190505061034f565b60405180827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b341561019657600080fd5b6101c2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610398565b604051808215151515815260200191505060405180910390f35b34156101e757600080fd5b6101ef610453565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561023c57600080fd5b61024461047d565b60405180826101f460200280838360005b83811015610270578082015181840152602081019050610255565b5050505090500191505060405180910390f35b60008090505b81518110156103075781818151811015156102a057fe5b906020019060200201516000826101f4811015156102ba57fe5b602091828204019190066101000a81548160ff02191690837f0100000000000000000000000000000000000000000000000000000000000000900402179055508080600101915050610289565b5050565b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000816101f48110151561035f57fe5b60209182820401919006915054906101000a90047f01000000000000000000000000000000000000000000000000000000000000000281565b60008060405180807f61747461636828290000000000000000000000000000000000000000000000008152506008019050604051809103902090508273ffffffffffffffffffffffffffffffffffffffff16817c010000000000000000000000000000000000000000000000000000000090046040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303816000875af192505050915050919050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61048561052e565b60006101f48060200260405190810160405280929190826101f48015610524576020028201916000905b82829054906101000a90047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600101906020826000010492830192600103820291508084116104af5790505b5050505050905090565b613e80604051908101604052806101f4905b60007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060019003908161054057905050905600a165627a7a72305820efda46bfcdc2cd6e66f2bd6d0bb8dcd60bee44946a98456baab193a44ab1ba5d0029',
gas: '4700000'
}, function (e, contract){
console.log(e, contract);
if (typeof contract.address !== 'undefined') {
console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
}
})