Skip to content

Instantly share code, notes, and snippets.

View rfikki's full-sized avatar

Rocky Fikki rfikki

View GitHub Profile
pragma solidity ^0.4.0;
contract AbstractENS {
function owner(bytes32 node) constant returns(address);
function resolver(bytes32 node) constant returns(address);
function ttl(bytes32 node) constant returns(uint64);
function setOwner(bytes32 node, address owner);
function setSubnodeOwner(bytes32 node, bytes32 label, address owner);
function setResolver(bytes32 node, address resolver);
function setTTL(bytes32 node, uint64 ttl);
admin.getPeers(function(e,r){r.forEach(function(i){console.log('admin.addPeer("enode://'+i.id+'@'+i.network.remoteAddress + '");')})})
function namehash(name) {
var node = '0x0000000000000000000000000000000000000000000000000000000000000000';
if(name != '') {
var labels = name.split(".");
for(var i = labels.length - 1; i >= 0; i--) {
node = web3.sha3(node + web3.sha3(labels[i]).slice(2), {encoding: 'hex'});
}
}
return node.toString();
}
Rocky@ASUS MINGW64 /c/projects/truffle-3
$ mkdir truffle-init-webpack
Rocky@ASUS MINGW64 /c/projects/truffle-3
$ cd truffle-init-webpack
Rocky@ASUS MINGW64 /c/projects/truffle-3/truffle-init-webpack
$ truffle init webpack
Downloading project...
Installing dependencies...
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\System32>cd c:\projects\cakeshop
c:\projects\cakeshop>java -jar cakeshop.war
Defaulting to spring profile: local
Extracting geth to C:\projects\cakeshop\data\geth
INFO 2016-12-20 21:01:59,467 [main] (StartupInfoLogger.java:48 ) Starting SpringBootApplication on ASUS with PID 9244 (started by Rocky in c:\projects\cakeshop)
INFO 2016-12-20 21:01:59,469 [main] (SpringApplication.java:670) The following profiles are active: container,spring-boot,local
@rfikki
rfikki / cakeshop-clean-working-log.txt
Created December 20, 2016 21:23
Cakeshop on Windows 10 64 bit, running smoothly connected to the Ethereum Ropsten Public Testnet
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\System32>cd c:\projects\cakeshop
c:\projects\cakeshop>java -jar cakeshop.war
Defaulting to spring profile: local
Extracting geth to C:\projects\cakeshop\data\geth
INFO 2016-12-20 14:58:20,293 [main] (StartupInfoLogger.java:48 ) Starting SpringBootApplication on ASUS with PID 8412 (started by Rocky in c:\projects\cakeshop)
INFO 2016-12-20 14:58:20,296 [main] (SpringApplication.java:670) The following profiles are active: container,spring-boot,local
@rfikki
rfikki / cakeshop-ropsten-running-smooth.txt
Created December 20, 2016 14:56
Windows 10 running cakeshop with the Ropsten Ethereum Public Testnet
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\System32>cd c:\projects\cakeshop
c:\projects\cakeshop>dir
Volume in drive C has no label.
Volume Serial Number is 1015-CD80
Directory of c:\projects\cakeshop
$ truffle console
truffle(default)> var r = Registrar.deployed()
undefined
truffle(default)> var insurance = web3.sha3('insurance');
undefined
truffle(default)> r.entries(insurance);
[ { [String: '2'] s: 1, e: 0, c: [ 2 ] },
'0x268e06911ba1ddc9138b355f9b42711abbc6eaec',
{ [String: '1481108206'] s: 1, e: 9, c: [ 1481108206 ] },
{ [String: '5000000000000000000'] s: 1, e: 18, c: [ 50000 ] },
@rfikki
rfikki / ens-exchange-subdomain-resolver-testing.txt
Created December 16, 2016 16:56
exchange.eth subdomain for testing purposes
> getAddr('exchange.eth')
"0x968ea5eed1d40486a7f87991c3299d383a8e85d2"
> getAddr('tokens.exchange.eth')
"0xe589a2d9993970a55d6644d46d0a31567a6a0ab9"
> getAddr('stock.exchange.eth')
"0xa7e05bd2cc0d488649c79e54fd637da02a0f73b8"
> getAddr('money.exchange.eth')
"0x76ff1940d6c15ae2ef8436de7564485770356076"
> getAddr('domain.exchange.eth')
"0xf8aaa4ccb80d0e047e9293619b47160e2c3b82d8"
@rfikki
rfikki / ens-insurance-subdomain-resolver-testing.txt
Last active December 16, 2016 16:58
insurance.eth subdomains for testing
> getAddr('insurance.eth')
"0x18ee4d627b7c1951a209b75a20e3296e434a4ad6"
> getAddr('health.insurance.eth')
"0x69a3f2957e65cd5dfdcd9ec16c3951f6a2ac0d45"
> getAddr('auto.insurance.eth')
"0x3b2652709d13f0dcd7327618c3003a02b0baac05"
> getAddr('home.insurance.eth')